From c6f3f7b0d977c88b93bec7106c0fde364486cd5f Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 17 七月 2023 14:53:49 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java |   68 +++++++++++++++++++++------------
 1 files changed, 43 insertions(+), 25 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 bad631d..e941cac 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,7 +3,6 @@
 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;
@@ -38,7 +37,6 @@
 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.util.UBCSSqlKeyword;
@@ -48,11 +46,13 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import javax.annotation.Resource;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 import static com.vci.ubcs.code.constant.MdmEngineConstant.DEFAULT_SYNC_ATTR_LIST;
@@ -65,7 +65,8 @@
 @Slf4j
 @VciWebservice(path = "/universalInterface")
 public class UniversalInterfaceImpl<IDockingLogeServiceing> implements UniversalInterfaceI {
-
+	@Value("${code.checkConfig:true}")
+	public boolean CODE_CHECKCONFIG;
 	@Autowired(required = false)
 	private AttributeMapConfig attributeMapConfig;
 	/**
@@ -335,14 +336,12 @@
 			ClassfysVO classfysVO = interParameterVO.getData().getClassifys();
 			systemId = interParameterVO.getData().getSystemId();
 
-
 			//鏍¢獙鏄惁閰嶇疆
-			boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue());
-			if(!checkPass){
-				errorid="101";
-				throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,"+sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+			boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getValue());
+			if (!checkPass) {
+				errorid = "101";
+				throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_EDITCODE.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
 			}
-
 			UserVO userVo = interParameterVO.getData().getUser();
 			List<ClassfyVO> classVOList = classfysVO.getClassify();
 			InterParameterVO finalInterParameterVO = interParameterVO;
@@ -494,12 +493,11 @@
 			String libId= libraryVO.getId();
 			List<String> classifyIdList=  libraryVO.getClassifyid();
 			List<CodeClassifyVO> codeClassifyVOS =new ArrayList<>();
-
-			//鏍¢獙鏄惁閰嶇疆
-			boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getValue());
-			if(!checkPass){
-				errorid="101";
-				throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,"+sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+				//鏍¢獙鏄惁閰嶇疆
+			boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getValue());
+			if (!checkPass) {
+				errorid = "101";
+				throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_QUERYCLAFILY.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
 			}
 
 			//杩欐槸璐﹀彿淇℃伅
@@ -663,12 +661,14 @@
 				msg = "鎺ュ彛鍙傛暟锛歭ibrary 涓簄ull";
 				throw new Throwable(msg);
 			}
+
 			//鏍¢獙鏄惁閰嶇疆
-			boolean checkPass= checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue());
-			if(!checkPass){
-				errorid="101";
-				throw new Throwable("绯荤粺鏍囪瘑涓恒��"+systemId+"銆�,"+sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
+			boolean checkPass = checkIspass(systemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getValue());
+			if (!checkPass) {
+				errorid = "101";
+				throw new Throwable("绯荤粺鏍囪瘑涓恒��" + systemId + "銆�," + sysIntegrationPushTypeEnum.ACCPET_QUERYDATA.getText() + "鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
 			}
+
 			//鍏堢畝绉版槸鍚︽湁鍏宠仈妯℃澘锛屾湁妯℃澘瑕佸厛鍒犻櫎
 
 			List<CodeClassify> libIdDos =classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId,library));
@@ -854,12 +854,13 @@
 			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()+"鎺ュ彛閰嶇疆宸插仠鐢ㄦ垨鑰呮湭閰嶇疆锛岃鑱旂郴缂栫爜绠$悊鍛橈紒");
-			}*/
+			//鏍¢獙鏄惁閰嶇疆
+			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) {
@@ -979,6 +980,20 @@
 										sb.append( buildSqlwhere );
 									}
 									List<Map> ListMap=	commonsMapper.selectBySql(sb.toString());
+									String valueField=coderefersecSearchVO.getValueField();
+									String textField=coderefersecSearchVO.getTextField();
+									final int[] num = {0};
+									if(!CollectionUtils.isEmpty(ListMap)){
+										ListMap.stream().forEach(map->{
+											num[0]++;
+											String id= map.getOrDefault("OID".toUpperCase(Locale.ROOT),"").toString();
+											String value= map.getOrDefault(valueField.toUpperCase(Locale.ROOT),"").toString();
+											String text=map.getOrDefault(textField.toUpperCase(Locale.ROOT),"").toString();
+											String description=map.getOrDefault("description".toUpperCase(Locale.ROOT),"").toString();
+											CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(id, num[0]+"",value,text,"",description);
+											codeSectionValueVOList.add(sectionValueVO);
+										});
+									}
 									log.info(libId);
 								}else if(secType.equals("codelevelsec")) {//灞傜骇鐮佹
 									int level = codeBasicSecVO.getCodeLevelValue();
@@ -1381,6 +1396,9 @@
 	 * @return
 	 */
 	private boolean checkIspass(String systemId,String type,String operationType){
+		if(!CODE_CHECKCONFIG) {
+			return true;
+		}
 		//鏍规嵁绫诲瀷鍘绘煡璇㈤渶瑕侀泦鎴愮殑鍒嗙被鎴栬�呮暟鎹�
 		LambdaQueryWrapper<DockingSystemConfig> queryWrapper = Wrappers.<DockingSystemConfig>lambdaQuery();
 		queryWrapper.eq(DockingSystemConfig::getUsedFlag, MdmDuckingConstant.SEND_FLAG_TRUE);

--
Gitblit v1.9.3