Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/controller/WebProcessCommandController.java
@@ -1,6 +1,6 @@ package com.vci.web.controller; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.corba.wf.data.TasksAssignedInfo; import com.vci.pagemodel.ProcessUserVO; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.pagemodel.BaseResult; Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/dao/WebProcessDaoI.java
@@ -1,8 +1,8 @@ package com.vci.web.dao; import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.WorkflowServicePrx; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.corba.wf.WFServicePrx; import com.vci.corba.wf.data.TasksAssignedInfo; import com.vci.dto.ProcessTemplateVO; import com.vci.model.WFProcessClassifyDO; import com.vci.model.WFProcessTemplateDO; @@ -298,7 +298,7 @@ * è·åå¹³å°çæµç¨æå¡ * @return */ WorkflowServicePrx getWorkService() throws VciBaseException; WFServicePrx getWFService() throws VciBaseException; /** * ä»»å¡ä¸æ°æ®å ³èç龿¥ç±»å Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/dao/impl/WebProcessDaoImpl.java
@@ -6,8 +6,9 @@ import com.vci.corba.common.data.UserEntityInfo; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.WorkflowServicePrx; import com.vci.corba.workflow.data.*; import com.vci.corba.wf.WFServicePrx; import com.vci.corba.wf.data.*; import com.vci.corba.workflow.data.FlowApproveHistoryInfo; import com.vci.dto.ProcessTemplateVO; import com.vci.model.ProcessInstance; import com.vci.model.ProcessTask; @@ -19,7 +20,6 @@ import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; import com.vci.starter.web.pagemodel.SessionInfo; import com.vci.starter.web.util.BeanUtilForVCI; import com.vci.starter.web.util.VciBaseUtil; import com.vci.starter.web.util.VciDateUtil; @@ -80,7 +80,7 @@ /** * å¹³å°çæµç¨æå¡ */ private WorkflowServicePrx workService = null; private WFServicePrx wfService = null; /** * å¹³å°è°ç¨å®¢æ·ç«¯ @@ -107,7 +107,7 @@ */ private void getCategory() throws VciBaseException { try { ProcessCategoryInfo[] pcia = getWorkService().getProcessCategories("root"); ProcessCategoryInfo[] pcia = getWFService().getProcessCategories("root"); if(pcia!=null&&pcia.length>0){ for(ProcessCategoryInfo pci : pcia){ categoryMap.put(pci.name.toLowerCase(), pci.id); @@ -144,7 +144,7 @@ throw new VciBaseException(msgCodePrefix + "typeNotExist", new String[]{type}); } try { allFlowInType = getWorkService().getProcessDefinitions(typeOid); allFlowInType = getWFService().getProcessDefinitions(typeOid); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -153,14 +153,14 @@ List<String> templateList = VciBaseUtil.str2List(filterTemplate); if(!CollectionUtils.isEmpty(templateList)){ templateList.forEach(name->{ try { /*try {*/ String nameUnRev = name; String revision = ""; if(name.contains("-")){ nameUnRev = name.substring(0,name.lastIndexOf("-")); revision = name.substring(name.lastIndexOf("-")+1); } ProcessDefinitionInfo[] definition = getWorkService().getProcessDefinitionByProcessDefinitionName(nameUnRev, ""); ProcessDefinitionInfo[] definition = null;//getWFService()().getProcessDefinitionByProcessDefinitionName(nameUnRev, ""); if(definition!=null){ if(StringUtils.isBlank(revision)) { Collections.addAll(infoList, definition); @@ -170,9 +170,9 @@ infoList.addAll(Arrays.stream(definition).filter(s -> finalRevision.equalsIgnoreCase(String.valueOf(s.version))).collect(Collectors.toList())); } } } catch (PLException e) { /*} catch (PLException e) { throw WebUtil.getVciBaseException(e); } }*/ }); } allFlowInType = infoList.toArray(new ProcessDefinitionInfo[0]); @@ -191,7 +191,7 @@ WebUtil.alertNotNull(deployId,"æµç¨é¨ç½²ä¸»é®"); ProcessDefinitionInfo pdi = null; try { pdi = getWorkService().getProcessDefinitionByDeployId(deployId.trim()); pdi = getWFService().getProcessDefinitionByDeployId(deployId.trim()); } catch (PLException e) { throw new VciBaseException(msgCodePrefix + "deployIdNotExist", new String[]{deployId}); } @@ -255,7 +255,7 @@ public String getFirstNodeName(String deployId) throws VciBaseException { WebUtil.alertNotNull(deployId,"é¨ç½²ä¸»é®"); try { ProcessTaskInfo firstProcessTask = getWorkService().getFirstProcessTask(deployId); ProcessTaskInfo firstProcessTask = getWFService().getFirstProcessTask(deployId); if(firstProcessTask!=null){ return firstProcessTask.taskName; } @@ -291,7 +291,7 @@ public String[] getAllProcessNodeNameByDeploy(String deploymentId) throws VciBaseException{ String[] allTaskNames = null; try { allTaskNames = getWorkService().getAllTaskNames(deploymentId); allTaskNames = getWFService().getAllTaskNames(deploymentId); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -305,7 +305,7 @@ @Override public String getJbpmDeploymentId(String processOid) throws VciBaseException{ WebUtil.alertNotNull(processOid,"æµç¨æ¨¡æ¿ä¸»é®"); return getWorkService().getDeploymentID(processOid); return null;//getWFService()().getDeploymentID(processOid); } /** @@ -318,7 +318,7 @@ public String getJbpmDeploymentIdByExecutionId(String executionId) throws VciBaseException{ WebUtil.alertNotNull(executionId,"æµç¨æ§è¡ä¸»é®"); try { return getWorkService().getDeploymentIdByExecutionId(executionId); return getWFService().getDeploymentIdByExecutionId(executionId); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -337,7 +337,7 @@ ProcessNodeVO pn = new ProcessNodeVO(); pn.setName(taskName); try { String[] nodePresideUsers = getWorkService().getCurCandidates(deploymentId, taskName, "", ""); String[] nodePresideUsers = getWFService().getCurCandidates(deploymentId, taskName, "", ""); if(nodePresideUsers!=null&& nodePresideUsers.length>0){ for(String preUsers : nodePresideUsers){ //å¹³å°åå¨çæ¹å¼æ¯ç¨æ·;è§è²;é¨é¨;èªå®ä¹.... @@ -399,7 +399,7 @@ return null; } //ä¸è½ä½¿ç¨workitem廿¥è¯¢ï¼å 为å¯è½ä»»å¡è¿æ²¡å° String users = getWorkService().getNextTaskAssigner(executionid, taskName); String users = getWFService().getNextTaskAssigner(executionid, taskName); List<ProcessUserVO> allProUser = new ArrayList<ProcessUserVO>(); if(StringUtils.isNotEmpty(users)){ String userIds = users.replace("user:", "");//ç°å¨åªæ¯æè®¾ç½®ç¨æ· @@ -602,16 +602,16 @@ @Override public String getVariablesInProcess(String executionId,String key) throws VciBaseException{ WebUtil.alertNotNull(executionId,"æµç¨æ§è¡ä¸»é®",key,"åæ°Key"); UserEntityInfo ueo = new UserEntityInfo(); SessionInfo si = WebUtil.getCurrentUserSessionInfo(); ueo.modules = "æµç¨"; ueo.userName = si.getUserId(); // UserEntityInfo ueo = new UserEntityInfo(); // SessionInfo si = WebUtil.getCurrentUserSessionInfo(); // ueo.modules = "æµç¨"; // ueo.userName = si.getUserId(); while(StringUtils.countMatches(executionId,".")>1){ //è¯´ææ¯åä»»å¡ï¼ç¨ç¶ä»»å¡è·åä¸ä¸åé executionId = executionId.substring(0,executionId.lastIndexOf(".")); } try { return getWorkService().getProcessVariable(executionId, key, ueo); return getWFService().getProcessVariable(executionId, key); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -718,11 +718,7 @@ WebUtil.alertNotNull(executionId,"æµç¨æ§è¡ä¸»é®"); List<ProcessHistoryVO> hisList = new ArrayList<ProcessHistoryVO>(); FlowApproveHistoryInfo[] historyActivitys = null; try { historyActivitys = getWorkService().getHistoryActivityByProInsIdbyPLM(executionId); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } //éè¦å»é¤æªå¤ççéå¤é¡¹ for (int i = 0; i < historyActivitys.length; i++) { FlowApproveHistoryInfo historyActivity = historyActivitys[i]; @@ -752,7 +748,11 @@ //妿endTime为空表示æ¯å¾ åçï¼ä½æ¯æå¡ç«¯çæ¥å£ä¸æä¸ªé®é¢æ¯ï¼ä¼æä¼ç¾æè åæµç¨ä¸å·²ç»å¤ççåæªå¤ççæ··åå¨ä¸èµ· //ç´æ¥ä»å¾ åä»»å¡é廿¥è¯¢ } /*try { historyActivitys = getWFService()().getHistoryActivityByProInsIdbyPLM(executionId); } catch (PLException e) { throw WebUtil.getVciBaseException(e); }*/ Map<String,String> conditionMap = new HashMap<String, String>(); conditionMap.put("businesstype", "5");//æ¬é¡¹ç®æ²¡æå®é çæä¹ conditionMap.put("lcstatus", "Executing"); @@ -806,7 +806,7 @@ throws VciBaseException{ WebUtil.alertNotNull(executionId,"æµç¨æ§è¡ä¸»é®",taskName,"æµç¨ä»»å¡åç§°"); try { byte[] processChart = getWorkService().getExecutionImageByExecutionId(executionId, taskName); byte[] processChart = null;//getWFService()().getExecutionImageByExecutionId(executionId, taskName); return processChart; } catch (Throwable e) { String msg = "æå¯è½è¿ä¸ªä»»å¡å ³èçæµç¨å·²ç»ç»ææè è¢«ç»æ¢ï¼ä¸è½åæ¥çå ¶æµç¨å¾äº"; @@ -820,7 +820,7 @@ throws VciBaseException{ WebUtil.alertNotNull(executionId,"æµç¨å®ä¾ä¸»é®"); try { byte[] processChart = getWorkService().getFlowImageByDeployID(executionId); byte[] processChart = getWFService().getFlowImageByDeployID(executionId); return processChart; } catch (PLException e) { throw WebUtil.getVciBaseException(e); @@ -836,7 +836,7 @@ @Override public String[] getAllOutComes(String taskOid) throws VciBaseException{ try { return getWorkService().getAllOutComes(taskOid); return getWFService().getAllOutComes(taskOid); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -854,7 +854,7 @@ WebUtil.alertNotNull(executionid,"æµç¨æ§è¡ä¸»é®",taskName,"ä»»å¡åç§°"); String deployId = getJbpmDeploymentIdByExecutionId(executionid); try { return getWorkService().getNextTaskNameByJbpmId(deployId, taskName, outCome); return getWFService().getNextTaskNameByJbpmId(deployId, taskName, outCome); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -865,11 +865,11 @@ * @return */ @Override public WorkflowServicePrx getWorkService() throws VciBaseException{ if(workService == null){ this.workService = platformClientUtil.getWorkflowService(); public WFServicePrx getWFService() throws VciBaseException{ if(wfService == null){ this.wfService = platformClientUtil.getWFService(); } return workService; return wfService; } @Override @@ -910,11 +910,11 @@ taskAss.endTime = VciDateUtil.getTime(endDate); taskAss.isTrue = isNowEnable?true:false; taskAss.fromUser =WebUtil.getCurrentUserSessionInfo().getUserId(); try { getWorkService().saveOrUpdateTasksAssigned(taskAss, WebUtil.getUserEntityInfo("æµç¨")); /*try { getWFService().saveOrUpdateTasksAssigned(taskAss, WebUtil.getUserEntityInfo("æµç¨")); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } }*/ } @@ -925,7 +925,7 @@ //å¹³å°ä¸æ¯æåç¨å¯ç¨ä»£çä¿¡æ¯..å¯ä»¥æ¥è¯¢åºæ¥åéæ°æ·»å ã try { UserEntityInfo uei = WebUtil.getUserEntityInfo( "æµç¨"); getWorkService().deleteTasksAssignedByUserName(new String[]{uei.userName}, uei); getWFService().deleteTasksAssignedByUserName(new String[]{uei.userName}); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -935,7 +935,7 @@ public TasksAssignedInfo getProxy() throws VciBaseException{ TasksAssignedInfo assign = null; try { assign = getWorkService().getTasksAssignedByUserName("", WebUtil.getUserEntityInfo( "æµç¨")); assign = getWFService().getTasksAssignedByUserName(""); } catch (PLException e) { throw WebUtil.getVciBaseException(e); } @@ -956,11 +956,11 @@ UserEntityInfo userEntityInfo = WebUtil.getUserEntityInfo("æµç¨"); String resetStatus = null; try{ resetStatus = getWorkService().getProcessVariable(executionId, WFVariablesKeyConstant.RESET_STATUS, userEntityInfo); resetStatus = getWFService().getProcessVariable(executionId, WFVariablesKeyConstant.RESET_STATUS); }catch (Throwable e){ logger.error("è·åæµç¨çåéåºé",e); } getWorkService().endProcessInstanceByplatform(executionId,userEntityInfo); //getWFService().endProcessInstanceByplatform(executionId,userEntityInfo); //平尿²¡æèªå¨å°ä¸å¡æ°æ®æ¢å¤å°ä¹åçç¶æ if(StringUtils.isNotBlank(resetStatus)){ resetLcStatusForBusinessData(dataGrid.getData(),resetStatus); @@ -1053,11 +1053,11 @@ @Override public byte[] getProcessXmlContent(String jbpmDeploymentId) throws VciBaseException { WebUtil.alertNotNull("æµç¨æ§è¡ä¸»é®ä¿¡æ¯",jbpmDeploymentId); try { return getWorkService().getProcessResource(jbpmDeploymentId,".xml"); } catch (PLException e) { /*try {*/ return null;//getWFService().getProcessResource(jbpmDeploymentId,".xml"); /*} catch (PLException e) { throw WebUtil.getVciBaseException(e); } }*/ } /** Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/WebProcessCommandServiceI.java
@@ -1,6 +1,6 @@ package com.vci.web.service; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.corba.wf.data.TasksAssignedInfo; import com.vci.starter.web.exception.VciBaseException; import com.vci.dto.ProcessStartConfigDTO; import com.vci.pagemodel.ProcessUserVO; Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/service/impl/WebProcessCommandServiceImpl.java
@@ -8,7 +8,7 @@ import com.vci.corba.omd.data.LinkObject; import com.vci.corba.workflow.data.FlowInstanceInfo; import com.vci.corba.workflow.data.MapTransfersInfo; import com.vci.corba.workflow.data.TasksAssignedInfo; import com.vci.corba.wf.data.TasksAssignedInfo; import com.vci.dto.ProcessStartConfigDTO; import com.vci.dto.ProcessTemplateVO; import com.vci.dto.VciFileObjectDTO; @@ -211,7 +211,7 @@ noticeInfo.setProcessTemplateVO(template); BusAnnotationUtil.callForAnnotation(FlowNotifyWeb.class, FlowNotifyBefore.class,noticeInfo); String processInstanceId = ""; try { /*try { if (config.isAutoSubmitFirst()) { processInstanceId = processDao.getWorkService().startProcessAndExecuteFirstNode(template.getOid(), flowInstanceInfo, @@ -226,7 +226,7 @@ objectPropertyValues); }else{ processInstanceId = processDao.getWorkService().startPocessByPLMv1( /** *//** * String processDefinitionKey, æµç¨æ¨¡æ¿ä¸»é® * FlowInstanceInfo flowInstanceInfo, æµç¨å®ä¾ * String[] objId, æ°æ®å¯¹è±¡id @@ -238,7 +238,7 @@ * MapTransfersInfo[] mapTransfersInfos, 移交Info * String[] objectProperty, ä¸å¡å±æ§ * String[][] objectPropertyValues ä¸å¡å±æ§å¼ */ *//* template.getOid(), flowInstanceInfo, objIds, @@ -254,7 +254,7 @@ } } catch (PLException e) { throw WebUtil.getVciBaseException(e); } }*/ if (StringUtils.isNotBlank(config.getStartStatus())) { try { lifeCycleService.transCboStatus(allCbo, config.getStartStatus()); @@ -505,7 +505,7 @@ throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); } callBefore(workitemList,outCome,note,currentTime); try { /*try { if (jbpmTaskIds.length == 1) { processDao.getWorkService().completeTaskByPlatformv1(jbpmTaskIds[0], outCome, nextTaskName, note, getUserEntityInfo(), nextTaskUsers, objectPropertyKeys, objectPropertyValues); } else { @@ -513,7 +513,7 @@ } } catch (PLException e) { throw WebUtil.getVciBaseException(e); } }*/ callAfter((String)workitemList.get(0).get("executionid"),null,workitemList,currentTime); } @@ -541,7 +541,7 @@ for (String taskOid : taskOidArray) { if (StringUtils.isNotBlank(taskOid)) { try { processDao.getWorkService().transmitTask(taskOid, "user:" + userIds, getUserEntityInfo()); processDao.getWFService().transmitTask(taskOid, "user:" + userIds); } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/PlatformClientUtil.java
@@ -17,7 +17,7 @@ import com.vci.corba.portal.PortalServicePrx; import com.vci.corba.query.ObjectQueryServicePrx; import com.vci.corba.volume.VolumeServicePrx; import com.vci.corba.workflow.WorkflowServicePrx; import com.vci.corba.wf.WFServicePrx; import org.springframework.stereotype.Component; /** @@ -94,8 +94,8 @@ * è·åæµç¨æå¡ * @return æå¡ç对象 */ public WorkflowServicePrx getWorkflowService(){ return WebServiceProvider.getWFService(); public WFServicePrx getWFService(){ return WebServiceProvider.getFlowService(); } /** Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebFlowController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,129 @@ package com.vci.web.controller; import com.vci.corba.wf.data.ProcessCategoryInfo; import com.vci.dto.OsEnumDTO; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.WebFlowServiceI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * æµç¨æå¡æ§å¶å¨ * @author ludc * @date 2025/1/14 21:37 */ @VciBusinessLog(modelName="æµç¨æå¡") @RestController @RequestMapping("/WebFlowController") public class WebFlowController { /** * æ³¨å ¥æµç¨æå¡ */ @Autowired private WebFlowServiceI webFlowServiceI; /** * æ¥å¿ */ private Logger logger = LoggerFactory.getLogger(getClass()); /** * æµç¨åç±»å ¨æ¥è¯¢ * @param parentId ç¶id * @return å表çå 容 */ @GetMapping( "/getProcessCategories") @VciBusinessLog(operateName = "æµç¨åç±»å ¨æ¥è¯¢") public BaseResult<List<ProcessCategoryInfo>> getProcessCategories(String parentId){ try { return BaseResult.dataList(webFlowServiceI.getProcessCategories(parentId)); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "æµç¨åç±»æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * æµç¨åç±»å页æ¥è¯¢ * @param baseQueryObject * @return å表çå 容 */ @GetMapping( "/getProcessCategoriesByPage") @VciBusinessLog(operateName = "æµç¨åç±»å页æ¥è¯¢") public BaseResult<DataGrid<ProcessCategoryInfo>> getProcessCategoriesByPage(BaseQueryObject baseQueryObject){ try { return BaseResult.dataList(webFlowServiceI.getProcessCategoriesByPage(baseQueryObject)); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "æµç¨åç±»å页æ¥è¯¢æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * æ·»å æµç¨åç±» * @param processCategoryInfo * @return */ @PostMapping( "/saveProcessCategory") @VciBusinessLog(operateName = "æ·»å æµç¨åç±»") public BaseResult saveProcessCategory(@RequestBody ProcessCategoryInfo processCategoryInfo) { try { return BaseResult.success(webFlowServiceI.saveProcessCategory(processCategoryInfo)); }catch (Exception e) { e.printStackTrace(); String exceptionMessage = "æ·»å æµç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * ä¿®æ¹æµç¨åç±» * @param processCategoryInfo * @return */ @PutMapping( "/updateProcessCategory") @VciBusinessLog(operateName = "ä¿®æ¹æµç¨åç±»") public BaseResult updateProcessCategory(@RequestBody ProcessCategoryInfo processCategoryInfo) { try { return webFlowServiceI.updateProcessCategory(processCategoryInfo) ? BaseResult.success("æµç¨åç±»ä¿®æ¹æåï¼"):BaseResult.fail("æµç¨å类修æ¹å¤±è´¥ï¼"); }catch (Exception e) { e.printStackTrace(); String exceptionMessage = "ä¿®æ¹æµç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * å 餿µç¨åç±» * @param id * @return */ @DeleteMapping( "/deleteProcessCategory") @VciBusinessLog(operateName = "å 餿µç¨åç±»") public BaseResult deleteProcessCategory(String id) { try { return webFlowServiceI.deleteProcessCategory(id) ? BaseResult.success("æµç¨åç±»å 餿åï¼"):BaseResult.fail("æµç¨åç±»å é¤å¤±è´¥ï¼"); }catch (Exception e) { e.printStackTrace(); String exceptionMessage = "å 餿µç¨åç±»æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/WebFlowServiceI.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,53 @@ package com.vci.web.service; import com.vci.corba.wf.data.ProcessCategoryInfo; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.DataGrid; import java.util.List; /** * æµç¨æå¡ * @author ludc * @date 2025/1/14 17:28 */ public interface WebFlowServiceI { /** * æµç¨åç±»å ¨æ¥è¯¢ * @param parentId * @return * @throws Exception */ List<ProcessCategoryInfo> getProcessCategories(String parentId) throws Exception; /** * æµç¨åç±»å页æ¥è¯¢ * @param baseQueryObject * @return */ DataGrid<ProcessCategoryInfo> getProcessCategoriesByPage(BaseQueryObject baseQueryObject) throws Exception; /** * ä¿åæµç¨åç±» * @param category * @return */ String saveProcessCategory(ProcessCategoryInfo category) throws Exception; /** * ä¿®æ¹æµç¨åç±» * @param category * @return */ boolean updateProcessCategory(ProcessCategoryInfo category) throws Exception; /** * å 餿µç¨åç±» * @param id * @return * @throws Exception */ boolean deleteProcessCategory(String id) throws Exception; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/SmFunctionQueryServicePlatformImpl.java
@@ -609,6 +609,7 @@ menuVO.setName(funcInfo.name); menuVO.getMeta().put("keepAlive",true); menuVO.setSort((int) funcInfo.seq); menuVO.setRemark(funcInfo.desc); if(this.checkChildObject(menuVO.getId()) == 0){ menuVO.setHasChildren(false); }else{ @@ -657,6 +658,7 @@ functionVO.setName(menu.name); functionVO.getMeta().put("keepAlive",true); functionVO.setSort((int) menu.seq); functionVO.setRemark(menu.desc); functionVO.setChildren(findChildFunctionVO(menu.id,map)); if(functionVO.getChildren().size() > 0){ functionVO.setHasChildren(true); @@ -685,6 +687,7 @@ menuVO.setName(funcObj.name); menuVO.getMeta().put("keepAlive",true); menuVO.setSort((int) funcObj.seq); menuVO.setRemark(funcObj.desc); findChildAuthFunctionVO(menuVO, isAll); functionVO.getChildren().add(menuVO); functionVO.setHasChildren(true); Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebFlowServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,129 @@ package com.vci.web.service.impl; import com.vci.corba.common.PLException; import com.vci.corba.wf.data.ProcessCategoryInfo; import com.vci.corba.wf.data.ProcessDefinitionInfo; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.util.Lcm.Func; import com.vci.starter.web.util.VciBaseUtil; import com.vci.web.service.WebFlowServiceI; import com.vci.web.util.PlatformClientUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; /** * æµç¨æå¡ * @author ludc * @date 2025/1/14 17:28 */ @Service public class WebFlowServiceImpl implements WebFlowServiceI { /** * å¹³å°è°ç¨å®¢æ·ç«¯ */ @Autowired private PlatformClientUtil platformClientUtil; /** * æµç¨åç±»å ¨æ¥è¯¢ * @param parentId * @return * @throws PLException */ @Override public List<ProcessCategoryInfo> getProcessCategories(String parentId) throws PLException { VciBaseUtil.alertNotNull(parentId,"æµç¨åç±»ç¶ä¸»é®"); ProcessCategoryInfo[] processCategories = platformClientUtil.getWFService().getProcessCategories(parentId); List<ProcessCategoryInfo> processCategoryInfoList = Arrays.asList(processCategories).stream().sorted((Comparator.comparing(o -> o.id))).collect(Collectors.toList()); return processCategoryInfoList; } /** * æµç¨åç±»å页æ¥è¯¢ * @param baseQueryObject * @return */ @Override public DataGrid<ProcessCategoryInfo> getProcessCategoriesByPage(BaseQueryObject baseQueryObject) throws PLException { String parentId = baseQueryObject.getConditionMap().get("parentId"); VciBaseUtil.alertNotNull(parentId,"æµç¨åç±»ç¶ä¸»é®"); int page = baseQueryObject.getPage(); int limit = baseQueryObject.getLimit(); ProcessCategoryInfo[] processCategories = platformClientUtil.getWFService().getProcessCategoriesByPage(parentId,limit,page); List<ProcessCategoryInfo> processCategoryInfoList = Arrays.asList(processCategories).stream().sorted((Comparator.comparing(o -> o.id))).collect(Collectors.toList()); DataGrid<ProcessCategoryInfo> dataGrid = new DataGrid<>(); dataGrid.setData(processCategoryInfoList); dataGrid.setPage(page); dataGrid.setLimit(limit); //dataGrid.setTotal(); return dataGrid; } /** * ä¿åæµç¨åç±» * @param category * @return è¿åä¸»é® */ @Override public String saveProcessCategory(ProcessCategoryInfo category) throws PLException { VciBaseUtil.alertNotNull(category,"æµç¨å类对象",category.name,"æµç¨åç±»åç§°"); this.checkNameExisted(category); if(Func.isBlank(category.parentId)){ category.parentId = "root"; } return platformClientUtil.getWFService().saveProcessCategory(category); } /** * ä¿®æ¹æµç¨åç±» * @param category * @return */ @Override public boolean updateProcessCategory(ProcessCategoryInfo category) throws PLException { VciBaseUtil.alertNotNull(category,"æµç¨å类对象",category.name,"æµç¨åç±»åç§°"); if(Func.isBlank(category.parentId)){ category.parentId = "root"; } this.checkNameExisted(category); return platformClientUtil.getWFService().updateProcessCategory(category); } /** * å 餿µç¨åç±» * @param id * @return * @throws Exception */ @Override public boolean deleteProcessCategory(String id) throws Exception { VciBaseUtil.alertNotNull(id,"å¾ å 餿µç¨åç±»ç主é®"); ProcessDefinitionInfo[] processDefinitions = platformClientUtil.getWFService().getProcessDefinitions(id); if(processDefinitions.length>0){ new VciBaseException( "åç±»ä¸ææ¨¡æ¿ï¼è¯·å å 餿¨¡çï¼"); } return platformClientUtil.getWFService().deleteProcessCategory(id); } /** * æ ¹æ®ä¸»é®ååç§°æ¥è¯¢æµç¨åç±»æ¯å¦åå¨ * @param category * @return */ private void checkNameExisted(ProcessCategoryInfo category) throws PLException{ //夿æ¯å¦åå¨ç¸ååç§°çæ¨¡æ¿åç±» if(platformClientUtil.getWFService().existProcessCategory(category.id, category.name)){ throw new VciBaseException("模æ¿åç±»çåç§°ä¸è½éå¤ï¼"); } } }