yusm 1 ヶ月 前
コミット
3cef11c248

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/ReportRateTaskVO.java

@@ -32,6 +32,7 @@ public class ReportRateTaskVO{
     private String jobNumber;//工号
 
     private String departmentName;//部门名称
+    private Integer deptId;//部门id
     private String timelinessRate;
     private String timelinessRateWithLeave;
 

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

@@ -11004,6 +11004,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if(firstDept.isPresent()){
                     Department dept= firstDept.get();
                     rateTaskVO.setDepartmentName(dept.getDepartmentName());
+                    rateTaskVO.setDeptId(dept.getDepartmentId());
                 }
 
                 List<Map<String, Object>> curTaskUserReportList = reportList.stream().filter(r->r.get("taskId")!=null
@@ -11301,6 +11302,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if(firstDept.isPresent()){
                     Department dept= firstDept.get();
                     rateTaskVO.setDepartmentName(dept.getDepartmentName());
+                    rateTaskVO.setDeptId(dept.getDepartmentId());
                 }
 
                 List<Map<String, Object>> curTaskUserReportList = reportList.stream().filter(r->r.get("taskId")!=null
@@ -11605,6 +11607,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
+        List<Department> departmentList = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
         try {
             // 创建工作簿
             SXSSFWorkbook workBook = new SXSSFWorkbook();
@@ -11786,7 +11789,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                         // 所属部门
                         Cell deptCell = row.createCell(6);
-                        deptCell.setCellValue(detail.getDepartmentName() != null ? detail.getDepartmentName() : "");
+                        if (detail.getDeptId()!=null){
+                            Optional<Department> department = departmentList.stream().filter(d -> d.getDepartmentId().equals(detail.getDeptId())).findFirst();
+                            if(department.isPresent()){
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    deptCell.setCellValue("$departmentName="+department.get().getCorpwxDeptid()+"$");
+                                }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
+                                    deptCell.setCellValue("$departmentName="+department.get().getDdDeptid()+"$");
+                                } else {
+                                    deptCell.setCellValue(department.get().getDepartmentName());
+                                }
+                            }else {
+                                deptCell.setCellValue("");
+                            }
+                        }else {
+                            deptCell.setCellValue("");
+                        }
                         deptCell.setCellStyle(cellStyle);
 
                         // 填报及时率