From dc41a85c4eadeae567973157f64c549d414f49ec Mon Sep 17 00:00:00 2001 From: fujunling <2984387807@qq.com> Date: 星期一, 05 六月 2023 18:09:43 +0800 Subject: [PATCH] 配置文件修改 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 5 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java index 1740d98..31ea7b7 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java @@ -19,10 +19,14 @@ import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.CodeKeyAttrRepeatRuleVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; +<<<<<<< Updated upstream import com.vci.ubcs.omd.cache.EnumCache; import com.vci.ubcs.omd.enums.EnumEnum; import com.vci.ubcs.omd.feign.IBtmTypeClient; import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; +======= +import com.vci.ubcs.omd.feign.IBtmTypeClient; +>>>>>>> Stashed changes import com.vci.ubcs.omd.vo.BtmTypeVO; import com.vci.ubcs.starter.bo.WriteExcelData; import com.vci.ubcs.starter.exception.VciBaseException; @@ -77,7 +81,19 @@ private ICodeRuleService codeRuleService; @Resource +<<<<<<< Updated upstream private IBtmTypeClient btmTypeClient; +======= + private CodeOsbtmtypeMapper codeOsbtmtypeMapper; + + @Resource + private CodeOsbtmtypeattributeMapper codeOsbtmtypeattributeMapper; + + @Resource + private IBtmTypeClient btmTypeClient; + + +>>>>>>> Stashed changes /** * 鏃ュ織 @@ -873,7 +889,7 @@ * @return 灞炴�х殑淇℃伅锛屽寘鍚粯璁ょ殑灞炴�� */ @Override - public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) { + public DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) throws ServiceException{ if(baseQueryObject == null){ baseQueryObject = new BaseQueryObject(); } @@ -897,8 +913,11 @@ Map<String,Object> condition = new HashMap<>(1); condition.put("pkbtmtype",topClassifyVO.getBtmtypeid()); - BtmTypeVO data = btmTypeClient.getDetail(btmTypeOid).getData(); - List<BtmTypeAttributeVO> unDefaultAttributes = data.getAttributes(); + R<BtmTypeVO> btmTypeDetail = btmTypeClient.getDetail(btmTypeOid); + if(btmTypeDetail.getCode() != 200){ + throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤鍑洪敊"); + } + List<BtmTypeAttributeVO> unDefaultAttributes = btmTypeDetail.getData().getAttributes(); // List<CodeOsbtmtypeattributeEntity> unDefaultAttributes = codeOsbtmtypeattributeMapper.selectByMap(condition); // List<OsBtmTypeAttributeVO> unDefaultAttributes = btmService. (topClassifyVO.getBtmtypeid()); List<BtmTypeAttributeVO> attributeVOS = new ArrayList<>(); @@ -908,8 +927,8 @@ BeanUtils.copyProperties(attr,attributeVO); attributeVO.setAttrDataType(attr.getAttrDataType()); attributeVO.setAttributeLength(attr.getAttributeLength()); - attributeVO.setBtmTypeId(data.getId()); - attributeVO.setBtmname(data.getName()); + attributeVO.setBtmTypeId(btmTypeDetail.getData().getId()); + attributeVO.setBtmname(btmTypeDetail.getData().getName()); attributeVO.setAttrDataTypeText(EnumCache.getValue(EnumEnum.VCO_FIELD_TYPE,attr.getAttrDataType())); boolean add = true; if(StringUtils.isNotBlank(id) && !attributeVO.getId().contains(id.replace("*",""))){ @@ -920,6 +939,25 @@ } if(add){ attributeVOS.add(attributeVO); + } + }); + } + R<BtmTypeVO> btmTypeVOR = btmTypeClient.getDefaultAttrByBtmId(topClassifyVO.getBtmtypeid()); + if(btmTypeVOR.getCode() != 200){ + throw new ServiceException("涓氬姟绫诲瀷feign鎺ュ彛璋冪敤鍑洪敊"); + } + List<BtmTypeAttributeVO> defaultAttrVOS = btmTypeVOR.getData().getAttributes(); + if(!CollectionUtils.isEmpty(defaultAttrVOS)){ + defaultAttrVOS.stream().forEach(attr->{ + boolean add = true; + if(StringUtils.isNotBlank(id) && !attr.getId().contains(id.replace("*",""))){ + add = false; + } + if(StringUtils.isNotBlank(name) && !attr.getId().contains(name.replace("*",""))){ + add = false; + } + if(add){ + attributeVOS.add(attr); } }); } @@ -1009,7 +1047,11 @@ } /** +<<<<<<< Updated upstream * 涓婚搴撶殑鏍�,宸茶仈璋冧笟鍔$被鍨嬫煡璇eign +======= + * 涓婚搴撶殑鏍�,宸茬粡鑱旇皟涓氬姟绫诲瀷鏌ヨ +>>>>>>> Stashed changes * * @param treeQueryObject 鏍戝舰鏌ヨ瀵硅薄 * @return 涓婚搴撴樉绀烘爲 @@ -1031,6 +1073,7 @@ if(Func.isEmpty(btmTypeVOS) || Func.isEmpty(trees)){ return null; } +<<<<<<< Updated upstream List<Tree> treeList = trees.stream().filter(tree -> !CollectionUtils.isEmpty(btmTypeVOS.stream().filter(btmType -> { if(Objects.equals(tree.getAttributes().get("id"), btmType.getId())){ tree.getAttributes().put("btmTypeOid",btmType.getOid()); @@ -1039,6 +1082,10 @@ return false; }).collect(Collectors.toList()))) .collect(Collectors.toList()); +======= + List<Tree> treeList = trees.stream().filter(tree -> btmTypeVOS.stream(). + anyMatch(btmType -> Objects.equals(tree.getAttributes().get("id"), btmType.getId()))).collect(Collectors.toList()); +>>>>>>> Stashed changes return treeList; } -- Gitblit v1.9.3