Explorar o código

钉钉导出文件转译
解决代码耦合 循环依赖问题
员工任务进度表开发

Min hai 1 ano
pai
achega
0badb16cca
Modificáronse 32 ficheiros con 929 adicións e 466 borrados
  1. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  2. 6 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ExpenseItemController.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinanceController.java
  4. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/GroupBudgetReviewController.java
  5. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java
  6. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  7. 445 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java
  8. 7 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java
  9. 5 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserYearleaveSettingController.java
  10. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  11. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TaskMapper.java
  12. 6 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ExcelExportService.java
  13. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskService.java
  14. 0 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java
  15. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java
  16. 8 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java
  17. 13 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  18. 168 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java
  19. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  20. 6 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  21. 5 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java
  22. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectApprovalServiceImpl.java
  23. 63 31
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  24. 6 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProviderInfoServiceImpl.java
  25. 6 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportExtraDegreeServiceImpl.java
  26. 14 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  27. 4 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java
  28. 6 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskRestartServiceImpl.java
  29. 95 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  30. 1 370
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  31. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  32. 30 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

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

@@ -8,7 +8,7 @@ import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.CompanyDingdingService;
 import com.management.platform.service.DingDingService;
-import com.management.platform.service.impl.DingDingServiceImpl;
+import com.management.platform.service.impl.*;
 import com.management.platform.util.*;
 import com.taobao.api.ApiException;
 import org.slf4j.Logger;

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

@@ -3,9 +3,11 @@ package com.management.platform.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.CompanyDingding;
 import com.management.platform.entity.ExpenseItem;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.entity.vo.ExpenseItemVO;
+import com.management.platform.mapper.CompanyDingdingMapper;
 import com.management.platform.mapper.ExpenseItemMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.WxCorpInfoMapper;
@@ -44,6 +46,8 @@ public class ExpenseItemController {
     @Resource
     private WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
+    @Resource
     private ExcelExportService excelExportService;
     @Value(value = "${upload.path}")
     private String path;
@@ -61,6 +65,7 @@ public class ExpenseItemController {
         HttpRespMsg msg = new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId,companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId,companyId));
         HttpRespMsg data = list(projectId);
         List<ExpenseItemVO> itemVOS = (List<ExpenseItemVO>) data.getData();
         List<List<String>> dataList=new ArrayList<>();
@@ -99,7 +104,7 @@ public class ExpenseItemController {
         }
         String fileUrlSuffix = "费用报销明细表_" + System.currentTimeMillis();
         try {
-           return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileUrlSuffix, dataList, path);
+           return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileUrlSuffix, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

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

