|
@@ -117,6 +117,12 @@ public class ReportController {
|
|
|
|
|
|
@Resource
|
|
|
private ParticipationMapper participationMapper;
|
|
|
+ @Autowired
|
|
|
+ private TaskGroupMapper taskGroupMapper;
|
|
|
+ @Autowired
|
|
|
+ private CompanyDingdingService companyDingdingService;
|
|
|
+ @Autowired
|
|
|
+ private UserDingdingTimeMapper userDingdingTimeMapper;
|
|
|
|
|
|
//获取任务相关的日报列表
|
|
|
@RequestMapping("/getTaskReportList")
|
|
@@ -1581,6 +1587,33 @@ public class ReportController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //HardCode:对于正北两家公司,校验填报工时不得少于考勤时长
|
|
|
+ if (company.getId() == 8138 || company.getId() == 7703) {
|
|
|
+ if (company.getId() == 8138) {
|
|
|
+ //苏州正北, 用钉钉
|
|
|
+ List<UserDingdingTime> userDingdingTimes = userDingdingTimeMapper.selectList(new QueryWrapper<UserDingdingTime>().eq("user_id", creatorId).eq("work_date", cDate));
|
|
|
+ if (userDingdingTimes.size() > 0) {
|
|
|
+ UserDingdingTime userDingdingTime = userDingdingTimes.get(0);
|
|
|
+ if (Math.abs(userDingdingTime.getWorkHours() - dailyWorktime) > 0.01) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("每日填报工作时长("+dailyWorktime+"h)必须与考勤时长("+userDingdingTime.getWorkHours()+"h)一致");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //广州正北,企业微信,导入的考勤
|
|
|
+ List<UserCorpwxTime> userCorpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("corpwx_userid", creatorId).eq("create_date", cDate));
|
|
|
+ if (userCorpwxTimes.size() > 0) {
|
|
|
+ UserCorpwxTime userCorpwxTime = userCorpwxTimes.get(0);
|
|
|
+ if (Math.abs(userCorpwxTime.getWorkHours() - dailyWorktime) > 0.01) {
|
|
|
+ HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
+ httpRespMsg.setError("每日填报工作时长("+dailyWorktime+"h)必须与考勤时长("+userCorpwxTime.getWorkHours()+"h)一致");
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
//针对泓浒(苏州),需要按照工单号的部门来设置工时所属部门,同时设置是否是协作工时
|
|
@@ -1612,11 +1645,6 @@ public class ReportController {
|
|
|
if (first.isPresent()) {
|
|
|
//如果是清洁打包的分组,需要校验工单的时效性,工单关闭日期的当月或者下月
|
|
|
ErpOrderInfo order = first.get();
|
|
|
-// if (order.getStatus() == 4 && report.getCreateDate().isAfter(order.getCloseDate())) {
|
|
|
-//
|
|
|
-// }
|
|
|
-// YearMonth.from(report.getCreateDate()).equals();
|
|
|
-
|
|
|
if (order.getDeptId() == null) {
|
|
|
errorMsg = "工单号:"+report.getExtraField4()+"无部门id";
|
|
|
} else {
|
|
@@ -1631,8 +1659,23 @@ public class ReportController {
|
|
|
}
|
|
|
if (errorMsg == null) {
|
|
|
//校验工单号的状态是否关闭
|
|
|
- if (first.get().getStatus() == 4 && report.getCreateDate().isAfter(first.get().getCloseDate())) {
|
|
|
- errorMsg = "工单号:"+report.getExtraField4()+"于"+dateTimeFormatter.format(first.get().getCloseDate())+"已关闭";
|
|
|
+ if (first.get().getStatus() == 4) {
|
|
|
+ //区分分组,如果是清洁打包的分组,需要校验工单的时效性,工单关闭日期的当月或者下月
|
|
|
+ if (report.getGroupId() != null && report.getGroupId() != 0) {
|
|
|
+ TaskGroup gp = taskGroupMapper.selectById(report.getGroupId());
|
|
|
+ if (gp != null && gp.getName().contains("清洁打包")) {
|
|
|
+ YearMonth reportYm = YearMonth.from(report.getCreateDate());
|
|
|
+ YearMonth.from(order.getCloseDate().plusMonths(1));
|
|
|
+ if (!(reportYm.equals(YearMonth.from(order.getCloseDate())) || reportYm.equals(YearMonth.from(order.getCloseDate().plusMonths(1))))) {
|
|
|
+ errorMsg = "工单号:"+report.getExtraField4()+"于"+dateTimeFormatter.format(first.get().getCloseDate())+"已关闭,清洁打包工时仅在关闭当月及次月可填报";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (report.getCreateDate().isAfter(first.get().getCloseDate())) {
|
|
|
+ errorMsg = "工单号:"+report.getExtraField4()+"于"+dateTimeFormatter.format(first.get().getCloseDate())+"已关闭";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|