Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -876,7 +876,7 @@ //数据更改回调 updataSumbit(val){ this.DataVisible = false; val.copyfromversion = this.rowOid; val.copyFromVersion = this.rowOid; val.oid='' console.log(val) upSaveCode(val).then(res=>{ Source/UBCS/ubcs-ops-api/ubcs-flow-api/src/main/java/com/vci/ubcs/flow/core/entity/BladeFlow.java
@@ -185,6 +185,11 @@ private String historyActivityIdea; /** * 流程开始事件 */ private String processDefinitionStartTime; /** * 获取是否通过 */ public boolean isPass() { Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/business/service/impl/FlowBusinessServiceImpl.java
@@ -24,6 +24,7 @@ import com.vci.ubcs.flow.engine.constant.FlowEngineConstant; import com.vci.ubcs.flow.engine.entity.FlowProcess; import com.vci.ubcs.flow.engine.utils.FlowCache; import com.vci.ubcs.starter.web.util.VciDateUtil; import com.vci.ubcs.system.user.cache.UserCache; import com.vci.ubcs.system.user.entity.User; import lombok.AllArgsConstructor; @@ -81,9 +82,9 @@ .includeProcessVariables().active().orderByTaskCreateTime().desc(); // 构建列表数据 buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM); buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM); buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM); buildFlowTaskList(bladeFlow, flowList, claimUserQuery, FlowEngineConstant.STATUS_CLAIM, page); buildFlowTaskList(bladeFlow, flowList, claimRoleWithTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page); buildFlowTaskList(bladeFlow, flowList, claimRoleWithoutTenantIdQuery, FlowEngineConstant.STATUS_CLAIM, page); // 计算总数 long count = claimUserQuery.count() + claimRoleWithTenantIdQuery.count() + claimRoleWithoutTenantIdQuery.count(); @@ -106,7 +107,7 @@ .includeProcessVariables().orderByTaskCreateTime().desc(); // 构建列表数据 buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO); buildFlowTaskList(bladeFlow, flowList, todoQuery, FlowEngineConstant.STATUS_TODO,page); // 计算总数 long count = todoQuery.count(); @@ -298,8 +299,9 @@ * @param flowList 流程列表 * @param taskQuery 任务查询类 * @param status 状态 * @param page */ private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status) { private void buildFlowTaskList(BladeFlow bladeFlow, List<BladeFlow> flowList, TaskQuery taskQuery, String status, IPage<BladeFlow> page) { // if (bladeFlow.getCategory() != null) { if (StringUtils.isNotEmpty(bladeFlow.getCategory())) { taskQuery.processCategoryIn(Func.toStrList(bladeFlow.getCategory())); @@ -313,7 +315,9 @@ if (bladeFlow.getEndDate() != null) { taskQuery.taskCreatedBefore(bladeFlow.getEndDate()); } taskQuery.list().forEach(task -> { int firstResult = (int) ((page.getCurrent()-1)* page.getSize()); int maxResult = (int) page.getSize(); taskQuery.listPage(firstResult,maxResult).forEach(task -> { BladeFlow flow = new BladeFlow(); flow.setTaskId(task.getId()); flow.setTaskDefinitionKey(task.getTaskDefinitionKey()); @@ -340,10 +344,11 @@ flow.setHistoryActivityIdea(commentList.get(0).getFullMessage()); } } List<HistoricProcessInstance> processInstanceList = historyService.createHistoricProcessInstanceQuery() .processInstanceId(task.getProcessInstanceId()).orderByProcessInstanceStartTime().asc().list(); flow.setProcessDefinitionStartTime(VciDateUtil.date2Str(processInstanceList.get(0).getStartTime(),VciDateUtil.DateTimeFormat)); // 获取流程发起人名称 if (FlowEngineConstant.START_EVENT.equals(historicActivityInstance.getActivityType())) { List<HistoricProcessInstance> processInstanceList = historyService.createHistoricProcessInstanceQuery() .processInstanceId(task.getProcessInstanceId()).orderByProcessInstanceStartTime().asc().list(); if (processInstanceList.size() > 0) { if (StringUtil.isNotBlank(processInstanceList.get(0).getStartUserId())) { String taskUser = processInstanceList.get(0).getStartUserId(); @@ -357,9 +362,14 @@ } if (Func.isNotEmpty(historicProcessInstance)) { String[] businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); String[] businessKey = new String[2]; if(historicProcessInstance.getBusinessKey().contains(StringPool.COLON)){ businessKey = Func.toStrArray(StringPool.COLON, historicProcessInstance.getBusinessKey()); }else{ businessKey[0] = historicProcessInstance.getBusinessKey(); } flow.setBusinessTable(businessKey[0]); flow.setBusinessId(businessKey.length>1?businessKey[1]:"1"); flow.setBusinessId(businessKey.length>1 && StringUtils.isNotEmpty(businessKey[1])?businessKey[1]:"1"); } FlowProcess processDefinition = FlowCache.getProcessDefinition(task.getProcessDefinitionId()); Source/UBCS/ubcs-ops/ubcs-flow/src/main/java/com/vci/ubcs/flow/engine/service/impl/VCIFlowserviceImpl.java
@@ -19,14 +19,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.vci.ubcs.flow.core.constant.ProcessConstant; import com.vci.ubcs.flow.core.dto.FlowTaskDTO; import com.vci.ubcs.flow.core.dto.ProcessStageAttrDTO; import com.vci.ubcs.flow.core.entity.BladeFlow; import com.vci.ubcs.flow.core.entity.FlowTaskUser; import com.vci.ubcs.flow.core.entity.ProcessStageAttr; import com.vci.ubcs.flow.core.utils.TaskUtil; import com.vci.ubcs.flow.engine.entity.*; import com.vci.ubcs.flow.engine.service.FlowEngineService; import com.vci.ubcs.flow.engine.service.FlowTaskUserService; import com.vci.ubcs.flow.engine.service.ProcessStageAttrService; import com.vci.ubcs.flow.engine.service.VICFlowService; import com.vci.ubcs.starter.web.util.BeanUtil; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -232,6 +235,22 @@ flowTaskDTO.setVariables(variables); } //流程阶段 Map<String, Object> m = new HashMap<>(); String templateId = variables.get("templateId").toString(); m.put("template_id", templateId); m.put("task_id", crruentActivityId); m.put("model_key", modelKey); QueryWrapper q = Condition.getQueryWrapper(m, ProcessStageAttr.class) .select("attr_id attrId,attr_name attrName,attr_group attrGroup"); List<ProcessStageAttr> stageAttrs = processStageAttrService.list(q); List<ProcessStageAttrDTO> stageAttrsDto = new ArrayList<>(); stageAttrs.stream().forEach(e->{ ProcessStageAttrDTO dto = new ProcessStageAttrDTO(); BeanUtil.convert(e,dto); stageAttrsDto.add(dto); }); flowTaskDTO.setStageAttrs(stageAttrsDto); //放入流程阶段、流程modelkey variables.put(TASKID,crruentActivityId); Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/MdmEngineController.java
@@ -13,6 +13,7 @@ import com.vci.ubcs.code.service.MdmEngineService; import com.vci.ubcs.code.service.MdmIOService; import com.vci.ubcs.code.vo.pagemodel.*; import com.vci.ubcs.flow.core.dto.FlowStatusDTO; import com.vci.ubcs.starter.annotation.VciBusinessLog; import com.vci.ubcs.starter.revision.model.BaseModel; import com.vci.ubcs.starter.revision.model.TreeQueryObject; @@ -739,4 +740,13 @@ return engineService.referTree(referConfigVO,queryObject); } /** * 流程中变更状态的简易接口 * @param flowDTO 流程中携带的body * @return */ @PostMapping("/processChangeStatus") public R processChangeStatus(@RequestBody FlowStatusDTO flowDTO){ return engineService.processChangeStatus(flowDTO); } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/MdmEngineService.java
@@ -10,6 +10,7 @@ import com.vci.ubcs.code.vo.CodeKeyAttrRepeatVO; import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; import com.vci.ubcs.code.vo.pagemodel.*; import com.vci.ubcs.flow.core.dto.FlowStatusDTO; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.revision.model.BaseModel; import com.vci.ubcs.starter.revision.model.TreeQueryObject; @@ -439,4 +440,10 @@ ||"checkouttime".equalsIgnoreCase(attrName)); } /** * 流程中变更状态值 * @param flowDTO * @return */ R processChangeStatus(FlowStatusDTO flowDTO); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -20,6 +20,7 @@ import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO; import com.vci.ubcs.code.vo.pagemodel.UITablePageVO; import com.vci.ubcs.code.vo.pagemodel.*; import com.vci.ubcs.flow.core.dto.FlowStatusDTO; import com.vci.ubcs.flow.core.feign.IMDMIFlowAttrClient; import com.vci.ubcs.flow.core.vo.ProcessStageAttrVO; import com.vci.ubcs.omd.constant.BtmTypeLcStatusConstant; @@ -2606,17 +2607,10 @@ orderDTO.getCodeClassifyOid(), "主题库分类的主键"); //需要升版 // ClientBusinessObjectOperation cboOperation = new ClientBusinessObjectOperation(); BaseModel cbo = null; // try { // //cbo = cboOperation.createBusinessObjectVersion(oldCbo,VciBaseUtil.getCurrentUserId()); cbo = reviseBusinessObject(oldCbo); // } catch (VCIError e) { // throw new VciBaseException("初始化相关的内容出现了错误", new String[0], e); // } //1. 判断必输项 //CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); checkRequiredAttrOnOrder(templateVO, orderDTO); checkRequiredAttrOnOrder(templateVO, orderDTO); //2.先注入,再组合,最后校验 switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); //3.处理组合规则。组合规则不能使用编码的属性,因为编码的生成可能是需要属性的 @@ -2634,20 +2628,17 @@ //企业码和集团码的不修改 cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription()) ? "" : orderDTO.getDescription()); cbo.setName(orderDTO.getName()); // try { cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription()) ? "" : orderDTO.getDescription()); // cbo.setAttributeValueWithNoCheck("description", StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); cbo.setName(orderDTO.getName()); // } catch (VCIError e) { // e.printStackTrace(); // } //数据的时候,编码是不变的 cbo.setCreateTime(cbo.getCreateTime()); cbo.setLastModifyTime(cbo.getLastModifyTime()); // List<ClientBusinessObject> cboList = new ArrayList<>(); // cboList.add(cbo); cbo.setTenantId(AuthUtil.getTenantId()); oldCbo.setLastV("0"); oldCbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); oldCbo.setLastModifyTime(new Date()); try { // cboOperation.saveRevisionBuinessObject(cbo); updateBatchByBaseModel(oldCbo.getBtmname(), Collections.singletonList(oldCbo)); insertBatchByType(cbo.getBtmname(), Collections.singletonList(cbo)); } catch (Exception vciError) { throw new VciBaseException("数据更改保存出错了", new String[0], vciError); @@ -3831,4 +3822,21 @@ return toBo; } /** * 流程中变更状态值 * @param flowDTO * @return */ @Override public R processChangeStatus(FlowStatusDTO flowDTO) { flowDTO.getOids().forEach(s -> { BaseModelDTO baseModel = new BaseModelDTO(); baseModel.setOid(s); baseModel.setBtmname(flowDTO.getBtmType()); baseModel.setLcStatus(String.valueOf(flowDTO.getVariableMap().getOrDefault("statusValue","Auditing"))); changeStatus(baseModel); }); return R.success("成功"); } }