Переглянути джерело

正北日报限制填报,要先填之前的

QuYueTing 1 місяць тому
батько
коміт
1cebe0f484

+ 6 - 10
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1586,15 +1586,7 @@ public class ReportController {
             }
         }
         DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-        String curDate = createDate[0];
-        LocalDate localDate = LocalDate.parse(curDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-        localDate = localDate.withDayOfMonth(1);
-        int count2 = financialAuditMapper.selectCount(new QueryWrapper<FinancialAudit>().eq("company_id", company.getId()).eq("reportYrmnth", localDate).eq("review_status", 2));
-        if (count2 > 0) {
-            HttpRespMsg httpRespMsg = new HttpRespMsg();
-            httpRespMsg.setError("当月工时财务已锁定,无法填报");
-            return httpRespMsg;
-        }
+
         //对于正北(苏州和广州)需校验项目开始结束日期
         if (SysConstant.ZhengBeiCompIds.contains(company.getId())) {
             for (Report report : reportList) {
@@ -1616,11 +1608,15 @@ public class ReportController {
                 }
             }
             //校验之前7天内是否有未提交的日报
+            String curDate = createDate[0];
+            if (curDate.contains("@")) {
+                curDate = curDate.split("@")[0];
+            }
             LocalDate startDate = LocalDate.parse(curDate, dateTimeFormatter);
             LocalDate endDate = startDate.minusDays(1);
             startDate = startDate.minusDays(8);
             List<String> missingReportDates = reportService.getUserMissingReportDates(user.getId(), dateTimeFormatter.format(startDate), dateTimeFormatter.format(endDate));
-            System.out.println("missingReportDates.size()=="+missingReportDates.size());
+            System.out.println("missingReportDates.size()=="+missingReportDates.size() + ", startDate=" + dateTimeFormatter.format(startDate) + ", endDate=" + dateTimeFormatter.format(endDate));
             if (missingReportDates != null && missingReportDates.size() > 0) {
                 HttpRespMsg httpRespMsg = new HttpRespMsg();
                 httpRespMsg.setError("请按顺序填写近期日报:" + String.join(",", missingReportDates));

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -252,6 +252,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     private SysRoleFunctionService sysRoleFunctionService;
     @Resource
     private FinanceMapper financeMapper;
+    @Resource
     private FinancialAuditMapper financialAuditMapper;
 
 
@@ -3395,7 +3396,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         //获取日报所属月份,检查财务审核是否通过
         LocalDate localDate = LocalDate.parse(date, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
         localDate = localDate.withDayOfMonth(1);
-        int count = financialAuditMapper.selectCount(new QueryWrapper<FinancialAudit>().eq("company_id", company.getId()).eq("reportYrmnth", localDate).eq("review_status", 2));
+        int count = financialAuditMapper.selectCount(new QueryWrapper<FinancialAudit>().eq("company_id", company.getId()).eq("report_yrMnth", localDate).eq("review_status", 2));
         if (count > 0) {
             httpRespMsg.setError("当月工时财务已锁定,无法撤销");
             return httpRespMsg;