Преглед на файлове

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

zhangjq преди 1 година
родител
ревизия
2e1d1158ca

+ 2 - 1
zjugis-business/src/main/java/com/zjugis/business/bean/entity/OutsourceApply.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 
 /**
@@ -71,7 +72,7 @@ public class OutsourceApply extends BaseEntity {
     private String instanceId;
 
 
-    private LocalDate flowFinishtime;
+    private LocalDateTime flowFinishtime;
 
 
     private Integer flowStatus;

+ 2 - 1
zjugis-business/src/main/java/com/zjugis/business/bean/entity/SubcontractApply.java

@@ -5,6 +5,7 @@ import lombok.Data;
 
 import java.math.BigDecimal;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 
 
 /**
@@ -76,7 +77,7 @@ public class SubcontractApply extends BaseEntity {
     private String instanceId;
 
 
-    private LocalDate flowFinishtime;
+    private LocalDateTime flowFinishtime;
 
 
     private Integer flowStatus;

+ 0 - 9
zjugis-business/src/main/java/com/zjugis/business/flow/commoncost/service/CommonCostServiceImpl.java

@@ -276,16 +276,7 @@ public class CommonCostServiceImpl implements CommonCostService {
         PageResult<CommonCostRespVO> commonCostRespVOPageResult = CommonCostConvert.INSTANCE.convertPage(pageResult);
         if(pageResult.getTotal()>0){
             List<CommonCostRespVO> resultList = commonCostRespVOPageResult.getList();
-            Set<String> projectIds = convertSet(resultList, CommonCostRespVO::getProjectId);
-            List<Project> projectList = projectService.selectByIds(projectIds);
             resultList.forEach(commonCostRespVO -> {
-                Integer isAgent = commonCostRespVO.getIsAgent();
-                //不是代办项目
-                if(0==isAgent){
-                    Project projectDO = projectList.stream().filter(project -> project.getId().equals(commonCostRespVO.getProjectId())).findFirst().get();
-                    commonCostRespVO.setProjectName(projectDO.getXmmc());
-                    commonCostRespVO.setProjectDeptName(projectDO.getZrbm());
-                }
                 Integer flowStatus = commonCostRespVO.getFlowStatus();
                 if (FLOW_FINISHED == flowStatus) {
                     commonCostRespVO.setStatus("已报");

+ 285 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/event/OutsourceApplyEvent.java

@@ -0,0 +1,285 @@
+package com.zjugis.business.flow.outsourceApply.event;
+
+import com.zjugis.business.bean.entity.Project;
+import com.zjugis.business.bean.entity.OutsourceApply;
+import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.mapper.ProjectMapper;
+import com.zjugis.business.service.ProjectService;
+import com.zjugis.business.service.OutsourceApplyService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.workflow.exception.BusinessException;
+import com.zjugis.framework.workflow.model.BaseController;
+import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.spring.resovler.ParamModel;
+import com.zjugis.module.system.api.dept.DeptApi;
+import com.zjugis.module.system.api.dept.dto.DeptRespDTO;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * @author ljy
+ * @version 1.0
+ * @date 2023/11/29 9:05
+ */
+@Slf4j
+@RestController
+@RequestMapping("/outsource-apply-event")
+public class OutsourceApplyEvent extends BaseController {
+
+    @Resource
+    private OutsourceApplyService outsourceApplyService;
+
+
+    @Autowired
+    private ProjectService projectService;
+
+    @Autowired
+    ProjectMapper projectMapper;
+
+    @Autowired
+    WorkflowClient workflowClient;
+
+    @Autowired
+    DeptApi deptApi;
+
+    @Autowired
+    AdminUserApi adminUserApi;
+
+
+    @PostMapping("/setFlowDesc")
+    public String setFlowDesc(@ParamModel Map flowInstance, @ParamModel Map activityInstance) {
+        try {
+            if (!Objects.isNull(activityInstance) && activityInstance.containsKey("flowInstanceId")) {
+                String flowInstanceId = activityInstance.get("flowInstanceId").toString();
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                String flowDesc = StringUtils.join(Arrays.asList(entity.getApplyWorker(), entity.getOutAmount(),entity.getOutReason()), "/");
+                entity.setFlowStatus(FlowStatusConstants.FLOW_PROCESS);
+                outsourceApplyService.update(entity);
+                workflowClient.saveFlowDescribe(flowInstanceId,flowDesc);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    /**
+     * 流程归档事件
+     *
+     * @param flowInstance                  流程实例
+     * @param triggerFinishActivityInstance 触发归档的结束活动实例
+     * @return
+     */
+    @PostMapping("/flowArchingEvent")
+    public String flowArchingEvent(@ParamModel Map flowInstance, @ParamModel Map triggerFinishActivityInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_FINISHED);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                outsourceApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+
+    /**
+     * 作废事件
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 申请作废所在活动实例
+     * @param nullyApplyUserId 作废申请人ID
+     * @return
+     */
+    @PostMapping("/nullyEvent")
+    public String nullyEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_NULLY);
+                entity.setIsvalid(0);
+                outsourceApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废恢复事件
+     *
+     * @param flowInstance      流程实例
+     * @param activityInstance  申请作废所在活动实例
+     * @param nullyApplyUserId  作废申请人ID
+     * @param nullyRecoverserId 作废恢复人ID
+     * @return
+     */
+    @PostMapping("/nullyRecoverEvent")
+    public String nullyRecoverEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyRecoverserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_PROCESS);
+                entity.setIsvalid(1);
+                outsourceApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 彻底作废事件
+     *
+     * @param flowInstance        流程实例
+     * @param activityInstance    申请作废所在活动实例
+     * @param nullyApplyUserId    作废申请人ID
+     * @param nullyCompleteUserId 彻底作废人ID
+     * @return
+     */
+    @PostMapping("/nullyCompleteEvent")
+    public String nullyCompleteEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyCompleteUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                outsourceApplyService.deleteByIdList(Collections.singletonList(entity.getId()));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+
+    @PostMapping("/amountLt10")
+    public String amountLt10(@ParamModel Map flowInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+            if(entity != null && entity.getOutAmount() != null && entity.getOutAmount().compareTo(new BigDecimal("100000")) <= 0 ){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+
+    @PostMapping("/amountGe10")
+    public String amountGt20(@ParamModel Map flowInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+            if(entity != null && entity.getOutAmount() != null && entity.getOutAmount().compareTo(new BigDecimal("100000")) > 0 ){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+
+
+    @PostMapping("/to-leader-leader")
+    public String toLeaderLeader(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                Project project = projectService.selectById(entity.getProjectId());
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                if(StringUtils.isNotBlank(project.getZrbmId())){
+                    CommonResult<DeptRespDTO> result = deptApi.getDept(project.getZrbmId());
+                    DeptRespDTO dept = result.getCheckedData();
+                    if(dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())){
+                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(dept.getLeaderUserId());
+                        AdminUserRespDTO userLeader = userRes.getCheckedData();
+                        if(userLeader != null){
+                            HashMap<String,String> leaderMap = new HashMap<>();
+                            leaderMap.put("id",userLeader.getId());
+                            userMaps.add(leaderMap);
+                        }
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    @PostMapping("/to-dept-leader")
+    public String toDeptLeader(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
+                Project project = projectService.selectById(entity.getProjectId());
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                if(StringUtils.isNotBlank(project.getZrbmId())){
+                    CommonResult<DeptRespDTO> result = deptApi.getDept(project.getZrbmId());
+                    DeptRespDTO dept = result.getCheckedData();
+                    if(dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())){
+                        HashMap<String,String> map = new HashMap<>();
+                        map.put("id",dept.getLeaderUserId());
+                        userMaps.add(map);
+                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(dept.getLeaderUserId());
+                        AdminUserRespDTO userLeader = userRes.getCheckedData();
+                        if(userLeader != null){
+                            HashMap<String,String> leaderMap = new HashMap<>();
+                            leaderMap.put("id",userLeader.getId());
+                            userMaps.add(leaderMap);
+                        }
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+}

+ 285 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/subcontractApply/event/SubcontractApplyEvent.java

@@ -0,0 +1,285 @@
+package com.zjugis.business.flow.subcontractApply.event;
+
+import com.zjugis.business.bean.entity.Project;
+import com.zjugis.business.bean.entity.SubcontractApply;
+import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.mapper.ProjectMapper;
+import com.zjugis.business.service.ProjectService;
+import com.zjugis.business.service.SubcontractApplyService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.workflow.exception.BusinessException;
+import com.zjugis.framework.workflow.model.BaseController;
+import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.spring.resovler.ParamModel;
+import com.zjugis.module.system.api.dept.DeptApi;
+import com.zjugis.module.system.api.dept.dto.DeptRespDTO;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * @author ljy
+ * @version 1.0
+ * @date 2023/11/29 9:05
+ */
+@Slf4j
+@RestController
+@RequestMapping("/subcontract-apply-event")
+public class SubcontractApplyEvent extends BaseController {
+
+    @Resource
+    private SubcontractApplyService subcontractApplyService;
+
+
+    @Autowired
+    private ProjectService projectService;
+
+    @Autowired
+    ProjectMapper projectMapper;
+
+    @Autowired
+    WorkflowClient workflowClient;
+
+    @Autowired
+    DeptApi deptApi;
+
+    @Autowired
+    AdminUserApi adminUserApi;
+
+
+    @PostMapping("/setFlowDesc")
+    public String setFlowDesc(@ParamModel Map flowInstance, @ParamModel Map activityInstance) {
+        try {
+            if (!Objects.isNull(activityInstance) && activityInstance.containsKey("flowInstanceId")) {
+                String flowInstanceId = activityInstance.get("flowInstanceId").toString();
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                String flowDesc = StringUtils.join(Arrays.asList(entity.getApplyWorker(), entity.getSubAmount(),entity.getSubReason()), "/");
+                entity.setFlowStatus(FlowStatusConstants.FLOW_PROCESS);
+                subcontractApplyService.update(entity);
+                workflowClient.saveFlowDescribe(flowInstanceId,flowDesc);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    /**
+     * 流程归档事件
+     *
+     * @param flowInstance                  流程实例
+     * @param triggerFinishActivityInstance 触发归档的结束活动实例
+     * @return
+     */
+    @PostMapping("/flowArchingEvent")
+    public String flowArchingEvent(@ParamModel Map flowInstance, @ParamModel Map triggerFinishActivityInstance) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_FINISHED);
+                entity.setFlowFinishtime(LocalDateTime.now());
+                subcontractApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+
+    /**
+     * 作废事件
+     *
+     * @param flowInstance     流程实例
+     * @param activityInstance 申请作废所在活动实例
+     * @param nullyApplyUserId 作废申请人ID
+     * @return
+     */
+    @PostMapping("/nullyEvent")
+    public String nullyEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_NULLY);
+                entity.setIsvalid(0);
+                subcontractApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 作废恢复事件
+     *
+     * @param flowInstance      流程实例
+     * @param activityInstance  申请作废所在活动实例
+     * @param nullyApplyUserId  作废申请人ID
+     * @param nullyRecoverserId 作废恢复人ID
+     * @return
+     */
+    @PostMapping("/nullyRecoverEvent")
+    public String nullyRecoverEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyRecoverserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                entity.setFlowStatus(FlowStatusConstants.FLOW_PROCESS);
+                entity.setIsvalid(1);
+                subcontractApplyService.update(entity);
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+    /**
+     * 彻底作废事件
+     *
+     * @param flowInstance        流程实例
+     * @param activityInstance    申请作废所在活动实例
+     * @param nullyApplyUserId    作废申请人ID
+     * @param nullyCompleteUserId 彻底作废人ID
+     * @return
+     */
+    @PostMapping("/nullyCompleteEvent")
+    public String nullyCompleteEvent(@ParamModel Map flowInstance, @ParamModel Map activityInstance, String nullyApplyUserId, String nullyCompleteUserId) {
+        try {
+            if (!Objects.isNull(flowInstance) && flowInstance.containsKey("id")) {
+                String flowInstanceId = flowInstance.get("id").toString();
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                subcontractApplyService.deleteByIdList(Collections.singletonList(entity.getId()));
+                return ok("true");
+            } else {
+                throw new BusinessException("执行事件出错,请联系管理员!");
+            }
+        } catch (Exception e) {
+            log.error(e.getMessage(),e);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+
+    @PostMapping("/amountLt10")
+    public String amountLt10(@ParamModel Map flowInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+            if(entity != null && entity.getSubAmount() != null && entity.getSubAmount().compareTo(new BigDecimal("100000")) <= 0 ){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+
+    @PostMapping("/amountGe10")
+    public String amountGt20(@ParamModel Map flowInstance) {
+        try {
+            String flowInstanceId = flowInstance.get("id").toString();
+            SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+            if(entity != null && entity.getSubAmount() != null && entity.getSubAmount().compareTo(new BigDecimal("100000")) > 0 ){
+                return "true";
+            }
+            return "false";
+        } catch (Exception ex) {
+            return error(ex.getMessage(), ErrorCode.DEFAULT);
+        }
+    }
+
+
+    @PostMapping("/to-leader-leader")
+    public String toLeaderLeader(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                Project project = projectService.selectById(entity.getProjectId());
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                if(StringUtils.isNotBlank(project.getZrbmId())){
+                    CommonResult<DeptRespDTO> result = deptApi.getDept(project.getZrbmId());
+                    DeptRespDTO dept = result.getCheckedData();
+                    if(dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())){
+                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(dept.getLeaderUserId());
+                        AdminUserRespDTO userLeader = userRes.getCheckedData();
+                        if(userLeader != null){
+                            HashMap<String,String> leaderMap = new HashMap<>();
+                            leaderMap.put("id",userLeader.getId());
+                            userMaps.add(leaderMap);
+                        }
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+
+    @PostMapping("/to-dept-leader")
+    public String toDeptLeader(String flowInstanceId) {
+        try {
+            if (StringUtils.isNotBlank(flowInstanceId)) {
+                SubcontractApply entity = subcontractApplyService.selectByInstanceId(flowInstanceId);
+                Project project = projectService.selectById(entity.getProjectId());
+                List<Map<String, String>> userMaps = new ArrayList<>();
+                if(StringUtils.isNotBlank(project.getZrbmId())){
+                    CommonResult<DeptRespDTO> result = deptApi.getDept(project.getZrbmId());
+                    DeptRespDTO dept = result.getCheckedData();
+                    if(dept != null && StringUtils.isNotBlank(dept.getLeaderUserId())){
+                        HashMap<String,String> map = new HashMap<>();
+                        map.put("id",dept.getLeaderUserId());
+                        userMaps.add(map);
+                        CommonResult<AdminUserRespDTO> userRes = adminUserApi.getUserLeader(dept.getLeaderUserId());
+                        AdminUserRespDTO userLeader = userRes.getCheckedData();
+                        if(userLeader != null){
+                            HashMap<String,String> leaderMap = new HashMap<>();
+                            leaderMap.put("id",userLeader.getId());
+                            userMaps.add(leaderMap);
+                        }
+                    }
+                }
+                return ok(userMaps);
+            } else {
+                throw new BusinessException("找不到流程id");
+            }
+        } catch(Exception ex){
+            log.error(ex.getMessage(),ex);
+            throw new BusinessException("执行事件出错,请联系管理员!");
+        }
+    }
+
+}

+ 4 - 0
zjugis-business/src/main/java/com/zjugis/business/service/CommonService.java

@@ -2,6 +2,8 @@ package com.zjugis.business.service;
 
 import com.zjugis.framework.workflow.model.SerialNumberDto;
 import com.zjugis.framework.workflow.utils.zTree;
+import com.zjugis.module.adm.api.workday.dto.WorkdayListReqDTO;
+import com.zjugis.module.adm.api.workday.dto.WorkdayRespDTO;
 
 import java.util.List;
 
@@ -28,4 +30,6 @@ public interface CommonService {
     List<zTree> getAreaManagerTree();
 
     String createProcess(String mark);
+
+    List<WorkdayRespDTO> getWorkDayList(WorkdayListReqDTO reqDTO);
 }

+ 12 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/CommonServiceImpl.java

@@ -12,6 +12,9 @@ import com.zjugis.framework.workflow.model.ProcessDto;
 import com.zjugis.framework.workflow.model.SerialNumberDto;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
 import com.zjugis.framework.workflow.utils.zTree;
+import com.zjugis.module.adm.api.workday.WorkdayApi;
+import com.zjugis.module.adm.api.workday.dto.WorkdayListReqDTO;
+import com.zjugis.module.adm.api.workday.dto.WorkdayRespDTO;
 import com.zjugis.module.system.api.area.dto.AreaNodeRespVO;
 import com.zjugis.module.system.api.company.CompanyApi;
 import com.zjugis.module.system.api.company.dto.CompanyRespDTO;
@@ -20,6 +23,7 @@ import com.zjugis.module.system.api.dept.dto.DeptRespDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.*;
 
 /**
@@ -45,6 +49,9 @@ public class CommonServiceImpl implements CommonService {
     @Autowired
     DeptApi deptApi;
 
+    @Resource
+    private WorkdayApi workdayApi;
+
     @Override
     public List<zTree> getProjectTypeZTree() {
         List<ProjectTypeNode> tree = projectTypeService.tree();
@@ -139,6 +146,11 @@ public class CommonServiceImpl implements CommonService {
         return workflowClient.createProcess(processDto);
     }
 
+    @Override
+    public List<WorkdayRespDTO> getWorkDayList(WorkdayListReqDTO reqDTO) {
+        return workdayApi.getWorkdayList(reqDTO).getCheckedData();
+    }
+
     private void convertProjectType2Ztree(List<ProjectTypeNode> tree, String pid,List<zTree>  zTrees){
         for (ProjectTypeNode projectTypeNode : tree) {
             zTree node = new zTree();

+ 1 - 1
zjugis-module-system/zjugis-module-system-biz/src/main/java/com/zjugis/module/system/service/user/AdminUserServiceImpl.java

@@ -248,7 +248,7 @@ public class AdminUserServiceImpl implements AdminUserService {
         if (CollUtil.isEmpty(deptIds)) {
             return Collections.emptyList();
         }
-        Set<String> userIds = convertSet(userDeptMapper.selectListByDeptIds(deptIds), UserDeptDO::getUserId);
+        Set<String> userIds = convertSet(userMapper.selectListByDeptIds(deptIds), AdminUserDO::getId);
         if (CollUtil.isEmpty(userIds)) {
             return Collections.emptyList();
         }