Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/SmPwdStrategyQueryServiceImpl.java
@@ -414,6 +414,7 @@ //组合方式转换为存储值 spsDto.setRequireCharType(combinations2Plchartypes(spsDto.getCombinations())); PasswordStrategyInfo passwordStrategyInfo = changePasswordStrategyDTO2Info(spsDto); return platformClientUtil.getFrameworkService().editPasswordStrategy(passwordStrategyInfo,userEntityInfo); } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -92,7 +92,15 @@ String attrId = baseQueryObject.getConditionMap().containsKey("name")?baseQueryObject.getConditionMap().get("name").replace("*",""):""; String attrName = baseQueryObject.getConditionMap().containsKey("label") ? baseQueryObject.getConditionMap().get("label").replace("*","") : ""; OsLinkTypeVO linkTypeVO = linkTypeService.selectByOid(linkTypeOid); List<OsLinkTypeAttributeVO> boAttrs = linkTypeService.listAttributeByLinkId(linkTypeVO.getId()); List<OsLinkTypeAttributeVO> boAttrs = null; try { boAttrs = linkTypeService.listAttributeByLinkId(linkTypeVO.getId()); }catch (Exception e){ e.printStackTrace(); String errorLog = "查询链接类型关联的属性时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(errorLog); throw new VciBaseException(errorLog); } List<OsLinkTypeAttributeVO> attrList = boAttrs.stream().filter(s->{ boolean usedFlag = true; if(StringUtils.isNotBlank(attrId) && !s.getId().contains(attrId)){ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
@@ -614,8 +614,15 @@ */ @GetMapping("/createERDiagram") public BaseResult createERDiagram(String id){ OsERVO osERVO = btmService.createERDiagram(id); return BaseResult.success(osERVO); try { OsERVO osERVO = btmService.createERDiagram(id); return BaseResult.success(osERVO); }catch (Exception e){ e.printStackTrace(); String msg = "生成业务类型使用的ER图时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(msg); return BaseResult.fail(msg); } } /** @@ -625,7 +632,14 @@ */ @GetMapping("/createERUsed") public BaseResult createERUsed(String id){ return BaseResult.success(btmService.createERUsed(id)); try { return BaseResult.success(btmService.createERUsed(id)); } catch (PLException e) { e.printStackTrace(); String msg = "取使用这个业务类型的E-R图时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(msg); return BaseResult.fail(msg); } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebUIDataController.java
@@ -87,7 +87,14 @@ @VciUnCheckRight @VciBusinessLog(operateName = "树的查询",description = "${param.btmname}") public List<Tree> getDataForTree(UITreeQuery treeQuery){ return uiDataService.getDataForTree(treeQuery); try { return uiDataService.getDataForTree(treeQuery); }catch (Exception e){ e.printStackTrace(); String errorMsg = "树的数据查询出现错误,原因:"+ VciBaseUtil.getExceptionMessage(e); logger.error(errorMsg); throw new VciBaseException(errorMsg); } } /** Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java
@@ -108,7 +108,7 @@ * @param id 编号 * @return 业务类型 */ OsBtmTypeVO getBtmById(String id); OsBtmTypeVO getBtmById(String id) throws PLException; /** * 使用类型名获取业务类型,查不到直接报错 @@ -176,20 +176,20 @@ * @param id 枚举的英文 * @return 枚举的名称 */ String getNameById(String id); String getNameById(String id) throws PLException; /** * 根据业务类型和链接类型生成ER图 * @param btmId 业务类型主键 */ OsERVO createERDiagram(String btmId); OsERVO createERDiagram(String btmId) throws PLException; /** * 获取使用这个业务类型的E-R图 * @param btmId 业务类型编号 * @return 执行结果 */ OsERVO createERUsed(String btmId); OsERVO createERUsed(String btmId) throws PLException; /** * 获取所有业务类型(树形结构) Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -91,14 +91,14 @@ * @param id 编号 * @return 链接类型 */ OsLinkTypeVO getLinkTypeById(String id); OsLinkTypeVO getLinkTypeById(String id) throws PLException; /** * 获取链接类型的属性 * @param linkTypeId 链接类型的编号 * @return 链接类型的属性 */ List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId); List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) throws PLException; /** * 链接类型的列表 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIDataServiceI.java
@@ -50,7 +50,7 @@ * @return 树形数据 * @throws VciBaseException 查询出错的时候会抛出异常 */ List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException; List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException, PLException; /** * 调用前置事件 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -22,6 +22,7 @@ import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.stm.StatePool; import com.vci.corba.omd.vrm.VersionRule; import com.vci.corba.portal.data.PLUILayout; import com.vci.dto.OsBtmTypeDTO; import com.vci.dto.OsBtmTypeLinkAttributesDTO; import com.vci.model.IndexObject; @@ -203,7 +204,7 @@ @Override public List<OsBtmTypeVO> btmDO2VOs(Collection<BizType> btmItems,Map<String, OsAttributeVO> attributeVOMap) { List<OsBtmTypeVO> VOS = new ArrayList<>(); Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).stream().forEach(btmItem -> { Optional.ofNullable(btmItems).orElseGet(() -> new ArrayList<>()).parallelStream().forEach(btmItem -> { OsBtmTypeVO vo = btmDO2VO(btmItem,attributeVOMap); VOS.add(vo); }); @@ -290,12 +291,12 @@ if (CollectionUtils.isEmpty(btmIds)) { return null; } Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap(); //Map<String, OsBtmTypeVO> btmTypeVOMap = self.selectAllBtmMap(); BtmDataFetcher btmDataFetcher = new BtmDataFetcher(); List<OsBtmTypeVO> btmTypeVOS = new ArrayList<>(); btmIds.stream().forEach(id -> { if (btmTypeVOMap.containsKey(id.toLowerCase())) { btmTypeVOS.add(btmTypeVOMap.get(id.toLowerCase())); } OsBtmTypeVO btmType = btmDataFetcher.getBtmType(id); btmTypeVOS.add(btmType); }); return btmTypeVOS; } @@ -307,11 +308,12 @@ * @return 业务类型 */ @Override public OsBtmTypeVO getBtmById(String id) { public OsBtmTypeVO getBtmById(String id) throws PLException { if (StringUtils.isBlank(id)) { return null; } return self.selectAllBtmMap().getOrDefault(id.toLowerCase(), null); BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(id); return btmDO2VO(bizType,null); } /** @@ -623,7 +625,7 @@ * @return 枚举的名称 */ @Override public String getNameById(String id) { public String getNameById(String id) throws PLException { OsBtmTypeVO btmTypeVO = getBtmById(id); if (btmTypeVO == null) { throw new VciBaseException("业务类型[{0}]在系统里不存在", new String[]{id}); @@ -637,7 +639,7 @@ * @param btmId 业务类型主键 */ @Override public OsERVO createERDiagram(String btmId) { public OsERVO createERDiagram(String btmId) throws PLException { VciBaseUtil.alertNotNull(btmId, "业务类型编号"); OsBtmTypeVO btmTypeVO = getBtmById(btmId); List<OsERNodeVO> nodeVOList = new ArrayList<>(); @@ -658,7 +660,7 @@ * @return 执行结果 */ @Override public OsERVO createERUsed(String btmId) { public OsERVO createERUsed(String btmId) throws PLException { VciBaseUtil.alertNotNull(btmId, "业务类型编号"); OsBtmTypeVO btmTypeVO = getBtmById(btmId); //获取使用当前类型的属性 @@ -1654,7 +1656,14 @@ itemList.add(nodePropertyVO); //判断参照 if (hasRefer) { selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList); try { selectReferenceBtmType(attribute, btmTypeVO, nodeVOList, relationVOList); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "判断业务类型的属性是不是参照类型时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); throw new VciBaseException(exceptionMessage); } } }); nodeVO.setItems(itemList); @@ -1670,7 +1679,7 @@ * @param relationVOList 关系信息 */ private void selectReferenceBtmType(OsBtmTypeAttributeVO attribute, OsBtmTypeVO btmTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) { List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) throws PLException { if (StringUtils.isNotBlank(attribute.getReferBtmTypeId())) { //是参照类型的 OsBtmTypeVO referenceBtmType = getBtmById(attribute.getReferBtmTypeId()); @@ -1759,7 +1768,14 @@ items.add(nodePropertyVO); //判断参照 if (!used) { selectReferenceLinkType(attr, link, nodeVOList, relationVOList); try { selectReferenceLinkType(attr, link, nodeVOList, relationVOList); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "断链接类型的属性是不是参照类型时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); throw new VciBaseException(exceptionMessage); } } }); nodeVO.setItems(items); @@ -1834,7 +1850,7 @@ * @param nodeVOList 节点对象 * @param relationVOList 关系对象 */ private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) { private void selectReferenceLinkType(OsLinkTypeAttributeVO attr, OsLinkTypeVO linkTypeVO, List<OsERNodeVO> nodeVOList, List<OsERRelationVO> relationVOList) throws PLException { if (StringUtils.isNotBlank(attr.getReferBtmTypeId())) { //是参照类型的 OsBtmTypeVO referenceBtmType = getBtmById(attr.getReferBtmTypeId()); @@ -2085,4 +2101,41 @@ } private class BtmDataFetcher { //业务类型 private Map<String, BizType> btmTypeVOMap = new HashMap<String, BizType>(); public BtmDataFetcher() { initBtmDataFetcher(); } private void initBtmDataFetcher(){ try { BizType[] bizTypes = platformClientUtil.getBtmService().getBizTypes(""); //List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes), null); if(Func.isNotEmpty(bizTypes)){ btmTypeVOMap = Arrays.stream(bizTypes).collect(Collectors.toMap(btm -> btm.name, btm -> btm)); } }catch (Exception e){ e.printStackTrace(); } } /** * 获取业务类型 * @param id * @return */ public OsBtmTypeVO getBtmType(String id) { BizType bizType = btmTypeVOMap.get(id); if(Func.isEmpty(bizType)){ return null; } //获取的时候才赚VO对象,这样避免一次性全部Btm转VO太慢的问题 return btmDO2VO(bizType,null); } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -242,11 +242,12 @@ * @return 链接类型 */ @Override public OsLinkTypeVO getLinkTypeById(String id) { public OsLinkTypeVO getLinkTypeById(String id) throws PLException { if(StringUtils.isBlank(id)){ return null; } return self.selectAllLinkMap().getOrDefault(id.toLowerCase(),null); LinkType linkType = platformClientUtil.getLinkTypeService().getLinkType(id); return this.linkTypeDO2VO(linkType); } /** @@ -256,7 +257,7 @@ * @return 链接类型的属性 */ @Override public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) { public List<OsLinkTypeAttributeVO> listAttributeByLinkId(String linkTypeId) throws PLException { OsLinkTypeVO linkTypeVO = getLinkTypeById(linkTypeId); return linkTypeVO.getAttributes(); } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -345,7 +345,7 @@ * @throws VciBaseException 查询出错的时候会抛出异常 */ @Override public List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException { public List<Tree> getDataForTree(UITreeQuery treeQuery) throws VciBaseException, PLException { VciBaseUtil.alertNotNull(treeQuery,"表单的查询对象",treeQuery.getBtmname(),"业务类型的信息",treeQuery.getComponentOid(),"树所在的组件的主键"); Map<String, OsAttributeVO> attributeVOMap = attrService.selectAllAttributeMap(); UIComponentVO componentVO = uiEngineService.getComponentByOid(treeQuery.getComponentOid(),attributeVOMap); @@ -1594,7 +1594,12 @@ conditionMap.put(usedAttributeVO.getId(),QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")"); if(StringUtils.isNotBlank(usedAttributeVO.getPkBtmType())) { if (boService.queryCount(usedAttributeVO.getPkBtmType(), conditionMap) > 0) { OsBtmTypeVO btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType()); OsBtmTypeVO btmTypeVO = null; try { btmTypeVO = btmService.getBtmById(usedAttributeVO.getPkBtmType()); } catch (PLException e) { e.printStackTrace(); } throw new VciBaseException("数据在【" + btmTypeVO.getName() + "】中的字段[" + usedAttributeVO.getName() + "]里被引用.不能删除"); } }else{ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -3539,7 +3539,7 @@ */ private boolean checkLinkTypeInputIsOk(String txtVIName/*选择的模板*/,String txtQTName/*查询模板*/,String btmType) throws PLException { boolean res = false; if(!(this.checkBtmTypeTxtIsOk("目标对象", linkType,true))){ if(!(this.checkLinkTypeTxtIsOk("目标对象", linkType,true))){ res = false; } else if(!(this.checkPortalVITxtIsOk("选择模板", txtVIName, linkType,true))){ res = false; Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBtmIOServiceImpl.java
@@ -762,7 +762,14 @@ attributes.stream().forEach( t -> { int index = indexMap.get("index"); Map<String,Object> columnData = attributeToWordMap(t,index); Map<String,Object> columnData = null; try { columnData = attributeToWordMap(t,index); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "将属性对象拷贝到word数据对象中时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); } indexMap.put("index",index+1); columnDataList.add(columnData); }); @@ -804,7 +811,14 @@ indexMap.put("index",1); attributes.stream().forEach( t -> { int index = indexMap.get("index"); Map<String,Object> columnData = attributeToWordMap(t,index); Map<String,Object> columnData = null; try { columnData = attributeToWordMap(t,index); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "将属性对象拷贝到word数据对象中时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); } indexMap.put("index",index+1); columnDataList.add(columnData); }); @@ -920,7 +934,15 @@ if(!CollectionUtils.isEmpty(linkTypeVOList)){ linkTypeVOList.stream().forEach(linkTypeVO->{ String linkTypeId = linkTypeVO.getId(); List<OsLinkTypeAttributeVO> attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId); List<OsLinkTypeAttributeVO> attributeVOS = null; try { attributeVOS = linkTypeService.listAttributeByLinkId(linkTypeId); } catch (PLException e) { e.printStackTrace(); String errorLog = "查询链接类型时出现错误,原因:"+VciBaseUtil.getExceptionMessage(e); logger.error(errorLog); throw new VciBaseException(errorLog); } //先是名称 int rowIndex = index[0]; WriteExcelData idED = new WriteExcelData(rowIndex, 0, linkTypeId); @@ -1063,7 +1085,7 @@ * @param index 索引 * @return 数据映射,key 是word里的域字段,value是对应的值 */ private Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index){ private Map<String,Object> attributeToWordMap(OsBtmTypeAttributeVO btmTypeAttributeVO,int index) throws PLException { Map<String,Object> columnData = new HashMap<>(); if(StringUtils.isNotBlank(wordFieldProperties.getColumnIndex())) { columnData.put(wordFieldProperties.getColumnIndex(), index); Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/utility/UIDataFetcher.java
@@ -11,6 +11,7 @@ import java.util.stream.Collectors; /** * 加载UI上下文 * @author ludc * @date 2024/10/15 10:32 */ @@ -27,8 +28,6 @@ //按钮map private Map<String, List<PLTabButton>> buttonMap = new HashMap<String, List<PLTabButton>>(); public UIDataFetcher() { initUIDefination();