Reiskuchen 5 éve
szülő
commit
6c1966c82e

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

@@ -92,7 +92,7 @@ public class ReportController {
             httpRespMsg.setError("验证失败");
             return httpRespMsg;
         }
-        return reportService.editReport(id, reportList, createDate.length > 0 ? createDate[0] : null);
+        return reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null);
     }
 
     /**

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -22,7 +22,7 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg getReport(String date, HttpServletRequest request);
 
-    HttpRespMsg editReport(Integer[] ids, List<Report> reportList, String date);
+    HttpRespMsg editReport(List<Report> reportList, String date);
 
     HttpRespMsg deleteReport(Integer reportId);
 

+ 4 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -245,8 +245,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
     //新增或编辑报告
     @Override
-    public HttpRespMsg editReport(Integer[] ids, List<Report> reportList, String date) {
+    public HttpRespMsg editReport(List<Report> reportList, String date) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
+        List<Integer> idList = new ArrayList<>();
         for (Report report : reportList) {
             //获取一下信息
             if (report.getWorkingTime() <= 0.0) {
@@ -264,14 +265,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                 }
             }
+            idList.add(report.getId());
         }
-        if (reportList.size() > 0 && date != null) {
-            List<Integer> idList = new ArrayList<>();
-            for (Integer id : ids) {
-                if (id != -1) {
-                    idList.add(id);
-                }
-            }
+        if (idList.size() > 0 && date != null) {
             reportMapper.delete(new QueryWrapper<Report>()
                     .eq("create_date", date)
                     .eq("creator_id", reportList.get(0).getCreatorId())