| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.mxgraph.model.mxCell; |
| | | import com.mxgraph.view.mxGraph; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.wf.data.ProcessCategoryInfo; |
| | | import com.vci.corba.wf.data.ProcessDefinitionInfo; |
| | | import com.vci.pagemodel.DeployProcessVO; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | 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.Lcm.Func; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.dao.WebProcessDaoI; |
| | | import com.vci.web.service.WebFlowServiceI; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.swing.*; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Autowired |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | @Autowired |
| | | private WebProcessDaoI webProcessDaoI; |
| | | |
| | | /** |
| | | * 流程分类全查询 |
| | |
| | | if(Func.isBlank(category.parentId)){ |
| | | category.parentId = "root"; |
| | | } |
| | | |
| | | long time = new Date().getTime(); |
| | | String userId = WebUtil.getCurrentUserId(); |
| | | category.createTime = time; |
| | | category.modifyTime = time; |
| | | category.creator = userId; |
| | | category.modifer = userId; |
| | | return platformClientUtil.getWFService().saveProcessCategory(category); |
| | | } |
| | | |
| | |
| | | category.parentId = "root"; |
| | | } |
| | | this.checkNameExisted(category); |
| | | category.modifyTime = new Date().getTime(); |
| | | category.modifer = WebUtil.getCurrentUserId(); |
| | | return platformClientUtil.getWFService().updateProcessCategory(category); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 部署流程 |
| | | * @param deployProcessVO |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public BaseResult deployProcess(DeployProcessVO deployProcessVO) throws Exception { |
| | | VciBaseUtil.alertNotNull( |
| | | deployProcessVO,"流程部署对象", |
| | | deployProcessVO.getProcessCategoryId(),"流程分类", |
| | | deployProcessVO.getXmlContext(),"流程模板内容" |
| | | ); |
| | | //基础校验 |
| | | /*if(!checkTask()){ |
| | | BaseResult.fail("流程任务不能重名,请确认"); |
| | | } |
| | | if(!checkJoin()){ |
| | | BaseResult.fail("合并节点不能重名,请确认"); |
| | | } |
| | | if(!checkFork()){ |
| | | BaseResult.fail("分支节点不能重名,请确认"); |
| | | } |
| | | if(!checkDecision()){ |
| | | BaseResult.fail("判断节点不能重名,请确认"); |
| | | } |
| | | if(!checkEdge()){ |
| | | BaseResult.fail("路由名称和节点名称重名,请确认"); |
| | | } |
| | | */ |
| | | |
| | | boolean res = platformClientUtil.getWFService().deployProcess( |
| | | null, |
| | | deployProcessVO.getXmlContext(), |
| | | null, |
| | | deployProcessVO.getProcessCategoryId(), |
| | | deployProcessVO.getTaskInfos() |
| | | ); |
| | | return res ? BaseResult.success("流程部署成功!"):BaseResult.success("流程部署失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 根据主键和名称查询流程分类是否存在 |
| | | * @param category |
| | | * @return |