Jelajahi Sumber

工作流转件功能修复,项目金额补充

ljy121 1 tahun lalu
induk
melakukan
0b80b84719
18 mengubah file dengan 249 tambahan dan 875 penghapusan
  1. 0 13
      zjugis-business/src/main/java/com/zjugis/business/bean/dto/OutsourceApplyDto.java
  2. 0 81
      zjugis-business/src/main/java/com/zjugis/business/bean/entity/OutsourceApply.java
  3. 10 0
      zjugis-business/src/main/java/com/zjugis/business/bean/entity/ProjectAmount.java
  4. 0 83
      zjugis-business/src/main/java/com/zjugis/business/controller/OutsourceApplyController.java
  5. 0 39
      zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/controller/FlowOutsourceApplyController.java
  6. 0 285
      zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/event/OutsourceApplyEvent.java
  7. 0 104
      zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/service/FlowOutsourceApplyService.java
  8. 11 3
      zjugis-business/src/main/java/com/zjugis/business/job/ProjectAmountJob.java
  9. 0 18
      zjugis-business/src/main/java/com/zjugis/business/mapper/OutsourceApplyMapper.java
  10. 0 57
      zjugis-business/src/main/java/com/zjugis/business/service/OutsourceApplyService.java
  11. 1 1
      zjugis-business/src/main/java/com/zjugis/business/service/ProjectCostService.java
  12. 0 135
      zjugis-business/src/main/java/com/zjugis/business/service/impl/OutsourceApplyServiceImpl.java
  13. 3 3
      zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectCostServiceImpl.java
  14. 11 3
      zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectServiceImpl.java
  15. 0 6
      zjugis-business/src/main/resources/mapper/oracle/OutsourceApplyMapper.xml
  16. 0 41
      zjugis-workflow/src/main/java/com/zjugis/z_workflow/service/ActiInsRelFormService.java
  17. 200 2
      zjugis-workflow/src/main/java/com/zjugis/z_workflow/utils/ParticipantsUtils/MethodHandler.java
  18. 13 1
      zjugis-workflow/src/main/java/com/zjugis/z_workflow/utils/ParticipantsUtils/PostParticipantsUtils.java

+ 0 - 13
zjugis-business/src/main/java/com/zjugis/business/bean/dto/OutsourceApplyDto.java

@@ -1,13 +0,0 @@
-package com.zjugis.business.bean.dto;
-
-import com.zjugis.framework.common.pojo.PageParam;
-import lombok.Data;
-
-/**
- * @author ljy
- * @version 1.0
- * @date 2024/3/14 14:50
- */
-@Data
-public class OutsourceApplyDto extends PageParam {
-}

+ 0 - 81
zjugis-business/src/main/java/com/zjugis/business/bean/entity/OutsourceApply.java

@@ -1,81 +0,0 @@
-package com.zjugis.business.bean.entity;
-
-import com.zjugis.business.mybatis.entity.BaseEntity;
-import lombok.Data;
-
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-
-
-/**
- * (OutsourceApply)实体类
- *
- * @author ljy
- * @since 2024-03-12 18:51:38
- */
-
-
-@Data
-public class OutsourceApply extends BaseEntity {
-
-
-    private String id;
-
-/**
-     * 合同ID
-     */
-    private String contractId;
-
-/**
-     * 项目ID
-     */
-    private String projectId;
-
-/**
-     * 申请日期
-     */
-    private LocalDate applyDate;
-
-/**
-     * 申请人ID
-     */
-    private String applyWorkerId;
-
-/**
-     * 申请人
-     */
-    private String applyWorker;
-
-/**
-     * 分包合同额
-     */
-    private BigDecimal outAmount;
-
-/**
-     * 供应商ID
-     */
-    private String clientId;
-/**
-     * 分包理由
-     */
-    private String outReason;
-
-    private Integer isSign;
-
-    private String bz;
-
-    private String qualityControllerId;
-
-    private String qualityControllerName;
-
-    private String instanceId;
-
-
-    private LocalDateTime flowFinishtime;
-
-
-    private Integer flowStatus;
-
-}
-

+ 10 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/entity/ProjectAmount.java

@@ -33,6 +33,16 @@ public class ProjectAmount {
 
     private BigDecimal projectCost;
 
+    private BigDecimal travelCost;
+
+    private BigDecimal reimbursementCost;
+
+    private BigDecimal subcontractCost;
+
+    private BigDecimal outsourceCost;
+
+    private BigDecimal paymentCost;
+
     private LocalDateTime updateTime;
 
 }

+ 0 - 83
zjugis-business/src/main/java/com/zjugis/business/controller/OutsourceApplyController.java

@@ -1,83 +0,0 @@
-package com.zjugis.business.controller;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zjugis.business.bean.dto.OutsourceApplyDto;
-import com.zjugis.business.bean.entity.OutsourceApply;
-import com.zjugis.business.service.OutsourceApplyService;
-import com.zjugis.framework.common.pojo.CommonResult;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * (OUTSOURCE_APPLY)表控制层
- *
- * @author ljy
- * @since 2024-03-12 18:51:36
- */
-@RestController
-public class OutsourceApplyController {
-    /**
-     * 服务对象
-     */
-    @Resource
-    private OutsourceApplyService outsourceApplyService;
-
-    @RequestMapping("/outsource-apply/page")
-    public CommonResult<Page<OutsourceApply>> page(@RequestBody OutsourceApplyDto outsourceApplyDto) {
-        return CommonResult.success(outsourceApplyService.page(outsourceApplyDto));
-    }
-
-
-    /**
-     * 通过主键查询单条数据
-     *
-     * @param id 主键
-     * @return 单条数据
-     */
-    @GetMapping("/outsource-apply")
-    public CommonResult<OutsourceApply> queryById(@RequestParam("id") String id) {
-        return CommonResult.success(outsourceApplyService.queryById(id));
-    }
-
-    /**
-     * 新增数据
-     *
-     * @param outsourceApply 实体
-     * @return 新增结果
-     */
-    @PostMapping("/outsource-apply")
-    public CommonResult<String> create(@RequestBody OutsourceApply outsourceApply) {
-        return CommonResult.success(outsourceApplyService.insert(outsourceApply));
-    }
-
-    /**
-     * 编辑数据
-     *
-     * @param outsourceApply 实体
-     * @return 编辑结果
-     */
-    @PutMapping("/outsource-apply")
-    public CommonResult update(@RequestBody OutsourceApply outsourceApply) {
-        return CommonResult.success(outsourceApplyService.update(outsourceApply));
-    }
-
-    /**
-     * 删除数据
-     *
-     * @return 删除是否成功
-     */
-    @DeleteMapping("/outsource-apply")
-    public CommonResult<Integer> deleteByIds(@RequestBody List<String> idList) {
-        return CommonResult.success(outsourceApplyService.deleteByIdList(idList));
-    }
-
-    @GetMapping("/outsource-apply/process")
-    public CommonResult<String> subcontract(@RequestParam("projectId") String projectId) {
-        return CommonResult.success(outsourceApplyService.process(projectId));
-    }
-
-
-}
-

+ 0 - 39
zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/controller/FlowOutsourceApplyController.java

@@ -1,39 +0,0 @@
-package com.zjugis.business.flow.outsourceApply.controller;
-
-import com.zjugis.business.bean.entity.OutsourceApply;
-import com.zjugis.business.flow.outsourceApply.service.FlowOutsourceApplyService;
-import com.zjugis.framework.workflow.model.BaseController;
-import com.zjugis.framework.workflow.spring.resovler.ParamModel;
-import com.zjugis.framework.workflow.workflow.WorkFlow;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-/**
- * @author ljy
- * @version 1.0
- * @date 2024/3/12 18:58
- */
-@RestController
-@RequestMapping("/flow/outsource")
-public class FlowOutsourceApplyController extends BaseController {
-
-    @Autowired
-    FlowOutsourceApplyService flowOutsourceApplyService;
-
-    @WorkFlow(isReceiveMaterial = true, isReceiveOpinion = true)
-    @GetMapping("/apply")
-    public String apply(String activityTemplateId, String flowInstanceId, String userId) throws Exception {
-        Map<String, Object> map = flowOutsourceApplyService.getFormParams(flowInstanceId);
-        return resultPage(map);
-    }
-
-    @PostMapping("/update")
-    public String update(@ParamModel OutsourceApply outsourceApply) {
-        return success(flowOutsourceApplyService.updateById(outsourceApply));
-    }
-}

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

@@ -1,285 +0,0 @@
-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("执行事件出错,请联系管理员!");
-        }
-    }
-
-}

+ 0 - 104
zjugis-business/src/main/java/com/zjugis/business/flow/outsourceApply/service/FlowOutsourceApplyService.java

