Parcourir la source

保存日报记录,解决companyId疏漏 问题。

seyason il y a 10 mois
Parent
commit
647581339b

+ 6 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1373,11 +1373,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     //保存审核日报的记录
-    private void saveApproveReportLog(List<Report> reportList, String operatorId, String opName) {
+    private void saveApproveReportLog(Integer companyId, List<Report> reportList, String operatorId, String opName) {
         Report r = reportList.get(0);
         List<ReportLog> addLogList = new ArrayList<>();
         List<ReportLogDetail> addLogDetailList = new ArrayList<>();
-        Integer companyId = r.getCompanyId();
 //        List<Integer> projectIds = reportList.stream().map(Report::getProjectId).collect(Collectors.toList());
 //        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id, project_name").in("id", projectIds));
         //操作审核通过
@@ -1402,7 +1401,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             detail.setWorkDate(log.getCreateDate());
             detail.setOperatorId(log.getOperatorId());
             detail.setOperateDate(log.getOperateDate());
-            detail.setCompanyId(log.getCompanyId());
+            detail.setCompanyId(companyId);
             detail.setMsg(log.getMsg());
             addLogDetailList.add(detail);
         }
@@ -1964,7 +1963,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             reportAlogMembdateMapper.insert(membdate);
 
             //日报的审核过程记录
-            saveApproveReportLog(reportList, user.getId(), user.getName());
+            saveApproveReportLog(company.getId(), reportList, user.getId(), user.getName());
         } else {
             //先按照大的审核模式进行分类
             Report oneReport = reportMapper.selectById(ids.get(0));
@@ -2616,7 +2615,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             reportAlogMembdateMapper.insert(membdate);
 
             //日报的审核过程记录
-            saveApproveReportLog(reportList, user.getId(), user.getName());
+            saveApproveReportLog(company.getId(), reportList, user.getId(), user.getName());
         }
         return httpRespMsg;
     }
@@ -3998,7 +3997,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             log.setProjectName(s);
             reportAuditLogMapper.insert(log);
 
-            saveApproveReportLog(allReports, user.getId(), user.getName());
+            saveApproveReportLog(company.getId(), allReports, user.getId(), user.getName());
             //当前所有员工的日期
             List<ReportAlogMembdate> membList = new ArrayList<>();
             for (Report r : allReports) {
@@ -7536,7 +7535,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             reportAlogMembdateMapper.insert(membdate);
 
             //日报的审核过程记录
-            saveApproveReportLog(reportList, user.getId(), user.getName());
+            saveApproveReportLog(companyId, reportList, user.getId(), user.getName());
         } else {
             msg.setError("无待审核日报");
         }