@@ -166,7 +166,7 @@ public class FinanceController {
         //String fileName = company.getCompanyName()+"_财务人员成本模板";
         String fileName = MessageUtils.message("fileName.financialCost",company.getCompanyName());
         //导出模板不需要转译,不传wxCorpInfo
-        return excelExportService.exportGeneralExcelByTitleAndList(null, fileName, allList, path);
+        return excelExportService.exportGeneralExcelByTitleAndList(null,null, fileName, allList, path);
     }
     @RequestMapping("/batchRemove")
     public HttpRespMsg batchRemove(String ids){

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

@@ -65,6 +65,8 @@ public class GroupBudgetReviewController {
     private TimeTypeMapper timeTypeMapper;
     @Resource
     private InformationMapper informationMapper;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @RequestMapping("/add")
     public HttpRespMsg add(Integer groupId,Integer oldManDay,Integer changeManDay,Integer nowManDay,String remark){
@@ -216,6 +218,7 @@ public class GroupBudgetReviewController {
         LocalDateTime localDateTimesStart = LocalDate.parse(startDate, df).atTime(LocalTime.MIN);
         LocalDateTime localDateTimesEnd = LocalDate.parse(endDate, df).atTime(LocalTime.MAX);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
         LambdaQueryWrapper<GroupBudgetReview> queryWrapper = new LambdaQueryWrapper<GroupBudgetReview>().eq(GroupBudgetReview::getCompanyId, companyId).orderByDesc(GroupBudgetReview::getCreateTime);
         if(startDate!=null && endDate!=null){
@@ -267,7 +270,7 @@ public class GroupBudgetReviewController {
         }
         String fileUrlSuffix = "预估工时审核表_" + System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileUrlSuffix,dataList,path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileUrlSuffix,dataList,path);
         } catch (Exception e) {
             e.printStackTrace();
         }

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

@@ -64,6 +64,8 @@ public class ProjectRequirementController {
     private WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
     private ExcelExportService excelExportService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
     @RequestMapping("/addOrMod")
     public HttpRespMsg addOrMod(ProjectRequirement record) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -124,6 +126,7 @@ public class ProjectRequirementController {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("TOKEN")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         LocalDate now = LocalDate.now();
         now = now.minusDays(7);
         String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
@@ -198,7 +201,7 @@ public class ProjectRequirementController {
         //生成excel文件导出
         //String fileName = "资源需求统计报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.resourceDemand",System.currentTimeMillis());
-        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
     }
     @RequestMapping("/importData")
     public HttpRespMsg importData(MultipartFile multipartFile){

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

@@ -1178,6 +1178,7 @@ public class TaskController {
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
         List<Department> departmentList = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         HttpRespMsg respMsg = listByPage(status, viewId, null, null, type, dateType, startDate, endDate, deptId, projectId, groupId, targetUserId);
         Map<String, Object> msgData = (Map<String, Object>) respMsg.getData();
         List<Task> taskList = (List<Task>) msgData.get("records");
@@ -1252,13 +1253,18 @@ public class TaskController {
         }
         String fileName = "待办任务导出_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
         return msg;
     }
 
+    @RequestMapping("/userTaskCompleteDetail")
+    public HttpRespMsg userTaskCompleteDetail(Integer pageIndex,Integer pageSize,String startDate,String endDate,String userId,Integer deptId){
+        return taskService.userTaskCompleteDetail(pageIndex,pageSize,startDate,endDate,userId,deptId);
+    }
+
 
 }
 

+ 445 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -12,9 +12,13 @@ import com.management.platform.service.*;
 import com.management.platform.util.ColorUtil;
 import com.management.platform.util.HttpRespMsg;
 
+import com.management.platform.util.ListUtil;
+import com.management.platform.util.MessageUtils;
+import org.apache.poi.hssf.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.ldap.core.LdapTemplate;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -29,10 +33,12 @@ import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 import javax.naming.ldap.SortControl;
 import javax.servlet.http.HttpServletRequest;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -89,8 +95,28 @@ public class UserController {
     private String dcFirst;
     @Value("${spring.ldap.base.dcSecond}")
     private String dcSecond;
+    @Value(value = "${upload.path}")
+    private String path;
     @Resource
     private UserWithBeisenMapper userWithBeisenMapper;
+    @Resource
+    private SysFunctionService sysFunctionService;
+    @Resource
+    private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private WxCorpInfoMapper wxCorpInfoMapper;
+    @Resource
+    private CompanyDingdingService companyDingdingService;
+    @Resource
+    private DingDingService dingDingService;
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private UserCertMapper userCertMapper;
+
+    public static HashMap<String, Integer> corpddJobCenter = new HashMap();
+    //用于控制线程锁
+    public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
 
     /**
      * 登录网页端
@@ -257,14 +283,431 @@ public class UserController {
 
     @RequestMapping("/exportUsers")
     public HttpRespMsg exportUsers(Integer containInvalid) {
-        return userService.exportUsers(containInvalid,request);
+            HttpRespMsg httpRespMsg = new HttpRespMsg();
+            try {
+                String userId = request.getHeader("Token");
+                User user = userService.getById(userId);
+                TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
+                WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+                CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
+                List<User> userList = userService.list(new LambdaQueryWrapper<User>().select(User::getId, User::getName, User::getCorpwxUserid).eq(User::getCompanyId, user.getCompanyId()));
+                List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", user.getCompanyId()));
+                //查看当前用户是否有人员成本的查看权限
+                boolean canViewCost = sysFunctionService.hasPriviledge(user.getRoleId(), "人员成本管理");
+                System.out.println("canViewCost=========="+canViewCost);
+                //准备导出
+                HSSFWorkbook workbook = new HSSFWorkbook();
+                //HSSFSheet sheet = workbook.createSheet("全部员工列表");
+                HSSFSheet sheet = workbook.createSheet(MessageUtils.message("excel.allPeopleList"));
+                //创建表头
+                HSSFRow headRow = sheet.createRow(0);
+                //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
+                sheet.setColumnWidth(0, 5 * 256);
+                sheet.setColumnWidth(1, 10 * 256);
+                sheet.setColumnWidth(2, 20 * 256);
+                sheet.setColumnWidth(3, 20 * 256);
+                sheet.setColumnWidth(4, 20 * 256);
+                sheet.setColumnWidth(5, 10 * 256);
+
+                sheet.setColumnWidth(6, 10 * 256);
+                sheet.setColumnWidth(7, 10 * 256);
+                sheet.setColumnWidth(8, 10 * 256);
+                //设置为居中加粗
+                HSSFCellStyle headStyle = workbook.createCellStyle();
+                HSSFFont font = workbook.createFont();
+                font.setBold(true);
+                headStyle.setFont(font);
+                //表头
+                HSSFCell headCell;
+                headCell = headRow.createCell(0);
+                //headCell.setCellValue("序号");
+                headCell.setCellValue(MessageUtils.message("entry.serialNo"));
+                headCell.setCellStyle(headStyle);
+                headCell = headRow.createCell(1);
+                //headCell.setCellValue("姓名");
+                headCell.setCellValue(MessageUtils.message("entry.name"));
+                headCell.setCellStyle(headStyle);
+                headCell = headRow.createCell(2);
+                //headCell.setCellValue("角色");
+                headCell.setCellValue(MessageUtils.message("role.role"));
+                headCell.setCellStyle(headStyle);
+                headCell = headRow.createCell(3);
+                //headCell.setCellValue("手机号");
+                headCell.setCellValue(MessageUtils.message("excel.phoneNumber"));
+                headCell.setCellStyle(headStyle);
+                headCell = headRow.createCell(4);
+                //headCell.setCellValue("部门");
+                headCell.setCellValue(MessageUtils.message("excel.department"));
+                headCell.setCellStyle(headStyle);
+                int auditIndex = -1;
+                if(timeType.getReportAuditType() == 5 || timeType.getReportAuditType() == 6){
+                    headCell = headRow.createCell(5);
+                    headCell.setCellValue("直属审核人");
+                    headCell.setCellStyle(headStyle);
+                    auditIndex=0;
+                }
+
+                int minusIndex = -2;
+                if (canViewCost) {
+                    headCell = headRow.createCell(6+auditIndex);
+                    //headCell.setCellValue("月薪");
+                    headCell.setCellValue(MessageUtils.message("excel.MonSalary"));
+                    headCell.setCellStyle(headStyle);
+                    headCell = headRow.createCell(7+auditIndex);
+                    //headCell.setCellValue("时薪");
+                    headCell.setCellValue(MessageUtils.message("excel.hourlyWage"));
+                    headCell.setCellStyle(headStyle);
+                    minusIndex = 0;
+                }
+
+                headCell = headRow.createCell(8+minusIndex+auditIndex);
+                //headCell.setCellValue("证书");
+                headCell.setCellValue(MessageUtils.message("excel.certificate"));
+                headCell.setCellStyle(headStyle);
+                for (int i = 0; i < userCustomList.size(); i++) {
+                    headCell = headRow.createCell(minusIndex+9+i+auditIndex);
+                    headCell.setCellValue(userCustomList.get(i).getName());
+                    headCell.setCellStyle(headStyle);
+                }
+                headCell = headRow.createCell(minusIndex+9+userCustomList.size()+auditIndex);
+                //headCell.setCellValue("状态");
+                headCell.setCellValue(MessageUtils.message("leave.status"));
+                headCell.setCellStyle(headStyle);
+
+                //设置日期格式
+                HSSFCellStyle style = workbook.createCellStyle();
+                style.setDataFormat(HSSFDataFormat.getBuiltinFormat("yy/mm/dd hh:mm"));
+                //新增数据行 并且装填数据
+                int rowNum = 1;
+                QueryWrapper<User> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("company_id", user.getCompanyId());
+                if (containInvalid == 0) {
+                    queryWrapper.eq("is_active", 1);
+                }
+                List<User> data = userMapper.selectList(queryWrapper);
+                List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+                List<String> collect = data.stream().map(da -> da.getId()).distinct().collect(Collectors.toList());
+                List<UserCert> userCertList=new ArrayList<>();
+                if(collect!=null&&!StringUtils.isEmpty(data)){
+                    userCertList = userCertMapper.selectList(new QueryWrapper<UserCert>().in("user_id", collect));
+                }
+                for (User item : data) {
+                    if (item.getDepartmentId() != 0) {
+                        Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(item.getDepartmentId())).findFirst();
+                        if(first.isPresent()){
+                            Department department =first.get();
+                            item.setDepartmentName(department.getDepartmentName());
+                        }
+                    }
+                    HSSFRow row = sheet.createRow(rowNum);
+                    row.createCell(0).setCellValue(rowNum);
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        row.createCell(1).setCellValue("$userName="+(item.getCorpwxUserid()==null?" ":item.getCorpwxUserid())+"$");
+                    }else {
+                        row.createCell(1).setCellValue(item.getName());
+                    }
+                    row.createCell(2).setCellValue(item.getRoleName());
+                    row.createCell(3).setCellValue(item.getPhone());
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        row.createCell(4).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?" ":item.getCorpwxDeptid())+"$");
+                    }else {
+                        row.createCell(4).setCellValue(item.getDepartmentName());
+                    }
+                    if(timeType.getReportAuditType()==5||timeType.getReportAuditType()==6){
+                        if(item.getSuperiorId()!=null){
+                            Optional<User> first = userList.stream().filter(u ->u.getId().equals(item.getSuperiorId())).findFirst();
+                            if(first.isPresent()){
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    row.createCell(5).setCellValue("$userName="+(first.get().getCorpwxUserid()==null?" ":first.get().getCorpwxUserid())+"$");
+                                }else {
+                                    row.createCell(5).setCellValue(first.get().getName());
+                                }
+                            }else {
+                                row.createCell(5).setCellValue("");
+                            }
+                        }else {
+                            row.createCell(5).setCellValue("");
+                        }
+
+                    }
+                    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());
+                    }
+                    List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
+                    if(certList.size()>0){
+                        String s="";
+                        for (int i = 0; i < certList.size(); i++) {
+                            if(i<certList.size()-1){
+                                s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate()+",";
+                            }else {
+                                s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate();
+                            }
+                        }
+                        row.createCell(8+minusIndex+auditIndex).setCellValue(s);
+                    }else {
+                        row.createCell(8+minusIndex+auditIndex).setCellValue("");
+                    }
+                    for (int i = 0; i < userCustomList.size(); i++) {
+                        String value="";
+                        switch (i){
+                            case 0:value=item.getPlate1()==null?"":item.getPlate1();
+                                break;
+                            case 1:value=item.getPlate2()==null?"":item.getPlate2();
+                                break;
+                            case 2:value=item.getPlate3()==null?"":item.getPlate3();
+                                break;
+                            case 3:value=item.getPlate4()==null?"":item.getPlate4();
+                                break;
+                            case 4:value=item.getPlate5()==null?"":item.getPlate5();
+                                break;
+                        }
+                        row.createCell(9+i+minusIndex+auditIndex).setCellValue(value);
+                    }
+                    row.createCell(9+userCustomList.size()+minusIndex+auditIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
+                    rowNum++;
+                }
+                //生成Excel文件
+                //String fileUrlSuffix = "员工列表" + System.currentTimeMillis() + ".xls";
+                String fileUrlSuffix = MessageUtils.message("excel.peopleList") + System.currentTimeMillis() + ".xls";
+                FileOutputStream fos = new FileOutputStream(path + fileUrlSuffix);
+                workbook.write(fos);
+                fos.flush();
+                fos.close();
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
+                    String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
+            /*if(jobId!=null&&!jobId.equals("")){
+                File file=new File(path + fileUrlSuffix);
+                if(file.exists()){
+                    file.delete();
+                }
+            }*/
+                    int i = 0;
+                    String syncTranslationResult = null;
+                    /**
+                     * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
+                     * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+                     */
+                    while (i < 10) {
+                        Thread.sleep(300);
+                        CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);
+                        if (corpwxJobResult != null) {
+                            if (corpwxJobResult.getErrCode() == 0) {
+                                syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
+                                corpwxJobCenter.remove(jobId);
+                            } else {
+                                httpRespMsg.setError(corpwxJobResult.getErrMsg());
+                                return httpRespMsg;
+                            }
+                            break;
+                        }
+                        i++;
+                    }
+                    if (syncTranslationResult != null) {
+                        httpRespMsg.data = syncTranslationResult;
+                    } else {
+                        //httpRespMsg.setError("处理超时...");
+                        httpRespMsg.setError(MessageUtils.message("request.outTime"));
+                    }
+                }else if(dingding!=null&&dingding.getSyncContact()==1){
+                    String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+                    String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix,user.getDingdingUnionid(), dingding);
+                    int i = 0;
+                    String syncTranslationResult = null;
+                    /**
+                     * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
+                     * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+                     */
+                    while (i < 10) {
+                        Thread.sleep(300);
+                        Integer status = corpddJobCenter.get(jobId);
+                        if (status != null) {
+                            if (status == 1) {
+                                syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                                corpddJobCenter.remove(jobId);
+                            }
+                            break;
+                        }
+                        i++;
+                    }
+                    if (syncTranslationResult != null) {
+                        httpRespMsg.data = syncTranslationResult;
+                    } else {
+                        //httpRespMsg.setError("处理超时...");
+                        httpRespMsg.setError(MessageUtils.message("request.outTime"));
+                    }
+                }else {
+                    httpRespMsg.data = "/upload/" + fileUrlSuffix;
+                }
+            } catch (NullPointerException e) {
+                e.printStackTrace();
+                //httpRespMsg.setError("验证失败或缺少数据");
+                httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
+                return httpRespMsg;
+            } catch (IOException e) {
+                e.printStackTrace();
+                //httpRespMsg.setError("文件生成错误");
+                httpRespMsg.setError(MessageUtils.message("file.generateError"));
+                return httpRespMsg;
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            return httpRespMsg;
     }
 
     @RequestMapping("/pushFillReport")
     public HttpRespMsg pushFillReport(String ids, String date,Integer code) {return userService.pushFillReport(ids, request, date,code); }
 
     @RequestMapping("/exportMembList")
-    public HttpRespMsg exportMembList(boolean isFill, String ids, String date) {return userService.exportMembList(isFill, ids, request, date); }
+    public HttpRespMsg exportMembList(boolean isFill, String ids, String date) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        try {
+            String userId = request.getHeader("Token");
+            User user = userMapper.selectById(userId);
+            List<String> strings = ListUtil.convertLongIdsArrayToList(ids);
+            List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
+            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+            CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
+            List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", strings));
+            userList.forEach(u->{
+                Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(u.getDepartmentId())).findFirst();
+                if (first.isPresent()) {
+                    u.setDepartmentName(first.get().getDepartmentName());
+                }
+            });
+            //准备导出
+            HSSFWorkbook workbook = new HSSFWorkbook();
+            //HSSFSheet sheet = workbook.createSheet("人员列表");
+            HSSFSheet sheet = workbook.createSheet(MessageUtils.message("excel.perList"));
+            //创建表头
+            HSSFRow headRow = sheet.createRow(0);
+            //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
+            sheet.setColumnWidth(0, 5 * 256);
+            sheet.setColumnWidth(1, 10 * 256);
+            sheet.setColumnWidth(2, 20 * 256);
+            //设置为居中加粗
+            HSSFCellStyle headStyle = workbook.createCellStyle();
+            HSSFFont font = workbook.createFont();
+            font.setBold(true);
+            headStyle.setFont(font);
+            //表头
+            HSSFCell headCell;
+            headCell = headRow.createCell(0);
+            //headCell.setCellValue("序号");
+            headCell.setCellValue(MessageUtils.message("entry.serialNo"));
+            headCell.setCellStyle(headStyle);
+            headCell = headRow.createCell(1);
+            //headCell.setCellValue("姓名");
+            headCell.setCellValue(MessageUtils.message("entry.name"));
+            headCell.setCellStyle(headStyle);
+            headCell = headRow.createCell(2);
+            //headCell.setCellValue("部门");
+            headCell.setCellValue(MessageUtils.message("excel.department"));
+            headCell.setCellStyle(headStyle);
+
+            //新增数据行 并且装填数据
+            int rowNum = 1;
+            for (User item : userList) {
+                HSSFRow row = sheet.createRow(rowNum);
+                row.createCell(0).setCellValue(rowNum);
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    row.createCell(1).setCellValue("$userName="+(item.getCorpwxUserid()==null?"":item.getCorpwxUserid())+"$");
+                    row.createCell(2).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?"":item.getCorpwxDeptid())+"$");
+                }else {
+                    row.createCell(1).setCellValue(item.getName());
+                    row.createCell(2).setCellValue(item.getDepartmentName());
+                }
+                rowNum++;
+            }
+            //生成Excel文件
+            //String fileUrlSuffix = date+(isFill?"已填":"未填")+"人员列表" + System.currentTimeMillis() + ".xls";
+            String fileUrlSuffix = date+(isFill?MessageUtils.message("excel.Filled"):MessageUtils.message("excel.notFilled"))+MessageUtils.message("excel.perList") + System.currentTimeMillis() + ".xls";
+            FileOutputStream fos = new FileOutputStream(path + fileUrlSuffix);
+            workbook.write(fos);
+            fos.flush();
+            fos.close();
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
+                String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
+            /*if(jobId!=null&&!jobId.equals("")){
+                File file=new File(path + fileUrlSuffix);
+                if(file.exists()){
+                    file.delete();
+                }
+            }*/
+                int i = 0;
+                String syncTranslationResult = null;
+                /**
+                 * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
+                 * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+                 */
+                while (i < 10) {
+                    Thread.sleep(300);
+                    CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);
+                    if (corpwxJobResult != null) {
+                        if (corpwxJobResult.getErrCode() == 0) {
+                            syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
+                            corpwxJobCenter.remove(jobId);
+                        } else {
+                            httpRespMsg.setError(corpwxJobResult.getErrMsg());
+                            return httpRespMsg;
+                        }
+                        break;
+                    }
+                    i++;
+                }
+                if (syncTranslationResult != null) {
+                    httpRespMsg.data = syncTranslationResult;
+                } else {
+                    //httpRespMsg.setError("处理超时...");
+                    httpRespMsg.setError(MessageUtils.message("request.outTime"));
+                }
+            }else if(dingding!=null&&dingding.getSyncContact()==1){
+                String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+                String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
+                int i = 0;
+                String syncTranslationResult = null;
+                /**
+                 * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
+                 * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+                 */
+                while (i < 10) {
+                    Thread.sleep(300);
+                    Integer status = corpddJobCenter.get(jobId);
+                    if (status != null) {
+                        if (status == 1) {
+                            syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                            corpddJobCenter.remove(jobId);
+                        }
+                        break;
+                    }
+                    i++;
+                }
+                if (syncTranslationResult != null) {
+                    httpRespMsg.data = syncTranslationResult;
+                } else {
+                    //httpRespMsg.setError("处理超时...");
+                    httpRespMsg.setError(MessageUtils.message("request.outTime"));
+                }
+            }else {
+                httpRespMsg.data = "/upload/" + fileUrlSuffix;
+            }
+        } catch (NullPointerException e) {
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
+            return httpRespMsg;
+        } catch (IOException e) {
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
+            return httpRespMsg;
+        }catch (Exception e){
+            e.printStackTrace();
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
+            return httpRespMsg;
+        }
+        return httpRespMsg;
+    }
 
     @RequestMapping("/getHRList")
     public HttpRespMsg getHRList() {return userService.getHRList(request); }

+ 7 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserCorpwxTimeController.java

@@ -3,6 +3,7 @@ package com.management.platform.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.*;
 import com.management.platform.entity.vo.SysRichFunction;
@@ -79,6 +80,8 @@ public class UserCorpwxTimeController {
     WxCorpInfoService wxCorpInfoService;
     @Resource
     UserCorpwxTimeService userCorpwxTimeService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @RequestMapping("/getMyDeptMembsData")
     public HttpRespMsg getMyDeptMembsData(String startDate, String endDate) {
@@ -245,6 +248,7 @@ public class UserCorpwxTimeController {
         User user = userMapper.selectById(token);
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         Integer manageDeptId = user.getManageDeptId();
 
         HttpRespMsg ret = getMyDeptMembsData(startDate, endDate);
@@ -320,7 +324,7 @@ public class UserCorpwxTimeController {
         }
         //fileName += "_人员工时统计模板"+startDate+"至"+endDate;
         fileName += MessageUtils.message("fileName.workHour",startDate,endDate);
-        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, allData, path);
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, allData, path);
     }
 
     //导出填报工时在考勤工时的占比
@@ -330,6 +334,7 @@ public class UserCorpwxTimeController {
         User user = userMapper.selectById(token);
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Integer manageDeptId = user.getManageDeptId();
 
         List<Map> list = new ArrayList<Map>();
@@ -400,7 +405,7 @@ public class UserCorpwxTimeController {
         //fileName += "_人员工时统计模板"+startDate+"至"+endDate;
         fileName = ymonth + fileName;
         fileName += "项目工时占比_" + System.currentTimeMillis();
-        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, allData, path);
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, allData, path);
     }
     @RequestMapping("/getPunchRecordBySelf")
     public HttpRespMsg getUserPunchRecord(String date, String userId){

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

@@ -17,6 +17,7 @@ import com.management.platform.service.impl.ProjectServiceImpl;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.ListUtil;
 import com.management.platform.util.MessageUtils;
+import org.hibernate.validator.constraints.pl.REGON;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -68,6 +69,8 @@ public class UserYearleaveSettingController {
     private WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
     private DepartmentService departmentService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -218,6 +221,7 @@ public class UserYearleaveSettingController {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         Integer companyId = ddLeaveQtVo.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id",companyId));
         List<String> headList = new ArrayList<>();
         List<List<String>> allList = new ArrayList<>();
         HttpRespMsg dingDingLeaveQt = getDingDingLeaveQt(ddLeaveQtVo, 1);
@@ -284,7 +288,7 @@ public class UserYearleaveSettingController {
         //String fileName = "假期剩余表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.leaveRemaining")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,allList,path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,allList,path);
         } catch (Exception e) {
             e.printStackTrace();
         }

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

@@ -824,7 +824,7 @@ public class WeiXinCorpController {
                     corpwxJobResultMapper.insert(result);
                     ExcelExportServiceImpl.corpwxJobCenter.put(jobId, result);
                     ReportServiceImpl.corpwxJobCenter.put(jobId, result);
-                    UserServiceImpl.corpwxJobCenter.put(jobId, result);
+                    UserController.corpwxJobCenter.put(jobId, result);
                     TaskServiceImpl.corpwxJobCenter.put(jobId, result);
                 } else if ("auto_activate".equals(infoType)) {
                     //被邀请的同事自动激活使用

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TaskMapper.java

@@ -53,4 +53,6 @@ public interface TaskMapper extends BaseMapper<Task> {
     void updateEndDate(Integer id);
     @Update("update task set finish_date =null where id=#{id}")
     void updateFinishDate(Integer id);
+
+    List<Map<String,Object>>  userTaskCompleteDetail(Integer pageStart, Integer pageSize, String startDate, String endDate, String userId, Integer deptId,@Param("list") List<Integer> deptIds, Integer companyId);
 }

+ 6 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ExcelExportService.java

@@ -1,5 +1,6 @@
 package com.management.platform.service;
 
+import com.management.platform.entity.CompanyDingding;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.util.HttpRespMsg;
 
@@ -8,11 +9,10 @@ import java.util.Map;
 
 public interface ExcelExportService {
     public void testRead(String jobId);
-    public HttpRespMsg exportGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, String downloadPath) throws Exception;
-    public HttpRespMsg exportGeneralExcelByTitleAndList2(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, String downloadPath) throws Exception;
-    public HttpRespMsg exportMultiSheetGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo,String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) throws Exception;
-    public HttpRespMsg exportTranForwx(WxCorpInfo wxCorpInfo,String title) throws Exception;
+    public HttpRespMsg exportGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String title, List<List<String>> list, String downloadPath) throws Exception;
+    public HttpRespMsg exportGeneralExcelByTitleAndList2(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String title, List<List<String>> list, String downloadPath) throws Exception;
+    public HttpRespMsg exportMultiSheetGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, CompanyDingding dingding,String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) throws Exception;
+    public HttpRespMsg exportTranForwx(WxCorpInfo wxCorpInfo, CompanyDingding dingding,String title) throws Exception;
     void testAdd(String jobId);
-
-    HttpRespMsg exportGeneralExcelForExpense(WxCorpInfo wxCorpInfo, String fileName, List<List<String>> allList, List<Map> mapList, String path) throws Exception;
+    HttpRespMsg exportGeneralExcelForExpense(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String fileName, List<List<String>> allList, List<Map> mapList, String path) throws Exception;
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskService.java

@@ -50,4 +50,6 @@ public interface TaskService extends IService<Task> {
     public void notifyMileStoneFinish(Integer companyId, List<Task> taskList);
 
     HttpRespMsg getExecutorPlanHour(Integer projectId);
+
+    HttpRespMsg userTaskCompleteDetail(Integer pageIndex, Integer pageSize, String startDate, String endDate, String userId, Integer deptId);
 }

+ 0 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/UserService.java

@@ -54,14 +54,11 @@ public interface UserService extends IService<User> {
 
     HttpRespMsg bindWeiXin2(String code, String userId, Integer state);
 
-    HttpRespMsg exportUsers(Integer containInvalid, HttpServletRequest request);
 
     HttpRespMsg sendVcode(String mobile);
 
     HttpRespMsg pushFillReport(String ids, HttpServletRequest request, String date,Integer code);
 
-    HttpRespMsg exportMembList(boolean isFill, String ids, HttpServletRequest request, String date);
-
     HttpRespMsg getHRList(HttpServletRequest request);
 
     HttpRespMsg changeSysManager(String toUserId, Integer myRoleId, HttpServletRequest request);

+ 4 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -71,6 +71,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     private ContractLogMapper contractLogMapper;
     @Resource
     private InformationMapper informationMapper;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
     @Value(value = "${upload.path}")
     private String path;
 
@@ -226,6 +228,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             return httpRespMsg;
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
@@ -289,7 +292,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         }
         String fileName = MessageUtils.message("contract.export")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,allList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,allList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 8 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -75,6 +75,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
     private ExcelExportService excelExportService;
     @Resource
     private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Value("${corpId}")
     private String corpId;
@@ -670,6 +672,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             Integer companyId =targetUser.getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
             //当前用户管理部门
             List<Integer> deptIds=null;
@@ -908,7 +911,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //String fileName = "人员成本统计_"+System.currentTimeMillis();
             String fileName = MessageUtils.message("fileName.costStatistics",System.currentTimeMillis());
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -1174,6 +1177,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             HttpRespMsg msg = getUserCustomDataStatistic(startDate, endDate, null, request);
             Map<String, Object> map = (Map<String, Object>) msg.data;
             List<HashMap> itemList = (List<HashMap>) map.get("list");
@@ -1215,7 +1219,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //String fileName = timeType.getCustomDataName() + "统计_"+System.currentTimeMillis();
             String fileName = MessageUtils.message("fileName.statistics",timeType.getCustomDataName(),System.currentTimeMillis());
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, allList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, allList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -1359,6 +1363,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         try {
             Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             HttpRespMsg msg = getDepartmentStatistics(null, startDate, endDate, request);
             Map<String,Object> mapData = (Map<String, Object>) msg.data;
             List<DepartmentMasterVO> costList = (List<DepartmentMasterVO>) mapData.get("costList");
@@ -1407,7 +1412,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             //String fileName = "部门工时统计_"+System.currentTimeMillis();
             String fileName = MessageUtils.message("fileName.depHours",System.currentTimeMillis());
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 13 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -16,6 +16,7 @@ import com.dingtalk.api.DingTalkClient;
 import com.dingtalk.api.request.*;
 import com.dingtalk.api.response.*;
 import com.management.platform.constant.Constant;
+import com.management.platform.controller.UserController;
 import com.management.platform.entity.*;
 import com.management.platform.entity.vo.UserVO;
 import com.management.platform.mapper.*;
@@ -1364,6 +1365,18 @@ public class DingDingServiceImpl implements DingDingService {
                                         }
                                     }
                                 }
+                            }else if(139 == bizType){
+                                JSONObject actionBizData = JSONObject.parseObject(bizItem.getString("biz_data"));
+                                String syncAction = actionBizData.getString("syncAction");
+                                if("transfer_contact_id_job_result".equals(syncAction)){
+                                    bizLogger.info("异步转译通讯录id任务完成通知");
+                                    String jobId = actionBizData.getString("jobId");
+                                    Integer status = actionBizData.getInteger("status");
+                                    ExcelExportServiceImpl.corpddJobCenter.put(jobId, status);
+                                    ReportServiceImpl.corpddJobCenter.put(jobId, status);
+                                    UserController.corpddJobCenter.put(jobId, status);
+                                    TaskServiceImpl.corpddJobCenter.put(jobId, status);
+                                }
                             }
                         }
                     }

+ 168 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -1,8 +1,12 @@
 package com.management.platform.service.impl;
 
+import com.management.platform.entity.CompanyDingding;
 import com.management.platform.entity.CorpwxJobResult;
+import com.management.platform.entity.User;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.mapper.CorpwxJobResultMapper;
+import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.DingDingService;
 import com.management.platform.service.ExcelExportService;
 import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.util.ExcelUtil;
@@ -19,6 +23,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.time.LocalDateTime;
@@ -30,8 +35,15 @@ import java.util.Map;
 public class ExcelExportServiceImpl implements ExcelExportService {
     //用于控制线程锁
     public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
+    public static HashMap<String, Integer> corpddJobCenter = new HashMap();
     @Resource
     private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private DingDingService dingDingService;
+    @Resource
+    private HttpServletRequest request;
+    @Resource
+    private UserMapper userMapper;
 
     @Resource
     private CorpwxJobResultMapper corpwxJobResultMapper;
@@ -64,7 +76,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
         }
     }
 
-    public HttpRespMsg exportGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, String downloadPath) throws Exception {
+    public HttpRespMsg exportGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String title, List<List<String>> list, String downloadPath) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         if (title.contains("/")) {
             //文件名不能含有路径,得替换掉
@@ -119,13 +131,52 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
+        }else if(dingding != null && dingding.getSyncContact() == 1){
+            User user = userMapper.selectById(request.getHeader("token"));
+            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
+            System.out.println("上传待转译文件到钉钉, jobId==" + jobId);
+            int i = 0;
+            String syncTranslationResult = null;
+            /**
+             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
+             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+             */
+            long t = System.currentTimeMillis();
+            while (i < 30) {
+                if (i < 10) {
+                    Thread.sleep(300);
+                } else if (i < 20){
+                    Thread.sleep(1000);
+                } else {
+                    Thread.sleep(3000);
+                }
+                System.out.println("i=="+i+", "+LocalDateTime.now());
+                Integer status = corpddJobCenter.get(jobId);
+                if (status != null) {
+                    if (status == 1) {
+                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                        corpddJobCenter.remove(jobId);
+                    }
+                    break;
+                }
+                i++;
+            }
+            if (syncTranslationResult != null) {
+                long t2 = System.currentTimeMillis();
+                System.out.println("钉钉转译文件后地址是:"+syncTranslationResult+",耗时:" + (t2 - t) + "ms");
+                httpRespMsg.data = syncTranslationResult;
+            } else {
+                //httpRespMsg.setError("处理超时...");
+                httpRespMsg.setError(MessageUtils.message("request.outTime"));
+            }
         }else {
             httpRespMsg.data = resp;
         }
         return httpRespMsg;
     }
 
-    public HttpRespMsg exportGeneralExcelForExpense(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, List<Map> mapList, String downloadPath) throws Exception {
+    public HttpRespMsg exportGeneralExcelForExpense(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String title, List<List<String>> list, List<Map> mapList, String downloadPath) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         if (title.contains("/")) {
             //文件名不能含有路径,得替换掉
@@ -167,13 +218,41 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
+        }else if(dingding != null && dingding.getSyncContact() == 1){
+            User user = userMapper.selectById(request.getHeader("token"));
+            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
+            int i = 0;
+            String syncTranslationResult = null;
+            /**
+             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
+             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+             */
+            while (i < 10) {
+                Thread.sleep(300);
+                Integer status = corpddJobCenter.get(jobId);
+                if (status != null) {
+                    if (status == 1) {
+                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                        corpddJobCenter.remove(jobId);
+                    }
+                    break;
+                }
+                i++;
+            }
+            if (syncTranslationResult != null) {
+                httpRespMsg.data = syncTranslationResult;
+            } else {
+                //httpRespMsg.setError("处理超时...");
+                httpRespMsg.setError(MessageUtils.message("request.outTime"));
+            }
         }else {
             httpRespMsg.data = resp;
         }
         return httpRespMsg;
     }
 
-    public HttpRespMsg exportGeneralExcelByTitleAndList2(WxCorpInfo wxCorpInfo, String title, List<List<String>> list, String downloadPath) throws Exception {
+    public HttpRespMsg exportGeneralExcelByTitleAndList2(WxCorpInfo wxCorpInfo, CompanyDingding dingding, String title, List<List<String>> list, String downloadPath) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String resp = ExcelUtil.exportGeneralExcelByTitleAndList2(title, list, downloadPath);
         if (title.contains("/")) {
@@ -215,6 +294,34 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
+        }else if(dingding != null && dingding.getSyncContact() == 1){
+            User user = userMapper.selectById(request.getHeader("token"));
+            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
+            int i = 0;
+            String syncTranslationResult = null;
+            /**
+             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
+             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+             */
+            while (i < 10) {
+                Thread.sleep(300);
+                Integer status = corpddJobCenter.get(jobId);
+                if (status != null) {
+                    if (status == 1) {
+                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                        corpddJobCenter.remove(jobId);
+                    }
+                    break;
+                }
+                i++;
+            }
+            if (syncTranslationResult != null) {
+                httpRespMsg.data = syncTranslationResult;
+            } else {
+                //httpRespMsg.setError("处理超时...");
+                httpRespMsg.setError(MessageUtils.message("request.outTime"));
+            }
         }else {
             httpRespMsg.data = resp;
         }
@@ -222,7 +329,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
     }
 
 
-    public  HttpRespMsg exportMultiSheetGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo,String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) throws Exception {
+    public  HttpRespMsg exportMultiSheetGeneralExcelByTitleAndList(WxCorpInfo wxCorpInfo, CompanyDingding dingding,String title, List<List<String>>[] multiSheetList, String downloadPath,String[] sheetsName) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String resp = ExcelUtil.exportMultiSheetGeneralExcelByTitleAndList(title,multiSheetList, downloadPath,sheetsName);
         if (title.contains("/")) {
@@ -264,13 +371,41 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
+        }else if(dingding != null && dingding.getSyncContact() == 1){
+            User user = userMapper.selectById(request.getHeader("token"));
+            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix,user.getDingdingUnionid(), dingding);
+            int i = 0;
+            String syncTranslationResult = null;
+            /**
+             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
+             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+             */
+            while (i < 10) {
+                Thread.sleep(300);
+                Integer status = corpddJobCenter.get(jobId);
+                if (status != null) {
+                    if (status == 1) {
+                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                        corpddJobCenter.remove(jobId);
+                    }
+                    break;
+                }
+                i++;
+            }
+            if (syncTranslationResult != null) {
+                httpRespMsg.data = syncTranslationResult;
+            } else {
+                //httpRespMsg.setError("处理超时...");
+                httpRespMsg.setError(MessageUtils.message("request.outTime"));
+            }
         }else {
             httpRespMsg.data = resp;
         }
         return httpRespMsg;
     }
 
-    public  HttpRespMsg exportTranForwx(WxCorpInfo wxCorpInfo,String title) throws Exception {
+    public  HttpRespMsg exportTranForwx(WxCorpInfo wxCorpInfo, CompanyDingding dingding,String title) throws Exception {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         if (title.contains("/")) {
             //文件名不能含有路径,得替换掉
@@ -311,6 +446,34 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
+        }else if(dingding != null && dingding.getSyncContact() == 1){
+            User user = userMapper.selectById(request.getHeader("token"));
+            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix,user.getDingdingUnionid(), dingding);
+            int i = 0;
+            String syncTranslationResult = null;
+            /**
+             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
+             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+             */
+            while (i < 10) {
+                Thread.sleep(300);
+                Integer status = corpddJobCenter.get(jobId);
+                if (status != null) {
+                    if (status == 1) {
+                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+                        corpddJobCenter.remove(jobId);
+                    }
+                    break;
+                }
+                i++;
+            }
+            if (syncTranslationResult != null) {
+                httpRespMsg.data = syncTranslationResult;
+            } else {
+                //httpRespMsg.setError("处理超时...");
+                httpRespMsg.setError(MessageUtils.message("request.outTime"));
+            }
         }
         return httpRespMsg;
     }

+ 4 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -95,6 +95,8 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
 
     @Resource
     private ExpenseAuditSettingMapper expenseAuditSettingMapper;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
 
     @Override
@@ -1097,6 +1099,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
     @Override
     public HttpRespMsg exportList(ExpenseSheet sheet,Integer projectId, String startDate, String endDate) {
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", sheet.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", sheet.getCompanyId()));
         QueryWrapper<ExpenseSheet> queryWrapper = new QueryWrapper<ExpenseSheet>();
         queryWrapper.eq("company_id", sheet.getCompanyId()).orderByDesc("id");
         List<ExpenseMainType> mainTypes = expenseMainTypeService.list(new QueryWrapper<ExpenseMainType>().eq("company_id", sheet.getCompanyId()));
@@ -1238,7 +1241,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
         //String fileName = "费用报销单据列表"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.expense")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelForExpense(wxCorpInfo,fileName , allList,mapList, path);
+            return excelExportService.exportGeneralExcelForExpense(wxCorpInfo,dingding,fileName , allList,mapList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 6 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -86,6 +86,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
     UserCustomMapper userCustomMapper;
     @Resource
     WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Resource
     private ProjectMapper projectMapper;
@@ -625,6 +627,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             TimeType timeType = timeTypeMapper.selectById(companyId);
             boolean isSecret = timeType.getIsSecretSalary()==1?true:false;
             final List<FinanceTblcuscol> cusColList = financeTblcuscolMapper.selectList(new QueryWrapper<FinanceTblcuscol>().eq("company_id", companyId));
@@ -1518,9 +1521,9 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                             multiSheetDataList[i].add(newRow);
                         }
                     }
-                    return excelExportService.exportMultiSheetGeneralExcelByTitleAndList(wxCorpInfo,fileName , multiSheetDataList, path, sheetNameList.toArray(new String[0]));
+                    return excelExportService.exportMultiSheetGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , multiSheetDataList, path, sheetNameList.toArray(new String[0]));
                 } else {
-                    return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+                    return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
                 }
             } catch (Exception e) {
                 e.printStackTrace();
@@ -2052,7 +2055,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             String fileName = MessageUtils.message("fileName.perSal")+company.getCompanyName()+yearMonth+"_"+System.currentTimeMillis();
             try {
                 //不需要转译
-                return excelExportService.exportGeneralExcelByTitleAndList(null,fileName , allList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(null,null,fileName , allList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 5 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java

@@ -2,6 +2,7 @@ package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -75,6 +76,8 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
     WxCorpInfoService wxCorpInfoService;
     @Resource
     InformationMapper informationMapper;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -526,6 +529,7 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         Integer companyId = userMapper.selectById(userId).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).select("id","name","corpwx_userid"));
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
@@ -677,7 +681,7 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
         //String fileName = "请假信息_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.leaveInfo")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 4 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectApprovalServiceImpl.java

@@ -96,6 +96,8 @@ public class ProjectApprovalServiceImpl extends ServiceImpl<ProjectApprovalMappe
     private WxCorpTemplateService wxCorpTemplateService;
     @Resource
     private ReportService reportService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
     @Value(value = "${upload.path}")
     private String path;
 
@@ -725,6 +727,7 @@ public class ProjectApprovalServiceImpl extends ServiceImpl<ProjectApprovalMappe
         String[] arr=new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         titleList.add("项目编号");
         titleList.add("项目名称");
         titleList.add("项目分类");
@@ -754,7 +757,7 @@ public class ProjectApprovalServiceImpl extends ServiceImpl<ProjectApprovalMappe
         }
         String title="立项导出_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,title,dataList,path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,title,dataList,path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 63 - 31
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -240,6 +240,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     private SapProjectServiceService sapProjectServiceService;
     @Resource
     private HolidaySettingService holidaySettingService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -1656,6 +1658,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             Integer companyId = targetUser.getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
             Map<String, Object> resultMap = new HashMap<>();
             //当前用户管理部门
             List<Integer> deptIds=null;
@@ -2174,7 +2177,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 fileName = MessageUtils.message("fileName.projectCost")+System.currentTimeMillis();
             }
 
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
         } catch (NullPointerException e) {
             e.printStackTrace();
             //httpRespMsg.setError("验证失败");
@@ -2743,6 +2746,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         //判断用户的角色,如果是管理员和负责人,查看全部的。如果是普通员工,只能是看到参与的项目
         QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -2792,7 +2796,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.projectReport")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -2856,6 +2860,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
         QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -2945,7 +2950,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目任务报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.projectTaskReport")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -2959,6 +2964,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
 
 
         //该公司下的allday
@@ -3055,7 +3061,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目任务报表_"+System.currentTimeMillis();
         String fileName = "预估工时表"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
             httpRespMsg.setError(e.getMessage());
@@ -3144,6 +3150,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<Project> projectAllList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
         List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部项目任务报表");
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务报表");
@@ -3209,7 +3216,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目成本报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.projectCostReport")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -3297,6 +3304,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Integer companyId = user.getCompanyId();
         Company company = companyMapper.selectById(companyId);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<Project> projectAllList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
         List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全部项目任务报表");
         List<SysRichFunction> functionInchargeList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责项目任务报表");
@@ -3397,7 +3405,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目收支平衡报表(利润表)_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.profitSta")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -3412,6 +3420,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<CustomerProject> projectList = projectMapper.getCustomerProjectInAndOut(companyId, null, null,null,null);
         List<List<String>> exportList = new ArrayList<>();
         //String[] titles = {"客户名称", "相关项目", "合同金额", "人工成本", "一般费用", "差旅费用","外包费用", "总费用", "利润", "利润率"};
@@ -3470,7 +3479,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "客户项目利润报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.cusPro")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -4014,7 +4023,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目阶段工时报表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.ProPeriodWork")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList2(null,fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList2(null,null,fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -4094,6 +4103,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             String token = request.getHeader("TOKEN");
             User user = userMapper.selectById(token);
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id",user.getCompanyId()));
             TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
             List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "全公司加班情况");
             List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "负责部门加班情况");
@@ -4345,7 +4355,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             sheetNames[1] = MessageUtils.message("Statistics.ByPro");
             sheetNames[2] = MessageUtils.message("Statistics.ByPeople");
             try {
-                return excelExportService.exportMultiSheetGeneralExcelByTitleAndList(wxCorpInfo,fileName , totalList, path, sheetNames);
+                return excelExportService.exportMultiSheetGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , totalList, path, sheetNames);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -6394,6 +6404,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<String> nameList= (List<String>) resultMap.get("nameList");
         Company company = companyMapper.selectById(user.getCompanyId());
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", company.getId()));
         List<ProjectCustom> projectCustomList = projectCustomMapper.selectList(new QueryWrapper<ProjectCustom>().eq("company_id", company.getId()));
         List<ProjectCustom> customList = projectCustomList.stream().filter(pl -> pl.getCustomType() != 1).collect(Collectors.toList());
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
@@ -6695,7 +6706,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目导出_"+company.getCompanyName()+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.proExport")+company.getCompanyName()+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,allList,path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,allList,path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -6707,6 +6718,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         //获取全部用户
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().select("id, name, corpwx_userid").eq("company_id", user.getCompanyId()));
         String  projectCategorySub=null;
@@ -6799,7 +6811,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目分组_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.proGroup")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -6845,6 +6857,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         try {
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
             TimeType timeType = timeTypeMapper.selectById(companyId);
             List<String> headList = new ArrayList<String>();
@@ -6936,7 +6949,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //String fileName = timeType.getCustomDataName() + "统计_"+System.currentTimeMillis();
             String fileName = timeType.getCustomDataName() + MessageUtils.message("Statistics.tj")+"_"+System.currentTimeMillis();
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -7243,6 +7256,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         User user = userMapper.selectById(request.getHeader("Token"));
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         boolean viewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "全部工时成本预警表");
         boolean incharger = sysFunctionService.hasPriviledge(user.getRoleId(), "负责项目工时成本预警表");
         List<HashMap> projectList=new ArrayList();
@@ -7348,7 +7362,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "工时成本预警表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.hourCostAlert")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, exportList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, exportList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -7558,6 +7572,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             Integer companyId =targetUser.getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             Map<String, Object> resultMap = new HashMap<>();
             //当前用户管理部门
             List<Integer> deptIds=null;
@@ -7784,7 +7799,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //String fileName = "项目分类工时成本统计_"+System.currentTimeMillis();
             String fileName = MessageUtils.message("fileName.proClassLaborCost")+System.currentTimeMillis();
             try {
-                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+                return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -8022,6 +8037,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         HttpRespMsg userWorkingTimeList = getUserWorkingTimeList(userId,projectId,startDate, endDate, null,null,request,departmentId);
         HashMap result = (HashMap) userWorkingTimeList.data;
         List<Map<String, Object>> resultList = (List<Map<String, Object>>) result.get("result");
@@ -8090,7 +8106,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "人员工时分配统计_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.perHoursAllSta")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -8450,6 +8466,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg msg = getUserReportTimelinessRate(request, startDate, endDate, null, null, null, null);
         HashMap map= (HashMap) msg.data;
         List<TimelinessRateVO> list = (List<TimelinessRateVO>) map.get("list");
@@ -8479,7 +8496,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "人员填报及时率统计_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.timePerFill")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -8550,6 +8567,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg msg = getWaitingReviewList(request, stateKey, userId, null, null,startDate,endDate,null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
         HashMap resultmap= (HashMap) msg.data;
         List<Map<String,Object>> list= (List<Map<String, Object>>) resultmap.get("result");
@@ -8584,7 +8602,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "人员待审核统计_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.perReviewed")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -8704,6 +8722,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg httpRespMsg = getUserWorkingTimeStatic(startDate, endDate, null, null, request, userId, departmentId);
         Map<String,Object> data = (Map<String, Object>) httpRespMsg.data;
         List<Map<String,Object>> resultList= (List<Map<String, Object>>) data.get("result");
@@ -8742,7 +8761,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "人员工时统计_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.perHoursSta")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -9245,6 +9264,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg projectBaseCost = getProjectBaseCost(null, request, null, null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HashMap map= (HashMap) projectBaseCost.data;
         List<Project> resultProjectList= (List<Project>) map.get("result");
         List<List<String>> dataList=new ArrayList<>();
@@ -9276,7 +9296,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "项目成本基线表_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("Statistics.ProjectCostBase")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -9348,6 +9368,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         User targetUser = userMapper.selectById(request.getHeader("token"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", targetUser.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", targetUser.getCompanyId()));
         List<SysRichFunction> functionTimeList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看工时统计");
         List<SysRichFunction> functionCostList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "查看成本统计");
         HttpRespMsg msg = getTimeCostByUserCustom(startDate, endDate, null, customId, request, fieldName);
@@ -9381,7 +9402,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = userCustom.getName()+"工时成本统计_"+System.currentTimeMillis();
         String fileName = userCustom.getName()+MessageUtils.message("fileName.hourCost")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -10180,6 +10201,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg httpRespMsg = getEmpMonthHours(null, null,month,departmentId,userId,whether,request);
         Map<String,Object> data = (Map<String, Object>) httpRespMsg.data;
         List<Map<String,Object>> resultList= (List<Map<String, Object>>) data.get("result");
@@ -10226,7 +10248,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "人员"+time.getMonthValue()+"月度工时表"+System.currentTimeMillis();
         String fileName = MessageUtils.message("entry.personnel") +time.getMonthValue()+MessageUtils.message("fileName.monthWork")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -10369,6 +10391,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         String token = request.getHeader("token");
         User user = userMapper.selectById(token);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         HttpRespMsg httpRespMsg = deptPartInProjects(null, null, month, departmentId, request);
         Map<String, Object> data = (Map<String, Object>) (Map<String, Object>) httpRespMsg.data;
         List<Map<String, Object>> resultList = (List<Map<String, Object>>) data.get("resultList");
@@ -10404,7 +10427,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = "部门参与项目情况表"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.deptJoinPro")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -10418,6 +10441,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         String startDate=null;
         String endDate=null;
         LocalDate date1;
@@ -10531,7 +10555,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //String fileName = year+"人员填报及时率统计_"+System.currentTimeMillis();
         String fileName = year+"_"+quarter+MessageUtils.message("fileName.quarter")+MessageUtils.message("fileName.timePerFill")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -11154,6 +11178,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             User targetUser = userMapper.selectById(request.getHeader("Token"));
             Integer companyId =targetUser.getCompanyId();
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             Map<String, Object> resultMap = new HashMap<>();
             //当前用户管理部门
             List<Integer> deptIds=null;
@@ -11321,7 +11346,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             //生成excel文件导出
             //String fileName = "维度成本工时统计_"+System.currentTimeMillis();
             String fileName = timeType.getCustomDegreeName() + MessageUtils.message("fileName.degreeCost")+System.currentTimeMillis();
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , allList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , allList, path);
         } catch (NullPointerException e) {
             e.printStackTrace();
             //httpRespMsg.setError("验证失败");
@@ -11472,6 +11497,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         List<UserCustom> userCustoms = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", user.getCompanyId()).orderByAsc("id"));
         String customName = "";
         if (userCustoms.size() != 0){
@@ -11605,7 +11631,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         String fileName = "FTE报表"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -12190,6 +12216,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<LaborHourRateVo> resultList= (List<LaborHourRateVo>) msgData.getData();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Company company = companyMapper.selectById(companyId);
         //1.创建一个workbook,对应一个excel文件
         SXSSFWorkbook workBook = new SXSSFWorkbook();
@@ -12352,7 +12379,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
             try {
-                return excelExportService.exportTranForwx(wxCorpInfo, title);
+                return excelExportService.exportTranForwx(wxCorpInfo,dingding, title);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -12489,6 +12516,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg respMsg = getMembProjectCateRatio(startDate, endDate,departmentId,subUserCustomName, onlyShowWarning);
         Map<String,Object> resultMap= (Map<String, Object>) respMsg.getData();
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) resultMap.get("userList");
@@ -12530,7 +12558,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         String title= "项目分类工时占比表_"+System.currentTimeMillis();
         String fileName= title+".xlsx";
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,dataList,path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -12634,6 +12662,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) msgData.get("record");
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Company company = companyMapper.selectById(companyId);
         //1.创建一个workbook,对应一个excel文件
         SXSSFWorkbook workBook = new SXSSFWorkbook();
@@ -12808,7 +12837,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
 
             try {
-                return excelExportService.exportTranForwx(wxCorpInfo, title);
+                return excelExportService.exportTranForwx(wxCorpInfo,dingding, title);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -13098,6 +13127,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) msgData.get("record");
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Company company = companyMapper.selectById(companyId);
         //1.创建一个workbook,对应一个excel文件
         SXSSFWorkbook workBook = new SXSSFWorkbook();
@@ -13293,7 +13323,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
 
             try {
-                return excelExportService.exportTranForwx(wxCorpInfo, title);
+                return excelExportService.exportTranForwx(wxCorpInfo,dingding, title);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -13398,6 +13428,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         percentFormat.setMaximumFractionDigits(2);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg resultMsg = projectExpendProcessList(startDate,endDate,projectId,categoryId,userId,null,null);
         Map<String, Object> msgData = (Map<String, Object>) resultMsg.getData();
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) msgData.get("record");
@@ -13468,7 +13499,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         String fileName = "项目耗用进度表_"+System.currentTimeMillis();
         try {
-           return   excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+           return   excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -13547,6 +13578,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) msgData.get("record");
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Company company = companyMapper.selectById(companyId);
         //1.创建一个workbook,对应一个excel文件
         SXSSFWorkbook workBook = new SXSSFWorkbook();
@@ -13736,7 +13768,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
 
             try {
-                return excelExportService.exportTranForwx(wxCorpInfo, title);
+                return excelExportService.exportTranForwx(wxCorpInfo,dingding, title);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 6 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProviderInfoServiceImpl.java

@@ -2,9 +2,8 @@ package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.entity.ProviderInfo;
-import com.management.platform.entity.User;
-import com.management.platform.entity.WxCorpInfo;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.CompanyDingdingMapper;
 import com.management.platform.mapper.ProviderInfoMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.WxCorpInfoMapper;
@@ -50,6 +49,8 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
     WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
     ExcelExportService excelExportService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
     @Value(value = "${upload.path}")
     String path;
     @Override
@@ -166,6 +167,7 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
     public HttpRespMsg exportData(HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("token"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         List<List<String>> dataList=new ArrayList<>();
         //String[] titleString=new String[]{"供应商编号","供应商名称","分类","联系人","联系电话","邮箱","地址","备注"};
         String[] titleString=new String[]{MessageUtils.message("excel.supplierNo"),MessageUtils.message("excel.supplierName"),MessageUtils.message("excel.classification"),MessageUtils.message("excel.contacts"),MessageUtils.message("excel.phone"),MessageUtils.message("excel.email"),MessageUtils.message("excel.address"),MessageUtils.message("excel.remarks")};
@@ -188,7 +190,7 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
         //String fileName = "供应商统计_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.supStat")+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 6 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportExtraDegreeServiceImpl.java

@@ -2,14 +2,12 @@ package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.entity.ReportExtraDegree;
-import com.management.platform.entity.TimeType;
-import com.management.platform.entity.User;
-import com.management.platform.entity.WxCorpInfo;
+import com.management.platform.entity.*;
 import com.management.platform.mapper.ReportExtraDegreeMapper;
 import com.management.platform.mapper.TimeTypeMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.WxCorpInfoMapper;
+import com.management.platform.service.CompanyDingdingService;
 import com.management.platform.service.ExcelExportService;
 import com.management.platform.service.ReportExtraDegreeService;
 import com.management.platform.util.ExcelUtil;
@@ -57,6 +55,8 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
     WxCorpInfoMapper wxCorpInfoMapper;
     @Resource
     ExcelExportService excelExportService;
+    @Resource
+    private CompanyDingdingService companyDingdingService;
     @Override
     public HttpRespMsg importData(HttpServletRequest request, MultipartFile multipartFile) {
         HttpRespMsg msg=new HttpRespMsg();
@@ -161,6 +161,7 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         List<ReportExtraDegree> reportExtraDegreeList = reportExtraDegreeMapper.selectList(new QueryWrapper<ReportExtraDegree>().eq("company_id", user.getCompanyId()));
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
         List<String> titleList=new ArrayList<>();
@@ -175,7 +176,7 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
         //生成excel文件导出
         String fileName = timeType.getCustomDegreeName()+"_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

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

@@ -13,6 +13,7 @@ import com.management.platform.service.*;
 import com.management.platform.util.*;
 import com.management.platform.webservice.po.*;
 import com.management.platform.webservice.po.SapPeriod;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import lombok.SneakyThrows;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
@@ -74,6 +75,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     private final static Executor executor = Executors.newFixedThreadPool(3);//启用多线程
     //用于控制线程锁
     public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
+    public static HashMap<String, Integer> corpddJobCenter=new HashMap<>();
     @Value("${wx.template_report_pass}")
     public String TEMPLATE_REPORT_PASS;
     @Value("${wx.template_report_reject}")
@@ -4496,6 +4498,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg msg = getUserDailyWorkTime(request, startDate, endDate);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         //String[] weekDayCHN = {"周一","周二","周三","周四","周五","周六","周日"};
         String[] weekDayCHN = {MessageUtils.message("week.Monday"),MessageUtils.message("week.Tuesday"),MessageUtils.message("week.Wednesday"),MessageUtils.message("week.Thursday"),MessageUtils.message("week.Friday"),MessageUtils.message("week.Saturday"),MessageUtils.message("week.Sunday")};
         HashMap map = (HashMap) msg.data;
@@ -4554,7 +4557,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         //String fileName = "人员每日工时统计_"+startDate+"至"+endDate+"_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.dailyManHour",startDate,endDate)+"_"+System.currentTimeMillis();
         try {
-             return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+             return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -5247,6 +5250,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             Integer companyId = company.getId();
             List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", companyId));
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+            CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
             boolean needCorpWxTranslate = (wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
             List<List<String>> dataList=new ArrayList<>();
@@ -5821,7 +5825,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             //生成Excel文件
             String fileUrlSuffix = (startDate==null?"":(startDate+MessageUtils.message("leave.to")+endDate))+MessageUtils.message("excel.workReport") + System.currentTimeMillis();
-            httpRespMsg = excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileUrlSuffix,dataList,path);
+            httpRespMsg = excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileUrlSuffix,dataList,path);
         } catch (NullPointerException e) {
             //httpRespMsg.setError("验证失败或缺少数据");
             httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
@@ -6240,7 +6244,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg msg = getNoReportUserList(request, startDate, endDate,noReportDeptId);
         String token = request.getHeader("TOKEN");
         TimeType timeType = timeTypeMapper.selectById(userMapper.selectById(token).getCompanyId());
-        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", userMapper.selectById(token).getCompanyId()));
+        Integer companyId = userMapper.selectById(token).getCompanyId();
+        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         //String[] weekDayCHN = {"周一","周二","周三","周四","周五","周六","周日"};
         String[] weekDayCHN = {MessageUtils.message("week.Monday"),MessageUtils.message("week.Tuesday"),MessageUtils.message("week.Wednesday"),MessageUtils.message("week.Thursday"),MessageUtils.message("week.Friday"),MessageUtils.message("week.Saturday"),MessageUtils.message("week.Sunday")};
         List<UserDailyWorkItem> dailyWorkItems = (List<UserDailyWorkItem>) msg.data;
@@ -6283,7 +6289,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         //String fileName = "未填人员统计_"+startDate+"至"+endDate+"_"+System.currentTimeMillis();
         String fileName = MessageUtils.message("fileName.perNoFill")+startDate+MessageUtils.message("leave.to")+endDate+"_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -8704,6 +8710,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
 
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
         List<LocalDate> dates = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));
         List<UserCustom> userCustomList = userCustomMapper.selectList(new LambdaQueryWrapper<UserCustom>().eq(UserCustom::getCompanyId, companyId));
@@ -8775,7 +8782,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         String fileName = "分类工时明细表"+"_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding, fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -9005,6 +9012,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg timeReminder = getUserDailyWorkTimeReminder(request, startDate, endDate);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         Map<String, Object> data = (Map<String, Object>) timeReminder.getData();
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) data.get("list");
         List<List<String>> dataList=new ArrayList<>();
@@ -9032,6 +9040,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             dataList.add(item);
         }
         String fileName="工时异常表"+System.currentTimeMillis();
-        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName,dataList,path);
     }
 }

+ 4 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java

@@ -71,6 +71,8 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
     UserMapper userMapper;
     @Resource
     WxCorpInfoMapper wxCorpInfoMapper;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
     @Value(value = "${upload.path}")
     private String path;
 
@@ -396,6 +398,7 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
     public HttpRespMsg exportData(String yearMonth, Integer companyId, String type, HttpServletRequest request) {
         HttpRespMsg timeCost = getTimeCost(yearMonth, companyId, type, request);
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HashMap map = (HashMap)timeCost.data;
         List<HashMap> costList = (List<HashMap>)map.get("costList");
         List<List<String>> dataList = new ArrayList<>();
@@ -444,7 +447,7 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
         //生成excel文件导出
         String fileName = yearMonth+"_"+type+MessageUtils.message("report.report")+"_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,dingding,fileName , dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 6 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskRestartServiceImpl.java

@@ -1,16 +1,11 @@
 package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.management.platform.entity.TaskRestart;
-import com.management.platform.entity.User;
-import com.management.platform.entity.WxCorpInfo;
+import com.management.platform.entity.*;
 import com.management.platform.entity.vo.ProjectWithStage;
 import com.management.platform.entity.vo.StageCost;
 import com.management.platform.entity.vo.SysRichFunction;
-import com.management.platform.mapper.SysFunctionMapper;
-import com.management.platform.mapper.TaskRestartMapper;
-import com.management.platform.mapper.UserMapper;
-import com.management.platform.mapper.WxCorpInfoMapper;
+import com.management.platform.mapper.*;
 import com.management.platform.service.ExcelExportService;
 import com.management.platform.service.TaskRestartService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -50,6 +45,8 @@ public class TaskRestartServiceImpl extends ServiceImpl<TaskRestartMapper, TaskR
     private SysFunctionMapper sysFunctionMapper;
     @Resource
     private ExcelExportService excelExportService;
+    @Resource
+    private CompanyDingdingMapper companyDingdingMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -113,6 +110,7 @@ public class TaskRestartServiceImpl extends ServiceImpl<TaskRestartMapper, TaskR
         User user = userMapper.selectById(token);
         Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
         DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter df2=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -167,7 +165,7 @@ public class TaskRestartServiceImpl extends ServiceImpl<TaskRestartMapper, TaskR
         }
         String fileName = "任务重启报表_"+System.currentTimeMillis();
         try {
-            return excelExportService.exportGeneralExcelByTitleAndList2(wxCorpInfo,fileName, dataList, path);
+            return excelExportService.exportGeneralExcelByTitleAndList2(wxCorpInfo,dingding,fileName, dataList, path);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 95 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -2,18 +2,17 @@ package com.management.platform.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.util.StringUtil;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
-import com.management.platform.service.CompanyDingdingService;
-import com.management.platform.service.TaskExecutorService;
-import com.management.platform.service.TaskService;
-import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.service.*;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.xssf.usermodel.XSSFCell;
@@ -49,6 +48,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
 
     //用于控制线程锁
     public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
+    public static HashMap<String, Integer> corpddJobCenter = new HashMap();
 
     @Value(value = "${upload.path}")
     private String path;
@@ -80,6 +80,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     private WxCorpInfoService wxCorpInfoService;
     @Resource
     private WxCorpInfoMapper wxCorpInfoMapper;
+//    @Resource
+//    private DingDingService dingDingService;
+    @Resource
+    private SysFunctionService sysFunctionService;
+    @Resource
+    private DepartmentService departmentService;
+    @Resource
+    private DepartmentOtherManagerMapper departmentOtherManagerMapper;
 
     @Override
     public HttpRespMsg getExecutorPanel(Integer projectId) {
@@ -221,8 +229,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         List<TimeTask> list= taskMapper.getTaskWithWorktime(projectId, taskType);
         Project project = projectMapper.selectById(projectId);
-        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        User user = userMapper.selectById(request.getHeader("token"));
+        Integer companyId = user.getCompanyId();
         WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+        CompanyDingding dingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
         try {
             DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -365,6 +375,39 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     //httpRespMsg.setError("处理超时...");
                     httpRespMsg.setError(MessageUtils.message("request.outTime"));
                 }
+            }else if(dingding!=null&&dingding.getSyncContact()==1){
+//                String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
+//                String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix,user.getDingdingUnionid(),dingding);
+//            /*if(jobId!=null&&!jobId.equals("")){
+//                File file=new File(path + fileUrlSuffix);
+//                if(file.exists()){
+//                    file.delete();
+//                }
+//            }*/
+//                int i = 0;
+//                String syncTranslationResult = null;
+//                /**
+//                 * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
+//                 * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
+//                 */
+//                while (i < 10) {
+//                    Thread.sleep(300);
+//                    Integer status = corpddJobCenter.get(jobId);
+//                    if (status != null) {
+//                        if (status==1) {
+//                            syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
+//                            corpddJobCenter.remove(jobId);
+//                        }
+//                        break;
+//                    }
+//                    i++;
+//                }
+//                if (syncTranslationResult != null) {
+//                    httpRespMsg.data = syncTranslationResult;
+//                } else {
+//                    //httpRespMsg.setError("处理超时...");
+//                    httpRespMsg.setError(MessageUtils.message("request.outTime"));
+//                }
             }else {
                 httpRespMsg.data = "/upload/" + fileUrlSuffix;
             }
@@ -798,4 +841,51 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         httpRespMsg.data=list;
         return httpRespMsg;
     }
