Commit 2f8e33d5 authored by liaoanyuan's avatar liaoanyuan

项目是否还有未审批工时的判断

parent e7c53e59
......@@ -129,4 +129,11 @@ public interface WorkTimeOrderMapper extends BaseMapper<WorkTimeOrder> {
int countByWorkDay(@Param("userId") Integer userId, @Param("startDate") String startDate, @Param("enbDate") String endDate);
int addManyLeaveOrder(@Param("workTimeOrders") List<WorkTimeOrder> workTimeOrders);
/**
* 查询为未审批的项目工时
* @param projectId 项目id
* @return
*/
List<WorkTimeOrder> selectProjectIsEnd(@Param("projectId") Integer projectId);
}
......@@ -77,6 +77,7 @@
WHERE
t.work_day >= #{date} AND s.create_time &lt;work_day AND s.end_time > work_day
AND t.`status` IN (2, 5)
GROUP BY
`type`,
project_id,
......
......@@ -600,4 +600,15 @@
</if>
</where>
</select>
<select id="selectProjectIsEnd" parameterType="int" resultMap="BaseResultMap">
select project_id,user_id,`type`,is_overtime,work_time
from work_time_order
<where>
<if test="projectId != null">
project_id =#{projectId}
</if>
and `status` IN(1,3,4)
</where>
</select>
</mapper>
......@@ -160,8 +160,6 @@ public class StatisticsServiceImpl implements StatisticsService {
double days1=workTimeOrder.getWorkTime();
//统计天数
days +=days1/8;
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxx"+days1);
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"+days);
}
}
statisticsTableDto.setOvertimes(overtimes);
......@@ -452,6 +450,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HSSFWorkbook exportWorkTimeExcel(GetMonthlyCollectParam param) {
log.info("StatisticsServiceImpl[]exportWorkTimeExcel[]input.param{}" + param);
//是否为当月,默认为false
boolean isToday=false;
// 去除分页条件
param.setSize(null);
param.setCurrentPage(null);
......@@ -472,6 +472,7 @@ public class StatisticsServiceImpl implements StatisticsService {
if (year == param.getYear() && month == param.getMonth()) {
dayCount1 = DateUtil.daysBetween(DateUtil.getFirstDayOfMonth(now), now) + 1;
isToday=true;
}else{
dayCount1 = dayCount;
}
......@@ -497,7 +498,7 @@ public class StatisticsServiceImpl implements StatisticsService {
// 第一列列宽
sheet.setColumnWidth(1, EXCEL_WIDTH);
// 获取本月应上班日期集合
List<Date> dates = this.currentMonthWorkDays(date, false);
List<Date> dates = this.currentMonthWorkDays(date, isToday);
List<Integer> days = new ArrayList<>();
for (Date date1 : dates) {
days.add(DateUtil.getDay(date1));
......@@ -545,7 +546,6 @@ public class StatisticsServiceImpl implements StatisticsService {
//加班天数
row_i.createCell(3).setCellValue(next.getOvertimes());
row_i.getCell(3).setCellStyle(cellStyle);
//漏报天数
row_i.createCell(4).setCellValue(dates.size()-next.getUnderreportings());
row_i.getCell(4).setCellStyle(cellStyle);
......
......@@ -78,6 +78,9 @@ public class WorkProjectServiceImpl implements WorkProjectService {
@Autowired
private WorkUserMapper workUserMapper;
@Autowired
private WorkTimeOrderMapper workTimeOrderMapper;
// 项目编号
private static final Integer PROJECT_CODE = 1;
......@@ -293,6 +296,11 @@ public class WorkProjectServiceImpl implements WorkProjectService {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.WORK_PROJECT_IS_NULL);
}
//判断项目是否存在为审批工时
List<WorkTimeOrder> workTimeOrders = workTimeOrderMapper.selectProjectIsEnd(projectId);
if (workTimeOrders.size()!=0){
return false;
}
workProjectMapper.updateIsConclusionById(projectId);
// 插入更变日志
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment