浏览代码

添加任务执行人 自动加入分组参与人
日报审核 批量审核 钉钉 企业微信消息推送提醒
timeType字段控制
合同金额编辑 记录 项目编辑阶段

yurk 2 年之前
父节点
当前提交
3e9614d01d
共有 13 个文件被更改,包括 262 次插入109 次删除
  1. 2 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  2. 33 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Task.java
  4. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java
  5. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TaskMapper.java
  6. 3 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/CompanyDingdingService.java
  7. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java
  8. 46 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CompanyDingdingServiceImpl.java
  9. 62 72
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  10. 64 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  11. 32 22
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  12. 8 5
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml
  13. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml

+ 2 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -112,6 +112,7 @@ public class ProjectController {
                                    String planEndDate,
                                    Integer level,
                                    Double contractAmount,
+                                   String changeContractReason,
                                    Double budget,
                                    Integer customerId,
                                    String projectBaseCostData,
@@ -130,7 +131,7 @@ public class ProjectController {
                                    Integer deptId,
                                    @RequestParam(defaultValue = "false") boolean onlyChangeParticipate
                                    ) {
-        return projectService.editProject(id, name, code, userId, inchargerId, isPublic, planStartDate, planEndDate, level, contractAmount,
+        return projectService.editProject(id, name, code, userId, inchargerId, isPublic, planStartDate, planEndDate, level, contractAmount,changeContractReason,
                 projectBaseCostData,
                  budget,customerId,chosenLeaders, associateDegrees, associateDegreeNames,
                 taskGpIncharge,auditUserIds, category, projectDesc,projectMainId, providerIds, providerNames, request,projectSeparate,outputValue,deptId,onlyChangeParticipate);
@@ -597,9 +598,6 @@ public class ProjectController {
         if(company.getId()==936){
             heads.add("合同编号");
         }
-        if(company.getId()==428){
-            heads.add("项目分组");
-        }
         if(timeType.getMainProjectState()!=1){
             heads.add("项目分类");
         }

+ 33 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -73,6 +73,10 @@ public class TaskController {
     private WxCorpInfoService wxCorpInfoService;
     @Resource
     private ProjectSeparateMapper projectSeparateMapper;
+    @Resource
+    private GroupParticipatorMapper groupParticipatorMapper;
+    @Resource
+    private DepartmentService departmentService;
 
     @RequestMapping("/save")
     @Transactional
@@ -113,6 +117,17 @@ public class TaskController {
             task.setExecutorColor(StringUtils.isEmpty(colors)?null:colors);
             //总时长
             task.setPlanHours(executorList.stream().mapToInt(TaskExecutor::getPlanHours).sum());
+            //检查执行人是否在当前分组的参与人当中
+            List<GroupParticipator> groupParticipatorList = groupParticipatorMapper.selectList(new QueryWrapper<GroupParticipator>().eq("group_id", task.getGroupId()));
+            for (TaskExecutor executor : executorList) {
+                boolean b = groupParticipatorList.stream().anyMatch(gp -> gp.getUserId().equals(executor.getExecutorId()));
+                if(!b){
+                    GroupParticipator g=new GroupParticipator();
+                    g.setGroupId(task.getGroupId());
+                    g.setUserId(executor.getExecutorId());
+                    groupParticipatorMapper.insert(g);
+                }
+            }
         }
         //有父任务,需要设置名称
         if (task.getParentTid() != null && task.getParentTname() == null) {
@@ -705,7 +720,7 @@ public class TaskController {
      * @return
      */
     @RequestMapping("/listByPage")
-    public HttpRespMsg listByPage(Integer status, Integer viewId, Integer pageIndex, Integer pageSize,Integer type,Integer dateType,String startDate,String endDate,String groupName) {
+    public HttpRespMsg listByPage(Integer status, Integer viewId, Integer pageIndex, Integer pageSize,Integer type,Integer dateType,String startDate,String endDate,Integer deptId) {
         HttpRespMsg msg = new HttpRespMsg();
         String userId = request.getHeader("Token");
         User user = userMapper.selectById(userId);
@@ -741,7 +756,12 @@ public class TaskController {
 //            //已超期的任务,未完成的任务
 //            queryWrapper.lt("end_date", LocalDate.now()).eq("task_status", 0);
 //        }
-        List<Task> list = taskMapper.getTaskWithProjectName(queryWrapper, (pageIndex-1)*pageSize, pageSize,companyId,groupName);
+        List<Integer> branchDepartment=null;
+        if(deptId!=null){
+            List<Department> departmentList=departmentService.list(new QueryWrapper<Department>().eq("company_id",companyId));
+            branchDepartment= getBranchDepartment(deptId, departmentList);
+        }
+        List<Task> list = taskMapper.getTaskWithProjectName(queryWrapper, (pageIndex-1)*pageSize, pageSize,companyId,branchDepartment);
         int total = taskMapper.selectCount(queryWrapper);
         Map<String, Object> map = new HashMap<>();
         map.put("records", list);
@@ -749,6 +769,17 @@ public class TaskController {
         msg.data = map;
         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;
+    }
     @RequestMapping("/getGroupNameList")
     public HttpRespMsg getGroupNameList(HttpServletRequest request){
         HttpRespMsg httpRespMsg=new HttpRespMsg();

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Task.java

@@ -204,7 +204,7 @@ public class Task extends Model<Task> {
     @TableField(exist = false)
     private Integer finishRefTaskCount;
     @TableField(exist = false)
-    private String projectCategorySub;
+    private String departmentName;
 
     @Override
     protected Serializable pkVal() {

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import java.util.List;
  * </p>
  *
  * @author Seyason
- * @since 2022-08-08
+ * @since 2022-08-09
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -326,6 +326,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("chose_from_album")
     private Integer choseFromAlbum;
 
+    /**
+     * 项目相关部门 0-未开启 1-开启
+     */
+    @TableField("project_with_dept")
+    private Integer projectWithDept;
+
     @TableField(exist = false)
     private List<User> userList;
     

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

@@ -35,7 +35,7 @@ public interface TaskMapper extends BaseMapper<Task> {
 
     Integer getProjectTaskCount(Integer companyId, Integer projectId,Integer taskType,List<Integer> inchagerIds);
 
-    List getTaskWithProjectName(@Param(Constants.WRAPPER) Wrapper wrapper, Integer pageStart, Integer pageSize,Integer companyId,String groupName);
+    List getTaskWithProjectName(@Param(Constants.WRAPPER) Wrapper wrapper, Integer pageStart, Integer pageSize,Integer companyId,List<Integer> deptIds);
 
     List recentSimpleList(Integer projectId, String userId);
 

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
 import com.management.platform.entity.CompanyDingding;
 
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -24,6 +25,8 @@ public interface CompanyDingdingService extends IService<CompanyDingding> {
 
     public void sendReportWaitingApplyMsg(Integer companyId, Long agentId, Long auditNum, String useridList);
 
+    public void sendReportApproveMsg(Integer companyId, Long agentId, String content, String evaluate, LocalDate date, String useridList);
+
     public void sendBusinessTripSettingMsg(Integer companyId, Long agentId, String useridList);
 
     public void sendNewTaskMsg(CompanyDingding dingding, String userId, String title, String endDate);

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

@@ -29,6 +29,7 @@ public interface ProjectService extends IService<Project> {
                             String planEndDate,
                             Integer level,
                             Double contractAmount,
+                            String changeContractReason,
                             String projectBaseCostData,
                             Double budget,
                             Integer customerId,

+ 46 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CompanyDingdingServiceImpl.java

@@ -28,7 +28,9 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.net.URLEncoder;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -53,6 +55,8 @@ public class CompanyDingdingServiceImpl extends ServiceImpl<CompanyDingdingMappe
     public static final String TEMPLATE_LEAVE_APPLY = "8e2f89e03f1a43b58b3e83dc7c9ac5ba";
     //日报待审批的数量通知
     public static final String TEMPLATE_REPORT_WAITING_APPLY = "d871e80191d14ec8aeec3986aca3ce46";
+    //日报审批通过通知
+    public static final String TEMPLATE_REPORT_APPROVE_APPLY = "33ef248317f641c1ab23b152bd96eb79";
     //出差待关联
     public static final String TEMPLATE_BUSTRIP_SETTING = "68cc6f3a150f4d869449e83a2f249b65";
     //新任务
@@ -228,6 +232,48 @@ public class CompanyDingdingServiceImpl extends ServiceImpl<CompanyDingdingMappe
             System.out.println(rsp.getBody());
         }
     }
+
+    @Override
+    public void sendReportApproveMsg(Integer companyId, Long agentId, String auditorName, String evaluate, LocalDate date, String useridList) {
+        if (isDev) return;
+        CompanyDingding dingding = getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        if (isPrivateDeploy) {
+            List<OapiMessageCorpconversationAsyncsendV2Request.Form> form=new ArrayList<>();
+            OapiMessageCorpconversationAsyncsendV2Request.Form item1=new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            OapiMessageCorpconversationAsyncsendV2Request.Form item2=new OapiMessageCorpconversationAsyncsendV2Request.Form();
+            item1.setKey("审核人:");
+            item1.setValue(auditorName);
+            form.add(item1);
+            item2.setKey("评价:");
+            item2.setValue(evaluate);
+            form.add(item2);
+            sendOAMsg(dingding,useridList,"日报审核通过","您"+df.format(date)+"提交的日报审核通过了",form,null);
+        } else {
+            DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/sendbytemplate");
+            OapiMessageCorpconversationSendbytemplateRequest req = new OapiMessageCorpconversationSendbytemplateRequest();
+            req.setAgentId(agentId);
+            req.setUseridList(useridList);
+            req.setTemplateId(TEMPLATE_REPORT_APPROVE_APPLY);
+            JSONObject json = new JSONObject();
+            json.put("auditor",auditorName);
+            json.put("evaluate",evaluate);
+            json.put("date", "" + df.format(date));
+            json.put("APPID", "" + appId);
+            json.put("CORPID", dingding.getCorpid());
+            req.setData(json.toJSONString());
+            OapiMessageCorpconversationSendbytemplateResponse rsp = null;
+            try {
+                rsp = client.execute(req, getCorpAccessToken(dingding));
+            } catch (ApiException e) {
+                e.printStackTrace();
+            } catch (Exception exception) {
+                exception.printStackTrace();
+            }
+            System.out.println(rsp.getBody());
+        }
+    }
+
     @Override
     public void sendBusinessTripSettingMsg(Integer companyId, Long agentId, String useridList) {
         if (isDev) return;

+ 62 - 72
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -252,8 +252,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             if (projectId != null) {
                 queryWrapper.eq("id", projectId);
             }
+            List<Integer> branchDepartment=null;
             if(deptId!=null){
-                queryWrapper.eq("dept_id",deptId);
+                branchDepartment= getBranchDepartment(deptId, allDepartmentList);
+                if(branchDepartment.size()>0){
+                    queryWrapper.in("dept_id",branchDepartment);
+                }
             }
             if (StringUtils.isEmpty(sortProp)) {
                 queryWrapper.orderByDesc("is_public").orderByAsc("id");
@@ -282,12 +286,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             TimeType timeType = timeTypeMapper.selectById(companyId);
             List<Integer> projectIds = projectList.stream().distinct().map(pl -> pl.getId()).collect(Collectors.toList());
             List<ProjectSeparate> projectSeparateList=new ArrayList<>();
-            if(companyId==936||companyId==428){
+            if(companyId==936){
                 if (projectIds.size() > 0) {
                     projectSeparateList = projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", projectIds));
                 }
             }
-
             List<ProjectVO> list = new ArrayList<>();
             for (Project project : projectList) {
                 ProjectVO projectVO = new ProjectVO();
@@ -347,7 +350,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     projectVO.setProviderInfoList(mapList);
                 }
-                if(companyId==936||companyId==428){
+                if(companyId==936){
                         Optional<ProjectSeparate> first1 = projectSeparateList.stream().filter(ps -> ps.getId().equals(project.getId())).findFirst();
                         if(first1.isPresent()){
                             projectVO.setProjectSeparate(first1.get());
@@ -362,6 +365,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             map.put("records", list);
             map.put("total", total);
             map.put("nameList",stringList);
+            if(timeType.getIsCro()==1){
+                map.put("degrees",timeType.getCustomDegreeName());
+            }
             httpRespMsg.data = map;
         } catch (NullPointerException e) {
             e.printStackTrace();
@@ -379,6 +385,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                    String planEndDate,
                                    Integer level,
                                    Double contractAmount,
+                                   String changeContractReason,
                                    String projectBaseCostData,
                                    Double budget,
                                    Integer customerId,
@@ -506,7 +513,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         }
                     }
                     id = project.getId();
-                    if(companyId==936||companyId==428){
+                    if(companyId==936){
                         projectSeparate.setId(id);
                         projectSeparateMapper.insert(projectSeparate);
                     }
@@ -523,6 +530,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             if (count > 0) {
                 httpRespMsg.setError("提交失败:项目编号已存在");
             } else {
+                Project project = projectMapper.selectById(id);
                 Project p = new Project();
                 p.setProjectName(name).setId(id).setCompanyId(companyId).setProjectCode(code).setInchargerId(inchargerId)
                         .setLevel(level)
@@ -541,6 +549,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 convertDepartmentIdToCascade(0) :
                                 convertDepartmentIdToCascade(deptId))
                         .setProviderNames(providerNames);
+                //编辑项目合同修改 添加记录
+                if(project.getContractAmount().doubleValue()!=contractAmount){
+                    ContractModifyRecord contractModifyRecord=new ContractModifyRecord();
+                    contractModifyRecord.setEditUserId(user.getId());
+                    contractModifyRecord.setOldContractAmount(project.getContractAmount());
+                    contractModifyRecord.setNewContractAmount(contractAmount);
+                    contractModifyRecord.setProjectId(id);
+                    contractModifyRecord.setReason(changeContractReason);
+                    contractModifyRecord.setUpdateDate(LocalDateTime.now());
+                    contractModifyRecordMapper.insert(contractModifyRecord);
+                }
                 if(timeType.getOutputValueStatus()==1){
                     p.setOutputValue(outputValue==null?0.00:outputValue);
                 }
@@ -551,7 +570,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         p.setCategoryName(projectCategory.getName());
                     }
                 }
-                if(companyId==936||companyId==428){
+                if(companyId==936){
                     //编辑之前的项目是否存在子表数据
                     ProjectSeparate separate = projectSeparateMapper.selectById(id);
                     projectSeparate.setId(id);
@@ -1242,7 +1261,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<ProjectAuditor> auditorList = projectAuditorMapper.selectList(new QueryWrapper<ProjectAuditor>().eq("project_id", id));
         project.setAuditorList(auditorList);
         project.setAuditUserIds(auditorList.stream().map(ProjectAuditor::getAuditorId).collect(Collectors.toList()));
-        if(project.getCompanyId()==936||project.getCompanyId()==428){
+        if(project.getCompanyId()==936){
             ProjectSeparate projectSeparate = projectSeparateMapper.selectById(id);
             project.setProjectSeparate(projectSeparate);
         }
@@ -2835,25 +2854,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     int i=0;
                     int k=0;
                     int c=0;
-                    int d=0;
                     if(timeType.getMainProjectState()==1){
                         mainNameCell = row.getCell(0);
-                        if(company.getId()==428){
-                            projectCategorySubCell=row.getCell(1);
-                            d++;
-                        }
-                        codeCell = row.getCell(1+d);
+                        codeCell = row.getCell(1);
                         if(company.getId()==936){
-                            contractCell=row.getCell(2+d);
+                            contractCell=row.getCell(2);
                             c++;
                         }
-                        isPublicCell = row.getCell(2+c+d);
-                        nameCell = row.getCell(3+c+d);
-                        participatorCell = row.getCell(4+c+d);
-                        inchargerCell = row.getCell(5+c+d);
-                        levelCell = row.getCell(6+c+d);
+                        isPublicCell = row.getCell(2+c);
+                        nameCell = row.getCell(3+c);
+                        participatorCell = row.getCell(4+c);
+                        inchargerCell = row.getCell(5+c);
+                        levelCell = row.getCell(6+c);
                         if(company.getPackageCustomer()==1){
-                            customerCell=row.getCell(7+c+d);
+                            customerCell=row.getCell(7+c);
                             i++;
                         }
                         if(company.getPackageProvider()==1){
@@ -2863,17 +2877,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                             }
                         }
-                        startDateCell = row.getCell(7+i+k+c+d);
-                        endDateCell = row.getCell(8+i+k+c+d);
-                        amountCell = row.getCell(9+i+k+c+d);
+                        startDateCell = row.getCell(7+i+k+c);
+                        endDateCell = row.getCell(8+i+k+c);
+                        amountCell = row.getCell(9+i+k+c);
                         if(company.getId()==936){
-                            warrantyEndDateCell=row.getCell(10+i+k+c+d);
-                            warrantyStartDateCell=row.getCell(11+i+k+c+d);
-                            projectCategorySubCell=row.getCell(12+i+k+c+d);
-                            regionCell=row.getCell(13+i+k+c+d);
-                            buCell=row.getCell(14+i+k+c+d);
-                            stateCell=row.getCell(15+i+k+c+d);
-                            stageCell=row.getCell(16+i+k+c+d);
+                            warrantyEndDateCell=row.getCell(10+i+k+c);
+                            warrantyStartDateCell=row.getCell(11+i+k+c);
+                            projectCategorySubCell=row.getCell(12+i+k+c);
+                            regionCell=row.getCell(13+i+k+c);
+                            buCell=row.getCell(14+i+k+c);
+                            stateCell=row.getCell(15+i+k+c);
+                            stageCell=row.getCell(16+i+k+c);
                         }
                     }else {
                         codeCell = row.getCell(0);
@@ -2881,19 +2895,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             contractCell=row.getCell(1);
                             c++;
                         }
-                        if(company.getId()==428){
-                            projectCategorySubCell=row.getCell(1+c);
-                            d++;
-                        }
-                        categoryCell = row.getCell(1+c+d);
-                        isPublicCell = row.getCell(2+c+d);
-                        nameCell = row.getCell(3+c+d);
-                        subNameCell = row.getCell(4+c+d);
-                        participatorCell = row.getCell(5+c+d);
-                        inchargerCell = row.getCell(6+c+d);
-                        levelCell = row.getCell(7+c+d);
+                        categoryCell = row.getCell(1+c);
+                        isPublicCell = row.getCell(2+c);
+                        nameCell = row.getCell(3+c);
+                        subNameCell = row.getCell(4+c);
+                        participatorCell = row.getCell(5+c);
+                        inchargerCell = row.getCell(6+c);
+                        levelCell = row.getCell(7+c);
                         if(company.getPackageCustomer()==1){
-                            customerCell=row.getCell(8+c+d);
+                            customerCell=row.getCell(8+c);
                             i++;
                         }
                         if(company.getPackageProvider()==1){
@@ -2903,17 +2913,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                                 }
                             }
                         }
-                        startDateCell = row.getCell(8+i+k+c+d);
-                        endDateCell = row.getCell(9+i+k+c+d);
-                        amountCell = row.getCell(10+i+k+c+d);
+                        startDateCell = row.getCell(8+i+k+c);
+                        endDateCell = row.getCell(9+i+k+c);
+                        amountCell = row.getCell(10+i+k+c);
                         if(company.getId()==936){
-                            warrantyEndDateCell=row.getCell(11+i+k+c+d);
-                            warrantyStartDateCell=row.getCell(12+i+k+c+d);
-                            projectCategorySubCell=row.getCell(13+i+k+c+d);
-                            regionCell=row.getCell(14+i+k+c+d);
-                            buCell=row.getCell(15+i+k+c+d);
-                            stateCell=row.getCell(16+i+k+c+d);
-                            stageCell=row.getCell(17+i+k+c+d);
+                            warrantyEndDateCell=row.getCell(11+i+k+c);
+                            warrantyStartDateCell=row.getCell(12+i+k+c);
+                            projectCategorySubCell=row.getCell(13+i+k+c);
+                            regionCell=row.getCell(14+i+k+c);
+                            buCell=row.getCell(15+i+k+c);
+                            stateCell=row.getCell(16+i+k+c);
+                            stageCell=row.getCell(17+i+k+c);
                         }
                     }
                     if (codeCell != null)codeCell.setCellType(CellType.STRING);
@@ -3187,14 +3197,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         }
                         projectSeparateMapper.insert(projectSeparate);
                     }
-                    if(company.getId()==428){
-                        ProjectSeparate projectSeparate=new ProjectSeparate();
-                        projectSeparate.setId(id);
-                        if (projectCategorySubCell != null && !StringUtils.isEmpty(projectCategorySubCell.getStringCellValue())) {
-                            projectSeparate.setProjectCategorySub(projectCategorySubCell.getStringCellValue());
-                        }
-                        projectSeparateMapper.insert(projectSeparate);
-                    }
                     importCount++;
                     //参与人
                     if(inchargerCell!=null){
@@ -3370,9 +3372,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             headList.add("项目状态");
             headList.add("项目阶段");
         }
-        if(company.getId()==428){
-            headList.add("项目分组");
-        }
         List<List<String>> allList = new ArrayList<List<String>>();
         allList.add(headList);
         String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
@@ -3473,15 +3472,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
                 rowData.add(projectVO.getCurrentStageName()==null?"":projectVO.getCurrentStageName());
             }
-            if(company.getId()==428){
-                Optional<ProjectSeparate> first = projectSeparateList.stream().filter(ps -> ps.getId().equals(projectVO.getId())).findFirst();
-                if(first.isPresent()){
-                    ProjectSeparate projectSeparate = first.get();
-                    rowData.add(projectSeparate.getProjectCategorySub()==null?"":projectSeparate.getProjectCategorySub());
-                }else {
-                    rowData.add("");
-                }
-            }
             allList.add(rowData);
         }
 

+ 64 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -1377,7 +1377,39 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<Report> reportList = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
             List<Integer> collect = reportList.stream().map(rl -> rl.getProjectId()).distinct().collect(Collectors.toList());
             List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
+            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+            List<WxCorpInfo> wxCorpInfoList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+            List<CompanyDingding> companyDingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().eq("company_id", company.getId()));
             String pNames = projectList.stream().map(Project::getProjectName).collect(Collectors.joining(", ", "[", "]"));
+            //审核通过操作 向被审核人推送消息
+            for (Report report : reportList) {
+                String uId = report.getCreatorId();
+                Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
+                if(first.isPresent()){
+                    User u = first.get();
+                    if(u.getCorpwxUserid()!=null){
+                        if(wxCorpInfoList.size()>0){
+                            JSONObject json=new JSONObject();
+                            JSONArray dataJson=new JSONArray();
+                            JSONObject item=new JSONObject();
+                            item.put("审核人",user.getName());
+                            item.put("评价",report.getEvaluate());
+                            item.put("填报日期",report.getCreateDate());
+                            dataJson.add(item);
+                            json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
+                            json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                            json.put("content_item",dataJson);
+                            wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
+                        }
+                    }
+                    if(u.getDingdingUserid()!=null){
+                        if(companyDingdingList.size()>0){
+                            CompanyDingding companyDingding = companyDingdingList.get(0);
+                            companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
+                        }
+                    }
+                }
+            }
             //对导入审核,添加记录
             int channel = oldState == -1?0:1; //0-导入审核, 项目报告审核
             ReportAuditLog log = new ReportAuditLog();
@@ -2107,9 +2139,41 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             List<Integer> collect = allReports.stream().map(ar -> ar.getProjectId()).distinct().collect(Collectors.toList());
             List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect));
+            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
             List<String> stringList = projectList.stream().map(pl -> pl.getProjectName()).distinct().collect(Collectors.toList());
+            List<WxCorpInfo> wxCorpInfoList = wxCorpInfoMapper.selectList(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+            List<CompanyDingding> companyDingdingList = companyDingdingService.list(new QueryWrapper<CompanyDingding>().eq("company_id", company.getId()));
             String s = org.apache.commons.lang3.StringUtils.join(stringList, ",");
             int channel = oldState == -1?0:1; //0-导入审核, 项目报告审核
+            //审核通过操作 向被审核人推送消息
+            for (Report report : allReports) {
+                String uId = report.getCreatorId();
+                Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(uId)).findFirst();
+                if(first.isPresent()){
+                    User u = first.get();
+                    if(u.getCorpwxUserid()!=null){
+                        if(wxCorpInfoList.size()>0){
+                            JSONObject json=new JSONObject();
+                            JSONArray dataJson=new JSONArray();
+                            JSONObject item=new JSONObject();
+                            item.put("审核人",user.getName());
+                            item.put("评价",report.getEvaluate());
+                            item.put("填报日期",report.getCreateDate());
+                            dataJson.add(item);
+                            json.put("template_id","tty9TkCAAAWoUyhGnXRCZuhkgCqw_Uow");
+                            json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                            json.put("content_item",dataJson);
+                            wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfoList.get(0),u.getCorpwxUserid(),json);
+                        }
+                    }
+                    if(u.getDingdingUserid()!=null){
+                        if(companyDingdingList.size()>0){
+                            CompanyDingding companyDingding = companyDingdingList.get(0);
+                            companyDingdingService.sendReportApproveMsg(company.getId(),companyDingding.getAgentId(),user.getName(),report.getEvaluate(),report.getCreateDate(),u.getDingdingUserid());
+                        }
+                    }
+                }
+            }
             //需要进行审核记录保存
             ReportAuditLog log = new ReportAuditLog();
             log.setAuditChannel(channel);

+ 32 - 22
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -775,26 +775,31 @@
     </select>
 
     <select id="getWaitingReviewList" resultType="java.util.Map">
-        select us.name as userName,dp.department_name as departmentName,COUNT(rp.state=0 or null) as num
-        from user us
         <choose>
             <when test="stateKey==0">
-                left join report rp on rp.audit_deptid=us.manage_dept_id
+                select us.name as userName,dp2.department_name as departmentName,COUNT(rp.state=0 or null) as num
+                from department dp
+                left join user us on dp.manager_id=us.id
+                left join report rp on rp.audit_deptid=us.manage_dept_id and rp.create_date between #{startDate} and #{endDate} and rp.audit_deptid !=0
+                left join department dp2 on dp2.department_id=dp.department_id
             </when>
             <otherwise>
-                left join report rp on rp.project_auditor_id=us.id
+                select us.name as userName,dp.department_name as departmentName,COUNT(rp.state=0 or null) as num
+                from project_auditor pa
+                left join user us on pa.auditor_id=us.id
+                left join report rp on rp.project_auditor_id=us.id and pa.project_id=rp.project_id and rp.create_date between #{startDate} and #{endDate}
+                left join department dp on dp.department_id=us.department_id
             </otherwise>
         </choose>
-        left join department dp on dp.department_id=us.department_id
-        where us.company_id=#{companyId} and  (rp.audit_deptid !=0 or rp.project_id is not null) and rp.create_date between #{startDate} and #{endDate} and us.is_active=1
+        where us.company_id=#{companyId} and us.is_active=1
         <if test="userId!=null">
             and us.id=#{userId}
         </if>
         <if test="departmentId!=null">
-            and rp.dept_id=#{departmentId}
+            and us.department_id=#{departmentId}
         </if>
         group by us.id
-        order by rp.dept_id
+        order by us.department_id
         <if test="start!=null and size!=null">
             limit #{start},#{size}
         </if>
@@ -802,26 +807,31 @@
 
     <select id="findCount" resultType="java.lang.Long">
         select  count(1)
-        from (select us.name as userName,dp.department_name as departmentName,COUNT(rp.state=0 or null) as num
-        from user us
-        <choose>
-            <when test="stateKey==0">
-                left join report rp on rp.audit_deptid=us.manage_dept_id
-            </when>
-            <otherwise>
-                left join report rp on rp.project_auditor_id=us.id
-            </otherwise>
-        </choose>
-        left join department dp on dp.department_id=us.department_id
-        where us.company_id=#{companyId} and  (rp.audit_deptid !=0 or rp.project_id is not null) and rp.create_date between #{startDate} and #{endDate} and us.is_active=1
+        from (<choose>
+        <when test="stateKey==0">
+            select us.name as userName,dp2.department_name as departmentName,COUNT(rp.state=0 or null) as num
+            from department dp
+            left join user us on dp.manager_id=us.id
+            left join report rp on rp.audit_deptid=us.manage_dept_id and rp.create_date between #{startDate} and #{endDate} and rp.audit_deptid !=0
+            left join department dp2 on dp2.department_id=dp.department_id
+        </when>
+        <otherwise>
+            select us.name as userName,dp.department_name as departmentName,COUNT(rp.state=0 or null) as num
+            from project_auditor pa
+            left join user us on pa.auditor_id=us.id
+            left join report rp on rp.project_auditor_id=us.id and pa.project_id=rp.project_id and rp.create_date between #{startDate} and #{endDate}
+            left join department dp on dp.department_id=us.department_id
+        </otherwise>
+    </choose>
+        where us.company_id=#{companyId} and us.is_active=1
         <if test="userId!=null">
             and us.id=#{userId}
         </if>
         <if test="departmentId!=null">
-            and rp.dept_id=#{departmentId}
+            and us.department_id=#{departmentId}
         </if>
         group by us.id
-        order by rp.dept_id
+        order by us.department_id
         <if test="start!=null and size!=null">
             limit #{start},#{size}
         </if>) total

+ 8 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -87,7 +87,7 @@
         <result column="project_name" property="projectName" />
         <result column="start_date" property="startDate" />
         <result column="stages_name" property="stagesName" />
-        <result column="project_category_sub" property="projectCategorySub" />
+        <result column="department_name" property="departmentName" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
@@ -200,17 +200,20 @@
     <select id="getTaskWithProjectName" resultMap="RichResultMap">
         SELECT task.*, project.`project_name`, stages.stages_name
         <if test="companyId==428">
-            ,ps.project_category_sub
+            ,department.department_name
         </if>
         FROM task LEFT JOIN project ON project.id = task.`project_id`
         left join stages on stages.id = task.stages_id
         <if test="companyId==428">
-            left join project_separate ps on ps.id=task.project_id
+            left join department on department.department_id=project.dept_id
         </if>
         ${ew.customSqlSegment}
         <if test="companyId==428">
-            <if test="groupName!=null and groupName!=''">
-                and ps.project_category_sub=#{groupName}
+            <if test="deptIds!=null and deptIds.size()>0">
+                and project.dept_id in
+                <foreach collection="deptIds" open="(" close=")" separator="," item="item">
+                    #{item}
+                </foreach>
             </if>
         </if>
         ORDER BY task.indate desc

文件差异内容过多而无法显示
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml