fujunling
2023-06-26 5bd552eec6cc822278691e3495a1f6a97038dbb7
Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
已修改8个文件
139 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/template/SetPersonnel.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/work/process/leave/handle.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/feign/BtmTypeClient.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/refer/vciWebReferDefalut.vue
@@ -272,8 +272,7 @@
        var query={}
        if (this.query) {
          for (var key in this.query) {
            query['conditionMap["' + key + '"]'] = '*'+this.query[key]+'*';
            query[key]='*'+this.query[key]+'*';
            query['conditionMap["' + key + '"]'] = this.query[key];
          }
        }
        getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url).then(res => {
Source/UBCS-WEB/src/components/refer/vciWebReferTable.vue
@@ -330,8 +330,7 @@
        var query={}
        if (this.query) {
          for (var key in this.query) {
            query['conditionMap["' + key + '"]'] = '*'+this.query[key]+'*';
            query[key]='*'+this.query[key]+'*';
            query['conditionMap["' + key + '"]'] = this.query[key];
          }
        }
        getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url).then(res => {
Source/UBCS-WEB/src/components/template/SetPersonnel.vue
@@ -100,7 +100,7 @@
            tags: [],
            typeName: [],
            collectParam: {},
            saveParam: this.saveParam(),
            saveParam: this.setSaveParam(),
            users: [],
            rules: {
                processName: [
@@ -116,7 +116,7 @@
        // this.apiDict()
    },
    methods: {
        saveParam() {
        setSaveParam() {
            return {
                processName: this.parameter[this.parameterKeys.flowTemplate],
                topName: this.title,
@@ -200,8 +200,8 @@
                        message: "请选择节点!"
                    });
                } else {
                    const {modelKey,modelName,processDesc,processName,templateId,topName,vars} = this.saveParam
                    const vals= {modelKey,modelName,processDesc,processName,templateId,topName,...vars}
                    const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids} = this.saveParam
                    const vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,...vars}
                    const response = await personnelSave({ variables:vals, flowTaskUsers: this.collectParam.flowTaskUsers, })
                    if (response.status === 200) {
                        console.log(response)
Source/UBCS-WEB/src/views/work/process/leave/handle.vue
@@ -94,7 +94,7 @@
        indexLabelClassName: '序号',
        column: [
          { label: '任务名称', prop: 'historyActivityName', minWidth: 120 },
          { label: '执行操作', prop: 'sex', minWidth: 80 },
          { label: '执行操作', prop: 'pass', minWidth: 80 ,formatter:this.formatterPass},
          { label: '任务开始时间', prop: 'createTime', minWidth: 140 },
          { label: '审批意见', prop: 'comment', minWidth: 220, overHidden: true },
          { label: '执行人', prop: 'assigneeName', minWidth: 80 },
@@ -130,6 +130,10 @@
        }
      })
      this.apiGetBtnTask(this.processInstanceId)
    },
    formatterPass(row, value, column) {
      console.log('value',value)
      return value?'同意':'驳回'
    },
    async apiGetBtnTask(id) {
      const response = await getBtnTask({ processInstanceId: id })
@@ -185,7 +189,7 @@
  display: -ms-flexbox;
  display: flex;
  justify-content: space-between;
  height: 70vh;
  height: 85vh;
  &_tab {
    width: 79%;
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
@@ -27,12 +27,17 @@
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.history.HistoricProcessInstanceQuery;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
@@ -55,6 +60,7 @@
    private final TaskService taskService;
    private final HistoryService historyService;
    private final RuntimeService runtimeService;
    @Override
    public IPage<BladeFlow> selectClaimPage(IPage<BladeFlow> page, BladeFlow bladeFlow) {
@@ -264,8 +270,22 @@
            variables = Kv.create();
        }
        variables.put(ProcessConstant.PASS_KEY, flow.isPass());
        // 完成任务
        taskService.complete(taskId, variables);
//        //设置下一步审核人
//        Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).active().singleResult();//下一步节点
//        String taskKey = task.getTaskDefinitionKey();//就是流程配置的节点id
//        Object to = getVar(processInstanceId,taskKey);
//        if(to==null){
//            throw new ServiceException(taskKey+"没有设置审核人");
//        }
//        String assignee = to.toString();
//
//        if(StringUtils.isNotEmpty(assignee)) {
//            task.setAssignee(assignee);
//        }
        return true;
    }
@@ -332,4 +352,16 @@
        return historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
    }
    public Object getVar(String processInstanceId,String key){
        Object t = null;
        List<Execution> list = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).list();
        for (Execution execution : list) {
            Object va = runtimeService.getVariable(execution.getId(),key);
            if(va!=null){
                t=va;
            }
        }
        return t;
    }
}
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/entity/FlowTaskDTO.java
@@ -58,7 +58,7 @@
    //流程中参数
    private List<FlowTaskDTO> toTasks;//流程下一步按钮
    private Map<String, Object> vars;//流程参数
    private Map<String, Object> variables;//流程参数
Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
@@ -25,12 +25,14 @@
import com.vci.ubcs.flow.engine.service.VICFlowService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.model.*;
import org.flowable.engine.*;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
@@ -55,13 +57,14 @@
    private final FlowEngineService flowEngineService;
    private final HistoryService historyService;
    private static String MODELKEY = "modelKey";//前端传过来的模型key
    @Override
    public R<BladeFlow> startProcess(FlowTaskDTO flowTaskUserC){
        String modelKey = flowTaskUserC.getModelKey();
        String templateId = flowTaskUserC.getTemplateId();
        Map<String, Object> kvv = flowTaskUserC.getVariables();
        Kv kv = Kv.create()
            .set(ProcessConstant.TASK_VARIABLE_CREATE_USER, AuthUtil.getUserName());
        String modelKey = kvv.get(MODELKEY).toString();
        Kv kv = Kv.create().set(ProcessConstant.TASK_VARIABLE_CREATE_USER, AuthUtil.getUserName());
        // 设置流程启动用户
        identityService.setAuthenticatedUserId(TaskUtil.getTaskUser());
@@ -72,11 +75,11 @@
        String processDefinitionId = latesDefinition.getId();
        //查询每一步审核人
        List<FlowTaskUser> taskUsers = flowTaskUserService.getTaskUserByTemplateAndModelKey(templateId,modelKey);
        Set<String> taskIdSet = new HashSet<>();
        List<FlowTaskUser> taskUsers = flowTaskUserC.getFlowTaskUsers();
//        Set<String> taskIdSet = new HashSet<>();
        for (FlowTaskUser taskUser:taskUsers){
            kv.put(taskUser.getTaskId(),TaskUtil.getTaskUser(taskUser.getUserId()));
            taskIdSet.add(taskUser.getTaskId());
//            taskIdSet.add(taskUser.getTaskId());
        }
        //对比配置的审核人员和流程中节点是否一致,可能存在流程节点变更了,多了或者少了节点,但是配置审核人员的节点没有变
@@ -92,13 +95,28 @@
//        }
        //流程中文件、变量等
        //do..
        if(kvv!=null&&!kvv.isEmpty()){
            kv.putAll(kvv);
        }
        ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, modelKey, kv);
        // 组装流程通用类
        BladeFlow flow = new BladeFlow();
        flow.setProcessInstanceId(processInstance.getId());
//        //设置下一步审核人
//        Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).active().singleResult();
//        String taskId = task.getTaskDefinitionKey();
//        String assignee = null;
//        for (FlowTaskUser taskUser:taskUsers) {
//            if(taskId.equals(taskUser.getTaskId())){
//                assignee = taskUser.getUserId();
//            }
//        }
//        if(StringUtils.isEmpty(assignee)){
//            throw new ServiceException(taskId+"没有配置审核人!");
//        }
//        taskService.setAssignee(task.getId(),assignee);
        return R.data(flow);
    }
@@ -126,7 +144,7 @@
        //这个实例的所有节点
        ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
        Map<String, Object> processVariables = processInstance.getProcessVariables();//所有参数
        flowTaskDTO.setVars(processVariables);
        flowTaskDTO.setVariables(processVariables);
        String modelKey = processInstance.getProcessDefinitionKey();
        List<FlowTaskDTO> mis = flowEngineService.getNodeByFlowableKey(modelKey);
@@ -142,7 +160,24 @@
                // 下一个审批节点
                FlowElement targetFlow = sequenceFlow.getTargetFlowElement();
                if (targetFlow instanceof UserTask) {
                    System.out.println("下一节点: id=" + targetFlow.getId() + ",name=" + targetFlow.getName());
                    FlowTaskDTO flowTaskUserCi = new FlowTaskDTO();
                    //flowTaskUserCi.setConditionKey(null);
                    //flowTaskUserCi.setConditionValue(null);
                    flowTaskUserCi.setToName("同意");
                    flowTaskUserCi.setToTaskId(targetFlow.getId());
                    flowTaskUserCi.setToTaskName(targetFlow.getName());
                    taskList.add(flowTaskUserCi);
                }
                //结束
                if (targetFlow instanceof EndEvent) {
                    FlowTaskDTO flowTaskUserCi = new FlowTaskDTO();
                    //flowTaskUserCi.setConditionKey(null);
                    //flowTaskUserCi.setConditionValue(null);
                    flowTaskUserCi.setToName("同意");
                    flowTaskUserCi.setToTaskId(targetFlow.getId());
                    flowTaskUserCi.setToTaskName(targetFlow.getName());
                    taskList.add(flowTaskUserCi);
                }
                // 如果下个审批节点为排他网关
                if (targetFlow instanceof ExclusiveGateway) {
@@ -157,9 +192,20 @@
                        for (FlowTaskDTO flowTaskUserCi:mis){
                            if(taskId.equals(flowTaskUserCi.getTaskId())){
                                flowTaskUserCi.setCondition(conditionExpression);
                                if(conditionExpression.split("=").length>1) {
                                    flowTaskUserCi.setConditionKey(conditionExpression.split("=")[0]);
                                    flowTaskUserCi.setConditionValue(conditionExpression.split("=")[1]);
                                if(conditionExpression.contains("=")||conditionExpression.contains("<")||conditionExpression.contains(">")) {
                                    conditionExpression = conditionExpression.replace("${","").replace("}","").replaceAll("\"","");
                                    String[] conditionExpressionStr = conditionExpression.split("==");
                                    if(conditionExpression.contains("<")){
                                        conditionExpressionStr = conditionExpression.split("<");
                                    }else if(conditionExpression.contains("<=")){
                                        conditionExpressionStr = conditionExpression.split("<=");
                                    }else if(conditionExpression.contains(">")){
                                        conditionExpressionStr = conditionExpression.split(">");
                                    }else if(conditionExpression.contains(">=")){
                                        conditionExpressionStr = conditionExpression.split(">=");
                                    }
                                    flowTaskUserCi.setConditionKey(conditionExpressionStr.length>0?conditionExpressionStr[0]:null);
                                    flowTaskUserCi.setConditionValue(conditionExpressionStr.length>1?conditionExpressionStr[1]:null);
                                }
                                flowTaskUserCi.setToName(name);
                                flowTaskUserCi.setToTaskId(taskId);
@@ -171,6 +217,10 @@
                }
            }
        }
        Map<String,Object> variables = runtimeService.getVariables(processInstanceId);
        if(!variables.isEmpty()){
            flowTaskDTO.setVariables(variables);
        }
        return flowTaskDTO;
    }
}
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/feign/BtmTypeClient.java
@@ -78,12 +78,13 @@
        String domainValue = conditionMap.get(DOMAIN);
        VciBaseUtil.alertNotNull(domainValue,"领域值");
        conditionMap.remove(DOMAIN);
        BtmType queryObj = new BtmType();
        BeanMap.create(queryObj).putAll(conditionMap);
//        BtmType queryObj = new BtmType();
//        BeanMap.create(queryObj).putAll(conditionMap);
        Map<String, Object> condition = new HashMap<>(conditionMap);
        Query query = new Query();
        query.setSize(pageHelper.getLimit());
        query.setCurrent(pageHelper.getPage());
        IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(queryObj).lambda().eq(BtmType::getDomain, domainValue).orderByAsc(BtmType::getId));
        IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition,BtmType.class).lambda().eq(BtmType::getDomain, domainValue).orderByAsc(BtmType::getId));
        if (CollectionUtils.isEmpty(page.getRecords())){
            return R.data(null);
        }