+
+    @Override
+    public HttpRespMsg userTaskCompleteDetail(Integer pageIndex, Integer pageSize, String startDate, String endDate, String userId, Integer deptId) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer pageStart=null;
+        User user = userMapper.selectById(request.getHeader("token"));
+        Integer companyId = user.getCompanyId();
+        List<Department> departmentList = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        boolean viewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "全部员工任务完成情况表");
+        boolean viewDept = sysFunctionService.hasPriviledge(user.getRoleId(), "负责部门员工任务完成情况表");
+        List<Map<String, Object>> resultMaps;
+        if(pageIndex!=null&&pageSize!=null){
+            pageStart = (pageIndex - 1) * pageSize;
+        }
+        if(!viewAll){
+            if(viewDept){
+                //获取负责部门数据
+                List<Integer> deptIds = departmentService.list(new LambdaQueryWrapper<Department>().eq(Department::getManagerId, user.getId())).stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
+                List<Integer> targetDeptIds=new ArrayList<>();
+                targetDeptIds.addAll(deptIds);
+                for (Integer id : deptIds) {
+                    List<Integer> branchDepartment = getBranchDepartment(id, departmentList);
+                    targetDeptIds.addAll(branchDepartment);
+                }
+                resultMaps = taskMapper.userTaskCompleteDetail(pageStart, pageSize, startDate, endDate, userId, deptId,targetDeptIds, companyId);
+            }else {
+                //只能看自己的
+                resultMaps = taskMapper.userTaskCompleteDetail(pageStart, pageSize, startDate, endDate, user.getId(), deptId,null, companyId);
+            }
+        }else {
+            resultMaps = taskMapper.userTaskCompleteDetail(pageStart, pageSize, startDate, endDate, userId, deptId,null, companyId);
+        }
+        msg.setData(resultMaps);
+        return msg;
+    }
+
+    private List<Integer> getBranchDepartment(Integer departmentId, List<Department> departmentList) {
+        List<Integer> list = new ArrayList<>();
+        list.add(departmentId);
+        //搜到子部门进行添加
+        for (Department department : departmentList) {
+            if (departmentId.equals(department.getSuperiorId())) {
+                list.addAll(getBranchDepartment(department.getDepartmentId(), departmentList));
+            }
+        }
+        return list;
+    }
 }

+ 1 - 370
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -15,6 +15,7 @@ import com.management.platform.entity.vo.UserVO;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.*;
+import jdk.nashorn.api.scripting.ScriptObjectMirror;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
@@ -105,8 +106,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     public static final String GET_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=accessToken&openid=openId&lang=zh_CN";
     public static final String[] MATCHING_FILED = {"corpwx_userid","phone","job_number"};
 
-    //用于控制线程锁
-    public static HashMap<String, CorpwxJobResult> corpwxJobCenter = new HashMap();
     @Resource
     private RedisUtil redisUtil;
 
@@ -1996,252 +1995,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return respMsg;
     }
 
-    @Override
-    public HttpRespMsg exportUsers(Integer containInvalid, HttpServletRequest request) {
-        HttpRespMsg httpRespMsg = new HttpRespMsg();
-        try {
-            String userId = request.getHeader("Token");
-            User user = userMapper.selectById(userId);
-            TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
-            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-            List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().select(User::getId, User::getName, User::getCorpwxUserid).eq(User::getCompanyId, user.getCompanyId()));
-            List<UserCustom> userCustomList = userCustomMapper.selectList(new QueryWrapper<UserCustom>().eq("company_id", user.getCompanyId()));
-            //查看当前用户是否有人员成本的查看权限
-            boolean canViewCost = sysFunctionService.hasPriviledge(user.getRoleId(), "人员成本管理");
-            System.out.println("canViewCost=========="+canViewCost);
-            //准备导出
-            HSSFWorkbook workbook = new HSSFWorkbook();
-            //HSSFSheet sheet = workbook.createSheet("全部员工列表");
-            HSSFSheet sheet = workbook.createSheet(MessageUtils.message("excel.allPeopleList"));
-            //创建表头
-            HSSFRow headRow = sheet.createRow(0);
-            //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
-            sheet.setColumnWidth(0, 5 * 256);
-            sheet.setColumnWidth(1, 10 * 256);
-            sheet.setColumnWidth(2, 20 * 256);
-            sheet.setColumnWidth(3, 20 * 256);
-            sheet.setColumnWidth(4, 20 * 256);
-            sheet.setColumnWidth(5, 10 * 256);
-
-            sheet.setColumnWidth(6, 10 * 256);
-            sheet.setColumnWidth(7, 10 * 256);
-            sheet.setColumnWidth(8, 10 * 256);
-            //设置为居中加粗
-            HSSFCellStyle headStyle = workbook.createCellStyle();
-            HSSFFont font = workbook.createFont();
-            font.setBold(true);
-            headStyle.setFont(font);
-            //表头
-            HSSFCell headCell;
-            headCell = headRow.createCell(0);
-            //headCell.setCellValue("序号");
-            headCell.setCellValue(MessageUtils.message("entry.serialNo"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(1);
-            //headCell.setCellValue("姓名");
-            headCell.setCellValue(MessageUtils.message("entry.name"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(2);
-            //headCell.setCellValue("角色");
-            headCell.setCellValue(MessageUtils.message("role.role"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(3);
-            //headCell.setCellValue("手机号");
-            headCell.setCellValue(MessageUtils.message("excel.phoneNumber"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(4);
-            //headCell.setCellValue("部门");
-            headCell.setCellValue(MessageUtils.message("excel.department"));
-            headCell.setCellStyle(headStyle);
-            int auditIndex = -1;
-            if(timeType.getReportAuditType() == 5 || timeType.getReportAuditType() == 6){
-                headCell = headRow.createCell(5);
-                headCell.setCellValue("直属审核人");
-                headCell.setCellStyle(headStyle);
-                auditIndex=0;
-            }
-
-            int minusIndex = -2;
-            if (canViewCost) {
-                headCell = headRow.createCell(6+auditIndex);
-                //headCell.setCellValue("月薪");
-                headCell.setCellValue(MessageUtils.message("excel.MonSalary"));
-                headCell.setCellStyle(headStyle);
-                headCell = headRow.createCell(7+auditIndex);
-                //headCell.setCellValue("时薪");
-                headCell.setCellValue(MessageUtils.message("excel.hourlyWage"));
-                headCell.setCellStyle(headStyle);
-                minusIndex = 0;
-            }
-
-            headCell = headRow.createCell(8+minusIndex+auditIndex);
-            //headCell.setCellValue("证书");
-            headCell.setCellValue(MessageUtils.message("excel.certificate"));
-            headCell.setCellStyle(headStyle);
-            for (int i = 0; i < userCustomList.size(); i++) {
-                headCell = headRow.createCell(minusIndex+9+i+auditIndex);
-                headCell.setCellValue(userCustomList.get(i).getName());
-                headCell.setCellStyle(headStyle);
-            }
-            headCell = headRow.createCell(minusIndex+9+userCustomList.size()+auditIndex);
-            //headCell.setCellValue("状态");
-            headCell.setCellValue(MessageUtils.message("leave.status"));
-            headCell.setCellStyle(headStyle);
-
-            //设置日期格式
-            HSSFCellStyle style = workbook.createCellStyle();
-            style.setDataFormat(HSSFDataFormat.getBuiltinFormat("yy/mm/dd hh:mm"));
-            //新增数据行 并且装填数据
-            int rowNum = 1;
-            QueryWrapper<User> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("company_id", user.getCompanyId());
-            if (containInvalid == 0) {
-                queryWrapper.eq("is_active", 1);
-            }
-            List<User> data = userMapper.selectList(queryWrapper);
-            List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
-            List<String> collect = data.stream().map(da -> da.getId()).distinct().collect(Collectors.toList());
-            List<UserCert> userCertList=new ArrayList<>();
-            if(collect!=null&&!StringUtils.isEmpty(data)){
-                userCertList = userCertMapper.selectList(new QueryWrapper<UserCert>().in("user_id", collect));
-            }
-            for (User item : data) {
-                if (item.getDepartmentId() != 0) {
-                    Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(item.getDepartmentId())).findFirst();
-                    if(first.isPresent()){
-                        Department department =first.get();
-                        item.setDepartmentName(department.getDepartmentName());
-                    }
-                }
-                HSSFRow row = sheet.createRow(rowNum);
-                row.createCell(0).setCellValue(rowNum);
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    row.createCell(1).setCellValue("$userName="+(item.getCorpwxUserid()==null?" ":item.getCorpwxUserid())+"$");
-                }else {
-                    row.createCell(1).setCellValue(item.getName());
-                }
-                row.createCell(2).setCellValue(item.getRoleName());
-                row.createCell(3).setCellValue(item.getPhone());
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    row.createCell(4).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?" ":item.getCorpwxDeptid())+"$");
-                }else {
-                    row.createCell(4).setCellValue(item.getDepartmentName());
-                }
-                if(timeType.getReportAuditType()==5||timeType.getReportAuditType()==6){
-                    if(item.getSuperiorId()!=null){
-                        Optional<User> first = userList.stream().filter(u ->u.getId().equals(item.getSuperiorId())).findFirst();
-                        if(first.isPresent()){
-                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                row.createCell(5).setCellValue("$userName="+(first.get().getCorpwxUserid()==null?" ":first.get().getCorpwxUserid())+"$");
-                            }else {
-                                row.createCell(5).setCellValue(first.get().getName());
-                            }
-                        }else {
-                            row.createCell(5).setCellValue("");
-                        }
-                    }else {
-                        row.createCell(5).setCellValue("");
-                    }
-
-                }
-                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());
-                }
-                List<UserCert> certList = userCertList.stream().distinct().filter(uc -> uc.getUserId().equals(item.getId())).collect(Collectors.toList());
-                if(certList.size()>0){
-                    String s="";
-                    for (int i = 0; i < certList.size(); i++) {
-                        if(i<certList.size()-1){
-                            s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate()+",";
-                        }else {
-                            s+=certList.get(i).getCertName()+" "+certList.get(i).getCertDate();
-                        }
-                    }
-                    row.createCell(8+minusIndex+auditIndex).setCellValue(s);
-                }else {
-                    row.createCell(8+minusIndex+auditIndex).setCellValue("");
-                }
-                for (int i = 0; i < userCustomList.size(); i++) {
-                    String value="";
-                    switch (i){
-                        case 0:value=item.getPlate1()==null?"":item.getPlate1();
-                            break;
-                        case 1:value=item.getPlate2()==null?"":item.getPlate2();
-                            break;
-                        case 2:value=item.getPlate3()==null?"":item.getPlate3();
-                            break;
-                        case 3:value=item.getPlate4()==null?"":item.getPlate4();
-                            break;
-                        case 4:value=item.getPlate5()==null?"":item.getPlate5();
-                            break;
-                    }
-                    row.createCell(9+i+minusIndex+auditIndex).setCellValue(value);
-                }
-                row.createCell(9+userCustomList.size()+minusIndex+auditIndex).setCellValue(item.getIsActive()==1?MessageUtils.message("excel.normal"):MessageUtils.message("access.deactivated"));
-                rowNum++;
-            }
-            //生成Excel文件
-            //String fileUrlSuffix = "员工列表" + System.currentTimeMillis() + ".xls";
-            String fileUrlSuffix = MessageUtils.message("excel.peopleList") + System.currentTimeMillis() + ".xls";
-            FileOutputStream fos = new FileOutputStream(path + fileUrlSuffix);
-            workbook.write(fos);
-            fos.flush();
-            fos.close();
-            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
-                String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
-            /*if(jobId!=null&&!jobId.equals("")){
-                File file=new File(path + fileUrlSuffix);
-                if(file.exists()){
-                    file.delete();
-                }
-            }*/
-                int i = 0;
-                String syncTranslationResult = null;
-                /**
-                 * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
-                 * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
-                 */
-                while (i < 10) {
-                    Thread.sleep(300);
-                    CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);
-                    if (corpwxJobResult != null) {
-                        if (corpwxJobResult.getErrCode() == 0) {
-                            syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
-                            corpwxJobCenter.remove(jobId);
-                        } else {
-                            httpRespMsg.setError(corpwxJobResult.getErrMsg());
-                            return httpRespMsg;
-                        }
-                        break;
-                    }
-                    i++;
-                }
-                if (syncTranslationResult != null) {
-                    httpRespMsg.data = syncTranslationResult;
-                } else {
-                    //httpRespMsg.setError("处理超时...");
-                    httpRespMsg.setError(MessageUtils.message("request.outTime"));
-                }
-            }else {
-                httpRespMsg.data = "/upload/" + fileUrlSuffix;
-            }
-        } catch (NullPointerException e) {
-            e.printStackTrace();
-            //httpRespMsg.setError("验证失败或缺少数据");
-            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
-            return httpRespMsg;
-        } catch (IOException e) {
-            e.printStackTrace();
-            //httpRespMsg.setError("文件生成错误");
-            httpRespMsg.setError(MessageUtils.message("file.generateError"));
-            return httpRespMsg;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return httpRespMsg;
-    }
 
     @Override
     public HttpRespMsg sendVcode(String mobile) {
@@ -2338,128 +2091,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return msg;
     }
 
