From 79b61d7f259618ddde73948de8b60e1b07bc7d42 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 22 三月 2024 19:45:46 +0800 Subject: [PATCH] 集成相关更改 --- Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feigh/MdmInterJtClient.java | 61 +++++++++++++++++++----------- 1 files changed, 39 insertions(+), 22 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feigh/MdmInterJtClient.java b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feigh/MdmInterJtClient.java index 310f5bc..344f981 100644 --- a/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feigh/MdmInterJtClient.java +++ b/Source/UBCS/ubcs-service/ubcs-applyjtcodeservice/src/main/java/com/vci/ubcs/code/applyjtcodeservice/feigh/MdmInterJtClient.java @@ -2,6 +2,7 @@ import com.alibaba.cloud.commons.lang.StringUtils; import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.vci.ubcs.code.applyjtcodeservice.entity.*; import com.vci.ubcs.code.applyjtcodeservice.feign.IMdmInterJtClient; @@ -14,6 +15,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; import org.springframework.beans.factory.annotation.Autowired; @@ -35,8 +37,10 @@ @Data @Slf4j public class MdmInterJtClient implements IMdmInterJtClient { + @Value("${docking.apply.partCoe:10}") public String partCoe; + /** * 闆嗗洟鐢宠鍗曟湇鍔� */ @@ -56,10 +60,12 @@ * 闆嗗洟鍒嗙被鐢宠鍗曟湇鍔� */ private final IDockingPreClassifyService dockingPreClassifyService; + /*** * 灞炴�ф槧灏勬湇鍔� */ private final IDockingPreAttrMappingService dockingPreAttrMappingService; + /** * 闆嗗洟鍙栧�艰寖鍥寸敵璇峰崟鏈嶅姟 */ @@ -72,6 +78,7 @@ @Autowired(required = false) private IMdmEngineClient mdmEngineClient; + /*** * 鐢宠闆嗗洟缂栫爜 * @return @@ -111,6 +118,7 @@ return R.fail("闆嗗洟鐮佹暟鎹慨鏀瑰け璐ワ細"+e.getMessage()); } } + /* * 涓绘暟鎹笟鍔℃湇鍔� */ @@ -184,16 +192,23 @@ String jdatabtmname = dockingPreApplyForm.getDataBtmName(); if (res) { //姝ゅ闇�瑕佹煡璇笟鍔℃暟鎹紝鍘绘洿鏀� - BaseModel baseModel = new BaseModel(); - String classOid=baseModel.getData().getOrDefault("CODECLSFID",""); - if(partCoe.equals(classOid)){ - baseModel.setId(10+customCoding); + R<List<BaseModel>> R = mdmEngineClient.selectByTypeAndOid(jdatabtmname,jdataid); + if(R.isSuccess()){ + List<BaseModel> oldDatalist=new ArrayList<>(); + List<BaseModel> newDatalist=R.getData(); + if(!CollectionUtils.isEmpty(newDatalist)){ + if(editObjectMap.containsKey(jdatabtmname)){ + oldDatalist=editObjectMap.getOrDefault(jdatabtmname,new ArrayList<>()); + } + BaseModel baseModel=oldDatalist.get(0); + //DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel); + baseModel.setLastModifyTime(new Date()); + baseModel.getData().put("groupcode",customCoding); + log.info("鐢宠鍗�:"+applyId+",闆嗗洟鐮侊細"+customCoding+"缂栫爜锛�"+baseModel.getId()); + oldDatalist.add(baseModel); + editObjectMap.put(jdatabtmname,oldDatalist); + } } - String btmeName=baseModel.getBtmname(); - baseModel.getData().put("groupcode",customCoding); - log.info("鐢宠鍗�:"+applyId+",闆嗗洟鐮侊細"+customCoding+"缂栫爜锛�"+baseModel.getId()); - editObjectMap.getOrDefault(btmeName,new ArrayList<>()).add(baseModel); - } } if(!CollectionUtils.isEmpty(editObjectMap)) { @@ -202,10 +217,12 @@ mdmEngineClient.updateBatchBtypeDatas(btmName, modeList); }); } - dockingPreApplyFormService.saveOrUpdateBatch(dockingPreApplyFormList); + if(!CollectionUtils.isEmpty(dockingPreApplyFormList)){ + dockingPreApplyFormService.saveOrUpdateBatch(dockingPreApplyFormList); + } }catch (Throwable e){ e.printStackTrace(); - return R.fail("闆嗗洟鐮侀泦鎴愯祴鍊煎け璐�"+e); + return R.fail("闆嗗洟鐮侀泦鎴愯祴鍊煎け璐ワ紝鍘熷洜锛�"+e.getMessage()); } log.info("鑾峰彇闆嗗洟闆嗗洟鐮侊紝璧嬪�煎埌涓绘暟鎹� end"); return R.success("闆嗗洟鐮佽祴鍊兼垚鍔�"); @@ -258,9 +275,9 @@ if (dockingPreClassify == null|| StringUtils.isBlank(dockingPreClassify.getOid())) { dockingPreClassify = new DockingPreClassify(); - DefaultAttrAssimtUtil.addDefaultAttrAssimt(dockingPreClassify, MdmBtmTypeConstant.DOCKING_PRE_JCLASSIFY,null); + DefaultAttrAssimtUtil.addDefaultAttrAssimt(dockingPreClassify, MdmBtmTypeConstant.DOCKING_PRE_JCLASSIFY); } else { - DefaultAttrAssimtUtil.updateDefaultAttrAssimt(dockingPreClassify,null); + DefaultAttrAssimtUtil.updateDefaultAttrAssimt(dockingPreClassify); } dockingPreClassify.setOid(id); dockingPreClassify.setName(className); @@ -283,13 +300,14 @@ throw new Throwable("瀛樺偍瑙嗗浘妯″瀷鍑虹幇闂"); } } + /*** * 鑾峰彇鍒嗙被瑙嗗浘 * * @param jclassObject * @throws Throwable */ - private void getVilewMode(DockingClassifyVO jclassObject, List<DockingClassifyViewVO> list) + private void getVilewMode(@NotNull DockingClassifyVO jclassObject, List<DockingClassifyViewVO> list) throws Throwable { String nodeLinkName = jclassObject.getNodeLinkName(); try { @@ -304,7 +322,7 @@ for (DockingClassifyViewVO viewInfo : list) { String viewName =StringUtils.isBlank(viewInfo.getViewName())?"":viewInfo.getViewName(); - String impactList = StringUtils.isBlank(viewInfo.getImpactList())?"":viewInfo.getImpactList(); + String impactList = viewInfo.getImpactList() == null ? "" : viewInfo.getImpactList().get(0).get(0); log.info("VilewMode:-------------->瑙嗗浘鍚嶇О:"+viewName); log.info("VilewMode:-------------->褰卞搷缂栫爜椤�:"+impactList); log.info("VilewMode:--------------> 闆嗗洟鍒嗙被涓婚敭:"+jclassId); @@ -314,10 +332,10 @@ jviewModelObject = jviewmodelMap.get(viewName); //褰卞搷缂栫爜椤圭殑鏁版嵁 jviewModelObject.setImpactList(impactList); - DefaultAttrAssimtUtil.updateDefaultAttrAssimt(jviewModelObject,null); + DefaultAttrAssimtUtil.updateDefaultAttrAssimt(jviewModelObject); } else { jviewModelObject =new DockingPreViewModel(); - DefaultAttrAssimtUtil.addDefaultAttrAssimt(jviewModelObject,MdmBtmTypeConstant.DOCKING_PRE_JVIEWMODEL,null); + DefaultAttrAssimtUtil.addDefaultAttrAssimt(jviewModelObject,MdmBtmTypeConstant.DOCKING_PRE_JVIEWMODEL); jviewModelObject.setSourceClassifyId(jclassId);// 闆嗗洟鍒嗙被id jviewModelObject.setViewName(viewName);// 闆嗗洟瑙嗗浘鍚嶇О //褰卞搷缂栫爜椤圭殑鏁版嵁 @@ -338,7 +356,6 @@ throw new Throwable("缁勭粐鍒嗙被" + nodeLinkName + "妯″瀷瑙嗗浘瀛樺偍鍑虹幇闂"); } } - /*** * 鑾峰彇妯″瀷瑙嗗浘灞炴�� @@ -372,9 +389,9 @@ dockingPreMetaAttr = jmetaattrMap.get(englishName); dockingPreMetaAttr.setChineseName(chineseName); dockingPreMetaAttr.setDefaultValue(defaultValue); - DefaultAttrAssimtUtil.updateDefaultAttrAssimt(dockingPreMetaAttr,null); + DefaultAttrAssimtUtil.updateDefaultAttrAssimt(dockingPreMetaAttr); } else { - DefaultAttrAssimtUtil.addDefaultAttrAssimt(dockingPreMetaAttr,MdmBtmTypeConstant.DOCKING_PRE_JMETAATRR,null); + DefaultAttrAssimtUtil.addDefaultAttrAssimt(dockingPreMetaAttr,MdmBtmTypeConstant.DOCKING_PRE_JMETAATRR); dockingPreMetaAttr.setSourceClassifyId(jclassId);// 闆嗗洟鍒嗙被id dockingPreMetaAttr.setViewModelId(jviewModelObject.getOid());// 闆嗗洟瑙嗗浘妯″瀷id dockingPreMetaAttr.setChineseName(chineseName);// 灞炴�у悕绉� @@ -436,9 +453,9 @@ rangeObject = rangeMap.get(rangeKey); rangeObject.setNumTextValue(keyValue); rangeObject.setNumText(rangeKey); - DefaultAttrAssimtUtil.updateDefaultAttrAssimt(rangeObject,null); + DefaultAttrAssimtUtil.updateDefaultAttrAssimt(rangeObject); } else { - DefaultAttrAssimtUtil.addDefaultAttrAssimt(rangeObject,MdmBtmTypeConstant.DOCKING_PRE_JRANGE,null); + DefaultAttrAssimtUtil.addDefaultAttrAssimt(rangeObject,MdmBtmTypeConstant.DOCKING_PRE_JRANGE); rangeObject.setNumTextValue(keyValue); rangeObject.setNumText(rangeKey); rangeObject.setTs(rangeObject.getLastModifyTime()); -- Gitblit v1.9.3