Browse Source

支持被驳回后,先暂存,再提交。不校验过期补填规则。

seyason 1 năm trước cách đây
mục cha
commit
8e2501002f

+ 27 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -75,6 +75,8 @@ public class ReportController {
     @Resource
     private BusinessTripService businessTripService;
     @Resource
+    private ReportLogDetailMapper  reportLogDetailMapper;
+    @Resource
     private ProjectCurrentcostMapper projectCurrentcostMapper;
     @Resource
     private UserSalaryService userSalaryService;
@@ -714,18 +716,32 @@ public class ReportController {
                     if (id != null) {
                         List<Integer> editReportIds = Arrays.stream(id).collect(Collectors.toList());
                         denyCount = reportMapper.selectCount(new QueryWrapper<Report>().eq("state", 2).in("id", editReportIds));
-                    }
-                    if (denyCount == 0) {
-                        //不存在驳回的日报
-                        HttpRespMsg msg = new HttpRespMsg();
-                        //msg.setError("补填日报不可早于"+dateTimeFormatter.format(targetDate)+",请联系系统管理员代填。");
-                        if (!isLastMonthFail) {
-                            msg.setError(MessageUtils.message("profession.repairError",dateTimeFormatter.format(targetDate)));
-                        } else {
-                            msg.setError("不得晚于"+dateTimeFormatter.format(fillDay)+"后补填,请联系系统管理员代填。");
+                        if (denyCount == 0) {
+                            //检查最近一次审核是否是被驳回
+                            List<ReportLogDetail> reportLogDetails = reportLogDetailMapper.selectList(new QueryWrapper<ReportLogDetail>().select("report_id, GROUP_CONCAT(msg SEPARATOR '@') as msg").in("report_id", editReportIds).groupBy("report_id"));
+                            for (ReportLogDetail reportLogDetail : reportLogDetails) {
+                                String msg = reportLogDetail.getMsg();
+                                //msg为逗号隔开的字符串,取最后一个
+                                if (msg.contains("@")) {
+                                    String[] split = msg.split("@");
+                                    msg = split[split.length - 1];
+                                }
+                                if (msg.contains("驳回")) {
+                                    denyCount++;
+                                }
+                            }
+                            if (denyCount == 0) {
+                                //不存在驳回的日报
+                                HttpRespMsg msg = new HttpRespMsg();
+                                //msg.setError("补填日报不可早于"+dateTimeFormatter.format(targetDate)+",请联系系统管理员代填。");
+                                if (!isLastMonthFail) {
+                                    msg.setError(MessageUtils.message("profession.repairError",dateTimeFormatter.format(targetDate)));
+                                } else {
+                                    msg.setError("不得晚于"+dateTimeFormatter.format(fillDay)+"后补填,请联系系统管理员代填。");
+                                }
+                                return msg;
+                            }
                         }
-
-                        return msg;
                     }
                 }
             }