@@ -1,104 +0,0 @@
-package com.zjugis.business.flow.outsourceApply.service;
-
-import com.alibaba.excel.util.StringUtils;
-import com.zjugis.business.bean.entity.Contract;
-import com.zjugis.business.bean.entity.OutsourceApply;
-import com.zjugis.business.bean.entity.Project;
-import com.zjugis.business.constants.FlowStatusConstants;
-import com.zjugis.business.mapper.OutsourceApplyMapper;
-import com.zjugis.business.service.ContractService;
-import com.zjugis.business.service.OutsourceApplyService;
-import com.zjugis.business.service.ProjectService;
-import com.zjugis.framework.common.pojo.CommonResult;
-import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
-import com.zjugis.framework.workflow.model.IFlowInstance;
-import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
-import com.zjugis.module.system.api.dict.DictDataApi;
-import com.zjugis.module.system.api.district.DistrictApi;
-import com.zjugis.module.system.api.user.AdminUserApi;
-import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * @author ljy
- * @version 1.0
- * @date 2024/3/12 19:00
- */
-@Service
-public class FlowOutsourceApplyService {
-
-    @Autowired
-    DictDataApi dictDataApi;
-
-    @Autowired
-    OutsourceApplyService outsourceApplyService;
-
-    @Autowired
-    ContractService contractService;
-
-    @Autowired
-    ProjectService projectService;
-
-    @Autowired
-    OutsourceApplyMapper outsourceApplyMapper;
-
-
-    @Autowired
-    WorkflowClient workflowClient;
-
-    @Autowired
-    AdminUserApi adminUserApi;
-
-    @Autowired
-    DistrictApi districtApi;
-
-    public Map<String, Object> getFormParams(String flowInstanceId) {
-        String userId = SecurityFrameworkUtils.getLoginUserId();
-        CommonResult<IFlowInstance> flowResult = workflowClient.flowInstance(flowInstanceId);
-        if(flowResult.isSuccess()){
-            OutsourceApply entity = outsourceApplyService.selectByInstanceId(flowInstanceId);
-
-            if(Objects.isNull(entity)){
-                entity = new OutsourceApply();
-                entity.setInstanceId(flowInstanceId);
-                entity.setApplyWorkerId(userId);
-                entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
-                CommonResult<AdminUserRespDTO> result = adminUserApi.getUser(userId);
-                entity.setApplyWorker(result.getCheckedData().getNickname());
-                outsourceApplyService.insert(entity);
-            }
-            return createMap(entity);
-        }
-        return createModelMap();
-    }
-
-    private Map<String, Object> createModelMap() {
-        Map<String, Object> map = new HashMap<>();
-        map.put("formEntity", new HashMap<>());
-        return map;
-    }
-
-    private Map<String, Object>  createMap(OutsourceApply entity) {
-        Map<String, Object> map = new HashMap<>();
-        if(StringUtils.isNotBlank(entity.getContractId())){
-            Contract contract = contractService.selectByPrimaryKey(entity.getContractId());
-            map.put("contract",contract);
-        }
-        if(StringUtils.isNotBlank(entity.getProjectId())){
-            Project project = projectService.selectById(entity.getProjectId());
-            map.put("project",project);
-        }
-        map.put("formEntity", entity);
-        return map;
-    }
-
-    public int updateById(OutsourceApply outsourceApply) {
-        return outsourceApplyMapper.updateById(outsourceApply);
-    }
-
-}

+ 11 - 3
zjugis-business/src/main/java/com/zjugis/business/job/ProjectAmountJob.java

@@ -3,6 +3,7 @@ package com.zjugis.business.job;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.zjugis.business.bean.dto.ProjectCostDto;
 import com.zjugis.business.bean.entity.ProjectAmount;
+import com.zjugis.business.bean.response.ProjectCostResponse;
 import com.zjugis.business.service.ContractService;
 import com.zjugis.business.service.ProjectAmountService;
 import com.zjugis.business.service.ProjectCostService;
