Browse Source

导出人员添加字段

yusm 8 months ago
parent
commit
176409dc74

+ 35 - 29
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -311,14 +311,15 @@ public class UserController {
                 //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
                 //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
                 sheet.setColumnWidth(0, 5 * 256);
                 sheet.setColumnWidth(0, 5 * 256);
                 sheet.setColumnWidth(1, 10 * 256);
                 sheet.setColumnWidth(1, 10 * 256);
-                sheet.setColumnWidth(2, 20 * 256);
+                sheet.setColumnWidth(2, 10 * 256);
                 sheet.setColumnWidth(3, 20 * 256);
                 sheet.setColumnWidth(3, 20 * 256);
                 sheet.setColumnWidth(4, 20 * 256);
                 sheet.setColumnWidth(4, 20 * 256);
-                sheet.setColumnWidth(5, 10 * 256);
-
+                sheet.setColumnWidth(5, 20 * 256);
                 sheet.setColumnWidth(6, 10 * 256);
                 sheet.setColumnWidth(6, 10 * 256);
+
                 sheet.setColumnWidth(7, 10 * 256);
                 sheet.setColumnWidth(7, 10 * 256);
                 sheet.setColumnWidth(8, 10 * 256);
                 sheet.setColumnWidth(8, 10 * 256);
+                sheet.setColumnWidth(9, 10 * 256);
                 //设置为居中加粗
                 //设置为居中加粗
                 HSSFCellStyle headStyle = workbook.createCellStyle();
                 HSSFCellStyle headStyle = workbook.createCellStyle();
                 HSSFFont font = workbook.createFont();
                 HSSFFont font = workbook.createFont();
@@ -335,20 +336,24 @@ public class UserController {
                 headCell.setCellValue(MessageUtils.message("entry.name"));
                 headCell.setCellValue(MessageUtils.message("entry.name"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
                 headCell = headRow.createCell(2);
                 headCell = headRow.createCell(2);
+                //headCell.setCellValue("姓名");
+                headCell.setCellValue(MessageUtils.message("entry.No"));
+                headCell.setCellStyle(headStyle);
+                headCell = headRow.createCell(3);
                 //headCell.setCellValue("角色");
                 //headCell.setCellValue("角色");
                 headCell.setCellValue(MessageUtils.message("role.role"));
                 headCell.setCellValue(MessageUtils.message("role.role"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
-                headCell = headRow.createCell(3);
+                headCell = headRow.createCell(4);
                 //headCell.setCellValue("手机号");
                 //headCell.setCellValue("手机号");
                 headCell.setCellValue(MessageUtils.message("excel.phoneNumber"));
                 headCell.setCellValue(MessageUtils.message("excel.phoneNumber"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
-                headCell = headRow.createCell(4);
+                headCell = headRow.createCell(5);
                 //headCell.setCellValue("部门");
                 //headCell.setCellValue("部门");
                 headCell.setCellValue(MessageUtils.message("excel.department"));
                 headCell.setCellValue(MessageUtils.message("excel.department"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
                 int auditIndex = -1;
                 int auditIndex = -1;
-                if(timeType.getReportAuditType() == 5 || timeType.getReportAuditType() == 6){
-                    headCell = headRow.createCell(5);
+                if(timeType.getReportAuditType() == 6 || timeType.getReportAuditType() == 7){
+                    headCell = headRow.createCell(6);
                     headCell.setCellValue("直属审核人");
                     headCell.setCellValue("直属审核人");
                     headCell.setCellStyle(headStyle);
                     headCell.setCellStyle(headStyle);
                     auditIndex=0;
                     auditIndex=0;
@@ -356,27 +361,27 @@ public class UserController {
 
 
                 int minusIndex = -2;
                 int minusIndex = -2;
                 if (canViewCost) {
                 if (canViewCost) {
-                    headCell = headRow.createCell(6+auditIndex);
+                    headCell = headRow.createCell(7+auditIndex);
                     //headCell.setCellValue("月薪");
                     //headCell.setCellValue("月薪");
                     headCell.setCellValue(MessageUtils.message("excel.MonSalary"));
                     headCell.setCellValue(MessageUtils.message("excel.MonSalary"));
                     headCell.setCellStyle(headStyle);
                     headCell.setCellStyle(headStyle);
-                    headCell = headRow.createCell(7+auditIndex);
+                    headCell = headRow.createCell(8+auditIndex);
                     //headCell.setCellValue("时薪");
                     //headCell.setCellValue("时薪");
                     headCell.setCellValue(MessageUtils.message("excel.hourlyWage"));
                     headCell.setCellValue(MessageUtils.message("excel.hourlyWage"));
                     headCell.setCellStyle(headStyle);
                     headCell.setCellStyle(headStyle);
                     minusIndex = 0;
                     minusIndex = 0;
                 }
                 }
 
 
-                headCell = headRow.createCell(8+minusIndex+auditIndex);
+                headCell = headRow.createCell(9+minusIndex+auditIndex);
                 //headCell.setCellValue("证书");
                 //headCell.setCellValue("证书");
                 headCell.setCellValue(MessageUtils.message("excel.certificate"));
                 headCell.setCellValue(MessageUtils.message("excel.certificate"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
                 for (int i = 0; i < userCustomList.size(); i++) {
                 for (int i = 0; i < userCustomList.size(); i++) {
-                    headCell = headRow.createCell(minusIndex+9+i+auditIndex);
+                    headCell = headRow.createCell(minusIndex+10+i+auditIndex);
                     headCell.setCellValue(userCustomList.get(i).getName());
                     headCell.setCellValue(userCustomList.get(i).getName());
                     headCell.setCellStyle(headStyle);
                     headCell.setCellStyle(headStyle);
                 }
                 }
-                headCell = headRow.createCell(minusIndex+9+userCustomList.size()+auditIndex);
+                headCell = headRow.createCell(minusIndex+10+userCustomList.size()+auditIndex);
                 //headCell.setCellValue("状态");
                 //headCell.setCellValue("状态");
                 headCell.setCellValue(MessageUtils.message("leave.status"));
                 headCell.setCellValue(MessageUtils.message("leave.status"));
                 headCell.setCellStyle(headStyle);
                 headCell.setCellStyle(headStyle);
@@ -415,45 +420,46 @@ public class UserController {
                     }else {
                     }else {
                         row.createCell(1).setCellValue(item.getName());
                         row.createCell(1).setCellValue(item.getName());
                     }
                     }
-                    row.createCell(2).setCellValue(item.getRoleName());
-                    row.createCell(3).setCellValue(item.getPhone());
+                    row.createCell(2).setCellValue(item.getJobNumber());
+                    row.createCell(3).setCellValue(item.getRoleName());
+                    row.createCell(4).setCellValue(item.getPhone());
                     if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                     if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                        row.createCell(4).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?" ":item.getCorpwxDeptid())+"$");
+                        row.createCell(5).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?" ":item.getCorpwxDeptid())+"$");
                     }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
                     }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
                         if (item.getDepartmentId() != 0) {
                         if (item.getDepartmentId() != 0) {
                             Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(item.getDepartmentId())).findFirst();
                             Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(item.getDepartmentId())).findFirst();
                             if(first.isPresent()){
                             if(first.isPresent()){
                                 Department department =first.get();
                                 Department department =first.get();
-                                row.createCell(4).setCellValue("$departmentName="+(department.getDdDeptid()==null?" ":department.getDdDeptid())+"$");
+                                row.createCell(5).setCellValue("$departmentName="+(department.getDdDeptid()==null?" ":department.getDdDeptid())+"$");
                             }else {
                             }else {
-                                row.createCell(4).setCellValue(item.getDepartmentName());
+                                row.createCell(5).setCellValue(item.getDepartmentName());
                             }
                             }
                         }
                         }
                     }else {
                     }else {
-                        row.createCell(4).setCellValue(item.getDepartmentName());
+                        row.createCell(5).setCellValue(item.getDepartmentName());
                     }
                     }
                     if(timeType.getReportAuditType()==5||timeType.getReportAuditType()==6){
                     if(timeType.getReportAuditType()==5||timeType.getReportAuditType()==6){
                         if(item.getSuperiorId()!=null){
                         if(item.getSuperiorId()!=null){
                             Optional<User> first = userList.stream().filter(u ->u.getId().equals(item.getSuperiorId())).findFirst();
                             Optional<User> first = userList.stream().filter(u ->u.getId().equals(item.getSuperiorId())).findFirst();
                             if(first.isPresent()){
                             if(first.isPresent()){
                                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                    row.createCell(5).setCellValue("$userName="+(first.get().getCorpwxUserid()==null?" ":first.get().getCorpwxUserid())+"$");
+                                    row.createCell(6).setCellValue("$userName="+(first.get().getCorpwxUserid()==null?" ":first.get().getCorpwxUserid())+"$");
                                 }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
                                 }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
-                                    row.createCell(5).setCellValue("$userName="+(first.get().getDingdingUserid()==null?" ":first.get().getDingdingUserid())+"$");
+                                    row.createCell(6).setCellValue("$userName="+(first.get().getDingdingUserid()==null?" ":first.get().getDingdingUserid())+"$");
                                 }else {
                                 }else {
-                                    row.createCell(5).setCellValue(first.get().getName());
+                                    row.createCell(6).setCellValue(first.get().getName());
                                 }
                                 }
                             }else {
                             }else {
-                                row.createCell(5).setCellValue("");
+                                row.createCell(6).setCellValue("");
                             }
                             }
                         }else {
                         }else {
-                            row.createCell(5).setCellValue("");
+                            row.createCell(6).setCellValue("");
                         }
                         }
 
 
                     }
                     }
                     if (canViewCost) {
                     if (canViewCost) {
-                        row.createCell(6+auditIndex).setCellValue(item.getMonthCost()==null? 0 : item.getMonthCost().intValue());
-                        row.createCell(7+auditIndex).setCellValue(item.getCost() == null?0.0 : item.getCost().doubleValue());
+                        row.createCell(7+auditIndex).setCellValue(item.getMonthCost()==null? 0 : item.getMonthCost().intValue());
+                        row.createCell(8+auditIndex).setCellValue(item.getCost() == null?0.0 : item.getCost().doubleValue());
                     }
                     }
                     List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
                     List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
                     if(certList.size()>0){
                     if(certList.size()>0){
@@ -465,9 +471,9 @@ public class UserController {
                                 s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate();
                                 s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate();
                             }
                             }
                         }
                         }
-                        row.createCell(8+minusIndex+auditIndex).setCellValue(s);
+                        row.createCell(9+minusIndex+auditIndex).setCellValue(s);
                     }else {
                     }else {
-                        row.createCell(8+minusIndex+auditIndex).setCellValue("");
+                        row.createCell(9+minusIndex+auditIndex).setCellValue("");
                     }
                     }
                     for (int i = 0; i < userCustomList.size(); i++) {
                     for (int i = 0; i < userCustomList.size(); i++) {
                         String value="";
                         String value="";
@@ -483,9 +489,9 @@ public class UserController {
                             case 4:value=item.getPlate5()==null?"":item.getPlate5();
                             case 4:value=item.getPlate5()==null?"":item.getPlate5();
                                 break;
                                 break;
                         }
                         }
-                        row.createCell(9+i+minusIndex+auditIndex).setCellValue(value);
+                        row.createCell(10+i+minusIndex+auditIndex).setCellValue(value);
                     }
                     }
-                    row.createCell(9+userCustomList.size()+minusIndex+auditIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
+                    row.createCell(10+userCustomList.size()+minusIndex+auditIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
                     rowNum++;
                     rowNum++;
                 }
                 }
                 //生成Excel文件
                 //生成Excel文件