From cca29ef0f3592879731abff315ced6bb7c4e5e6a Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期一, 17 七月 2023 10:14:11 +0800
Subject: [PATCH] 集成获取分类接口(包含编码规则码段码值信息)

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java |   51 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
index ebda882..bad631d 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -3,6 +3,7 @@
 import com.alibaba.cloud.commons.lang.StringUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.xml.DomDriver;
@@ -11,10 +12,7 @@
 import com.vci.ubcs.code.dto.CodeOrderDTO;
 import com.vci.ubcs.code.dto.CodeOrderSecDTO;
 import com.vci.ubcs.code.entity.*;
-import com.vci.ubcs.code.enumpack.CodeDefaultLC;
-import com.vci.ubcs.code.enumpack.CodeSecTypeEnum;
-import com.vci.ubcs.code.enumpack.SysIntegrationDataFlowTypeEnum;
-import com.vci.ubcs.code.enumpack.sysIntegrationPushTypeEnum;
+import com.vci.ubcs.code.enumpack.*;
 import com.vci.ubcs.code.mapper.CommonsMapper;
 import com.vci.ubcs.code.service.*;
 import com.vci.ubcs.code.util.ClientBusinessObject;
@@ -39,10 +37,11 @@
 import com.vci.ubcs.code.wrapper.CodeClassifyWrapper;
 import com.vci.ubcs.omd.feign.IBtmTypeClient;
 import com.vci.ubcs.omd.vo.BtmTypeVO;
+import com.vci.ubcs.starter.exception.VciBaseException;
 import com.vci.ubcs.starter.revision.model.BaseModel;
 import com.vci.ubcs.starter.revision.model.TreeQueryObject;
 import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil;
-import com.vci.ubcs.starter.web.constant.QueryOptionConstant;
+import com.vci.ubcs.starter.util.UBCSSqlKeyword;
 import com.vci.ubcs.starter.web.pagemodel.SessionInfo;
 import com.vci.ubcs.starter.web.util.BeanUtilForVCI;
 import com.vci.ubcs.starter.web.util.VciBaseUtil;
@@ -56,9 +55,7 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.stream.Collectors;
 
-import static com.vci.ubcs.code.constant.MdmDuckingConstant.DOCKING_DEFAULT_CLASSIFY;
 import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST;
-import static com.vci.ubcs.code.constant.MdmEngineConstant.IMPORT_ROW_INDEX;
 import static com.vci.ubcs.code.enumpack.CodeSecTypeEnum.CODE_CLASSIFY_SEC;
 
 /***
@@ -857,12 +854,12 @@
 			List<String> classifyIdList=  libraryVO.getClassifyid();
 			List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>();
 
-			//鏍¢獙鏄惁閰嶇疆
+			/*//鏍¢獙鏄惁閰嶇疆
 			boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getValue());
 			if(!checkPass){
 				errorid="101";
 				throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,"+sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILYRULE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
-			}
+			}*/
 			//杩欐槸璐﹀彿淇℃伅
 			//杩欐槸璐﹀彿淇℃伅
 			if(userVo!=null) {
@@ -949,10 +946,40 @@
 								}else if(secType.equals("coderefersec")){//寮曠敤鐮佹
 									codeBasicSecVO.getReferAttributeId();
 									codeBasicSecVO.getReferCodeClassifyOid();
-									codeBasicSecVO.getReferBtmId();
-									codeBasicSecVO.getReferBtmName();
-									//codeBasicSecVO.getReferValueInfo();
+									String referBtmId=codeBasicSecVO.getReferBtmId();
+									String btmName=codeBasicSecVO.getReferBtmName();
+									String referConfig= codeBasicSecVO.getReferConfig();
+									CoderefersecSearchVO coderefersecSearchVO=new CoderefersecSearchVO();
+									if(StringUtils.isNotBlank(referConfig)){
+										coderefersecSearchVO = JSONObject.toJavaObject(JSONObject.parseObject(referConfig), CoderefersecSearchVO.class);
+									}
+									String buildSqlwhere="";
+									if(coderefersecSearchVO!=null){
+										Map<String,Object> condtionMap=new HashMap<>();
+										List<CodeSrchCondConfigVO> codeSrchCondConfigVOList=coderefersecSearchVO.getCodeSrchCondConfigVOS();
 
+										if(!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) {
+											codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> {
+												condtionMap.put(codeSrchCondConfigVO.getFilterField()+codeSrchCondConfigVO.getFilterType(),codeSrchCondConfigVO.getFilterValue());
+											});
+											buildSqlwhere=	UBCSSqlKeyword.buildSqlwhere(condtionMap);
+										}
+									}
+									//浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
+									R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId));
+									if (!listR.isSuccess() || listR.getData().size() == 0) {
+										throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+									}
+									String referTable = listR.getData().get(0).getTableName();
+									StringBuffer sb=new StringBuffer();
+									sb.append(" select * from  ");
+									sb.append(referTable);
+									sb.append(" where 1=1  ");
+									if(StringUtils.isNotBlank(buildSqlwhere)){
+										sb.append( buildSqlwhere );
+									}
+									List<Map> ListMap=	commonsMapper.selectBySql(sb.toString());
+									log.info(libId);
 								}else if(secType.equals("codelevelsec")) {//灞傜骇鐮佹
 									int level = codeBasicSecVO.getCodeLevelValue();
 									CodeClassifyVO levelCodeClassifyVO = new CodeClassifyVO();

--
Gitblit v1.9.3