@@ -12,7 +13,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
@@ -88,10 +88,18 @@ public class ProjectAmountJob {
                 List<ProjectAmount> batch = contractService.selectAmountList(ids);
                 ProjectCostDto costDto = new ProjectCostDto();
                 costDto.setProjectIds(ids);
-                Map<String, BigDecimal> costMap = projectCostService.calculateCostMap(costDto);
+                Map<String, ProjectCostResponse> costMap = projectCostService.calculateCostMap(costDto);
                 LocalDateTime now = LocalDateTime.now();
                 for (ProjectAmount entity : batch) {
-                    entity.setProjectCost(costMap.get(entity.getProjectId()));
+                    ProjectCostResponse projectCostResponse = costMap.get(entity.getProjectId());
+                    if(projectCostResponse != null){
+                        entity.setProjectCost(projectCostResponse.getCost());
+                        entity.setReimbursementCost(projectCostResponse.getReimbursementCost());
+                        entity.setTravelCost(projectCostResponse.getTravelCost());
+                        entity.setSubcontractCost(projectCostResponse.getSubcontractCost());
+                        entity.setOutsourceCost(projectCostResponse.getOutsourceCost());
+                        entity.setPaymentCost(projectCostResponse.getPaymentCost());
+                    }
                     entity.setUpdateTime(now);
                 }
                 if(insert){

+ 0 - 18
zjugis-business/src/main/java/com/zjugis/business/mapper/OutsourceApplyMapper.java

@@ -1,18 +0,0 @@
-package com.zjugis.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.zjugis.business.bean.entity.OutsourceApply;
-import org.springframework.stereotype.Repository;
-
-/**
- * (OutsourceApply)表数据库访问层
- *
- * @author ljy
- * @since 2024-03-12 18:51:37
- */
-@Repository
-public interface OutsourceApplyMapper extends BaseMapper<OutsourceApply> {
-
-
-}
-

+ 0 - 57
zjugis-business/src/main/java/com/zjugis/business/service/OutsourceApplyService.java

@@ -1,57 +0,0 @@
-package com.zjugis.business.service;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zjugis.business.bean.dto.OutsourceApplyDto;
-import com.zjugis.business.bean.entity.OutsourceApply;
-
-import java.util.List;
-
-/**
- * (OUTSOURCE_APPLY)表服务接口
- *
- * @author ljy
- * @since 2024-03-12 18:51:40
- */
-public interface OutsourceApplyService {
-
-    Page<OutsourceApply> page(OutsourceApplyDto outsourceApplyDto);
-
-    /**
-     * 通过ID查询单条数据
-     *
-     * @param id 主键
-     * @return 实例对象
-     */
-    OutsourceApply queryById(String id);
-
-    OutsourceApply selectByInstanceId(String id);
-
-    /**
-     * 新增数据
-     *
-     * @param outsourceApply 实例对象
-     * @return 实例对象
-     */
-    String insert(OutsourceApply outsourceApply);
-
-    /**
-     * 修改数据
-     *
-     * @param outsourceApply 实例对象
-     * @return 实例对象
-     */
-    int update(OutsourceApply outsourceApply);
-
-    /**
-     * 通过主键删除数据
-     *
-     * @param id 主键
-     * @return 是否成功
-     */
-    int deleteById(String id);
-
-    int deleteByIdList(List<String> ids);
-
-    String process(String projectId);
-}
-

+ 1 - 1
zjugis-business/src/main/java/com/zjugis/business/service/ProjectCostService.java

@@ -55,7 +55,7 @@ public interface ProjectCostService {
 
     ProjectCostResponse calculateSum(ProjectCostDto projectCostDto);
 
-    Map<String, BigDecimal> calculateCostMap(ProjectCostDto projectCostDto);
+    Map<String, ProjectCostResponse> calculateCostMap(ProjectCostDto projectCostDto);
 
     List<String> selectCurMonthProjectIds(int year, int month);
 

+ 0 - 135
zjugis-business/src/main/java/com/zjugis/business/service/impl/OutsourceApplyServiceImpl.java

@@ -1,135 +0,0 @@
-package com.zjugis.business.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.zjugis.business.bean.dto.OutsourceApplyDto;
-import com.zjugis.business.bean.entity.OutsourceApply;
-import com.zjugis.business.constants.FlowStatusConstants;
-import com.zjugis.business.mapper.OutsourceApplyMapper;
-import com.zjugis.business.service.OutsourceApplyService;
-import com.zjugis.framework.common.exception.ServiceException;
-import com.zjugis.framework.common.pojo.CommonResult;
-import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
-import com.zjugis.framework.workflow.model.ProcessDto;
-import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
-import com.zjugis.framework.workflow.utils.UrlUtils;
-import com.zjugis.module.system.api.user.AdminUserApi;
-import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import static com.zjugis.business.constants.ResponseStatusEnum.WORKFLOW_ERROR;
-
-/**
- * (OUTSOURCE_APPLY)表服务实现类
- *
- * @author ljy
- * @since 2024-03-12 18:51:40
- */
-@Service
-public class OutsourceApplyServiceImpl implements OutsourceApplyService {
-    @Resource
-    private OutsourceApplyMapper outsourceApplyMapper;
-
-    @Autowired
-    private AdminUserApi adminUserApi;
-    @Autowired
-    private WorkflowClient workflowClient;
-
-
-    @Override
-    public Page<OutsourceApply> page(OutsourceApplyDto outsourceApplyDto) {
-        Page<OutsourceApply> page = new Page<>(outsourceApplyDto.getPageNo(),outsourceApplyDto.getPageSize());
-        QueryWrapper<OutsourceApply> queryWrapper = new QueryWrapper<>();
-        return outsourceApplyMapper.selectPage(page,queryWrapper);
-    }
-
-    /**
-     * 通过ID查询单条数据
-     *
-     * @param id 主键
-     * @return 实例对象
-     */
-    @Override
-    public OutsourceApply queryById(String id) {
-        return outsourceApplyMapper.selectById(id);
-    }
-
-    @Override
-    public OutsourceApply selectByInstanceId(String id) {
-        QueryWrapper<OutsourceApply> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("INSTANCE_ID",id);
-        return outsourceApplyMapper.selectOne(queryWrapper);
-    }
-
-    /**
-     * 新增数据
-     *
-     * @param outsourceApply 实例对象
-     * @return 实例对象
-     */
-    @Override
-    public String insert(OutsourceApply outsourceApply) {
-        outsourceApply.setIsvalid(1);
-        this.outsourceApplyMapper.insert(outsourceApply);
-        return outsourceApply.getId();
-    }
-
-    /**
-     * 修改数据
-     *
-     * @param outsourceApply 实例对象
-     * @return 实例对象
-     */
-    @Override
-    public int update(OutsourceApply outsourceApply) {
-        return this.outsourceApplyMapper.updateById(outsourceApply);
-    }
-
-    /**
-     * 通过主键删除数据
-     *
-     * @param id 主键
-     * @return 是否成功
-     */
-    @Override
-    public int deleteById(String id) {
-        return this.outsourceApplyMapper.deleteById(id);
-    }
-
-
-    @Override
-    public int deleteByIdList(List<String> ids) {
-        return this.outsourceApplyMapper.deleteBatchIds(ids);
-    }
-
-    /**
-     * @param projectId
-     * @return
-     */
-    @Override
-    public String process(String projectId) {
-        String userId = SecurityFrameworkUtils.getLoginUserId();
-        CommonResult<AdminUserRespDTO> userResp = adminUserApi.getUser(userId);
-        String mark = "wbhtsq";
-        ProcessDto processDto = new ProcessDto();
-        processDto.setFlowTemplateMark(mark);
-        processDto.setPromoterId(userId);
-        String returnUrl = workflowClient.createProcess(processDto);
-        if(returnUrl.contains("error_code")){
-            throw new ServiceException(WORKFLOW_ERROR.getCode(), returnUrl);
-        }
-        OutsourceApply entity = new OutsourceApply();
-        entity.setInstanceId(UrlUtils.getParam(returnUrl,"flowInstanceId"));
-        entity.setProjectId(projectId);
-        entity.setApplyWorker(userResp.getCheckedData().getNickname());
-        entity.setApplyWorkerId(userId);
-        entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
-        insert(entity);
-        return returnUrl;
-    }
-}
-

+ 3 - 3
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectCostServiceImpl.java

@@ -83,7 +83,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
     }
 
     @Override
-    public Map<String,BigDecimal> calculateCostMap(ProjectCostDto projectCostDto) {
+    public Map<String,ProjectCostResponse> calculateCostMap(ProjectCostDto projectCostDto) {
         List<ProjectCostResponse> costList = projectCostMapper.calculateList(projectCostDto);
         List<ContractSubCostDto> subCostList = contractSubService.selectSubCostByProjectIds(projectCostDto.getProjectIds());
         Map<String, BigDecimal> commonCostMap = commonCostService.getProjectCostMap(projectCostDto.getProjectIds());
@@ -92,7 +92,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
         if(subCostList != null){
             subCostMap = subCostList.stream().collect(Collectors.groupingBy(ContractSubCostDto::getProjectId));
         }
-        Map<String,BigDecimal> costMap = new HashMap<>(costList.size());
+        Map<String,ProjectCostResponse> costMap = new HashMap<>(costList.size());
         for (ProjectCostResponse item : costList) {
             BigDecimal commonCost = commonCostMap == null ?BigDecimal.ZERO :commonCostMap.get(item.getProjectId());
             BigDecimal travelCost = travelCostMap== null ?BigDecimal.ZERO :travelCostMap.get(item.getProjectId());
@@ -108,7 +108,7 @@ public class ProjectCostServiceImpl implements ProjectCostService {
                 }
             }
             item.calcCost();
-            costMap.put(item.getProjectId(),item.getCost());
+            costMap.put(item.getProjectId(),item);
         }
         return costMap;
     }

+ 11 - 3
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectServiceImpl.java

@@ -138,7 +138,7 @@ public class ProjectServiceImpl implements ProjectService {
         QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("INSTANCE_ID",id);
         Project project = projectMapper.selectOne(queryWrapper);
-        if(StringUtils.isNotBlank(project.getZrbmId())){
+        if(project != null && StringUtils.isNotBlank(project.getZrbmId())){
             CommonResult<DeptRespDTO> dept = deptApi.getDept(project.getZrbmId());
             project.setZrbm(dept.getCheckedData().getName());
         }
@@ -385,9 +385,17 @@ public class ProjectServiceImpl implements ProjectService {
             projectAmount.setContractBalance(projectAmount.getVirtualAmount().subtract(projectAmount.getInvoiceAmount()));
             ProjectCostDto costDto = new ProjectCostDto();
             costDto.setProjectIds(ids);
-            Map<String, BigDecimal> costMap = projectCostService.calculateCostMap(costDto);
+            Map<String, ProjectCostResponse> costMap = projectCostService.calculateCostMap(costDto);
             LocalDateTime now = LocalDateTime.now();
-            projectAmount.setProjectCost(costMap.get(projectAmount.getProjectId()));
+            ProjectCostResponse projectCostResponse = costMap.get(projectAmount.getProjectId());
+            if(projectCostResponse != null){
+                projectAmount.setProjectCost(projectCostResponse.getCost());
+                projectAmount.setReimbursementCost(projectCostResponse.getReimbursementCost());
+                projectAmount.setTravelCost(projectCostResponse.getTravelCost());
+                projectAmount.setSubcontractCost(projectCostResponse.getSubcontractCost());
+                projectAmount.setOutsourceCost(projectCostResponse.getOutsourceCost());
+                projectAmount.setPaymentCost(projectCostResponse.getPaymentCost());
+            }
             projectAmount.setUpdateTime(now);
             ProjectAmount dbEntity = projectAmountService.selectById(projectId);
             if(dbEntity == null){

+ 0 - 6
zjugis-business/src/main/resources/mapper/oracle/OutsourceApplyMapper.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.zjugis.business.mapper.OutsourceApplyMapper">
-
-</mapper>
-

+ 0 - 41
zjugis-workflow/src/main/java/com/zjugis/z_workflow/service/ActiInsRelFormService.java

@@ -215,47 +215,6 @@ public class ActiInsRelFormService extends ServiceImpl<ActiInsRelFormDao, ActiIn
 		}
 	}
 
-	/**
-	 * 批量保存活动实例表单关联数据,同时保存活动实例表单与报表关联数据
-	 * @param activityInstances
-	 */
-	public void batchInsertList(List<IActivityInstance> activityInstances) throws Exception {
-		if (CollectionUtils.isEmpty(activityInstances)) {
-			return;
-		}
-		Set<String> activityTemplateIds = activityInstances.stream().map(IActivityInstance::getActivityTemplateId).collect(Collectors.toSet());
-		List<TFormRel> formRels = tFormRelService.findListByActivityTemplateIds(new ArrayList<>(activityTemplateIds));
-		List<Form> formList = getForms(formRels);
-		List<FormRelReport> reportsList = getReportsList(formRels);
-		List<ActiInsRelForm> actiInsRelForms = new ArrayList<>();
-		activityInstances.forEach(item -> {
-			actiInsRelForms.addAll(formList.stream().map(t -> {
-				Optional<TFormRel> rt = formRels.stream().filter(tf -> tf.getFormId().equals(t.getId())
-						&& tf.getActivityTemplateId().equals(item.getActivityTemplateId())).findAny();
-                return rt.map(tFormRel -> getInstance(item.getFlowInstanceId(), item.getId(), tFormRel.getFormId(),
-                        t.getShowName(), t.getPcUrl(), t.getMobileUrl(),
-                        t.getTitle(), tFormRel.getIndexCode())).orElse(null);
-            }).filter(Objects::nonNull).collect(Collectors.toList())); });
-		List<IRelFormRelReport> formRelReports = new ArrayList<>();
-		//保存活动实例表单关联表
-		if (!CollectionUtils.isEmpty(actiInsRelForms)) {
-			//生成活动实例表单关联表与报表实例的关联信息
-			for (FormRelReport t : reportsList) {
-				List<ActiInsRelForm> iActiInsRelForms = actiInsRelForms.stream().filter(i ->
-						i.getFormId().equals(t.getFromId())).collect(Collectors.toList());
-				if (!CollectionUtils.isEmpty(iActiInsRelForms)) {
-					formRelReports.addAll(iActiInsRelForms.stream().map(ac ->
-							iRelFormRelReportService.getInstance(ac.getId(), t.getReportId())).collect(Collectors.toList()));
-				}
-			}
-			actiInsRelFormDao.insertOrUpdateBatchByList(actiInsRelForms);
-		}
-		//保存活动实例表单报表关联表
-		if (!CollectionUtils.isEmpty(formRelReports)) {
-			iRelFormRelReportService.batchInsertOrUpdate(formRelReports);
-		}
-	}
-
 	/**
 	 * 按集合查询数据
 	 *

+ 200 - 2
zjugis-workflow/src/main/java/com/zjugis/z_workflow/utils/ParticipantsUtils/MethodHandler.java

@@ -1,9 +1,21 @@
 package com.zjugis.z_workflow.utils.ParticipantsUtils;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.alibaba.fastjson2.TypeReference;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.workflow.spring.SpringUtils;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import com.zjugis.z_workflow.base.utils.ServiceApiUtils;
 import com.zjugis.z_workflow.utils.ConvertUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.CollectionUtils;
 
-import java.util.Comparator;
-import java.util.Map;
+import java.util.*;
+import java.util.function.Function;
 
 /**
  * @ClassName:
@@ -16,4 +28,190 @@ import java.util.Map;
 public class MethodHandler {
 
 	public static Comparator<Map<String, Object>> comparator = Comparator.comparing(o -> ConvertUtils.toString(o.get("id")));
+
+    /**
+     * 根据部门ID查询所有关联人员(指定部门)
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByDeptFun = postData -> {
+
+        AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
+        CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByDeptIds(Collections.singleton((String) postData.get("dID")));
+        return handledResult(result.getCheckedData());
+    };
+
+    /**
+     * 根据指定职位ID获取该职位下所有用户(指定职位)
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByPositionFun = postData -> {
+        AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
+        CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByPostIds(Collections.singleton(Long.valueOf((String) postData.get("pID"))));
+        return handledResult(result.getCheckedData());
+    };
+
+//	/**
+//	 * 根据职位名称或编码获取该职位下所有用户(指定职位名称)
+//	 */
+//	public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByPositionNameFun = postData -> {
+//		String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_USER_BY_POSITION_NAME_CODE;
+//		return post(postUrl, postData);
+//	};
+
+    /**
+     * 根据角色ID获取该角色下所有的用户(指定角色)
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByRoleFun = postData -> {
+        AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
+        CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUserListByRoleId(Long.valueOf((String) ((Map)postData.get("role")).get("id")));
+        return handledResult(result.getCheckedData());
+    };
+
+//    /**
+//     * 指定部门分管
+//     */
+//    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByInChargeFun = postData -> {
+//        String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_LEADER_BY_DEPT_ID;
+//        return post(postUrl, postData);
+//    };
+
+    /**
+     * 指定用户
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByIdFun = postData -> {
+        AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
+        String id = postData.getOrDefault("id", "").toString();
+        List<String> ids = new ArrayList<>();
+        if (!StringUtils.isBlank(id)) {
+            ids.add(id);
+        }
+        CommonResult<List<AdminUserRespDTO>> result = adminUserApi.getUsers(ids);
+        return handledResult(result.getCheckedData());
+    };
+
+//    /**
+//     * 指定用户所在部门
+//     */
+//    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithDeptFun = postData -> {
+//        String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_DEPT_USER_BY_USER_ID;
+//        return post(postUrl, postData);
+//    };
+//
+//    /**
+//     * 指定用户所在职位
+//     */
+//    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithPositionFun = postData -> {
+//        String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_POSITION_USER_BY_USER_ID;
+//        return post(postUrl, postData);
+//    };
+
+//    /**
+//     * 指定用户所在部门职位
+//     */
+//    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithDeptPositionFun = postData -> {
+//        String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_DEPT_POSITION_BY_ID;
+//        return post(postUrl, postData);
+//    };
+//
+//    /**
+//     * 指定用户所在角色
+//     */
+//    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithRoleFun = postData -> {
+//        String postUrl = YmlUtil.getzUserOrgRightUrl() + WorkFlowConstant.USER_API_FIND_ROLE_USER_BY_USER_ID;
+//        return post(postUrl, postData);
+//    };
+
+    /**
+     * 指定用户的分管领导
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByWithLeaderFun = postData -> {
+        AdminUserApi adminUserApi = SpringUtils.getBean(AdminUserApi.class);
+        String id = postData.getOrDefault("id", "").toString();
+        CommonResult<AdminUserRespDTO> result = adminUserApi.getUserLeader(id);
+        return handledResult(result.getCheckedData());
+    };
+
+    /**
+     * 指定已创建活动实例参与人(最近)
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByActivityInstanceFun = postData -> {
+        List<String> ids = (List<String>) postData.get("ids");
+        return getParticipantData(ids);
+    };
+
+
+    /**
+     * 自定义可参与人
+     */
+    public static Function<Map<String, Object>, Set<Map<String, Object>>> getUserByCustomFun = postData -> {
+        String postUrl = postData.get("requestUrl").toString();
+        return post(postUrl, postData);
+    };
+
+    /**
+     * 请求webApi
+     *
+     * @param postUrl
+     * @param postData
+     * @return
+     */
+    private static Set<Map<String, Object>> post(String postUrl, Map<String, Object> postData) {
+        Set<Map<String, Object>> rtnSet = new TreeSet<>(comparator);
+        try {
+            String result = ServiceApiUtils.getDataFromServiceApi(postUrl, postData);
+            if (!StringUtils.isBlank(result)) {
+                List<Map<String, Object>> mapList = new ArrayList<>();
+                Object resultObj = JSON.parse(result);
+                if (resultObj instanceof JSONArray) {//判断是JSONArray
+                    mapList = JSON.parseObject(result, new TypeReference<List<Map<String, Object>>>() {});
+                } else if (resultObj instanceof JSONObject) {//判断是JSONObject
+                    JSONObject jsonObject = (JSONObject) resultObj;
+                    mapList.add(jsonObject);
+                }
+                if (!CollectionUtils.isEmpty(mapList)) {
+                    rtnSet.addAll(mapList);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return rtnSet;
+    }
+
+    /**
+     * 根据用户ID集合返回需要的参与人结构数据
+     * @param userIds 用户ID集合
+     * @return
+     */
+    private static Set<Map<String, Object>> getParticipantData(List<String> userIds) {
+        Set<Map<String, Object>> rtnSet = new TreeSet<>(comparator);
+        try {
+            if (!CollectionUtils.isEmpty(userIds)) {
+                List<Map<String, Object>> mapList = new ArrayList<>();
+                userIds.stream().forEach(t -> {
+                    mapList.add(new HashMap<String, Object>(){{
+                        put("id", t);
+                    }});
+                });
+                rtnSet.addAll(mapList);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return rtnSet;
+    }
+
+    private static HashSet<Map<String, Object>> handledResult(List<AdminUserRespDTO> userList){
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        for (AdminUserRespDTO user : userList) {
+            Map<String, Object> map = BeanUtil.beanToMap(user);
+            mapList.add(map);
+        }
+        return new HashSet<>(mapList);
+    }
+
+    private static HashSet<Map<String, Object>> handledResult(AdminUserRespDTO user){
+        List<Map<String, Object>> mapList = new ArrayList<>();
+        Map<String, Object> map = BeanUtil.beanToMap(user);
+        mapList.add(map);
+        return new HashSet<>(mapList);
+    }
 }

+ 13 - 1
zjugis-workflow/src/main/java/com/zjugis/z_workflow/utils/ParticipantsUtils/PostParticipantsUtils.java

@@ -224,7 +224,19 @@ public class PostParticipantsUtils {
 	 * 参与人组类型
 	 */
 	private enum ParticipantFilterTypeEnum {
-        ;
+        ASSIGN_DEPT("指定部门", 1, MethodHandler.getUserByDeptFun, ParamsHandler.getParamsByDeptFun),
+        ASSIGN_POSITION("指定职位", 2, MethodHandler.getUserByPositionFun, ParamsHandler.getParamsByPositionFun),
+        //		ASSIGN_POSITION_NAME("指定职位名称", 3, MethodHandler.getUserByPositionNameFun, ParamsHandler.getParamsByPositionNameFun),
+        ASSIGN_ROLE("指定角色", 4, MethodHandler.getUserByRoleFun, ParamsHandler.getParamsByRoleFun),
+//        DEPT_MANAGE("指定部门分管", 5, MethodHandler.getUserByInChargeFun, ParamsHandler.getParamsByInChargeFun),
+        ASSIGN_USER("指定用户", 6, MethodHandler.getUserByIdFun, ParamsHandler.getParamsByIdFun),
+//        ASSIGN_USER_DEPT("指定用户所在部门", 7, MethodHandler.getUserByWithDeptFun, ParamsHandler.getParamsByWithDeptFun),
+//        ASSIGN_USER_POSITION("指定用户所在职位", 8, MethodHandler.getUserByWithPositionFun, ParamsHandler.getParamsByWithPositionFun),
+//        ASSIGN_USER_DEPT_POSITION("指定用户所在部门职位", 16, MethodHandler.getUserByWithDeptPositionFun, ParamsHandler.getParamsByWithDeptPositionFun),
+//        ASSIGN_USER_ROLE("指定用户所在角色", 9, MethodHandler.getUserByWithRoleFun, ParamsHandler.getParamsByWithRoleFun),
+        ASSIGN_USER_LEADER("指定用户的分管领导", 10, MethodHandler.getUserByWithLeaderFun, ParamsHandler.getParamsByWithLeaderFun),
+        ASSIGN_ACTIVITY_PARTICIPANT("指定已创建活动实例参与人(最近)", 11, MethodHandler.getUserByActivityInstanceFun, ParamsHandler.getParamsByActivityInstanceFun),
+        CUSTOM_PARTICIPANT("自定义可参与人", 13, MethodHandler.getUserByCustomFun, ParamsHandler.getParamsByCustomFun);
 		// 成员变量
 		private String name;
 		private Integer index;