| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.framework.data.UserEntityInfo; |
| | | import com.vci.client.bof.ClientLinkObject; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.workflow.data.FlowInstanceInfo; |
| | | import com.vci.corba.workflow.data.MapTransfersInfo; |
| | | import com.vci.corba.workflow.data.TasksAssignedInfo; |
| | | import com.vci.file.dto.VciFileObjectDTO; |
| | | import com.vci.rmip.workflow.server.template.TasksAssigned; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.enumpck.DataSecretEnum; |
| | | 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.LangBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import plm.bs.bom.clientobject.ClientLinkObject; |
| | | |
| | | import java.util.*; |
| | | import java.util.Map.Entry; |
| | |
| | | Map<String, String> conditionMap = WebUtil.getOidQuery(config.getOids()); |
| | | conditionMap.put(WebBoServiceI.QUERY_FILTER_SECRET, "false"); |
| | | conditionMap.put(WebBoServiceI.QUERY_FILTER_DATARIGHT, "false"); |
| | | List<ClientBusinessObject> allCbo = boService.queryCBO(config.getBtmType().toLowerCase().trim(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbo = boService.queryCBO(config.getBtmType().toLowerCase().trim(), conditionMap); |
| | | if (allCbo == null || allCbo.size() == 0) { |
| | | throw new VciBaseException(msgCodePrefix + "dataNotNull", new String[]{}); |
| | | } |
| | |
| | | //查询数据是否已经发起了流程 |
| | | //查询input连接里是不是有流程实例,并且流程实例不等于终止 |
| | | conditionMap.put("oid", " in (select f_oid from platformlt_" + processDao.getTaskDataLink() + " where oid " + conditionMap.get("oid").replace("\\IN", " in ") + ")"); |
| | | List<ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | if (workInstanceCbos != null && workInstanceCbos.size() > 0) { |
| | | for (ClientBusinessObject workInstance : workInstanceCbos) { |
| | | for (com.vci.client.bof.ClientBusinessObject workInstance : workInstanceCbos) { |
| | | if (!workInstance.getLcStatus().equalsIgnoreCase("Obsoleted")) { |
| | | throw new VciBaseException(msgCodePrefix + "dataSubmitedToProcess", new String[]{workInstance.getName(), workInstance.getCreator()}); |
| | | } |
| | |
| | | String[][] objectPropertyValues = new String[allCbo.size()][4]; |
| | | String[] objIds = new String[allCbo.size()];//业务数据的组件 |
| | | for (int i = 0; i < allCbo.size(); i++) { |
| | | ClientBusinessObject cbo = allCbo.get(i); |
| | | com.vci.client.bof.ClientBusinessObject cbo = allCbo.get(i); |
| | | String[] values = new String[4]; |
| | | values[0] = cbo.getOid(); |
| | | values[1] = cbo.getRevisionid(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TasksAssigned getProxy() throws VciBaseException { |
| | | public TasksAssignedInfo getProxy() throws VciBaseException { |
| | | return processDao.getProxy(); |
| | | } |
| | | |
| | |
| | | //查询流程实例 |
| | | Map<String, String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("executionid", executionId.trim() + "*");//会有子流程 |
| | | List<ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | if (workInstanceCbos == null || workInstanceCbos.size() == 0) { |
| | | throw new VciBaseException(msgCodePrefix + "executionNotExist"); |
| | | } |
| | | //判断是否都是执行状态,前端的判断能被跳过 |
| | | List<ClientBusinessObject> needUpdateCbos = new ArrayList<ClientBusinessObject>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<>(); |
| | | List<String> workInstanceOids = new ArrayList<String>(); |
| | | for (ClientBusinessObject cbo : workInstanceCbos) { |
| | | for (com.vci.client.bof.ClientBusinessObject cbo : workInstanceCbos) { |
| | | if (!cbo.getLcStatus().equalsIgnoreCase("Executing")) { |
| | | throw new VciBaseException(msgCodePrefix + "processNotExecutionStatus"); |
| | | } |
| | |
| | | //找相关的流程任务对象,并且是正在执行中的 |
| | | conditionMap.put("executionid", QueryOptionConstant.IN + "(" + WebUtil.toInSql(workInstanceOids.toArray(new String[0])) + ")"); |
| | | conditionMap.put("lcstatus", "Executing"); |
| | | List<ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); |
| | | if (workItemCbos != null && workItemCbos.size() > 0) { |
| | | needUpdateCbos.addAll(workItemCbos); |
| | | } |
| | |
| | | //查询流程实例 |
| | | Map<String, String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("executionid", executionId.trim() + "*");//会有子流程 |
| | | List<ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> workInstanceCbos = boService.queryCBO(processDao.getWorkIntanceBtmType(), conditionMap); |
| | | if (workInstanceCbos == null || workInstanceCbos.size() == 0) { |
| | | throw new VciBaseException(msgCodePrefix + "executionNotExist"); |
| | | } |
| | | //判断是否都是执行状态,前端的判断能被跳过 |
| | | List<ClientBusinessObject> needUpdateCbos = new ArrayList<ClientBusinessObject>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<>(); |
| | | List<String> workInstanceOids = new ArrayList<String>(); |
| | | for (ClientBusinessObject cbo : workInstanceCbos) { |
| | | for (com.vci.client.bof.ClientBusinessObject cbo : workInstanceCbos) { |
| | | if (!cbo.getLcStatus().equalsIgnoreCase("Suspended")) { |
| | | throw new VciBaseException(msgCodePrefix + "processNotSuspendedStatus"); |
| | | } |
| | |
| | | //找相关的流程任务对象,并且是正在执行中的 |
| | | conditionMap.put("executionid", QueryOptionConstant.IN + "(" + WebUtil.toInSql(workInstanceOids.toArray(new String[0])) + ")"); |
| | | conditionMap.put("lcstatus", "Suspended"); |
| | | List<ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> workItemCbos = boService.queryCBO(processDao.getWorkitemBtmType(), conditionMap); |
| | | if (workItemCbos != null && workItemCbos.size() > 0) { |
| | | needUpdateCbos.addAll(workItemCbos); |
| | | } |
| | |
| | | } |
| | | } |
| | | List<String> causeList = Arrays.asList(new String[]{primaryKeyName}); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btmType, conditionMap, null, causeList); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btmType, conditionMap, null, causeList); |
| | | if (cbos == null || cbos.size() == 0) { |
| | | throw new VciBaseException("发起流程的业务数据全部不符合要求"); |
| | | } |
| | |
| | | for (String oid : oidArray) { |
| | | oidSet.add(oid); |
| | | } |
| | | for (ClientBusinessObject cbo : cbos) { |
| | | for (com.vci.client.bof.ClientBusinessObject cbo : cbos) { |
| | | if (oidSet.contains(cbo.getAttributeValue(primaryKeyName))) { |
| | | oidSet.remove(cbo.getAttributeValue(primaryKeyName)); |
| | | } |