-    @Override
-    public HttpRespMsg exportMembList(boolean isFill, String ids, HttpServletRequest request, String date) {
-        HttpRespMsg httpRespMsg = new HttpRespMsg();
-        try {
-            String userId = request.getHeader("Token");
-            User user = userMapper.selectById(userId);
-            List<String> strings = ListUtil.convertLongIdsArrayToList(ids);
-            List<Department> deptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
-            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-            List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", strings));
-            userList.forEach(u->{
-                Optional<Department> first = deptList.stream().filter(d -> d.getDepartmentId().equals(u.getDepartmentId())).findFirst();
-                if (first.isPresent()) {
-                    u.setDepartmentName(first.get().getDepartmentName());
-                }
-            });
-            //准备导出
-            HSSFWorkbook workbook = new HSSFWorkbook();
-            //HSSFSheet sheet = workbook.createSheet("人员列表");
-            HSSFSheet sheet = workbook.createSheet(MessageUtils.message("excel.perList"));
-            //创建表头
-            HSSFRow headRow = sheet.createRow(0);
-            //设置列宽 setColumnWidth的第二个参数要乘以256 这个参数的单位是1/256个字符宽度
-            sheet.setColumnWidth(0, 5 * 256);
-            sheet.setColumnWidth(1, 10 * 256);
-            sheet.setColumnWidth(2, 20 * 256);
-            //设置为居中加粗
-            HSSFCellStyle headStyle = workbook.createCellStyle();
-            HSSFFont font = workbook.createFont();
-            font.setBold(true);
-            headStyle.setFont(font);
-            //表头
-            HSSFCell headCell;
-            headCell = headRow.createCell(0);
-            //headCell.setCellValue("序号");
-            headCell.setCellValue(MessageUtils.message("entry.serialNo"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(1);
-            //headCell.setCellValue("姓名");
-            headCell.setCellValue(MessageUtils.message("entry.name"));
-            headCell.setCellStyle(headStyle);
-            headCell = headRow.createCell(2);
-            //headCell.setCellValue("部门");
-            headCell.setCellValue(MessageUtils.message("excel.department"));
-            headCell.setCellStyle(headStyle);
-
-            //新增数据行 并且装填数据
-            int rowNum = 1;
-            for (User item : userList) {
-                HSSFRow row = sheet.createRow(rowNum);
-                row.createCell(0).setCellValue(rowNum);
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    row.createCell(1).setCellValue("$userName="+(item.getCorpwxUserid()==null?"":item.getCorpwxUserid())+"$");
-                    row.createCell(2).setCellValue("$departmentName="+(item.getCorpwxDeptid()==null?"":item.getCorpwxDeptid())+"$");
-                }else {
-                    row.createCell(1).setCellValue(item.getName());
-                    row.createCell(2).setCellValue(item.getDepartmentName());
-                }
-                rowNum++;
-            }
-            //生成Excel文件
-            //String fileUrlSuffix = date+(isFill?"已填":"未填")+"人员列表" + System.currentTimeMillis() + ".xls";
-            String fileUrlSuffix = date+(isFill?MessageUtils.message("excel.Filled"):MessageUtils.message("excel.notFilled"))+MessageUtils.message("excel.perList") + System.currentTimeMillis() + ".xls";
-            FileOutputStream fos = new FileOutputStream(path + fileUrlSuffix);
-            workbook.write(fos);
-            fos.flush();
-            fos.close();
-            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
-                String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
-            /*if(jobId!=null&&!jobId.equals("")){
-                File file=new File(path + fileUrlSuffix);
-                if(file.exists()){
-                    file.delete();
-                }
-            }*/
-                int i = 0;
-                String syncTranslationResult = null;
-                /**
-                 * 异步上传转译文件的任务完成时会触发回调,在WeiXinCorpController中的commonDevCallbackPost实现了对回调的处理,存储到corpwxJobResult表中
-                 * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
-                 */
-                while (i < 10) {
-                    Thread.sleep(300);
-                    CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);
-                    if (corpwxJobResult != null) {
-                        if (corpwxJobResult.getErrCode() == 0) {
-                            syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
-                            corpwxJobCenter.remove(jobId);
-                        } else {
-                            httpRespMsg.setError(corpwxJobResult.getErrMsg());
-                            return httpRespMsg;
-                        }
-                        break;
-                    }
-                    i++;
-                }
-                if (syncTranslationResult != null) {
-                    httpRespMsg.data = syncTranslationResult;
-                } else {
-                    //httpRespMsg.setError("处理超时...");
-                    httpRespMsg.setError(MessageUtils.message("request.outTime"));
-                }
-            }else {
-                httpRespMsg.data = "/upload/" + fileUrlSuffix;
-            }
-        } catch (NullPointerException e) {
-            //httpRespMsg.setError("验证失败或缺少数据");
-            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
-            return httpRespMsg;
-        } catch (IOException e) {
-            //httpRespMsg.setError("文件生成错误");
-            httpRespMsg.setError(MessageUtils.message("file.generateError"));
-            return httpRespMsg;
-        }catch (Exception e){
-            e.printStackTrace();
-            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
-            return httpRespMsg;
-        }
-        return httpRespMsg;
-    }
-
     @Override
     public HttpRespMsg getHRList(HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -8,6 +8,7 @@ import com.management.platform.controller.WeiXinCorpController;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.TimeTypeService;
+import com.management.platform.service.UserService;
 import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.service.WxCorpTemplateService;
 import com.management.platform.task.SFTPAsyncUploader;

+ 30 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -277,4 +277,34 @@
         </if>
         group by project_id) group by task.project_id
     </select>
+
+    <select id="userTaskCompleteDetail" resultType="java.util.Map">
+        SELECT u.id as userId, u.name AS userName,u.corpwx_deptid AS corpWxUserId,d.corpwx_deptid AS corpWxDeptId,d.department_name AS deptName,COUNT(t.name) AS allNum,COUNT(CASE WHEN t.task_status=0 THEN 1 END) AS noCompletedNum,COUNT(CASE WHEN t.task_status=1 THEN 1 END) AS completedNum,
+        COUNT(CASE WHEN t.finish_date &lt;= t.end_date AND t.task_status=1  THEN 1 END) AS onTimeNum,COUNT(CASE WHEN t.finish_date>t.end_date AND t.task_status=1 THEN 1 END) AS noOnTimeNum,
+        CONCAT(FORMAT(COUNT(CASE WHEN t.task_status=0 THEN 1 END)/COUNT(t.name), 2), '%') AS noCompletedPercent,CONCAT(FORMAT(COUNT(CASE WHEN t.finish_date &lt;= t.end_date AND t.task_status=1  THEN 1 END)/COUNT(t.name), 2), '%') AS onTimePercent
+        FROM
+        task_executor te
+        LEFT JOIN user u ON te.executor_id=u.id
+        LEFT JOIN department d ON u.department_id=d.department_id
+        LEFT JOIN task t ON te.task_id=t.`id`
+        WHERE u.company_id=#{companyId}
+        <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
+            AND t.start_date &lt; #{endDate} AND t.end_date &gt; #{startDate} GROUP BY te.executor_id
+        </if>
+        <if test="userId!=null and userId!=''">
+            and u.id=#{userId}
+        </if>
+        <if test="deptId!=null">
+         and d.department_id=#{deptId}
+        </if>
+        <if test="list!=null and list.size()>0">
+            and  d.department_id in
+            <foreach collection="list" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="pageStart != null and pageSize != null">
+            limit #{pageStart}, #{pageSize}
+        </if>
+    </select>
 </mapper>