1、主要完成对一些基础类的替换,将以前老的bean对象换成新平台的bean对象。
2、对树的查询接口进行修改测试联调。
3、对列表数据的查询接口进行修改测试联调。
4、对通用保存接口进行编写测试。
| | |
| | | if(!CollectionUtils.isEmpty(deptVOs)){ |
| | | deptVOList.addAll(deptVOs); |
| | | String sql = "select pluseruid,pldeptuid from pluserdept where pluseruid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; |
| | | List<ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | String userOid = cbo.getAttributeValue("pluseruid"); |
| | |
| | | if(!CollectionUtils.isEmpty(functionVOS)){ |
| | | functionVOList.addAll(functionVOS); |
| | | String sql = "select plfuncoid,plroleoid from plroleright where plroleoid in (" + WebUtil.toInSql(roleOids.toArray(new String[0])) + ")"; |
| | | List<ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | String roleOid = cbo.getAttributeValue("plroleoid"); |
| | |
| | | if(!CollectionUtils.isEmpty(roleVOS)){ |
| | | roleVOList.addAll(roleVOS); |
| | | String sql = "select pluseruid,plroleuid from pluserrole where pluseruid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; |
| | | List<ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | String userOid = cbo.getAttributeValue("pluseruid"); |
| | |
| | | if(!CollectionUtils.isEmpty(roleVOS)){ |
| | | roleVOList.addAll(roleVOS); |
| | | String sql = "select plroleoid,plfuncoid from plroleright where plfuncoid in (" + WebUtil.toInSql(userOids.toArray(new String[0])) + ")"; |
| | | List<ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, null); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | String funcOid = cbo.getAttributeValue("plfuncoid"); |
| | |
| | | package com.vci.frameworkcore.compatibility.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.omd.data.AttributeValue; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.frameworkcore.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.frameworkcore.pagemodel.SmUserVO; |
| | |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.CachePut; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import static com.vci.frameworkcore.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; |
| | | import static com.vci.web.constant.CacheNameConstant.VCI_OBJECT_SERVICE; |
| | | import static com.vci.web.constant.CacheNameConstant.VCI_USER; |
| | | import static com.vci.web.util.WebUtil.arryAndSqlToClientBusinessObject; |
| | | |
| | | /** |
| | | * 用户的查询相关的服务,可以兼容老平台和老的pdm |
| | |
| | | @Autowired(required = false) |
| | | @Lazy |
| | | private SmUserQueryServiceI self; |
| | | |
| | | |
| | | /** |
| | | * 根据用户名获取用户的对象,不区分大小写 |
| | | * @param userId 用户名 |
| | |
| | | + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + |
| | | " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + |
| | | queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); |
| | | List<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | ClientBusinessObject cbo = dataList.get(0); |
| | | return cbo2VO(cbo); |
| | | try{ |
| | | String[][] sqlQueryResult = ServiceProvider.getBOFService().getSqlQueryResult(sql + fromSql, null); |
| | | if(sqlQueryResult.length>0){ |
| | | com.vci.client.bof.ClientBusinessObject cbo = arryAndSqlToClientBusinessObject(queryWrapper.getSelectFieldSql(),sqlQueryResult[0]); |
| | | return cbo2VO(cbo); |
| | | } |
| | | }catch (Exception e){ |
| | | throw new VciBaseException("数据解析错误:" + e ); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + |
| | | " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + |
| | | queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); |
| | | List<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | dataList.stream().forEach(cbo->{ |
| | | userVOList.add(cbo2VO(cbo)); |
| | |
| | | + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + |
| | | " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + (QUERY_FIELD_ROLE.equalsIgnoreCase(queryField)?roleSql:"") + |
| | | queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); |
| | | List<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | dataList.stream().forEach(cbo->{ |
| | | userVOList.add(cbo2VO(cbo)); |
| | |
| | | * @param cbo 业务数据 |
| | | * @return 显示对象 |
| | | */ |
| | | private SmUserVO cbo2VO(ClientBusinessObject cbo){ |
| | | private SmUserVO cbo2VO(com.vci.client.bof.ClientBusinessObject cbo){ |
| | | SmUserDO userDO = new SmUserDO(); |
| | | SmUserVO userVO = new SmUserVO(); |
| | | WebUtil.copyValueToObjectFromCbos(cbo,userDO); |
| | |
| | | } |
| | | } |
| | | } |
| | | List<ClientBusinessObject> dataList = boService.queryBySql((isPage?("select " + pageSelectList.stream().collect(Collectors.joining(","))+ " from (select A.*,rownum RN from ( "):"") + sql + fromSql + (isPage?pageSubfix:""), null); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql((isPage?("select " + pageSelectList.stream().collect(Collectors.joining(","))+ " from (select A.*,rownum RN from ( "):"") + sql + fromSql + (isPage?pageSubfix:""), null); |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | dataList.stream().forEach(cbo->{ |
| | | userVOList.add(cbo2VO(cbo)); |
| | |
| | | + " left join pluserdept up on " + queryWrapper.getTableNick() + ".pluid = up.pluseruid left join pldept pkDepartment on up.pldeptuid = pkDepartment.pluid " + |
| | | " left join PLUSERPASSWORDSTRATEGY pkUserPassword on " +queryWrapper.getTableNick() + ".pluid = pkUserPassword.pluseruid " + |
| | | queryWrapper.getLinkTableSql() + (StringUtils.isNotBlank(queryWrapper.getWhereSql())?(" where " + queryWrapper.getWhereSql()):""); |
| | | List<ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataList = boService.queryBySql(sql + fromSql, null); |
| | | List<Tree> treeList = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | dataList.stream().forEach(cbo->{ |
| | |
| | | String sql = " select plpassword from pluser where pluid = :userOid"; |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("userOid",userOid.trim()); |
| | | List<ClientBusinessObject> clientBusinessObjectList = boService.queryBySql(sql, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> clientBusinessObjectList = boService.queryBySql(sql, conditionMap); |
| | | if(CollectionUtils.isEmpty(clientBusinessObjectList)){ |
| | | return false; |
| | | } |
| | |
| | | public SmPasswordStrategyVO getPasswordStrategyVOByOid(String oid){ |
| | | VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null, SmPasswordStrategyDO.class); |
| | | queryWrapperForDO.eq("oid",oid.trim()); |
| | | List<ClientBusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + |
| | | List<com.vci.client.bof.ClientBusinessObject> cboList = boService.queryBySql(queryWrapperForDO.getSelectFieldSql() + " from plpasswordstrategy " + |
| | | queryWrapperForDO.getTableNick() + queryWrapperForDO.getLinkTableSql() + |
| | | (StringUtils.isBlank(queryWrapperForDO.getWhereSql()) ? "" : (" where " + queryWrapperForDO.getWhereSql())), null); |
| | | if(!CollectionUtils.isEmpty(cboList)){ |
| | |
| | | * @return 表单的定义 |
| | | */ |
| | | @GetMapping("/getFormDefineById") |
| | | @VciUnCheckRight |
| | | public UIFormDefineVO getFormDefineById(String btmType,String id){ |
| | | return uiService.getFormById(btmType,id); |
| | | } |
| | |
| | | * @return 表单的数据 |
| | | */ |
| | | @PostMapping("/dataFormQuery") |
| | | @VciUnCheckRight |
| | | @VciBusinessLog(operateName = "表单的查询",description = "${param.btmname}里的${param.formDefineId}") |
| | | public BaseResult<UIFormDataVO> getDataForForm(UIFormQuery formQuery){ |
| | | return BaseResult.success(uiDataService.getDataForForm(formQuery)); |
| | |
| | | * @return 执行的结果 |
| | | */ |
| | | @PostMapping("/addSave") |
| | | @VciUnCheckRight |
| | | @VciBusinessLog(operateName = "添加数据",description = "${param.btmname}") |
| | | public BaseResult<Map<String,Object>> addSave(@RequestBody FormDataDTO formDataDTO){ |
| | | return uiDataService.addSave(formDataDTO); |
| | |
| | | VciBaseUtil.alertNotNull(ruleOid,"规则分类",serialAccord,"流水依据"); |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("pkcoderule",ruleOid); |
| | | List<ClientBusinessObject> queryList = this.boService.queryCBO("codebreakcode", conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> queryList = this.boService.queryCBO("codebreakcode", conditionMap); |
| | | if (CollectionUtils.isEmpty(queryList)){ |
| | | throw new VciBaseException("规则分类[{0}]在系统中不存在",new String[]{ruleOid}); |
| | | } |
| | | conditionMap.clear(); |
| | | String oid = ""; |
| | | for (ClientBusinessObject object : queryList) { |
| | | for (com.vci.client.bof.ClientBusinessObject object : queryList) { |
| | | oid += object.getOid() + ","; |
| | | } |
| | | oid = "(" + oid.substring(0,oid.length() -1) + ")"; |
| | |
| | | conditionMap.put("ruleOid",ruleOid); |
| | | String sql = " select a.oid as oid from " + BtmProvider.getInstance().getBTMTableName(BtmIdConstant.OS_CODE_ENUM_BTM_TYPE) + " a left join " |
| | | + BtmProvider.getInstance().getBTMTableName(BtmIdConstant.OS_CODE_RULE_ELEMENT_BTM_TYPE) + " b on a.pkCodeRuleElement = b.oid where b.pkCodeRule = :ruleOid"; |
| | | List<ClientBusinessObject> enumCbos = boService.queryBySql(sql, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> enumCbos = boService.queryBySql(sql, conditionMap); |
| | | if(CollectionUtils.isEmpty(enumCbos)){ |
| | | return new ArrayList<OsCodeEnumDO>(); |
| | | } |
| | | List<String> oidList = new ArrayList<String>(); |
| | | for(ClientBusinessObject cbo : enumCbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : enumCbos){ |
| | | oidList.add(cbo.getOid()); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public long batchUpdateLcStatus(Collection<String> oids, String lcStatus) { |
| | | List<ClientBusinessObject> cbos = boService.selectCBOByOidCollection(oids, "oscoderule"); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(oids, "oscoderule"); |
| | | if(CollectionUtils.isEmpty(cbos)){ |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public int updateLcStatus(String oid, String lcStatus) { |
| | | ClientBusinessObject cbo = boService.selectCBOByOid(oid, "oscoderule"); |
| | | com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(oid, "oscoderule"); |
| | | if(cbo == null || StringUtils.isBlank(cbo.getOid())){ |
| | | return 0; |
| | | } |
| | |
| | | public String selectSecret(String ownbizOid, String ownbizBtm) { |
| | | if(StringUtils.isNotBlank(ownbizOid) && StringUtils.isNotBlank(ownbizBtm)){ |
| | | //校验数据的密级 |
| | | ClientBusinessObject cbo = boService.selectCBOByOid(ownbizOid, ownbizBtm); |
| | | com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(ownbizOid, ownbizBtm); |
| | | if(cbo !=null && StringUtils.isNotBlank(cbo.getOid())){ |
| | | //有可能是先上传文件,所以我们这个不判断是否存在 |
| | | return cbo.getAttributeValue("secretgrade"); |
| | |
| | | }else { |
| | | caluesList.add("*"); |
| | | } |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btm, conditionMap,null,caluesList); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, conditionMap,null,caluesList); |
| | | data.addAll(boService.cbos2Map(cbos)); |
| | | } |
| | | } |
| | |
| | | PageHelper pageHelper = new PageHelper(-1); |
| | | pageHelper.setSort("endTime"); |
| | | pageHelper.setOrder(pageHelper.asc); |
| | | List<ClientBusinessObject> undoTaskCbos= boService.queryCBO(workitemBtmType, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> undoTaskCbos= boService.queryCBO(workitemBtmType, conditionMap); |
| | | if(undoTaskCbos != null && undoTaskCbos.size() > 0) { |
| | | for(ClientBusinessObject cbo : undoTaskCbos) { |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : undoTaskCbos) { |
| | | ProcessHistoryVO his = new ProcessHistoryVO(); |
| | | String taskName = cbo.getName(); |
| | | if(StringUtils.contains(taskName,"-")) { |
| | | taskName = taskName.substring(taskName.lastIndexOf("-") + 1); |
| | | } |
| | | his.setTaskName(taskName); |
| | | his.setCreateTime(cbo.getCreateTime()); |
| | | his.setCreateTime(String.valueOf(cbo.getCreateTime())); |
| | | String userIdString = cbo.getAttributeValue("principal"); |
| | | if(StringUtils.contains(userIdString,":")) { |
| | | userIdString = userIdString.substring(userIdString.indexOf(":") + 1); |
| | |
| | | oidList.add(oid); |
| | | } |
| | | //转换成500长度的 |
| | | List<ClientBusinessObject> cboList = new ArrayList<ClientBusinessObject>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> cboList = new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | if(oidList.size()>500){ |
| | | List<List<String>> oidListForIn = WebUtil.switchListForOracleIn(oidList); |
| | | for(List<String> oidListForInRecord : oidListForIn){ |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oidListForInRecord.toArray(new String[0])) + ")" ); |
| | | List<ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); |
| | | cboList.addAll(tempCbos); |
| | | } |
| | | }else{ |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oidList.toArray(new String[0])) + ")" ); |
| | | List<ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(btmType,conditionMap); |
| | | cboList.addAll(tempCbos); |
| | | } |
| | | //找到这个业务类型的起始状态 |
| | |
| | | * @param data 数据的映射 |
| | | * @param obj 对象 |
| | | */ |
| | | void convert(ClientBusinessObject data, T obj); |
| | | void convert(com.vci.client.bof.ClientBusinessObject data, T obj); |
| | | } |
| | |
| | | |
| | | String sql = "SELECT T_OID,T_BTWNAME FROM PLATFORMLT_INPUT WHERE F_OID = '" + wfOid + "'"; |
| | | ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation(); |
| | | List<ClientBusinessObject> queryResult = boService.queryBySql(sql, new HashMap<>()); |
| | | List<com.vci.client.bof.ClientBusinessObject> queryResult = boService.queryBySql(sql, new HashMap<>()); |
| | | if (queryResult.size() == 0) { |
| | | logger.info("没有找到业务数据"); |
| | | return; |
| | |
| | | " where wp.OID = '" + oid + "'"; |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("oid", oid); |
| | | List<ClientBusinessObject> codeResult = boService.queryCBO(btmName, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> codeResult = boService.queryCBO(btmName, conditionMap); |
| | | conditionMap.clear(); |
| | | conditionMap.put("createCodeOid", codeResult.get(0).getAttributeValue("oid")); |
| | | List<ClientBusinessObject> allCodeList = boService.queryCBO("codeAllCode", conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> allCodeList = boService.queryCBO("codeAllCode", conditionMap); |
| | | if (allCodeList.size() == 0) { |
| | | logger.info("没有找到编码"); |
| | | return; |
| | | } |
| | | for (ClientBusinessObject codeAllCode : allCodeList) { |
| | | for (com.vci.client.bof.ClientBusinessObject codeAllCode : allCodeList) { |
| | | codeAllCode.setLcStatus("Editing"); |
| | | codeAllCode.setAttributeValue("lcstatus", "Editing"); |
| | | } |
| | |
| | | package com.vci.web.pageModel; |
| | | |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import plm.bs.bom.clientobject.ClientLinkObject; |
| | | |
| | | import com.vci.client.bof.ClientBusinessObject; |
| | | import com.vci.client.bof.ClientLinkObject; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | |
| | | if( this.createCbos == null){ |
| | | this.createCbos = new HashSet<ClientBusinessObject>(); |
| | | } |
| | | return this.createCbos.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); |
| | | return this.createCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); |
| | | } |
| | | |
| | | public ClientLinkObject[] getCreateCloArray(){ |
| | | if( this.createClos == null){ |
| | | this.createClos = new HashSet<ClientLinkObject>(); |
| | | } |
| | | return this.createClos.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); |
| | | return this.createClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); |
| | | } |
| | | |
| | | |
| | |
| | | if( this.updateCbos == null){ |
| | | this.updateCbos = new HashSet<ClientBusinessObject>(); |
| | | } |
| | | return this.updateCbos.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); |
| | | return this.updateCbos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCboArray); |
| | | } |
| | | |
| | | public ClientLinkObject[] getUpdateCloArray(){ |
| | | if( this.updateClos == null){ |
| | | this.updateClos = new HashSet<ClientLinkObject>(); |
| | | } |
| | | return this.updateClos.stream().sorted(((o1, o2) -> o1.getCreateTime().compareTo(o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); |
| | | return this.updateClos.stream().sorted(((o1, o2) -> Math.toIntExact(o1.getCreateTime() - o2.getCreateTime()))).collect(Collectors.toList()).toArray(nullCloArray); |
| | | } |
| | | |
| | | public ClientBusinessObject[] getDeleteCboArray(){ |
| | |
| | | String sql = (StringUtils.isNotBlank(pageSql)?" select oid,ts,creator,createTime,modifier,modifyTime,name,label,description from (select A.* , rownum RN from (":"") |
| | | + baseSql+ pageSql ; |
| | | WebBoServiceI boService = ApplicationContextProvider.getApplicationContext().getBean(WebBoServiceI.class); |
| | | List<ClientBusinessObject> dataMap = boService.queryBySql(sql, null); |
| | | List<com.vci.client.bof.ClientBusinessObject> dataMap = boService.queryBySql(sql, null); |
| | | DataGrid<T> dataGrid = new DataGrid<>(); |
| | | if(!CollectionUtils.isEmpty(dataMap)){ |
| | | List<T> dataList = new ArrayList<>(); |
| | |
| | | package com.vci.web.service; |
| | | |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | |
| | | * @param targetStatus 目标的生命周期状态,不区分大小 |
| | | * @throws VciBaseException 如果目标生命周期和当前生命周期状态没有连接线时抛出异常 |
| | | */ |
| | | void transStatus(BusinessObject bo, String targetStatus) throws VciBaseException; |
| | | void transStatus(com.vci.corba.omd.data.BusinessObject bo, String targetStatus) throws VciBaseException; |
| | | |
| | | /** |
| | | * 批量跃迁生命周期状态,这些数据中的当前状态必须都是一样。或者是当前状态都可以连接到目标状态 |
| | |
| | | * @param targetStatus 目标状态,不区分大小写 |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | void transStatus(List<BusinessObject> boList, String targetStatus) throws VciBaseException; |
| | | void transStatus(List<com.vci.corba.omd.data.BusinessObject> boList, String targetStatus) throws VciBaseException; |
| | | |
| | | /** |
| | | * 批量跃迁生命周期状态,这些数据中的当前状态必须都是一样,或者是当前状态都可以连接到目标状态 |
| | |
| | | * @param targetStatus 目标状态,不区分大小写 |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | void transStatus(BusinessObject[] bos, String targetStatus) throws VciBaseException; |
| | | void transStatus(com.vci.corba.omd.data.BusinessObject[] bos, String targetStatus) throws VciBaseException; |
| | | |
| | | /** |
| | | * 批量跃迁生命周期状态,这些数据中的当前状态必须都是一样,或者是当前状态都可以连接到目标状态 |
| | |
| | | * @param targetStatus 目标状态,不区分大小写 |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | void transCboStatus(List<ClientBusinessObject> cboList, String targetStatus) throws VciBaseException; |
| | | void transCboStatus(List<com.vci.client.bof.ClientBusinessObject> cboList, String targetStatus) throws VciBaseException; |
| | | |
| | | /** |
| | | * 通过编号获取生命周期状态对象, |
| | |
| | | * @param lifeCycles 数据对象 |
| | | * @return 显示对象 |
| | | */ |
| | | List<OsLifeCycleVO> lifeCycleDO2VOs(Collection<LifeCyle> lifeCycles); |
| | | List<OsLifeCycleVO> lifeCycleDO2VOs(Collection<LifeCycle> lifeCycles); |
| | | |
| | | /** |
| | | * 生命周期的数据对象转换为显示对象 |
| | | * @param lifeCyle 数据对象 |
| | | * @return 显示对象 |
| | | */ |
| | | OsLifeCycleVO lifeCycleDO2VO(LifeCyle lifeCyle); |
| | | OsLifeCycleVO lifeCycleDO2VO(LifeCycle lifeCyle); |
| | | |
| | | /** |
| | | * 生命周期显示对象转换为数据对象 |
| | |
| | | * @param lineVO 跃迁路由 |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | void doTransVO(BusinessObject obj, OsLifeCycleLineVO lineVO) throws VciBaseException; |
| | | void doTransVO(com.vci.corba.omd.data.BusinessObject obj, OsLifeCycleLineVO lineVO) throws VciBaseException; |
| | | |
| | | /** |
| | | * 批量执行跃迁操作,要求必须是同一个业务类型下的 |
| | |
| | | * @param releaseStatus 发布状态,如果目标状态是发布状态时传递这个值 |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | void batchTransVo(BusinessObject[] bos, OsLifeCycleLineVO[] lineVOs, |
| | | void batchTransVo(com.vci.corba.omd.data.BusinessObject[] bos, OsLifeCycleLineVO[] lineVOs, |
| | | String[] releaseStatus) throws VciBaseException; |
| | | |
| | | /** |
| | |
| | | * @param vos 跃迁对象 |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | void batchTransVo(BusinessObject[] bos, OsLifeCycleLineVO[] vos) |
| | | void batchTransVo(com.vci.corba.omd.data.BusinessObject[] bos, OsLifeCycleLineVO[] vos) |
| | | throws VciBaseException; |
| | | |
| | | /** |
| | |
| | | * @param statePool 状态池的数据对象 |
| | | * @return 显示对象 |
| | | */ |
| | | OsStatusVO statusDO2VO(StatePool statePool); |
| | | OsStatusVO statusDO2VO(com.vci.corba.omd.stm.StatePool statePool); |
| | | |
| | | /** |
| | | * 数据对象转换为显示对象 |
| | | * @param statePools 状态池的数据对象 集合 |
| | | * @return 显示对象 |
| | | */ |
| | | List<OsStatusVO> statusDO2VOs(Collection<StatePool> statePools); |
| | | List<OsStatusVO> statusDO2VOs(Collection<com.vci.corba.omd.stm.StatePool> statePools); |
| | | |
| | | /** |
| | | * 查询所有的状态 |
| | |
| | | * @return 执行的结果 |
| | | * @throws VciBaseException 执行出错的会抛出异常,或者事件直接返回了异常 |
| | | */ |
| | | BaseResult callPostEvent(Collection<ClientBusinessObject> cbos, Collection<ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException; |
| | | BaseResult callPostEvent(Collection<com.vci.client.bof.ClientBusinessObject> cbos, Collection<com.vci.client.bof.ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException; |
| | | |
| | | /** |
| | | * 表单数据转换为基础对象 |
| | |
| | | * @param cbo 业务数据对象 |
| | | * @return 基础对象 |
| | | */ |
| | | BaseModel cbo2BaseModel(ClientBusinessObject cbo); |
| | | BaseModel cbo2BaseModel(com.vci.client.bof.ClientBusinessObject cbo); |
| | | |
| | | /** |
| | | * 业务数据表单对象转换为基础的属性 |
| | |
| | | * @param cbo 业务类型的对象 |
| | | * @param editFlag 是否为编辑 |
| | | */ |
| | | void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, ClientBusinessObject cbo, boolean editFlag); |
| | | void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, com.vci.client.bof.ClientBusinessObject cbo, boolean editFlag); |
| | | |
| | | /** |
| | | * 链接类型的编辑数据 |
| | |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.BatchCBO; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import com.vci.client.bof.ClientBusinessObject; |
| | | import plm.bs.bom.clientobject.ClientBusinessObjectOperation; |
| | | import plm.bs.bom.clientobject.ClientLinkObject; |
| | | import plm.corba.qt.QTServiceOperations; |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap) throws VciBaseException; |
| | | |
| | | /** |
| | | * 支持排序和分页的查询业务类型下的数据 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph) throws VciBaseException; |
| | | |
| | | /** |
| | | * 支持自定义查询字段(包括参照、枚举和生命周期) |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph, List<String> clauseList) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, Map<String, String> conditionMap, PageHelper ph, List<String> clauseList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 拷贝分页和排序的设置到查询模板 |
| | |
| | | * @param enumAttrName 枚举的名称 |
| | | * @throws VciBaseException 查询枚举出错的时候会抛出异常 |
| | | */ |
| | | void queryEnumText(ClientBusinessObject cbo, ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException; |
| | | void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo, com.vci.client.bof.ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException; |
| | | |
| | | /** |
| | | * 给链接类型设置属性 |
| | |
| | | * @param attributeName 属性的名称 |
| | | * @param attributeValue 属性的值 |
| | | */ |
| | | void setAttributeValueForClo(ClientLinkObject clo, String attributeName, String attributeValue); |
| | | void setAttributeValueForClo(com.vci.client.bof.ClientLinkObject clo, String attributeName, String attributeValue); |
| | | |
| | | /** |
| | | * 使用查询方案来查询数据,返回CBO |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap) throws VciBaseException; |
| | | |
| | | /** |
| | | * 使用查询方案来查询数据,返回CBO,支持分页 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph) throws VciBaseException; |
| | | |
| | | /** |
| | | * 使用名字获取查询模板 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, Map<String, String> conditionMap, Map<String, String> replaceMap, PageHelper ph, List<String> clauseList) throws VciBaseException; |
| | | |
| | | /** |
| | | * 查询数量 |
| | |
| | | * @return CBO |
| | | * @throws VciBaseException |
| | | */ |
| | | List<ClientBusinessObject> queryBySql(String sql, Map<String, String> conditionMap) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryBySql(String sql, Map<String, String> conditionMap) throws VciBaseException; |
| | | |
| | | /** |
| | | * 只用sql语句查询,这个和queryBySql区别是,特殊的sql(如包含有函数的)可以用这个方法,但是有sql注入风险 |
| | |
| | | * @return CBO |
| | | * @throws VciBaseException 查询出错活抛出异常 |
| | | */ |
| | | List<ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException; |
| | | List<com.vci.client.bof.ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException; |
| | | |
| | | /** |
| | | * 只用sql语句查询,这个和queryBySqlForMap区别是,特殊的sql(如包含有函数的)可以用这个方法,但是有sql注入风险 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map cbo2Map(ClientBusinessObject cbo) throws VciBaseException; |
| | | Map cbo2Map(com.vci.client.bof.ClientBusinessObject cbo) throws VciBaseException; |
| | | |
| | | /** |
| | | * map转为clientBusinessObject |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map<String,ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, boolean isDirection) throws VciBaseException; |
| | | Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, boolean isDirection) throws VciBaseException; |
| | | |
| | | /** |
| | | *查询链接类型某端的业务类型 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map<String,ClientBusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException; |
| | | Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException; |
| | | |
| | | /** |
| | | *查询链接类型某端的业务类型 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map<String,ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clo, boolean isDirection) throws VciBaseException; |
| | | Map<String,com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clo, boolean isDirection) throws VciBaseException; |
| | | |
| | | /** |
| | | * 查询链接类型某端的业务类型 |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map<String, ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clol, |
| | | Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(ClientLinkObject[] clol, |
| | | boolean isDirection, List<String> queryColumn) throws VciBaseException; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map<String, ClientBusinessObject> queryLinkedCbo(List los, |
| | | Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, |
| | | boolean isDirection, List<String> queryColumn) throws VciBaseException; |
| | | |
| | | /** |
| | |
| | | * @return map |
| | | * @throws VciBaseException |
| | | */ |
| | | List<Map> clos2Map(List<ClientLinkObject> clos) throws VciBaseException; |
| | | List<Map> clos2Map(List<com.vci.client.bof.ClientLinkObject> clos) throws VciBaseException; |
| | | |
| | | /** |
| | | * ClientLinkObject 转为HashMap |
| | |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | Map clo2Map(ClientLinkObject clo) throws VciBaseException; |
| | | Map clo2Map(com.vci.client.bof.ClientLinkObject clo) throws VciBaseException; |
| | | |
| | | /** |
| | | * map转为ClientLinkObject |
| | |
| | | * @param linkTypeDataQuery 查询对象 |
| | | * @return 链接类型和关联的to端 |
| | | */ |
| | | List<BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) ; |
| | | List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) ; |
| | | |
| | | /** |
| | | * 使用链接类型的名称查询 链接类型的to端的业务类型 |
| | | * @param linkTypeDataQuery 查询的对象 |
| | | * @return 链接对象和to端业务对象 |
| | | */ |
| | | List<BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery); |
| | | List<com.vci.corba.query.data.BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery); |
| | | |
| | | /** |
| | | * 查询列表 |
| | |
| | | * @param attributeName 属性名称 |
| | | * @param attributeValue 属性的值 |
| | | */ |
| | | public default void setAttribute(ClientLinkObject clo,String attributeName,String attributeValue){ |
| | | AttributeValue[] attrValues =clo.getLinkObject().newAttrValList; |
| | | ArrayList<AttributeValue> attrValList = new ArrayList(); |
| | | AttributeValue attrVal; |
| | | public default void setAttribute(com.vci.client.bof.ClientLinkObject clo,String attributeName,String attributeValue){ |
| | | com.vci.corba.omd.data.AttributeValue[] attrValues =clo.getLinkObject().newAttrValList; |
| | | ArrayList<com.vci.corba.omd.data.AttributeValue> attrValList = new ArrayList(); |
| | | com.vci.corba.omd.data.AttributeValue attrVal; |
| | | int i; |
| | | if (attrValues != null && attrValues.length > 0) { |
| | | AttributeValue[] var9 = attrValues; |
| | | com.vci.corba.omd.data.AttributeValue[] var9 = attrValues; |
| | | i = attrValues.length; |
| | | |
| | | for(int var7 = 0; var7 < i; ++var7) { |
| | |
| | | boolean isExist = false; |
| | | |
| | | for(i = 0; i < attrValList.size(); ++i) { |
| | | attrVal = (AttributeValue)attrValList.get(i); |
| | | attrVal = (com.vci.corba.omd.data.AttributeValue)attrValList.get(i); |
| | | if (attrVal.attrName.toUpperCase().equals(attributeName.toUpperCase())) { |
| | | attrVal.attrVal = attributeValue; |
| | | isExist = true; |
| | |
| | | } |
| | | |
| | | if (!isExist) { |
| | | attrVal = new AttributeValue(); |
| | | attrVal = new com.vci.corba.omd.data.AttributeValue(); |
| | | attrVal.attrName = attributeName.toUpperCase(); |
| | | attrVal.attrVal = attributeValue; |
| | | attrValList.add(attrVal); |
| | | } |
| | | |
| | | clo.getLinkObject().newAttrValList = (AttributeValue[])attrValList.toArray(new AttributeValue[attrValList.size()]); |
| | | clo.getLinkObject().newAttrValList = (com.vci.corba.omd.data.AttributeValue[])attrValList.toArray(new com.vci.corba.omd.data.AttributeValue[attrValList.size()]); |
| | | }; |
| | | } |
| | |
| | | enumVO.setLength((int) enumItem.length); |
| | | |
| | | try { |
| | | enumVO.setLastModifyTime(VciDateUtil.str2Date(String.valueOf(enumItem.createTime),VciDateUtil.DateTimeFormat)); |
| | | enumVO.setLastModifyTime(new Date(enumItem.createTime)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | enumVO.setCreateTime(VciDateUtil.str2Date(String.valueOf(enumItem.createTime),VciDateUtil.DateTimeFormat)); |
| | | enumVO.setCreateTime(new Date(enumItem.createTime)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | @Override |
| | | public List<KeyValue> getDataEnum(String oid, String btmname) { |
| | | VciBaseUtil.alertNotNull(oid,"业务数据的主键",btmname,"业务类型"); |
| | | ClientBusinessObject cbo = boService.selectCBOByOid(oid, btmname); |
| | | com.vci.client.bof.ClientBusinessObject cbo = boService.selectCBOByOid(oid, btmname); |
| | | String secret = cbo.getAttributeValue("secretGrade"); |
| | | //secret = DataSecretEnum.SECRET.getValue() + ""; |
| | | if(StringUtils.isBlank(secret)){ |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.omd.lcm.LifeCycle; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | |
| | | * @throws VciBaseException 如果目标生命周期和当前生命周期状态没有连接线时抛出异常 |
| | | */ |
| | | @Override |
| | | public void transStatus(BusinessObject bo, String targetStatus) |
| | | public void transStatus(com.vci.corba.omd.data.BusinessObject bo, String targetStatus) |
| | | throws VciBaseException { |
| | | WebUtil.alertNotNull(bo,"业务数据对象",bo.lctId,"生命周期编码",bo.lcStatus,"当前生命周期状态",targetStatus,"目标生命周期状态"); |
| | | OsLifeCycleLineVO transVO = getTransVO(bo.lctId, bo.lcStatus, targetStatus); |
| | |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | @Override |
| | | public void transStatus(List<BusinessObject> boList, String targetStatus) |
| | | public void transStatus(List<com.vci.corba.omd.data.BusinessObject> boList, String targetStatus) |
| | | throws VciBaseException { |
| | | WebUtil.alertNotNull(boList,"业务数据对象",targetStatus,"目标对象"); |
| | | transStatus(boList.toArray(new BusinessObject[0]), targetStatus); |
| | | transStatus(boList.toArray(new com.vci.corba.omd.data.BusinessObject[0]), targetStatus); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | @Override |
| | | public void transStatus(BusinessObject[] bos, String targetStatus) |
| | | public void transStatus(com.vci.corba.omd.data.BusinessObject[] bos, String targetStatus) |
| | | throws VciBaseException { |
| | | WebUtil.alertNotNull(bos,"业务数据对象",targetStatus,"目标对象"); |
| | | List<OsLifeCycleLineVO> transVOList = new ArrayList<>(); |
| | | List<BusinessObject> transBOs = new ArrayList<>(); |
| | | List<com.vci.corba.omd.data.BusinessObject> transBOs = new ArrayList<>(); |
| | | for(int i = 0 ; i < bos.length ; i ++){ |
| | | BusinessObject bo = bos[i]; |
| | | com.vci.corba.omd.data.BusinessObject bo = bos[i]; |
| | | WebUtil.alertNotNull(bo,"业务数据对象",bo.lctId,"生命周期编码",bo.lcStatus,"当前生命周期状态"); |
| | | OsLifeCycleLineVO transVO = getTransVO(bo.lctId, bo.lcStatus, targetStatus); |
| | | if(transVO!=null){ |
| | |
| | | } |
| | | } |
| | | if(!CollectionUtils.isEmpty(transBOs)) { |
| | | batchTransVo(transBOs.toArray(new BusinessObject[0]), transVOList.toArray(new OsLifeCycleLineVO[0])); |
| | | batchTransVo(transBOs.toArray(new com.vci.corba.omd.data.BusinessObject[0]), transVOList.toArray(new OsLifeCycleLineVO[0])); |
| | | } |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException 转换生命周期出错的时候抛出异常 |
| | | */ |
| | | @Override |
| | | public void transCboStatus(List<ClientBusinessObject> cboList, |
| | | public void transCboStatus(List<com.vci.client.bof.ClientBusinessObject> cboList, |
| | | String targetStatus) throws VciBaseException { |
| | | WebUtil.alertNotNull(cboList,"业务数据对象",targetStatus,"目标对象"); |
| | | BusinessObject[] bos = new BusinessObject[cboList.size()]; |
| | | com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[cboList.size()]; |
| | | for(int i = 0 ; i < cboList.size() ; i ++){ |
| | | bos[i] = cboList.get(i).getBusinessObject(); |
| | | } |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @Override |
| | | public List<OsLifeCycleVO> lifeCycleDO2VOs(Collection<LifeCyle> lifeCycles){ |
| | | public List<OsLifeCycleVO> lifeCycleDO2VOs(Collection<LifeCycle> lifeCycles){ |
| | | List<OsLifeCycleVO> lifeCycleVOS = new ArrayList<>(); |
| | | Optional.ofNullable(lifeCycles).orElseGet(()->new ArrayList<>()).stream().forEach(lifeCyle -> { |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleDO2VO(lifeCyle); |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @Override |
| | | public OsLifeCycleVO lifeCycleDO2VO(LifeCyle lifeCycle){ |
| | | public OsLifeCycleVO lifeCycleDO2VO(LifeCycle lifeCycle){ |
| | | OsLifeCycleVO life = new OsLifeCycleVO(); |
| | | Map<String, OsStatusVO> statusVOMap = statusService.selectAllStatusMap(); |
| | | if(lifeCycle !=null) { |
| | | try { |
| | | life.setCreateTime(VciDateUtil.str2Date(lifeCycle.createTime,VciDateUtil.DateTimeFormat)); |
| | | life.setCreateTime(new Date(lifeCycle.createTime)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | life.setId(lifeCycle.name); |
| | | life.setLastModifier(lifeCycle.modifier); |
| | | try { |
| | | life.setLastModifyTime(VciDateUtil.str2Date(lifeCycle.modifyTime,VciDateUtil.DateTimeFormat)); |
| | | life.setLastModifyTime(new Date(lifeCycle.modifyTime)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | }else { |
| | | OsLifeCycleLineEventVO[] eventVOs = new OsLifeCycleLineEventVO[route.transitionVOEvents.length]; |
| | | for (int i = 0; i < route.transitionVOEvents.length; i++) { |
| | | TransitionVOEvent event = route.transitionVOEvents[i]; |
| | | com.vci.corba.omd.lcm.TransitionVOEvent event = route.transitionVOEvents[i]; |
| | | OsLifeCycleLineEventVO eventVO = new OsLifeCycleLineEventVO(); |
| | | eventVO.setOid(event.id); |
| | | eventVO.setEventFullName(event.name); |
| | |
| | | lifeCyle.bounds = new Bound[0]; |
| | | } |
| | | //加链接线 |
| | | List<TransitionVO> lines = new ArrayList<>(); |
| | | List<com.vci.corba.omd.lcm.TransitionVO> lines = new ArrayList<>(); |
| | | for (int i = 0; i < lifeCycleVO.getLines().size(); i++) { |
| | | OsLifeCycleLineVO lineVO = lifeCycleVO.getLines().get(i); |
| | | lines.add(lifeCycleLineVO2DO(lineVO)); |
| | |
| | | @VciUnLog |
| | | public List<OsLifeCycleVO> selectAllLifeCycle() throws VciBaseException { |
| | | try { |
| | | LifeCyle[] lifeCyles = platformClientUtil.getLifeCycleService().getLifeCyles(); |
| | | // LifeCyle[] lifeCyles = platformClientUtil.getLifeCycleService().getLifeCyles(); |
| | | LifeCycle[] lifeCyles = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycles(); |
| | | return lifeCycleDO2VOs(Arrays.stream(lifeCyles).collect(Collectors.toList())); |
| | | } catch (VCIError vciError) { |
| | | if(logger.isErrorEnabled()){ |
| | |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | @Override |
| | | public void doTransVO(BusinessObject obj,OsLifeCycleLineVO lineVO) throws VciBaseException { |
| | | public void doTransVO(com.vci.corba.omd.data.BusinessObject obj,OsLifeCycleLineVO lineVO) throws VciBaseException { |
| | | if(lineVO!=null){ |
| | | try { |
| | | TransitionVO transitionVO = lifeCycleLineVO2DO(lineVO); |
| | | platformClientUtil.getBOFactoryService().transferBusinessObject(new BusinessObjectHolder(obj), transitionVO); |
| | | com.vci.corba.omd.lcm.TransitionVO transitionVO = lifeCycleLineVO2DO(lineVO); |
| | | // platformClientUtil.getBOFactoryService().transferBusinessObject(new BusinessObjectHolder(obj), transitionVO); |
| | | ServiceProvider.getBOFService().transferBusinessObject(obj, transitionVO); |
| | | } catch (VCIError e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | |
| | | * @param lineVO 连接线对象 |
| | | * @return 平台的连接线对象 |
| | | */ |
| | | private TransitionVO lifeCycleLineVO2DO(OsLifeCycleLineVO lineVO){ |
| | | TransitionVO transitionVO = new TransitionVO(); |
| | | private com.vci.corba.omd.lcm.TransitionVO lifeCycleLineVO2DO(OsLifeCycleLineVO lineVO){ |
| | | com.vci.corba.omd.lcm.TransitionVO transitionVO = new com.vci.corba.omd.lcm.TransitionVO(); |
| | | transitionVO.id = lineVO.getOid(); |
| | | transitionVO.source = lineVO.getSourceLifeStatus(); |
| | | transitionVO.destination = lineVO.getTargetLifeStatus(); |
| | | transitionVO.connect = lineVO.getName() == null?"":lineVO.getName(); |
| | | //加事件 |
| | | TransitionVOEvent[] events; |
| | | com.vci.corba.omd.lcm.TransitionVOEvent[] events; |
| | | if(lineVO.getEvents() == null || lineVO.getEvents().length == 0){ |
| | | events = new TransitionVOEvent[0]; |
| | | events = new com.vci.corba.omd.lcm.TransitionVOEvent[0]; |
| | | }else{ |
| | | events = new TransitionVOEvent[lineVO.getEvents().length]; |
| | | events = new com.vci.corba.omd.lcm.TransitionVOEvent[lineVO.getEvents().length]; |
| | | for (int j = 0; j < lineVO.getEvents().length; j++) { |
| | | OsLifeCycleLineEventVO eventVO = lineVO.getEvents()[j]; |
| | | TransitionVOEvent event = new TransitionVOEvent(); |
| | | com.vci.corba.omd.lcm.TransitionVOEvent event = new com.vci.corba.omd.lcm.TransitionVOEvent(); |
| | | event.id = eventVO.getOid(); |
| | | event.name = eventVO.getEventFullName(); |
| | | events[j] = event; |
| | |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | @Override |
| | | public void batchTransVo(BusinessObject[] bos,OsLifeCycleLineVO[] vos) throws VciBaseException{ |
| | | public void batchTransVo(com.vci.corba.omd.data.BusinessObject[] bos,OsLifeCycleLineVO[] vos) throws VciBaseException{ |
| | | batchTransVo(bos,vos,null); |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException 跃迁出错的是会抛出异常 |
| | | */ |
| | | @Override |
| | | public void batchTransVo(BusinessObject[] bos,OsLifeCycleLineVO[] lineVOs,String[] releaseStatus) throws VciBaseException{ |
| | | public void batchTransVo(com.vci.corba.omd.data.BusinessObject[] bos,OsLifeCycleLineVO[] lineVOs,String[] releaseStatus) throws VciBaseException{ |
| | | if(bos!=null && lineVOs != null && lineVOs.length == bos.length){ |
| | | try { |
| | | if(releaseStatus == null){ |
| | |
| | | releaseStatus[i] = ""; |
| | | } |
| | | } |
| | | TransitionVO[] vos = new TransitionVO[lineVOs.length]; |
| | | com.vci.corba.omd.lcm.TransitionVO[] vos = new com.vci.corba.omd.lcm.TransitionVO[lineVOs.length]; |
| | | for(int i = 0 ; i < lineVOs.length; i ++){ |
| | | vos[i] = lifeCycleLineVO2DO(lineVOs[i]); |
| | | } |
| | | platformClientUtil.getBOFactoryService().batchTransferBusinessObjectAndRelease( |
| | | // platformClientUtil.getBOFactoryService().batchTransferBusinessObjectAndRelease( |
| | | // bos, vos, releaseStatus); |
| | | ServiceProvider.getBOFService().batchTransferBusinessObjectAndRelease( |
| | | bos, vos, releaseStatus); |
| | | } catch (VCIError e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | |
| | | "inner JOIN user_col_comments c on t.TABLE_NAME = c.table_name and t.COLUMN_NAME = c.column_name where " + |
| | | "t.table_name = '" + VciBaseUtil.getTableName(btmTypeVO.getId()).toUpperCase(Locale.ROOT) + "' order by t.column_name asc"; |
| | | Map<String, OsBtmTypeAttributeVO> attributeVOMap = btmTypeVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t)); |
| | | List<ClientBusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbosList = boService.queryBySql(sql, new HashMap<>()); |
| | | if(!CollectionUtils.isEmpty(cbosList)){ |
| | | cbosList.stream().forEach(cbo->{ |
| | | String attrId = cbo.getAttributeValue("column_name"); |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.query.data.KV; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.BaseQueryObject; |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @Override |
| | | public OsStatusVO statusDO2VO(StatePool statePool) { |
| | | public OsStatusVO statusDO2VO(com.vci.corba.omd.stm.StatePool statePool) { |
| | | OsStatusVO statusVO = new OsStatusVO(); |
| | | if(statePool!=null){ |
| | | statusVO.setOid(statePool.oid); |
| | | statusVO.setCreator(statePool.creator); |
| | | statusVO.setLastModifier(statePool.modifier); |
| | | try { |
| | | statusVO.setCreateTime(VciDateUtil.str2Date(statePool.createTime,VciDateUtil.DateTimeFormat)); |
| | | statusVO.setLastModifyTime(VciDateUtil.str2Date(statePool.modifyTime,VciDateUtil.DateTimeFormat)); |
| | | statusVO.setCreateTime(new Date(statePool.createTime)); |
| | | statusVO.setLastModifyTime(new Date(statePool.modifyTime)); |
| | | statusVO.setTs(VciDateUtil.str2Date(statePool.ts,VciDateUtil.DateTimeMillFormat)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @Override |
| | | public List<OsStatusVO> statusDO2VOs(Collection<StatePool> statePools) { |
| | | public List<OsStatusVO> statusDO2VOs(Collection<com.vci.corba.omd.stm.StatePool> statePools) { |
| | | List<OsStatusVO> statusVOS = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(statePools)){ |
| | | statePools.stream().forEach(statePool -> { |
| | |
| | | @VciUnLog |
| | | public List<OsStatusVO> selectAllStatus() { |
| | | try { |
| | | return statusDO2VOs(Arrays.stream(platformClientUtil.getStatePoolService().getStatePools()).collect(Collectors.toList())); |
| | | // return statusDO2VOs(Arrays.stream(platformClientUtil.getStatePoolService().getStatePools()).collect(Collectors.toList())); |
| | | return statusDO2VOs(Arrays.stream(ServiceProvider.getOMDService().getStateService().getStatePools()).collect(Collectors.toList())); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | String sql = "select f.ploid from plfunction f where lower(f.plmoduleno) = :functionId"; |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("functionId",functionId.toLowerCase(Locale.ROOT).trim()); |
| | | List<ClientBusinessObject> functionCbos = boService.queryBySql(sql, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> functionCbos = boService.queryBySql(sql, conditionMap); |
| | | if(CollectionUtils.isEmpty(functionCbos)){ |
| | | //都没有这个功能 |
| | | return new ArrayList<>(); |
| | |
| | | sql = "select rf.plrightvalue from PLROLERIGHT rf left join pluserrole ur on rf.plroleoid = ur.plroleuid " + |
| | | " where ur.pluseruid =:useroid and rf.plfuncoid = :functionOid"; |
| | | conditionMap.put("useroid",VciBaseUtil.getCurrentUserOid()); |
| | | List<ClientBusinessObject> cbos = boService.queryBySql(sql, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryBySql(sql, conditionMap); |
| | | if(CollectionUtils.isEmpty(cbos)){ |
| | | //没有授权 |
| | | return new ArrayList<>(); |
| | |
| | | //获取具体包含哪些按钮 |
| | | sql = "select o.ploperoid,o.plno from PLFUNCOPERATION o where o.plfuncoid = :functionOid "; |
| | | conditionMap.remove("useroid"); |
| | | List<ClientBusinessObject> operationLinkCbos = boService.queryBySql(sql, conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> operationLinkCbos = boService.queryBySql(sql, conditionMap); |
| | | if(CollectionUtils.isEmpty(operationLinkCbos)){ |
| | | //根本没有按钮 |
| | | return new ArrayList<>(); |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | sql = "select ploid as oid,plname,pluniqueflag,pldesc,plalias,plsequence from ploperation where ploid in (" + VciBaseUtil.toInSql(hasRightOids.toArray(new String[0])) + ")"; |
| | | List<ClientBusinessObject> opertionCBOs = boService.queryBySql(sql, new HashMap<>()); |
| | | List<com.vci.client.bof.ClientBusinessObject> opertionCBOs = boService.queryBySql(sql, new HashMap<>()); |
| | | List<SmOperationVO> operationVOS = new ArrayList<>(); |
| | | Optional.ofNullable(opertionCBOs).orElseGet(()->new ArrayList<>()).stream().forEach(cbo->{ |
| | | SmOperationVO operationVO = new SmOperationVO(); |
| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | 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; |
| | |
| | | UIFormDataVO formDataVO = new UIFormDataVO(); |
| | | replaceMap.put("oid", formQuery.getOid().trim()); |
| | | if(!formDefineVO.isLinkTypeFlag()) { |
| | | List<ClientBusinessObject> cbos = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = null; |
| | | if (StringUtils.isNotBlank(queryTemplate)) { |
| | | replaceMap.put("oid", formQuery.getOid().trim()); |
| | | cbos = boService.queryCBOByScheme(queryTemplate, conditionMap, replaceMap, null, queryFieldList.stream().collect(Collectors.toList())); |
| | |
| | | cbos = boService.queryCBO(formQuery.getBtmname(), conditionMap, null, queryFieldList.stream().collect(Collectors.toList())); |
| | | } |
| | | if (!CollectionUtils.isEmpty(cbos)) { |
| | | ClientBusinessObject cbo = cbos.get(0); |
| | | com.vci.client.bof.ClientBusinessObject cbo = cbos.get(0); |
| | | formDataVO.setData(boService.cbo2Map(cbo)); |
| | | } else { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | |
| | | |
| | | if(treeQuery.isQueryRoot()){ |
| | | //是查询根节点 |
| | | List<ClientBusinessObject> rootCbos = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> rootCbos = null; |
| | | if(StringUtils.isNotBlank(queryTemplate)){ |
| | | //说明是菜单里定义了查询模板的 |
| | | rootCbos = boService.queryCBOByScheme(queryTemplate, null, replaceMap); |
| | |
| | | return rootTreeList; |
| | | }else{ |
| | | //这个不是跟节点,但是一般只是增加一个逐级查询,因为全部查询的时候,在根节点已经全部查询完了 |
| | | List<ClientBusinessObject> thisChildren = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> thisChildren = null; |
| | | if (StringUtils.isNotBlank(queryTemplate)) { |
| | | thisChildren = boService.queryCBOByScheme(queryTemplate, treeQuery.getConditionMap(), replaceMap, null, queryFieldList); |
| | | } else { |
| | |
| | | } |
| | | if(treeQuery.isQueryRoot()){ |
| | | //查询根节点.我们需要判断是否设置了根节点的查询条件 |
| | | List<BOAndLO> rootCbos = null; |
| | | List<com.vci.corba.query.data.BOAndLO> rootCbos = null; |
| | | String parentFieldNameAndValue = treeDefineVO.getShowLinkAbs(); |
| | | if(StringUtils.isNotBlank(parentFieldNameAndValue)){ |
| | | if(StringUtils.isNotBlank(queryTemplate)){ |
| | |
| | | */ |
| | | private void queryTreeForBO(List<Tree> rootTreeList, String queryTemplate,List<String> queryFieldList,TreeQueryObject treeQueryObject) { |
| | | for (Tree rootTree : rootTreeList) { |
| | | List<ClientBusinessObject> thisChildren = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> thisChildren = null; |
| | | Map<String,String> sourceDataMap = rootTree.getAttributes(); |
| | | sourceDataMap.put("f_oid",rootTree.getOid()); |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | |
| | | * @param parentOid 上级的主键 |
| | | * @return 树 |
| | | */ |
| | | private List<Tree> cbo2Trees(Collection<ClientBusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ |
| | | private List<Tree> cbo2Trees(Collection<com.vci.client.bof.ClientBusinessObject> cbos,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ |
| | | final int[] i = {0}; |
| | | List<Tree> rootList = new ArrayList<>(); |
| | | List<Tree> children = new ArrayList<>(); |
| | |
| | | children.add(tree); |
| | | } |
| | | }); |
| | | |
| | | if(rootList.size() == 0 && children.size() == 0){ |
| | | return rootList; |
| | | } |
| | | return Tree.getChildList(rootList,children); |
| | | } |
| | | |
| | |
| | | * @param parentOid 上级的值 |
| | | * @return 树形数据 |
| | | */ |
| | | public List<Tree> cloAndCbo2Trees(Collection<BOAndLO> boAndLOS,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ |
| | | public List<Tree> cloAndCbo2Trees(Collection<com.vci.corba.query.data.BOAndLO> boAndLOS,String valueField,String textField,String parentFieldName,boolean showCheckBox,String parentOid){ |
| | | final int[] i = {0}; |
| | | List<Tree> rootList = new ArrayList<>(); |
| | | List<Tree> children = new ArrayList<>(); |
| | | boAndLOS.stream().forEach(boAndLO->{ |
| | | Tree tree = new Tree(); |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | cbo.setBusinessObject(boAndLO.bo); |
| | | ClientLinkObject clo = new ClientLinkObject(); |
| | | com.vci.client.bof.ClientLinkObject clo = new com.vci.client.bof.ClientLinkObject(); |
| | | clo.setLinkObject(boAndLO.lo); |
| | | Map<String,String> cloMap = loService.clo2Map(clo); |
| | | Map<String,String> cbo2Map = boService.cbo2Map(cbo); |
| | |
| | | * @param fieldExpress 表达式的值 |
| | | * @return 转换后的值 |
| | | */ |
| | | private String getValueByExpress(ClientBusinessObject cbo,String fieldExpress){ |
| | | private String getValueByExpress(com.vci.client.bof.ClientBusinessObject cbo,String fieldExpress){ |
| | | if(StringUtils.isBlank(fieldExpress)){ |
| | | return ""; |
| | | } |
| | |
| | | * @throws VciBaseException 执行出错的会抛出异常,或者事件直接返回了异常 |
| | | */ |
| | | @Override |
| | | public BaseResult callPostEvent(Collection<ClientBusinessObject> cbos, Collection<ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{ |
| | | public BaseResult callPostEvent(Collection<com.vci.client.bof.ClientBusinessObject> cbos, Collection<com.vci.client.bof.ClientLinkObject> clos, String postEvent, VciChangeDocumentTypeEnum businessType) throws VciBaseException{ |
| | | if(CollectionUtils.isEmpty(cbos)){ |
| | | return BaseResult.success(); |
| | | } |
| | | String btmType = !CollectionUtils.isEmpty(cbos)?cbos.stream().findFirst().get().getBtmName():null; |
| | | String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().getLinkObject().linkTypeName:null; |
| | | String linkType = !CollectionUtils.isEmpty(clos)?clos.stream().findFirst().get().getLinkObject().ltName:null; |
| | | if(StringUtils.isNotBlank(postEvent)){ |
| | | //前置事件 |
| | | //bean的名字#方法; 或者全路径。最后一个是方法的名字 |
| | |
| | | return beforeResult; |
| | | } |
| | | //封装数据 |
| | | BaseResult<ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,false,false); |
| | | if(!resultCbo.isSuccess()){ |
| | | return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); |
| | | } |
| | | //执行保存 |
| | | BaseResult<Map<String,Object>> result = BaseResult.success(); |
| | | ClientBusinessObject afterCBO = null; |
| | | com.vci.client.bof.ClientBusinessObject afterCBO = null; |
| | | try { |
| | | BusinessObject resultBO = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),false,false); |
| | | afterCBO = new ClientBusinessObject(); |
| | | // 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); |
| | | afterCBO = new com.vci.client.bof.ClientBusinessObject(); |
| | | afterCBO.setBusinessObject(resultBO); |
| | | result.setObj(boService.cbo2Map(afterCBO)); |
| | | } catch (VCIError vciError) { |
| | |
| | | //后置事件 |
| | | String afterEvent = formDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(Arrays.stream(new ClientBusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{afterCBO}).collect(Collectors.toList()),null, afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | }catch (Throwable e){ |
| | | //说明后置事件出现了错误,那么就需要删除以前的这条数据 |
| | | try { |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(afterCBO.getBusinessObject(),1); |
| | | // platformClientUtil.getBOFactoryService().deleteBusinessObject(afterCBO.getBusinessObject(),1); |
| | | ServiceProvider.getBOFService().deleteBusinessObject(afterCBO.getBusinessObject(),1); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | * @param newVersion 新版次 |
| | | * @return 执行的结果 |
| | | */ |
| | | private BaseResult<ClientBusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperCbo(FormDataDTO formDataDTO,UIFormDefineVO formDefineVO,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | //扩展属性的值 |
| | | Map<String, String> data = formDataDTO.getData(); |
| | | Map<String,String> dataLow = new HashMap<>(); |
| | |
| | | if(!result.isSuccess()){ |
| | | return result; |
| | | } |
| | | ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion); |
| | | com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,newRevision,newVersion); |
| | | return BaseResult.success(cbo); |
| | | } |
| | | |
| | |
| | | * @return 基础对象 |
| | | */ |
| | | @Override |
| | | public BaseModel cbo2BaseModel(ClientBusinessObject cbo){ |
| | | public BaseModel cbo2BaseModel(com.vci.client.bof.ClientBusinessObject cbo){ |
| | | BaseModel baseModel = new BaseModel(); |
| | | baseModel.setOid(cbo.getOid()); |
| | | baseModel.setNameOid(cbo.getNameoid()); |
| | |
| | | baseModel.setFirstV(String.valueOf(cbo.getIsFirstV())); |
| | | baseModel.setCreator(cbo.getCreator()); |
| | | try { |
| | | baseModel.setCreateTime(VciDateUtil.str2Date(cbo.getCreateTime(), VciDateUtil.DateTimeFormat)); |
| | | baseModel.setLastModifyTime(VciDateUtil.str2Date(cbo.getLastModifyTime(), VciDateUtil.DateTimeFormat)); |
| | | baseModel.setTs(VciDateUtil.str2Date(cbo.getTs(), VciDateUtil.DateTimeFormat)); |
| | | baseModel.setCheckInTime(VciDateUtil.str2Date(cbo.getCheckinTime(), VciDateUtil.DateTimeFormat)); |
| | | baseModel.setCheckOutTime(VciDateUtil.str2Date(cbo.getCheckoutTime(), VciDateUtil.DateTimeFormat)); |
| | | baseModel.setCreateTime(new Date(cbo.getCreateTime())); |
| | | baseModel.setLastModifyTime(new Date(cbo.getLastModifyTime())); |
| | | baseModel.setTs(new Date(cbo.getTs())); |
| | | // baseModel.setCheckInTime(VciDateUtil.str2Date(cbo.getCheckinTime(), VciDateUtil.DateTimeFormat)); |
| | | // baseModel.setCheckOutTime(VciDateUtil.str2Date(cbo.getCheckoutTime(), VciDateUtil.DateTimeFormat)); |
| | | }catch (Throwable e){ |
| | | |
| | | } |
| | |
| | | baseModel.setName(cbo.getName()); |
| | | baseModel.setDescription(cbo.getDescription()); |
| | | baseModel.setOwner(cbo.getOwner()); |
| | | baseModel.setCheckInBy(cbo.getCheckinBy()); |
| | | baseModel.setCheckOutBy(cbo.getCheckoutBy()); |
| | | // baseModel.setCheckInBy(cbo.getCheckinBy()); |
| | | // baseModel.setCheckOutBy(cbo.getCheckoutBy()); |
| | | baseModel.setCopyFromVersion(cbo.getCopyFromVersion()); |
| | | return baseModel; |
| | | } |
| | |
| | | return beforeResult; |
| | | } |
| | | //封装数据 |
| | | List<BusinessObject> addBos = new ArrayList<>(); |
| | | List<BusinessObject> afterBOs = new ArrayList<>(); |
| | | List<ClientBusinessObject> afterCBOs = new ArrayList<>(); |
| | | List<com.vci.corba.omd.data.BusinessObject> addBos = new ArrayList<>(); |
| | | List<com.vci.corba.omd.data.BusinessObject> afterBOs = new ArrayList<>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>(); |
| | | Map<String,List<String>> releasedFileOids = new HashMap<>(); |
| | | for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) { |
| | | BaseResult<ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, false, false, false); |
| | | if (!resultCbo.isSuccess()) { |
| | | return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs()); |
| | | } |
| | |
| | | } |
| | | } |
| | | try { |
| | | BusinessObject[] resultBOs = platformClientUtil.getBOFactoryService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false); |
| | | // com.vci.corba.omd.data.BusinessObject[] resultBOs = platformClientUtil.getBOFactoryService().batchCreateBusinessObject(addBos.toArray(new BusinessObject[0]), false, false); |
| | | com.vci.corba.omd.data.BusinessObject[] resultBOs = ServiceProvider.getBOFService().batchCreateBusinessObject(addBos.toArray(new com.vci.corba.omd.data.BusinessObject[0]), false, false); |
| | | afterBOs = Arrays.stream(resultBOs).collect(Collectors.toList()); |
| | | Arrays.stream(resultBOs).forEach(bo->{ |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | cbo.setBusinessObject(bo); |
| | | afterCBOs.add(cbo); |
| | | }); |
| | |
| | | return beforeResult; |
| | | } |
| | | //封装数据 |
| | | BaseResult<ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,true,false,false); |
| | | if(!resultCbo.isSuccess()){ |
| | | return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); |
| | | } |
| | | //执行保存 |
| | | BaseResult<Map<String,Object>> result = BaseResult.success(); |
| | | try { |
| | | platformClientUtil.getBOFactoryService().updateBusinessObject(new BusinessObjectHolder(resultCbo.getObj().getBusinessObject())); |
| | | // platformClientUtil.getBOFactoryService().updateBusinessObject(new BusinessObjectHolder(resultCbo.getObj().getBusinessObject())); |
| | | ServiceProvider.getBOFService().updateBusinessObject(resultCbo.getObj().getBusinessObject()); |
| | | result.setObj(boService.cbo2Map(resultCbo.getObj())); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | |
| | | //后置事件 |
| | | String afterEvent = formDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(Arrays.stream(new ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | |
| | | return beforeResult; |
| | | } |
| | | //封装数据 |
| | | BaseResult<ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO,formDefineVO,false,formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | if(!resultCbo.isSuccess()){ |
| | | return BaseResult.fail(resultCbo.getMsg(),resultCbo.getMsgObjs()); |
| | | } |
| | | //执行保存 |
| | | BaseResult<Map<String,Object>> result = BaseResult.success(); |
| | | try { |
| | | BusinessObject bo = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | ClientBusinessObject afterCbo = new ClientBusinessObject(); |
| | | // BusinessObject bo = platformClientUtil.getBOFactoryService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | com.vci.corba.omd.data.BusinessObject bo = ServiceProvider.getBOFService().createBusinessObject(resultCbo.getObj().getBusinessObject(),formDataDTO.isUpVersion()?false:true,formDataDTO.isUpVersion()); |
| | | com.vci.client.bof.ClientBusinessObject afterCbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | afterCbo.setBusinessObject(bo); |
| | | result.setObj(boService.cbo2Map(afterCbo)); |
| | | } catch (VCIError vciError) { |
| | |
| | | //后置事件 |
| | | String afterEvent = formDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(Arrays.stream(new ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | callPostEvent(Arrays.stream(new com.vci.client.bof.ClientBusinessObject[]{resultCbo.getObj()}).collect(Collectors.toList()), null,afterEvent, VciChangeDocumentTypeEnum.EDIT); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | | } |
| | |
| | | return beforeResult; |
| | | } |
| | | //封装数据 |
| | | List<BusinessObject> updateCBOS = new ArrayList<>(); |
| | | List<com.vci.corba.omd.data.BusinessObject> updateCBOS = new ArrayList<>(); |
| | | Map<String,List<String>> releasedFileOids = new HashMap<>(); |
| | | List<ClientBusinessObject> afterCBOs = new ArrayList<>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> afterCBOs = new ArrayList<>(); |
| | | for(FormDataDTO formDataDTO:formDataDTOList.getFormDataDTOS()) { |
| | | BaseResult<ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> resultCbo = wrapperCbo(formDataDTO, formDefineVO, true, false, false); |
| | | if (!resultCbo.isSuccess()) { |
| | | return BaseResult.fail(resultCbo.getMsg(), resultCbo.getMsgObjs()); |
| | | } |
| | |
| | | String btmName = deleteDataDTO.getDataList().get(0).getBtmname(); |
| | | List<String> oidList = deleteDataDTO.getDataList().stream().map(BaseModelDTO::getOid).collect(Collectors.toList()); |
| | | //看看级联删除。只有自己引用自己的时候可以级联删除 |
| | | List<ClientBusinessObject> cbo = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> cbo = null; |
| | | if(deleteDataDTO.isCascade()){ |
| | | //级联删除 |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | |
| | | if(CollectionUtils.isEmpty(cbo)){ |
| | | return BaseResult.fail("没有在系统中找到这些数据,未执行删除操作"); |
| | | } |
| | | List<ClientBusinessObject> finalCbo = cbo; |
| | | Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(ClientBusinessObject::getOid).collect(Collectors.toList())); |
| | | List<com.vci.client.bof.ClientBusinessObject> finalCbo = cbo; |
| | | Collection<Collection<String>> oidCollections = WebUtil.switchCollectionForOracleIn(finalCbo.stream().map(com.vci.client.bof.ClientBusinessObject::getOid).collect(Collectors.toList())); |
| | | List<OsUsedAttributeVO> usedAttributeVOS = null; |
| | | boolean adminCascade = false; |
| | | if("admin".equalsIgnoreCase(VciBaseUtil.getCurrentUserId()) && deleteDataDTO.isAdminCascade()){ |
| | |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) { |
| | | List<ClientBusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap); |
| | | List<com.vci.client.bof.ClientBusinessObject> tempCbos = boService.queryCBO(usedAttributeVO.getPkBtmType(), conditionMap); |
| | | if(!CollectionUtils.isEmpty(tempCbos)){ |
| | | finalCbo.addAll(tempCbos); |
| | | } |
| | |
| | | //说明前置事件没有执行成功 |
| | | return beforeResult; |
| | | } |
| | | ClientLinkObject clo = null; |
| | | com.vci.client.bof.ClientLinkObject clo = null; |
| | | String prefix = ""; |
| | | if(formLinkDataDTO.isDirection()){ |
| | | prefix = LO_FROM_PREFIX; |
| | |
| | | } |
| | | |
| | | //查询from端的 |
| | | ClientBusinessObject fromCbo = new ClientBusinessObject(); |
| | | com.vci.client.bof.ClientBusinessObject fromCbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | try { |
| | | fromCbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(fromOid,fromBtmName)); |
| | | // fromCbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(fromOid,fromBtmName)); |
| | | fromCbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(fromOid,fromBtmName)); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | } |
| | | }); |
| | | //封装to端的 |
| | | BaseResult<ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO,formDefineVO,toOid,toBtmName,boData); |
| | | if(!result.isSuccess()){ |
| | | return BaseResult.fail(result.getMsg(),result.getMsgObjs()); |
| | | } |
| | | ClientBusinessObject toCbo = result.getObj(); |
| | | com.vci.client.bof.ClientBusinessObject toCbo = result.getObj(); |
| | | //初始化链接类型的值 |
| | | BaseResult<ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false); |
| | | BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, false); |
| | | if(!resultClo.isSuccess()){ |
| | | return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs()); |
| | | } |
| | |
| | | clo.setToBO(toCbo); |
| | | } |
| | | //执行保存 |
| | | BusinessObject[] bos = new BusinessObject[1]; |
| | | com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[1]; |
| | | toCbo.dealBusinessObjectNullValue(); |
| | | clo.dealLinkObjectNullValue(); |
| | | bos[0] = toCbo.getBusinessObject(); |
| | | BusinessObjectListHolder bosHolder = new BusinessObjectListHolder(); |
| | | bosHolder.value = bos; |
| | | LinkObjectHolder loHolder = new LinkObjectHolder(); |
| | | loHolder.value = clo.getLinkObject(); |
| | | try { |
| | | platformClientUtil.getBOFactoryService().createBusinessObjectWithLink(bosHolder,loHolder); |
| | | // platformClientUtil.getBOFactoryService().createBusinessObjectWithLink(bosHolder,loHolder); |
| | | ServiceProvider.getBOFService().createBusinessObjectWithLink(bos,clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | //后置事件 |
| | | String afterEvent = formLinkDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(null,Arrays.stream(new ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | }catch (Throwable e){ |
| | | //说明后置事件出现了错误,那么就需要删除以前的这条数据 |
| | | try { |
| | | platformClientUtil.getBOFactoryService().deleteBusinessObject(toCbo.getBusinessObject(),1); |
| | | platformClientUtil.getBOFactoryService().deleteLinkObject(clo.getLinkObject()); |
| | | // platformClientUtil.getBOFactoryService().deleteBusinessObject(toCbo.getBusinessObject(),1); |
| | | // platformClientUtil.getBOFactoryService().deleteLinkObject(clo.getLinkObject()); |
| | | ServiceProvider.getBOFService().deleteBusinessObject(toCbo.getBusinessObject(),1); |
| | | ServiceProvider.getBOFService().deleteLinkObject(clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | * @param editFlag 是否为编辑 |
| | | * @return 链接类型的内容 |
| | | */ |
| | | private BaseResult<ClientLinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){ |
| | | private BaseResult<com.vci.client.bof.ClientLinkObject> wrapperOnlyCLO(FormLinkDataDTO formLinkDataDTO,Map<String,String> loData,UIFormDefineVO formDefineVO,boolean editFlag){ |
| | | Map<String,String> baseDataMap = formLinkDataDTO2MapLow(formLinkDataDTO); |
| | | Map<String,String> allDataMap = new HashMap<>(); |
| | | allDataMap.putAll(loData); |
| | |
| | | return result; |
| | | } |
| | | //处理业务类型得到数据 |
| | | ClientLinkObject clo ; |
| | | com.vci.client.bof.ClientLinkObject clo ; |
| | | if(editFlag){ |
| | | try { |
| | | LinkObject linkObject = platformClientUtil.getBOFactoryService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType()); |
| | | clo = new ClientLinkObject(); |
| | | // LinkObject linkObject = platformClientUtil.getBOFactoryService().readLinkObjectById(formLinkDataDTO.getOid(), formLinkDataDTO.getLinkType()); |
| | | 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) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | }else{ |
| | | clo = new ClientLinkObject(); |
| | | clo = new com.vci.client.bof.ClientLinkObject(); |
| | | //处理初始化的数据 |
| | | clo.setOid(VciBaseUtil.getPk()); |
| | | clo.setCreator(VciBaseUtil.getCurrentUserId()); |
| | | clo.setCreateTime(VciDateUtil.getNowString()); |
| | | clo.setTs(VciDateUtil.getNowString()); |
| | | clo.setCreateTime(System.currentTimeMillis()); |
| | | clo.setTs(System.currentTimeMillis()); |
| | | clo.setLoName(formLinkDataDTO.getLinkType()); |
| | | } |
| | | // |
| | |
| | | * @param boData to的数据 |
| | | * @return 包含的对象 |
| | | */ |
| | | private BaseResult<ClientBusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){ |
| | | private BaseResult<com.vci.client.bof.ClientBusinessObject> wrapperToCbo(FormLinkDataDTO formLinkDataDTO,UIFormDefineVO formDefineVO,String toOid,String toBtmName,Map<String,String> boData){ |
| | | Map<String,String> dataLow = new HashMap<>(); |
| | | boData.forEach((key,value)->{ |
| | | dataLow.put(key.toLowerCase(),value); |
| | |
| | | if(!result.isSuccess()){ |
| | | return result; |
| | | } |
| | | ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion()); |
| | | com.vci.client.bof.ClientBusinessObject cbo = createOrGetCbo(dataLow,baseDataMap,editFlag,formLinkDataDTO.isToUpRevision(),formLinkDataDTO.isToUpVersion()); |
| | | return BaseResult.success(cbo); |
| | | |
| | | } |
| | |
| | | * @param newVersion 是否升版次 |
| | | * @return cbo对象 |
| | | */ |
| | | public ClientBusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | public com.vci.client.bof.ClientBusinessObject createOrGetCbo(Map<String,String> dataLowMap,Map<String,String> baseDataMap,boolean editFlag,boolean newRevision,boolean newVersion){ |
| | | String btmName = baseDataMap.get("btmname"); |
| | | String oid = baseDataMap.get("oid"); |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | // ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | String copyfromversion = baseDataMap.get("copyfromversion"); |
| | | OsBtmTypeVO btmTypeVO = btmService.getBtmById(btmName); |
| | | if(editFlag || newRevision || newVersion){ |
| | | try { |
| | | cbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); |
| | | // cbo.setBusinessObject(platformClientUtil.getBOFactoryService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); |
| | | cbo.setBusinessObject(ServiceProvider.getBOFService().readBusinessObject(editFlag?oid:copyfromversion,btmName)); |
| | | } catch (VCIError vciError) { |
| | | throw new VciBaseException("使用主键在系统中没有查询到数据",new String[]{oid},vciError); |
| | | } |
| | |
| | | BaseModel baseModel = cbo2BaseModel(cbo); |
| | | RevisionValueObject revisionValueObject = getNextRevision(btmTypeVO,baseModel); |
| | | cbo.setRevisionid(VciBaseUtil.getPk()); |
| | | cbo.setRevisionSeq(revisionValueObject.getRevisionSeq()); |
| | | cbo.setRevisionSeq((short) revisionValueObject.getRevisionSeq()); |
| | | cbo.setRevisionValue(revisionValueObject.getRevisionVal()); |
| | | cbo.setIsLastR(1); |
| | | cbo.setIsFirstR(0); |
| | | cbo.setIsLastR(true); |
| | | cbo.setIsFirstR(false); |
| | | //处理版次 |
| | | cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule())); |
| | | cbo.setVersionRule(btmTypeVO.getVersionRule()); |
| | | cbo.setVersionSeq(0); |
| | | cbo.setIsLastV(1); |
| | | cbo.setIsFirstV(1); |
| | | cbo.setVersionSeq((short) 0); |
| | | cbo.setIsLastV(true); |
| | | cbo.setIsFirstV(true); |
| | | } |
| | | //升版的时候,生命周期的状态需要改动到默认状态 |
| | | if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ |
| | | //查询生命周期 |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.getOid())){ |
| | | // OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); |
| | | LifeCycle lifeCycleVO = null; |
| | | try { |
| | | lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId()); |
| | | } catch (VCIError e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ |
| | | throw new VciBaseException("{0}里的生命周期设置得不正确,在系统中没有找到{1}这个生命周期",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()}); |
| | | } |
| | | cbo.setLcStatus(lifeCycleVO.getStartStatus()); |
| | | cbo.setLcStatus(lifeCycleVO.startState); |
| | | } |
| | | } |
| | | if(btmTypeVO.isRevisionFlag() && newVersion){ |
| | |
| | | BaseModel baseModel = cbo2BaseModel(cbo); |
| | | VersionValueObject versionValueObject = getNextVersion(btmTypeVO,baseModel); |
| | | cbo.setVersionValue(versionValueObject.getVersionVal()); |
| | | cbo.setVersionSeq(versionValueObject.getVersionSeq()); |
| | | cbo.setIsLastV(1); |
| | | cbo.setIsFirstV(0); |
| | | cbo.setVersionSeq((short) versionValueObject.getVersionSeq()); |
| | | cbo.setIsLastV(true); |
| | | cbo.setIsFirstV(false); |
| | | //升版的时候,生命周期的状态需要改动到默认状态 |
| | | if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ |
| | | //查询生命周期 |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.getOid())){ |
| | | // OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); |
| | | LifeCycle lifeCycleVO = null; |
| | | try { |
| | | lifeCycleVO = ServiceProvider.getOMDService().getLifeCycleService().getLifeCycle(btmTypeVO.getLifeCycleId()); |
| | | } catch (VCIError e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(lifeCycleVO == null || StringUtils.isBlank(lifeCycleVO.oid)){ |
| | | throw new VciBaseException("{0}里的生命周期设置得不正确,在系统中没有找到{1}这个生命周期",new String[]{btmTypeVO.getName(),btmTypeVO.getLifeCycleId()}); |
| | | } |
| | | cbo.setLcStatus(lifeCycleVO.getStartStatus()); |
| | | cbo.setLcStatus(lifeCycleVO.startState); |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | if(StringUtils.isBlank(cbo.getCreator())){ |
| | | cbo.setCreator(VciBaseUtil.getCurrentUserId()); |
| | | } |
| | | if(StringUtils.isBlank(cbo.getCreateTime())){ |
| | | cbo.setCreateTime(VciDateUtil.getNowString()); |
| | | if(cbo.getCreateTime() != 0){ |
| | | cbo.setCreateTime(System.currentTimeMillis()); |
| | | } |
| | | if(StringUtils.isBlank(cbo.getOwner())){ |
| | | cbo.setOwner(cbo.getCreator()); |
| | | } |
| | | cbo.setTs(VciDateUtil.getNowString()); |
| | | cbo.setTs(System.currentTimeMillis()); |
| | | if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId()) && (StringUtils.isBlank(cbo.getLcStatus()) || newRevision || newVersion)){ |
| | | //查询生命周期 |
| | | OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(btmTypeVO.getLifeCycleId()); |
| | |
| | | if (StringUtils.isBlank(cbo.getRevisionid())) { |
| | | cbo.setRevisionid(VciBaseUtil.getPk()); |
| | | } |
| | | cbo.setIsFirstR(1); |
| | | cbo.setIsLastR(1); |
| | | cbo.setIsFirstR(true); |
| | | cbo.setIsLastR(true); |
| | | cbo.setRevisionRule(btmTypeVO.getRevisionRuleId()); |
| | | cbo.setRevisionSeq(0); |
| | | cbo.setRevisionSeq((short) 0); |
| | | //看看是否需要处理版次 |
| | | |
| | | cbo.setVersionValue(getFirstVersion(btmTypeVO.getVersionRule())); |
| | | cbo.setVersionRule(btmTypeVO.getVersionRule()); |
| | | cbo.setVersionSeq(0); |
| | | cbo.setIsLastV(1); |
| | | cbo.setIsFirstV(1); |
| | | cbo.setVersionSeq((short) 0); |
| | | cbo.setIsLastV(true); |
| | | cbo.setIsFirstV(true); |
| | | } |
| | | } |
| | | setValueToCbo(dataLowMap,baseDataMap,cbo,editFlag); |
| | |
| | | * @param editFlag 是否为编辑 |
| | | */ |
| | | @Override |
| | | public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, ClientBusinessObject cbo, boolean editFlag){ |
| | | public void setValueToCbo(Map<String, String> dataLow, Map<String, String> baseDataLow, com.vci.client.bof.ClientBusinessObject cbo, boolean editFlag){ |
| | | dataLow.forEach((key,value)->{ |
| | | if(editFlag&¬SendOnEdit(key)){ |
| | | //平台不能传递这个 |
| | |
| | | //说明前置事件没有执行成功 |
| | | return beforeResult; |
| | | } |
| | | ClientLinkObject clo = null; |
| | | com.vci.client.bof.ClientLinkObject clo = null; |
| | | String prefix = formLinkDataDTO.isDirection()?LO_FROM_PREFIX:LO_TO_PREFIX; |
| | | String toOid = formLinkDataDTO.isDirection()?formLinkDataDTO.getFoid():formLinkDataDTO.getToid(); |
| | | String toBtmName = formLinkDataDTO.isDirection()?formLinkDataDTO.getFbtmname():formLinkDataDTO.getTbtmname(); |
| | |
| | | } |
| | | }); |
| | | } |
| | | ClientBusinessObject toCbo =null; |
| | | com.vci.client.bof.ClientBusinessObject toCbo =null; |
| | | if(!CollectionUtils.isEmpty(boData)) { |
| | | //封装to端的 |
| | | BaseResult<ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData); |
| | | BaseResult<com.vci.client.bof.ClientBusinessObject> result = wrapperToCbo(formLinkDataDTO, formDefineVO, toOid, toBtmName, boData); |
| | | if (!result.isSuccess()) { |
| | | return BaseResult.fail(result.getMsg(), result.getMsgObjs()); |
| | | } |
| | |
| | | } |
| | | |
| | | //初始化链接类型的值 |
| | | BaseResult<ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true); |
| | | BaseResult<com.vci.client.bof.ClientLinkObject> resultClo = wrapperOnlyCLO(formLinkDataDTO, loData, formDefineVO, true); |
| | | if(!resultClo.isSuccess()){ |
| | | return BaseResult.fail(resultClo.getMsg(),resultClo.getMsgObjs()); |
| | | } |
| | |
| | | clo.setToBO(toCbo); |
| | | } |
| | | } |
| | | LinkObjectHolder loHolder = new LinkObjectHolder(); |
| | | loHolder.value = clo.getLinkObject(); |
| | | // LinkObjectHolder loHolder = new LinkObjectHolder(); |
| | | // loHolder.value = clo.getLinkObject(); |
| | | try { |
| | | platformClientUtil.getBOFactoryService().updateLinkObject(loHolder); |
| | | // platformClientUtil.getBOFactoryService().updateLinkObject(loHolder); |
| | | ServiceProvider.getBOFService().updateLinkObject(clo.getLinkObject()); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | //保存to端或者from端 |
| | | BusinessObjectHolder boHolder = new BusinessObjectHolder(); |
| | | toCbo.dealBusinessObjectNullValue(); |
| | | boHolder.value = toCbo.getBusinessObject(); |
| | | // toCbo.dealBusinessObjectNullValue(); |
| | | // boHolder.value = toCbo.getBusinessObject(); |
| | | try{ |
| | | platformClientUtil.getBOFactoryService().updateBusinessObject(boHolder); |
| | | // platformClientUtil.getBOFactoryService().updateBusinessObject(boHolder); |
| | | ServiceProvider.getBOFService().updateBusinessObject(toCbo.getBusinessObject()); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | //后置事件 |
| | | String afterEvent = formLinkDataDTO.getPostEvent(); |
| | | try { |
| | | callPostEvent(null,Arrays.stream(new ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | callPostEvent(null,Arrays.stream(new com.vci.client.bof.ClientLinkObject[]{clo}).collect(Collectors.toList()), afterEvent, VciChangeDocumentTypeEnum.ADD); |
| | | }catch (Throwable e){ |
| | | //后置事件有问题了就只能是这样了,没办法恢复 |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[]{},e); |
| | |
| | | } |
| | | Map<String,List<ClientLinkObject>> fromBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getFromBTMName())); |
| | | Map<String,List<ClientLinkObject>> toBtmGroups = clos.stream().collect(Collectors.groupingBy(s->s.getToBTMName())); |
| | | Map<String,List<ClientBusinessObject>> fromBtmDataGroups = new HashMap<>(); |
| | | Map<String,List<ClientBusinessObject>> toBtmDataGroups = new HashMap<>(); |
| | | Map<String,List<com.vci.client.bof.ClientBusinessObject>> fromBtmDataGroups = new HashMap<>(); |
| | | Map<String,List<com.vci.client.bof.ClientBusinessObject>> toBtmDataGroups = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(fromBtmGroups)){ |
| | | fromBtmGroups.forEach((btmType,cloList)->{ |
| | | List<ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getFromOid).collect(Collectors.toList()), btmType); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getFromOid).collect(Collectors.toList()), btmType); |
| | | fromBtmDataGroups.put(btmType,cbos); |
| | | }); |
| | | } |
| | | if(!CollectionUtils.isEmpty(toBtmGroups)){ |
| | | toBtmGroups.forEach((btmType,cloList)->{ |
| | | List<ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getToOid).collect(Collectors.toList()), btmType); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.selectCBOByOidCollection(cloList.stream().map(ClientLinkObject::getToOid).collect(Collectors.toList()), btmType); |
| | | toBtmDataGroups.put(btmType,cbos); |
| | | }); |
| | | } |
| | |
| | | if(deleteLinkDataDTO.isDeleteFromData()){ |
| | | fromBtmDataGroups.forEach((btm,cbos)->{ |
| | | try{ |
| | | platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); |
| | | platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); |
| | | }catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | if(deleteLinkDataDTO.isDeleteToData()){ |
| | | toBtmDataGroups.forEach((btm,cbos)->{ |
| | | try{ |
| | | platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); |
| | | platformClientUtil.getBOFactoryService().batchDeleteBusinessObject(cbos.stream().map(com.vci.client.bof.ClientBusinessObject::getBusinessObject).toArray(BusinessObject[] :: new),1); |
| | | }catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | referConfigVO.setConditionMap(new HashMap<>()); |
| | | } |
| | | |
| | | List<ClientBusinessObject> cbos = null; |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = null; |
| | | String oidFieldName = StringUtils.isNotBlank(referConfigVO.getParentUsedField())?referConfigVO.getParentUsedField():referConfigVO.getValueField(); |
| | | if(referConfigVO.isSelectAllLevel()) { |
| | | String parentOidSql = ""; |
| | |
| | | @Override |
| | | public List<Map<String,String>> getDataAttr(String btmname, String oid) { |
| | | VciBaseUtil.alertNotNull(btmname,"业务类型的信息",oid,"业务数据的主键"); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btmname,WebUtil.getOidQuery(oid)); |
| | | List<Map<String,String>> dataMap = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | |
| | | import com.vci.corba.omd.qtm.QTInfo; |
| | | import com.vci.corba.query.ObjectQueryService; |
| | | import com.vci.corba.query.ObjectQueryServicePrx; |
| | | import com.vci.corba.query.data.KV; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.mw.client.InvocationUtility; |
| | | import com.vci.starter.web.annotation.Column; |
| | |
| | | import com.vci.starter.web.pagemodel.PageHelper; |
| | | import com.vci.starter.web.util.BeanUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.util.VciDateUtil; |
| | | import com.vci.starter.web.wrapper.VciQueryWrapperForDO; |
| | | import com.vci.web.pageModel.*; |
| | | import com.vci.web.properties.WebProperties; |
| | | import com.vci.web.service.*; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.dom4j.DocumentException; |
| | | import org.dom4j.DocumentHelper; |
| | | import org.omg.CORBA.IntHolder; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import plm.bs.bom.clientobject.ClientBusinessObject; |
| | | import com.vci.client.bof.ClientBusinessObject; |
| | | import plm.bs.bom.clientobject.ClientLinkObject; |
| | | import plm.bs.bom.common.*; |
| | | import plm.corba.qt.KV; |
| | | import plm.corba.qt.QTServiceOperations; |
| | | import plm.oq.objectQuery.common.*; |
| | | |
| | | import java.lang.reflect.Field; |
| | |
| | | bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); |
| | | bo.setNameoid((new ObjectUtility()).getNewObjectID36()); |
| | | bo.setBtmName(boName); |
| | | bo.setIsLastR(1); |
| | | bo.setIsFirstR(1); |
| | | bo.setIsFirstV(1); |
| | | bo.setIsLastV(1); |
| | | bo.setIsLastR(true); |
| | | bo.setIsFirstR(true); |
| | | bo.setIsFirstV(true); |
| | | bo.setIsLastV(true); |
| | | bo.setCreator(userName); |
| | | bo.setCreateTime(String.valueOf(System.currentTimeMillis())); |
| | | bo.setCreateTime(System.currentTimeMillis()); |
| | | bo.setLastModifier(userName); |
| | | bo.setLastModifyTime(String.valueOf(System.currentTimeMillis())); |
| | | bo.setLastModifyTime(System.currentTimeMillis()); |
| | | bo.setRevisionRule(btmTypeVO.getRevisionRuleId()); |
| | | bo.setVersionRule(String.valueOf(btmTypeVO.getVersionRule())); |
| | | if(StringUtils.isNotBlank(btmTypeVO.getRevisionRuleId())){ |
| | |
| | | bo.setRevisionValue(revisionRuleVO.getStartCode()); |
| | | } |
| | | |
| | | bo.setRevisionSeq(1); |
| | | bo.setVersionSeq(1); |
| | | bo.setRevisionSeq((short) 1); |
| | | bo.setVersionSeq((short) 1); |
| | | bo.setVersionValue(getVersionValue(WebUtil.getInt(btmTypeVO.getVersionRule()))); |
| | | bo.setLctId(btmTypeVO.getLifeCycleId()); |
| | | if(StringUtils.isNotBlank(btmTypeVO.getLifeCycleId())){ |
| | |
| | | bo.setName(""); |
| | | bo.setDescription(""); |
| | | bo.setOwner(userName); |
| | | bo.setCheckinBy(userName); |
| | | // bo.setCheckinBy(userName); |
| | | bo.setCopyFromVersion(""); |
| | | this.initTypeAttributeValue(bo,btmTypeVO); |
| | | return bo; |
| | |
| | | */ |
| | | private ClientBusinessObject cloneClientBusinessObject(ClientBusinessObject cbo){ |
| | | if(cbo !=null){ |
| | | BusinessObject businessObject = new BusinessObject(); |
| | | BusinessObject bo = cbo.getBusinessObject(); |
| | | com.vci.corba.omd.data.BusinessObject businessObject = new com.vci.corba.omd.data.BusinessObject(); |
| | | com.vci.corba.omd.data.BusinessObject bo = cbo.getBusinessObject(); |
| | | businessObject.oid = new ObjectUtility().getNewObjectID36(); |
| | | businessObject.revisionid = new ObjectUtility().getNewObjectID36(); |
| | | businessObject.nameoid = new ObjectUtility().getNewObjectID36(); |
| | | businessObject.btmName = bo.btmName; |
| | | businessObject.btName = bo.btName; |
| | | businessObject.isLastR = bo.isLastR; |
| | | businessObject.isFirstR = bo.isFirstR; |
| | | businessObject.isLastV = bo.isLastV; |
| | | businessObject.isFirstV = bo.isFirstV; |
| | | businessObject.creator = WebUtil.getCurrentUserId(); |
| | | businessObject.createTime = String.valueOf(System.currentTimeMillis()); |
| | | businessObject.lastModifier = bo.lastModifier; |
| | | businessObject.lastModifyTime = String.valueOf(bo.lastModifyTime); |
| | | businessObject.createTime = System.currentTimeMillis(); |
| | | businessObject.modifier = bo.modifier; |
| | | businessObject.modifyTime = bo.modifyTime; |
| | | businessObject.revisionRule = bo.revisionRule; |
| | | businessObject.versionRule = bo.versionRule; |
| | | businessObject.revisionSeq = bo.revisionSeq; |
| | |
| | | businessObject.versionValue = bo.versionValue; |
| | | businessObject.lctId = bo.lctId; |
| | | businessObject.lcStatus = bo.lcStatus; |
| | | businessObject.ts = VciDateUtil.getNowString(); |
| | | businessObject.ts = System.currentTimeMillis(); |
| | | businessObject.id = bo.id; |
| | | businessObject.name = bo.name; |
| | | businessObject.description = bo.description; |
| | | businessObject.owner = businessObject.creator; |
| | | businessObject.checkinBy = bo.checkinBy; |
| | | businessObject.checkinTime = bo.checkinTime; |
| | | businessObject.checkoutBy = bo.checkoutBy; |
| | | businessObject.checkoutTime = bo.checkoutTime; |
| | | businessObject.copyFromVersion = bo.copyFromVersion; |
| | | // businessObject.checkinBy = bo.checkinBy; |
| | | // businessObject.checkinTime = bo.checkinTime; |
| | | // businessObject.checkoutBy = bo.checkoutBy; |
| | | // businessObject.checkoutTime = bo.checkoutTime; |
| | | businessObject.fromVersion = bo.fromVersion; |
| | | if(bo.newAttrValList !=null){ |
| | | businessObject.newAttrValList = clone(bo.newAttrValList); |
| | | } |
| | |
| | | * @param newAttrValList 属性值对象数组 |
| | | * @return 拷贝后的新属性数组 |
| | | */ |
| | | private AttributeValue[] clone(AttributeValue[] newAttrValList) { |
| | | AttributeValue[] n = new AttributeValue[newAttrValList.length]; |
| | | private com.vci.corba.omd.data.AttributeValue[] clone(com.vci.corba.omd.data.AttributeValue[] newAttrValList) { |
| | | com.vci.corba.omd.data.AttributeValue[] n = new com.vci.corba.omd.data.AttributeValue[newAttrValList.length]; |
| | | for (int i = 0; i < newAttrValList.length; i++) { |
| | | n[i] = new AttributeValue(newAttrValList[i].attrName,newAttrValList[i].attrVal); |
| | | n[i] = new com.vci.corba.omd.data.AttributeValue(newAttrValList[i].attrName,newAttrValList[i].attrVal); |
| | | } |
| | | return n; |
| | | } |
| | |
| | | String fieldName = referInfo.split("\\.")[1].trim().toLowerCase(); |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put(fieldName,QueryOptionConstant.IN + "(" + WebUtil.toInSql(value.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName})); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null, Arrays.asList(new String[]{"oid",fieldName})); |
| | | |
| | | Map<String,String> data = new HashMap<String, String>(); |
| | | if(cbos!=null && cbos.size() > 0){ |
| | | for(ClientBusinessObject cbo : cbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : cbos){ |
| | | data.put(cbo.getAttributeValue(fieldName),cbo.getOid()); |
| | | } |
| | | } |
| | |
| | | throw new VciBaseException("属性" + columnName + "的值为空"); |
| | | } |
| | | conditionMap.put(columnName,QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oidSet.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName})); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = queryCBO(btmName,conditionMap,null,Arrays.asList(new String[]{columnName})); |
| | | if(cbos !=null && cbos.size() >0){ |
| | | for(ClientBusinessObject cbo : cbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : cbos){ |
| | | String oid = cbo.getAttributeValue(columnName); |
| | | if(oidSet.contains(oid)){ |
| | | oidSet.remove(oid); |
| | |
| | | * @throws VciBaseException 查询出错的是抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBO(String btmType, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, |
| | | Map<String, String> conditionMap) throws VciBaseException { |
| | | List<String> clauseList = new ArrayList<String>(); |
| | | clauseList.add("*"); |
| | |
| | | * @throws VciBaseException 查询出错的是抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBO(String btmType, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, |
| | | Map<String, String> conditionMap, PageHelper ph) |
| | | throws VciBaseException { |
| | | List<String> clauseList = new ArrayList<String>(); |
| | |
| | | * @throws VciBaseException 查询出错的是抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBO(String btmType, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBO(String btmType, |
| | | Map<String, String> conditionMap, PageHelper ph, |
| | | List<String> clauseList) throws VciBaseException { |
| | | QueryTemplate qt = new QueryTemplate(); |
| | |
| | | * @return 查询出来的值 |
| | | * @throws VciBaseException 查询出错的时候会抛出异常 |
| | | */ |
| | | private List<ClientBusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{ |
| | | List<ClientBusinessObject> allCbos = new ArrayList<ClientBusinessObject>(); |
| | | private List<com.vci.client.bof.ClientBusinessObject> baseQueryCBO(QueryTemplate qt,Map<String,String> conditionMap,PageHelper ph,List<String> clauseList) throws VciBaseException{ |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbos = new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | if(clauseList == null){ |
| | | clauseList = new ArrayList<String>(); |
| | | clauseList.add("*"); |
| | |
| | | } |
| | | if (bos != null && bos.count > 0) { |
| | | for (com.vci.corba.omd.data.BusinessObject bo : bos.returnValue) { |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | BusinessObject businessObject = Func.copyProperties(bo, BusinessObject.class); |
| | | cbo.setBusinessObject(businessObject); |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | // BusinessObject businessObject = new BusinessObject(bo.oid, bo.revisionid, bo.nameoid, bo.btName, bo.isLastR ? 1 : 0, bo.isFirstR ? 1 : 0, |
| | | // bo.isLastV ? 1 : 0, bo.isFirstV ? 1 : 0, bo.creator, String.valueOf(bo.createTime), bo.modifier, String.valueOf(bo.modifyTime), |
| | | // bo.revisionRule, bo.versionRule, bo.revisionSeq, bo.revisionValue, bo.versionSeq, |
| | | // bo.versionValue, bo.lctId, bo.lcStatus, String.valueOf(bo.ts), bo.id, bo.name, bo.description, |
| | | // bo.owner,null, null, null, null, |
| | | // bo.fromVersion, copyToAttributeValue(bo.newAttrValList), copyToAttributeValue(bo.hisAttrValList)); |
| | | cbo.setBusinessObject(bo); |
| | | queryEnumText(cbo,enumAttrName); |
| | | allCbos.add(cbo); |
| | | } |
| | |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | return allCbos; |
| | | } |
| | | |
| | | public AttributeValue[] copyToAttributeValue(com.vci.corba.omd.data.AttributeValue[] attributeValues){ |
| | | AttributeValue[] attributeValueList = new AttributeValue[attributeValues.length]; |
| | | for (int i = 0; i < attributeValues.length; i++) { |
| | | AttributeValue newAttributeValue = new AttributeValue(); |
| | | newAttributeValue.attrName = attributeValues[i].attrName; |
| | | newAttributeValue.attrVal = attributeValues[i].attrVal; |
| | | attributeValueList[i] = newAttributeValue; |
| | | } |
| | | return attributeValueList; |
| | | } |
| | | |
| | | /** |
| | |
| | | * 查询生命周期的值 |
| | | * @param cbos 业务对象 |
| | | */ |
| | | private void queryLcStatus(List<ClientBusinessObject> cbos){ |
| | | private void queryLcStatus(List<com.vci.client.bof.ClientBusinessObject> cbos){ |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | |
| | | Map<String, OsStatusVO> statusVOMap = statusService.selectAllStatusMap(); |
| | |
| | | * @param enumAttrName 枚举属性的值 |
| | | * @throws VciBaseException |
| | | */ |
| | | private void queryEnumText(ClientBusinessObject cbo,List<String> enumAttrName) throws VciBaseException{ |
| | | private void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo,List<String> enumAttrName) throws VciBaseException{ |
| | | queryEnumText(cbo,null,enumAttrName); |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException 查询枚举出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public void queryEnumText(ClientBusinessObject cbo, ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException{ |
| | | public void queryEnumText(com.vci.client.bof.ClientBusinessObject cbo, com.vci.client.bof.ClientLinkObject clo, List<String> enumAttrName) throws VciBaseException{ |
| | | if(enumAttrName.size()>0){//查询枚举 |
| | | for(String enumAttr:enumAttrName){//格式为 code_field code是枚举的编码,field是当前业务类型存储枚举值的字段 |
| | | if(enumAttr.toLowerCase().equals("creator_name")){ |
| | |
| | | * @param attr 属性名 |
| | | * @param value 值 |
| | | */ |
| | | private void setValueToCboOrClo(ClientBusinessObject cbo,ClientLinkObject clo,String attr,String value){ |
| | | private void setValueToCboOrClo(com.vci.client.bof.ClientBusinessObject cbo,com.vci.client.bof.ClientLinkObject clo,String attr,String value){ |
| | | try { |
| | | if (cbo != null) { |
| | | cbo.setAttributeValueWithNoCheck(attr, value); |
| | |
| | | * @param attributeValue 属性的值 |
| | | */ |
| | | @Override |
| | | public void setAttributeValueForClo(ClientLinkObject clo, String attributeName, String attributeValue) { |
| | | AttributeValue[] attrValues = clo.getLinkObject().newAttrValList; |
| | | ArrayList<AttributeValue> attrValList = new ArrayList(); |
| | | AttributeValue attrVal; |
| | | public void setAttributeValueForClo(com.vci.client.bof.ClientLinkObject clo, String attributeName, String attributeValue) { |
| | | com.vci.corba.omd.data.AttributeValue[] attrValues = clo.getLinkObject().newAttrValList; |
| | | ArrayList<com.vci.corba.omd.data.AttributeValue> attrValList = new ArrayList(); |
| | | com.vci.corba.omd.data.AttributeValue attrVal; |
| | | int i; |
| | | if (attrValues != null && attrValues.length > 0) { |
| | | AttributeValue[] var9 = attrValues; |
| | | com.vci.corba.omd.data.AttributeValue[] var9 = attrValues; |
| | | i = attrValues.length; |
| | | |
| | | for (int var7 = 0; var7 < i; ++var7) { |
| | |
| | | boolean isExist = false; |
| | | |
| | | for (i = 0; i < attrValList.size(); ++i) { |
| | | attrVal = (AttributeValue) attrValList.get(i); |
| | | attrVal = (com.vci.corba.omd.data.AttributeValue) attrValList.get(i); |
| | | if (attrVal.attrName.toUpperCase().equals(attributeName.toUpperCase())) { |
| | | attrVal.attrVal = attributeValue; |
| | | isExist = true; |
| | |
| | | } |
| | | |
| | | if (!isExist) { |
| | | attrVal = new AttributeValue(); |
| | | attrVal = new com.vci.corba.omd.data.AttributeValue(); |
| | | attrVal.attrName = attributeName.toUpperCase(); |
| | | attrVal.attrVal = attributeValue; |
| | | attrValList.add(attrVal); |
| | | } |
| | | |
| | | clo.getLinkObject().newAttrValList = (AttributeValue[]) attrValList.toArray(new AttributeValue[attrValList.size()]); |
| | | clo.getLinkObject().newAttrValList = (com.vci.corba.omd.data.AttributeValue[]) attrValList.toArray(new com.vci.corba.omd.data.AttributeValue[attrValList.size()]); |
| | | } |
| | | |
| | | |
| | |
| | | * @param enumAttrName 枚举属性 |
| | | * @throws VciBaseException 查询出错的时候会抛出异常 |
| | | */ |
| | | private void queryEnumTextClo(ClientLinkObject clo,List<String> enumAttrName) throws VciBaseException{ |
| | | private void queryEnumTextClo(com.vci.client.bof.ClientLinkObject clo,List<String> enumAttrName) throws VciBaseException{ |
| | | queryEnumText(null,clo,enumAttrName); |
| | | } |
| | | |
| | |
| | | * @throws VciBaseException 查询出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | Map<String, String> conditionMap, Map<String, String> replaceMap) |
| | | throws VciBaseException { |
| | | PageHelper ph = new PageHelper(-1); |
| | |
| | | * @throws VciBaseException 查询出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | Map<String, String> conditionMap, Map<String, String> replaceMap, |
| | | PageHelper ph) throws VciBaseException { |
| | | List<String> clauseList = new ArrayList<String>(); |
| | |
| | | * @throws VciBaseException 查询出错会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryCBOByScheme(String queryScheme, |
| | | Map<String, String> conditionMap, Map<String, String> replaceMap, |
| | | PageHelper ph, List<String> clauseList) throws VciBaseException { |
| | | QueryTemplate qt = getQtByName(queryScheme,replaceMap); |
| | |
| | | } |
| | | int count = 0; |
| | | try{ |
| | | count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); |
| | | // count = platformClientUtil.getQueryService().findTotalCount(); |
| | | count = Integer.parseInt(String.valueOf(ServiceProvider.getOQService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()))); |
| | | }catch (VCIError e) { |
| | | try { |
| | | count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); |
| | | // count = platformClientUtil.getQueryService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()); |
| | | count = Integer.parseInt(String.valueOf(ServiceProvider.getOQService().findTotalCount(qt.getId(), Tool.qtTOXMl(qt).asXML()))); |
| | | }catch (VCIError ee) { |
| | | // logger.error(ee.error_code,ee); |
| | | // throw WebUtil.getVciBaseException(ee); |
| | |
| | | * @throws VciBaseException 查询出错会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryBySql(String sql, |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryBySql(String sql, |
| | | Map<String, String> conditionMap) throws VciBaseException { |
| | | List<Map> allData = queryBySqlForMap(sql,conditionMap); |
| | | if(allData == null || allData.size() == 0){ |
| | | return new ArrayList<ClientBusinessObject>(); |
| | | return new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | }else{ |
| | | return map2Cbos(allData); |
| | | } |
| | |
| | | * @throws VciBaseException 查询出错活抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException{ |
| | | public List<com.vci.client.bof.ClientBusinessObject> queryByOnlySql(String sql) throws VciBaseException{ |
| | | List<Map> allData = queryByOnlySqlForMap(sql); |
| | | if(allData == null || allData.size() == 0){ |
| | | return new ArrayList<ClientBusinessObject>(); |
| | | return new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | }else{ |
| | | return map2Cbos(allData); |
| | | } |
| | |
| | | } |
| | | List<Map> dataList = new ArrayList<>(); |
| | | try { |
| | | KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql); |
| | | // KV[][] kvs = platformClientUtil.getQueryService().queryBySql(sql); |
| | | com.vci.corba.query.data.KV[][] kvs = ServiceProvider.getOQService().queryBySql(sql); |
| | | if(kvs!=null && kvs.length>0){ |
| | | for (int i = 0; i < kvs.length; i++) { |
| | | Map<String,String> data = new HashMap<>(); |
| | | KV[] kv = kvs[i]; |
| | | com.vci.corba.query.data.KV[] kv = kvs[i]; |
| | | if(kv!=null && kv.length >0){ |
| | | for (int j = 0; j < kv.length; j++) { |
| | | KV kv1 = kv[j]; |
| | |
| | | allFieldAttrMap.put(columnName.toLowerCase(),fieldName); |
| | | } |
| | | List<T> allObject = new ArrayList<T>(); |
| | | List<ClientBusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//执行查询 |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbos = queryCBO(WebUtil.getBtmTypeByObject(c), conditionMap, ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList()));//执行查询 |
| | | List<String> oids = new ArrayList<String>(); |
| | | |
| | | if(allCbos!=null&&allCbos.size()>0){ |
| | | for(ClientBusinessObject cbo : allCbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : allCbos){ |
| | | T obj = null; |
| | | try { |
| | | obj = c.newInstance(); |
| | |
| | | allFieldAttrMap.put(columnName.toLowerCase(),fieldName); |
| | | } |
| | | List<T> allObject = new ArrayList<T>(); |
| | | List<ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList())); |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbos = queryCBOByScheme(queryScheme, conditionMap, replaceMap,ph, allFieldAttrMap.keySet().stream().collect(Collectors.toList())); |
| | | List<String> oids = new ArrayList<String>(); |
| | | if(allCbos!=null&&allCbos.size()>0){ |
| | | for(ClientBusinessObject cbo : allCbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : allCbos){ |
| | | T obj = null; |
| | | try { |
| | | obj = c.newInstance(); |
| | |
| | | * @param isEdit 是否为编辑 |
| | | * @throws VciBaseException 设置出错会抛出异常 |
| | | */ |
| | | private void setValueToCbo(Object obj,String btmType,ClientBusinessObject cbo ,boolean isEdit) throws VciBaseException{ |
| | | private void setValueToCbo(Object obj,String btmType,com.vci.client.bof.ClientBusinessObject cbo ,boolean isEdit) throws VciBaseException{ |
| | | Field pkField = WebUtil.getPkFieldForObj(obj.getClass()); |
| | | if(pkField == null){ |
| | | throw new VciBaseException("{0}类中没有定义主键属性",new Object[]{obj.getClass()}); |
| | |
| | | if(list==null){ |
| | | throw new VciBaseException(VciBaseException.paramNull); |
| | | } |
| | | Set<ClientBusinessObject> allUpdateCbos = new HashSet<ClientBusinessObject>(); |
| | | Set<ClientBusinessObject> allDeleteCbos = new HashSet<ClientBusinessObject>(); |
| | | Set<ClientBusinessObject> allAddCbos = new HashSet<ClientBusinessObject>(); |
| | | Set<com.vci.client.bof.ClientBusinessObject> allUpdateCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>(); |
| | | Set<com.vci.client.bof.ClientBusinessObject> allDeleteCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>(); |
| | | Set<com.vci.client.bof.ClientBusinessObject> allAddCbos = new HashSet<com.vci.client.bof.ClientBusinessObject>(); |
| | | Map<String,String> btmOidsMap = new HashMap<String, String>(); |
| | | for(T obj : list){ |
| | | String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); |
| | |
| | | } |
| | | btmOidsMap.put(btmType, tempOids); |
| | | } |
| | | List<ClientBusinessObject> needUpdateCbos = new ArrayList<ClientBusinessObject>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> needUpdateCbos = new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | Iterator<String> it = btmOidsMap.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String btmType = it.next(); |
| | |
| | | } |
| | | //主键 |
| | | Object pkValue = WebUtil.getValueFromField(pkField.getName(), obj); |
| | | ClientBusinessObject cbo = null; |
| | | com.vci.client.bof.ClientBusinessObject cbo = null; |
| | | if(pkValue == null || (pkValue instanceof String && WebUtil.isNull(pkValue.toString()))){ |
| | | continue; |
| | | }else{ |
| | | for(ClientBusinessObject tempCbo : needUpdateCbos){ |
| | | for(com.vci.client.bof.ClientBusinessObject tempCbo : needUpdateCbos){ |
| | | if(tempCbo.getOid().equalsIgnoreCase(pkValue.toString().trim())){ |
| | | cbo = tempCbo; |
| | | break; |
| | |
| | | } |
| | | String btmType = WebUtil.getBtmTypeByObject(obj.getClass()); |
| | | //拷贝之前先清除已经有的值 |
| | | cbo.getBusinessObject().newAttrValList = new AttributeValue[0]; |
| | | cbo.getBusinessObject().newAttrValList = new com.vci.corba.omd.data.AttributeValue[0]; |
| | | setValueToCbo(obj,btmType,cbo,true); |
| | | allUpdateCbos.add(cbo); |
| | | } |
| | |
| | | if(ts.contains(".")){ |
| | | ts = ts.substring(0,ts.lastIndexOf(".")); |
| | | } |
| | | return cbos.get(0).getTs().contains(ts); |
| | | return cbos.get(0).getTs() == Long.valueOf(ts); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @throws VciBaseException 转换出错会抛出异常 |
| | | */ |
| | | @Override |
| | | public Map cbo2Map(ClientBusinessObject cbo) throws VciBaseException { |
| | | public Map cbo2Map(com.vci.client.bof.ClientBusinessObject cbo) throws VciBaseException { |
| | | Map<String,String> map = new HashMap<String, String>(); |
| | | WebUtil.copyValueToMapFromCbos(cbo, map); |
| | | return map; |
| | |
| | | * @throws VciBaseException 转换出错会抛出异常 |
| | | */ |
| | | @Override |
| | | public List<ClientBusinessObject> map2Cbos(List<Map> mapList) |
| | | public List<com.vci.client.bof.ClientBusinessObject> map2Cbos(List<Map> mapList) |
| | | throws VciBaseException { |
| | | List<ClientBusinessObject> cboList = new ArrayList<ClientBusinessObject>(); |
| | | List<com.vci.client.bof.ClientBusinessObject> cboList = new ArrayList<com.vci.client.bof.ClientBusinessObject>(); |
| | | for(Map map : mapList){ |
| | | cboList.add(map2Cbo(map)); |
| | | } |
| | |
| | | * @throws VciBaseException 转换出错会抛出异常 |
| | | */ |
| | | @Override |
| | | public ClientBusinessObject map2Cbo(Map map) throws VciBaseException { |
| | | ClientBusinessObject cbo = new ClientBusinessObject(); |
| | | public com.vci.client.bof.ClientBusinessObject map2Cbo(Map map) throws VciBaseException { |
| | | com.vci.client.bof.ClientBusinessObject cbo = new com.vci.client.bof.ClientBusinessObject(); |
| | | WebUtil.copyValueToCboFromMap(cbo, map); |
| | | return cbo; |
| | | } |
| | |
| | | deleteReferAttrInCbo(batchCbos.getDeleteCbos()); |
| | | } |
| | | try { |
| | | platformClientUtil.getBOFactoryService().batchCUDBOLO(new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray())), |
| | | new LinkObjectListHolder(cloArray2Lo(batchCbos.getCreateCloArray())), |
| | | new BusinessObjectListHolder(cboArray2Bo(batchCbos.getUpdateCboArray())), |
| | | new LinkObjectListHolder(cloArray2Lo(batchCbos.getUpdateCloArray())), |
| | | // platformClientUtil.getBOFactoryService().batchCUDBOLO(new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray())), |
| | | // new LinkObjectListHolder(cloArray2Lo(batchCbos.getCreateCloArray())), |
| | | // new BusinessObjectListHolder(cboArray2Bo(batchCbos.getUpdateCboArray())), |
| | | // new LinkObjectListHolder(cloArray2Lo(batchCbos.getUpdateCloArray())), |
| | | // cboArray2Bo(batchCbos.getDeleteCboArray()), cloArray2Lo(batchCbos.getDeleteCloArray())); |
| | | // new BusinessObjectListHolder(cboArray2Bo(batchCbos.getCreateCboArray())) |
| | | ServiceProvider.getBOFService().batchCUDBOLO(cboArray2Bo(batchCbos.getCreateCboArray()), |
| | | cloArray2Lo(batchCbos.getCreateCloArray()), |
| | | cboArray2Bo(batchCbos.getUpdateCboArray()), |
| | | cloArray2Lo(batchCbos.getUpdateCloArray()), |
| | | cboArray2Bo(batchCbos.getDeleteCboArray()), cloArray2Lo(batchCbos.getDeleteCloArray())); |
| | | } catch (VCIError e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | |
| | | * @param cbos 客户端对象 |
| | | * @return 业务对象 |
| | | */ |
| | | private BusinessObject[] cboArray2Bo(ClientBusinessObject[] cbos){ |
| | | private com.vci.corba.omd.data.BusinessObject[] cboArray2Bo(ClientBusinessObject[] cbos){ |
| | | if(cbos == null ||cbos.length == 0){ |
| | | return new BusinessObject[0]; |
| | | return new com.vci.corba.omd.data.BusinessObject[0]; |
| | | } |
| | | BusinessObject[] bos = new BusinessObject[cbos.length]; |
| | | com.vci.corba.omd.data.BusinessObject[] bos = new com.vci.corba.omd.data.BusinessObject[cbos.length]; |
| | | for(int i = 0; i < cbos.length; i++){ |
| | | bos[i] = cbos[i].getBusinessObject(); |
| | | } |
| | |
| | | * @param clos 客户端对象 |
| | | * @return 业务对象 |
| | | */ |
| | | private LinkObject[] cloArray2Lo(ClientLinkObject[] clos){ |
| | | private com.vci.corba.omd.data.LinkObject[] cloArray2Lo(com.vci.client.bof.ClientLinkObject[] clos){ |
| | | if(clos == null ||clos.length == 0){ |
| | | return new LinkObject[0]; |
| | | return new com.vci.corba.omd.data.LinkObject[0]; |
| | | } |
| | | LinkObject[] bos = new LinkObject[clos.length]; |
| | | com.vci.corba.omd.data.LinkObject[] bos = new com.vci.corba.omd.data.LinkObject[clos.length]; |
| | | for(int i = 0; i < clos.length; i++){ |
| | | bos[i] = clos[i].getLinkObject(); |
| | | } |
| | |
| | | private void deleteReferAttrInCbo(Set<ClientBusinessObject> cbos){ |
| | | if(cbos !=null){ |
| | | for(ClientBusinessObject cbo : cbos){ |
| | | BusinessObject bo = cbo.getBusinessObject(); |
| | | List<AttributeValue> newAttr = new ArrayList<AttributeValue>(); |
| | | com.vci.corba.omd.data.BusinessObject bo = cbo.getBusinessObject(); |
| | | List<com.vci.corba.omd.data.AttributeValue> newAttr = new ArrayList<com.vci.corba.omd.data.AttributeValue>(); |
| | | if (bo.newAttrValList != null) { |
| | | for (int i = 0; i < bo.newAttrValList.length; ++i) { |
| | | AttributeValue av = bo.newAttrValList[i]; |
| | | com.vci.corba.omd.data.AttributeValue av = bo.newAttrValList[i]; |
| | | if (WebUtil.isNormalAttr(av.attrName)) { |
| | | if(av.attrVal == null){ |
| | | av.attrVal = ""; |
| | |
| | | } |
| | | } |
| | | } |
| | | bo.newAttrValList = newAttr.toArray(new AttributeValue[0]); |
| | | bo.newAttrValList = newAttr.toArray(new com.vci.corba.omd.data.AttributeValue[0]); |
| | | cbo.setBusinessObject(bo); |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.vci.base.common.utility.ObjectUtility; |
| | | import com.vci.client.common.providers.ServiceProvider; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.query.ObjectQueryService; |
| | | import com.vci.starter.web.constant.QueryOptionConstant; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.DataGrid; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(LinkObject[] lo, |
| | | boolean isDirection) throws VciBaseException { |
| | | ClientLinkObject[] clos = new ClientLinkObject[lo.length]; |
| | | for(int i =0 ; i < lo.length; i ++){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(List los, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, |
| | | boolean isDirection) throws VciBaseException { |
| | | return queryLinkedCbo(los,isDirection,new ArrayList<String>()); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo(List los, |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo(List los, |
| | | boolean isDirection,List<String> queryColumn) throws VciBaseException { |
| | | ClientLinkObject[] clos = new ClientLinkObject[los.size()]; |
| | | for(int i = 0 ; i < los.size(); i ++){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo( |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo( |
| | | ClientLinkObject[] clol, boolean isDirection) throws VciBaseException { |
| | | return queryLinkedCbo(clol,isDirection,new ArrayList<String>()); |
| | | } |
| | |
| | | * |
| | | */ |
| | | @Override |
| | | public Map<String, ClientBusinessObject> queryLinkedCbo( |
| | | public Map<String, com.vci.client.bof.ClientBusinessObject> queryLinkedCbo( |
| | | ClientLinkObject[] clol, boolean isDirection,List<String> queryColumn) throws VciBaseException{ |
| | | Map<String/*t_oid或者f_oid*/,String/*oid*/> linkBoOidMap = new HashMap<String, String>(); |
| | | Map<String,String> btmTypeOidMap = new HashMap<String, String>(); |
| | |
| | | btmTypeOidMap.put(btmType, oids); |
| | | } |
| | | } |
| | | Map<String,ClientBusinessObject> linkedCboMap = new HashMap<String, ClientBusinessObject>(); |
| | | Map<String,com.vci.client.bof.ClientBusinessObject> linkedCboMap = new HashMap<>(); |
| | | Iterator<String> it = btmTypeOidMap.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String btmType = it.next(); |
| | |
| | | } |
| | | Map<String,String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("oid",oids); |
| | | List<ClientBusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); |
| | | List<com.vci.client.bof.ClientBusinessObject> allCbo = boService.queryCBO(btmType, conditionMap,new PageHelper(-1),clauseList); |
| | | if(allCbo.size()>0){ |
| | | for(ClientBusinessObject cbo : allCbo){ |
| | | for(com.vci.client.bof.ClientBusinessObject cbo : allCbo){ |
| | | String linkOid = linkBoOidMap.get(cbo.getOid()); |
| | | linkedCboMap.put(linkOid, cbo); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> clos2Map(List<ClientLinkObject> clos) throws VciBaseException { |
| | | public List<Map> clos2Map(List<com.vci.client.bof.ClientLinkObject> clos) throws VciBaseException { |
| | | List<Map> allMap = new ArrayList<Map>(); |
| | | for(ClientLinkObject clo : clos){ |
| | | for(com.vci.client.bof.ClientLinkObject clo : clos){ |
| | | allMap.add(clo2Map(clo)); |
| | | } |
| | | return allMap; |
| | | } |
| | | |
| | | @Override |
| | | public Map clo2Map(ClientLinkObject clo) throws VciBaseException { |
| | | public Map clo2Map(com.vci.client.bof.ClientLinkObject clo) throws VciBaseException { |
| | | Map<String,String> map = new HashMap<String, String>(); |
| | | WebUtil.copyValueToMapFromClos(clo, map); |
| | | return map; |
| | |
| | | * @return 链接类型和关联的to端 |
| | | */ |
| | | @Override |
| | | public List<BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) { |
| | | public List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) { |
| | | VciBaseUtil.alertNotNull(linkTypeDataQuery,"链接类型查询对象",linkTypeDataQuery.getQueryTemplateName(),"查询模板的名称"); |
| | | QueryTemplate qt =boService.getQtByName(linkTypeDataQuery.getQueryTemplateName(),linkTypeDataQuery.getReplaceMap()); |
| | | return queryCLOAndBOByQueryTemplate(qt,linkTypeDataQuery); |
| | |
| | | * @param linkTypeDataQuery 链接类型的查询对象 |
| | | * @return 链接类型和业务类型 |
| | | */ |
| | | private List<BOAndLO> queryCLOAndBOByQueryTemplate(QueryTemplate qt,UILinkTypeDataQuery linkTypeDataQuery){ |
| | | private List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOByQueryTemplate(QueryTemplate qt,UILinkTypeDataQuery linkTypeDataQuery){ |
| | | if(StringUtils.isNotBlank(linkTypeDataQuery.getToBtmType()) && StringUtils.isBlank(qt.getBtmType())) { |
| | | qt.setBtmType(linkTypeDataQuery.getToBtmType()); |
| | | } |
| | |
| | | } |
| | | boService.setPageAndOrderToQT(qt,linkTypeDataQuery.getPageHelper()); |
| | | try { |
| | | BOAndLO[] bos = platformClientUtil.getQueryService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | // com.vci.corba.query.data.BOAndLO[] bos = platformClientUtil.getQueryService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | com.vci.corba.query.data.BOAndLO[] bos = ServiceProvider.getOQService().getBOAndLOS(qt.getId(), Tool.qtTOXMl(qt).asXML(),linkTypeDataQuery.getParentOid()==null?"":linkTypeDataQuery.getParentOid()); |
| | | return Arrays.stream(bos).collect(Collectors.toList()); |
| | | } catch (VCIError e) { |
| | | // logger.error(e.error_code,e); |
| | |
| | | * @return 链接对象和to端业务对象 |
| | | */ |
| | | @Override |
| | | public List<BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery){ |
| | | public List<com.vci.corba.query.data.BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery){ |
| | | VciBaseUtil.alertNotNull(linkTypeDataQuery,"链接类型查询对象",linkTypeDataQuery.getLinkType(),"链接类型的名称"); |
| | | QueryTemplate qt = null; |
| | | if(StringUtils.isBlank(linkTypeDataQuery.getQueryTemplateName())){ |
| | |
| | | Map<String,List<String>> toBtmOidsMap = new HashMap<>(); |
| | | try { |
| | | IntHolder totalHolder = new IntHolder(); |
| | | LinkObject[] linkObjects = platformClientUtil.getQueryService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML(),totalHolder); |
| | | // com.vci.corba.omd.data.LinkObject[] linkObjects = platformClientUtil.getQueryService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML(),totalHolder); |
| | | ObjectQueryService.FindLTObjectsV2Result linkObjects = ServiceProvider.getOQService().findLTObjectsV2(qt.getId(), Tool.qtTOXMl(qt).asXML()); |
| | | |
| | | |
| | | List<Map<String,String>> data = new ArrayList<>(); |
| | | List<String> finalEnumFields = enumFields; |
| | | final Integer[] total = {totalHolder.value}; |
| | | Arrays.stream(linkObjects).forEach(lo->{ |
| | | ClientLinkObject clo = new ClientLinkObject(); |
| | | Arrays.stream(linkObjects.returnValue).forEach(lo->{ |
| | | com.vci.client.bof.ClientLinkObject clo = new com.vci.client.bof.ClientLinkObject(); |
| | | clo.setLinkObject(lo); |
| | | Map<String, String> map = new HashMap<>(); |
| | | boService.queryEnumText(null,clo, finalEnumFields); |
| | | WebUtil.copyValueToMapFromClos(clo,map); |
| | | List<String> fromOids = fromBtmOidsMap.getOrDefault(lo.fromBTMName, new ArrayList<>()); |
| | | List<String> fromOids = fromBtmOidsMap.getOrDefault(lo.fromBTName, new ArrayList<>()); |
| | | fromOids.add(lo.fromOid); |
| | | fromBtmOidsMap.put(lo.fromBTMName,fromOids); |
| | | fromBtmOidsMap.put(lo.fromBTName,fromOids); |
| | | |
| | | List<String> toOids = toBtmOidsMap.getOrDefault(lo.toBTMName, new ArrayList<>()); |
| | | List<String> toOids = toBtmOidsMap.getOrDefault(lo.toBTName, new ArrayList<>()); |
| | | toOids.add(lo.toOid); |
| | | toBtmOidsMap.put(lo.toBTMName,toOids); |
| | | toBtmOidsMap.put(lo.toBTName,toOids); |
| | | data.add(map); |
| | | if(total[0] == 0){ |
| | | total[0] = VciBaseUtil.getInt(map.getOrDefault(QTConstants.COUNT_OVER_ALIAS.toLowerCase(),"0")); |
| | |
| | | //分页不要超过1000 |
| | | Map<String,String> boConditionMap =new HashMap<>(); |
| | | boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, fromFieldsFix); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | dataGrid.getData().forEach(data->{ |
| | |
| | | //分页不要超过1000 |
| | | Map<String,String> boConditionMap =new HashMap<>(); |
| | | boConditionMap.put("oid",QueryOptionConstant.IN + "(" + WebUtil.toInSql(oids.toArray(new String[0])) + ")"); |
| | | List<ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); |
| | | List<com.vci.client.bof.ClientBusinessObject> cbos = boService.queryCBO(btm, boConditionMap, null, toFieldsFix); |
| | | if(!CollectionUtils.isEmpty(cbos)){ |
| | | cbos.stream().forEach(cbo->{ |
| | | dataGrid.getData().forEach(data->{ |
| | |
| | | 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(); |
| | |
| | | //查询流程实例 |
| | | 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)); |
| | | } |
| | |
| | | Map<String,String> conditionMap = new HashMap<String, String>(); |
| | | conditionMap.put("startip",ip.trim()); |
| | | |
| | | List<ClientBusinessObject> ipCbos = boService.queryCBO(EnumIdConstant.IPSECRET_BTMNAME,conditionMap,null, Arrays.asList(new String[]{"ipsecret"})); |
| | | List<com.vci.client.bof.ClientBusinessObject> ipCbos = boService.queryCBO(EnumIdConstant.IPSECRET_BTMNAME,conditionMap,null, Arrays.asList(new String[]{"ipsecret"})); |
| | | int ipSecret = 0; |
| | | if(ipCbos!=null&& ipCbos.size()>0){ |
| | | ipSecret = WebUtil.getInt(ipCbos.get(0).getAttributeValue("ipsecret")); |
| | |
| | | package com.vci.web.util; |
| | | |
| | | |
| | | import com.vci.starter.web.annotation.*; |
| | | import com.vci.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.starter.web.wrapper.VciReferFieldInfo; |
| | | import com.vci.web.util.beans.BeanProperty; |
| | | import com.vci.web.util.beans.BladeBeanCopier; |
| | | import com.vci.web.util.convert.BladeConverter; |
| | | import com.vci.web.util.beans.BladeBeanMap; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanWrapper; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.beans.PropertyAccessorFactory; |
| | | import org.springframework.cglib.beans.BeanGenerator; |
| | | import org.springframework.lang.Nullable; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | import static com.vci.starter.web.wrapper.VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP; |
| | | import static com.vci.starter.web.wrapper.VciQueryWrapperForDO.USER_TABLE_COMPATIBILITY; |
| | | |
| | | /** |
| | | * 实体工具类 |
| | | * |