| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.file.pagemodel.VciFileObjectVO; |
| | | import com.vci.frameworkcore.lcstatuspck.FrameworkDataLCStatus; |
| | | import com.vci.frameworkcore.lcstatuspck.ReleaseDataLCStatus; |
| | | import com.vci.omd.constants.SystemAttribute; |
| | | import com.vci.starter.revision.bo.TreeWrapperOptions; |
| | | import com.vci.starter.web.annotation.bus.VciChangeDataAfter; |
| | | import com.vci.starter.web.annotation.bus.VciChangeDataBefore; |
| | |
| | | com.vci.client.bof.ClientBusinessObject afterCBO = null; |
| | | try { |
| | | // BusinessObject resultBO = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false); |
| | | // com.vci.corba.omd.data.BusinessObject resultBO = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false); |
| | | com.vci.corba.omd.data.BusinessObject resultBO = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false); |
| | | afterCBO = new com.vci.client.bof.ClientBusinessObject(); |
| | | afterCBO.setBusinessObject(resultBO); |
| | | result.setObj(boService.cbo2Map(afterCBO)); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ |
| | |
| | | try { |
| | | // platformClientUtil.getBOFactoryService().deleteBusinessObject(afterCBO.getBusinessObject(),1); |
| | | ServiceProvider.getBOFService().deleteBusinessObject(afterCBO.getBusinessObject(),1); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | |
| | | Map<String,String> baseDataMap = formDataDTO2MapLow(formDataDTO); |
| | | Map<String,String> allDataMapLow = new HashMap<>(); |
| | | allDataMapLow.putAll(dataLow); |
| | | allDataMapLow.putAll(baseDataMap); |
| | | // allDataMapLow.putAll(baseDataMap); |
| | | //判断必输项 |
| | | BaseResult result = checkRequired(formDefineVO,null,allDataMapLow); |
| | | if(!result.isSuccess()){ |
| | |
| | | cbo.setBusinessObject(bo); |
| | | afterCBOs.add(cbo); |
| | | }); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(releasedFileOids)){ |
| | |
| | | // platformClientUtil.getBOFactoryService().updateBusinessObject(new BusinessObjectHolder(resultCbo.getObj().getBusinessObject())); |
| | | ServiceProvider.getBOFService().updateBusinessObject(resultCbo.getObj().getBusinessObject()); |
| | | result.setObj(boService.cbo2Map(resultCbo.getObj())); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ |
| | |
| | | com.vci.client.bof.ClientBusinessObject afterCbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | afterCbo.setBusinessObject(bo); |
| | | result.setObj(boService.cbo2Map(afterCbo)); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formDataDTO.getReleaseFileOids())){ |
| | |
| | | } |
| | | VciBaseUtil.switchCollectionForOracleIn(finalCbo).stream().forEach(cbos->{ |
| | | try { |
| | | platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1); |
| | | } catch (VCIError vciError) { |
| | | // platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new BusinessObject[0]),1); |
| | | ServiceProvider.getBOFService().batchDeleteBusinessObject(cbos.stream().map(s->s.getBusinessObject()).collect(Collectors.toList()).toArray(new com.vci.corba.omd.data.BusinessObject[0]),1); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | }); |
| | | System.out.println("zheshi shazi "); |
| | | return BaseResult.success(); |
| | | } |
| | | |
| | |
| | | try { |
| | | // fromCbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(fromOid,fromBtmName)); |
| | | fromCbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(fromOid,fromBtmName)); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | String finalPrefix = prefix; |
| | |
| | | try { |
| | | // platformClientUtil.getBOFactoryService().createBusinessObjectWithLink(bosHolder,loHolder); |
| | | ServiceProvider.getBOFService().createBusinessObjectWithLink(bos,clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){ |
| | |
| | | // platformClientUtil.getBOFactoryService().deleteLinkObject(clo.getLinkObject()); |
| | | ServiceProvider.getBOFService().deleteBusinessObject(toCbo.getBusinessObject(),1); |
| | | ServiceProvider.getBOFService().deleteLinkObject(clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | |
| | | com.vci.corba.omd.data.LinkObject linkObject = ServiceProvider.getBOFService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType()); |
| | | clo = new com.vci.client.bof.ClientLinkObject(); |
| | | clo.setLinkObject(linkObject); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | }else{ |
| | |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | String copyfromversion = baseDataMap.get("copyfromversion"); |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | | List<String> attributeList = btmTypeVO.getAttributes().stream().map(attribute -> attribute.getId()).collect(Collectors.toList()); |
| | | if(editFlag || newRevision || newVersion){ |
| | | try { |
| | | // cbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); |
| | | cbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("使用主键在系统中没有查询到数据",new String[]{oid},vciError); |
| | | } |
| | | if(btmTypeVO.isRevisionFlag() && newRevision){ |
| | |
| | | LifeCycle lifeCycleVO = null; |
| | | try { |
| | | lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId()); |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ |
| | |
| | | LifeCycle lifeCycleVO = null; |
| | | try { |
| | | lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId()); |
| | | } catch (VCIError e) { |
| | | } catch (PLException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ |
| | |
| | | cbo.setIsFirstV(true); |
| | | } |
| | | } |
| | | // Iterator<Map.Entry<String, String>> iterator = baseDataMap.entrySet().iterator(); |
| | | // while(iterator.hasNext()){ |
| | | // Map.Entry<String, String> next = iterator.next(); |
| | | // if(!attributeList.contains(next.getKey())){ |
| | | // iterator.remove(); |
| | | // } |
| | | // } |
| | | setValueToCbo(dataLowMap,baseDataMap,cbo,editFlag); |
| | | // cbo.setName(dataLowMap.get("name")); |
| | | return cbo; |
| | | } |
| | | |
| | |
| | | //平台不能传递这个 |
| | | }else{ |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck(key, value, !editFlag); |
| | | } catch (VCIError vciError) { |
| | | // if(!SystemAttribute.bosysAttList().contains(key)){ |
| | | cbo.setAttributeValueWithNoCheck(key, value, !editFlag); |
| | | // } |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError); |
| | | } |
| | | } |
| | |
| | | if(editFlag) { |
| | | //编辑的时候可以都设置 |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck(key, value, !editFlag); |
| | | } catch (VCIError vciError) { |
| | | // if(!SystemAttribute.bosysAttList().contains(key)){ |
| | | cbo.setAttributeValueWithNoCheck(key, value, !editFlag); |
| | | // } |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError); |
| | | } |
| | | }else{ |
| | | //只需要处理id,name,description,密级即可,其余的都已经被设置了 |
| | | if(basicFields.contains(key) &&StringUtils.isNotBlank(value)){ |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck(key, value, true); |
| | | } catch (VCIError vciError) { |
| | | // if(!SystemAttribute.bosysAttList().contains(key)){ |
| | | cbo.setAttributeValueWithNoCheck(key, value, true); |
| | | // } |
| | | } catch (PLException vciError) { |
| | | throw new VciBaseException("{0}的值不符合要求,当前是{1}", new String[]{key, value}, vciError); |
| | | } |
| | | } |
| | |
| | | try { |
| | | // platformClientUtil.getBOFactoryService().updateLinkObject(loHolder); |
| | | ServiceProvider.getBOFService().updateLinkObject(clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | //保存to端或者from端 |
| | |
| | | try{ |
| | | // platformClientUtil.getBOFactoryService().updateBusinessObject(boHolder); |
| | | ServiceProvider.getBOFService().updateBusinessObject(toCbo.getBusinessObject()); |
| | | } catch (VCIError vciError) { |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | if(!CollectionUtils.isEmpty(formLinkDataDTO.getReleaseFileOids())){ |