From e9ae27404803d0616e06ed21027408a71b4bc19c Mon Sep 17 00:00:00 2001
From: ludc <ludc@vci-tech.com>
Date: 星期三, 05 三月 2025 17:34:02 +0800
Subject: [PATCH] 集成申码接口调整:当码值按照约定传表名为空的业务场景下传null校验问题和码值组装问题。

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java |   75 ++++++++++++++++++++++---------------
 1 files changed, 44 insertions(+), 31 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 e47f645..3c11372 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
@@ -38,7 +38,10 @@
 import com.vci.ubcs.code.webService.annotation.VciWebservice;
 import com.vci.ubcs.code.webService.config.AttributeMapConfig;
 import com.vci.ubcs.code.webService.config.PersonAndDeptConfig;
+import com.vci.ubcs.omd.cache.EnumCache;
 import com.vci.ubcs.omd.feign.IBtmTypeClient;
+import com.vci.ubcs.omd.feign.IDictClient;
+import com.vci.ubcs.omd.feign.IEnumClient;
 import com.vci.ubcs.omd.vo.BtmTypeVO;
 import com.vci.ubcs.starter.exception.VciBaseException;
 import com.vci.ubcs.starter.revision.model.TreeQueryObject;
@@ -680,7 +683,7 @@
 							log.error("鏁版嵁淇濆瓨澶辫触:",e);
 							mesg=e.getMessage();
 							e.printStackTrace();
-							throw new ServiceException(e.getMessage());
+						//	throw new ServiceException(e.getMessage());
 						}finally {
 							XMLResultDataObjectDetailDO x=new XMLResultDataObjectDetailDO();
 							x.setId(rowData.getOid());
@@ -914,8 +917,9 @@
 					}
 					List<XMLResultDataObjectDetailDO> xDOs=new CopyOnWriteArrayList<>();
 					//闄愬埗绾跨▼骞惰鏁伴噺
-					customForkJoinPool.submit(()->{
-						dataObjectVO.getRowData().parallelStream().forEach(rowData->{
+					//customForkJoinPool.submit(()->{
+					//	dataObjectVO.getRowData().parallelStream().forEach(rowData->{
+					dataObjectVO.getRowData().forEach(rowData->{
 							String mesg="";
 							try {
 								CodeOrderDTO orderDTO = new CodeOrderDTO();
@@ -940,34 +944,34 @@
 								orderDTO.setSecDTOList(codeOrderSecDTOList);//瀛樺偍缂栫爜
 								orderDTO.setData(rowData.getFiledValue());
 								String code = engineService.addSaveCodeNotauthUser(orderDTO,false);
-							/*if(StringUtils.isNotBlank(code)) {
-								//rowData.setCode(code);
-								StringBuffer sqlsb = new StringBuffer();
-								sqlsb.append(" select * from ");
-								sqlsb.append(tableName);
-								sqlsb.append(" where 1=1 ");
-								sqlsb.append(" and lastr=1 and lastv=1");
-								sqlsb.append(" and id in (");
-								sqlsb.append(VciBaseUtil.toInSql(code));
-								sqlsb.append(")");
-								List<Map<String, String>> newDataMapList = commonsMapper.queryByOnlySqlForMap(sqlsb.toString());
-								if (!CollectionUtils.isEmpty(newDataMapList)) {
-									String oid = StringUtils.isBlank(newDataMapList.get(0).get("OID")) ? "" : newDataMapList.get(0).get("OID");
-									List<String> oidList = new ArrayList<>();
-									oidList.add(oid);
-									//濡傛灉鏈夌敵璇峰氨鍘昏皟鐢ㄧ敵璇烽泦鍥㈢爜
-									if (isPersonApplyGroupCode) {
-										mdmIOService.sendApplyGroupcode(oidList, templateVO.getBtmTypeId(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue());
-										success.set(true);
-										mesg = "鏁版嵁淇濆瓨鎴愬姛锛岀瓑寰呯敵璇烽泦鍥㈢爜";
+								/*if(StringUtils.isNotBlank(code)) {
+									//rowData.setCode(code);
+									StringBuffer sqlsb = new StringBuffer();
+									sqlsb.append(" select * from ");
+									sqlsb.append(tableName);
+									sqlsb.append(" where 1=1 ");
+									sqlsb.append(" and lastr=1 and lastv=1");
+									sqlsb.append(" and id in (");
+									sqlsb.append(VciBaseUtil.toInSql(code));
+									sqlsb.append(")");
+									List<Map<String, String>> newDataMapList = commonsMapper.queryByOnlySqlForMap(sqlsb.toString());
+									if (!CollectionUtils.isEmpty(newDataMapList)) {
+										String oid = StringUtils.isBlank(newDataMapList.get(0).get("OID")) ? "" : newDataMapList.get(0).get("OID");
+										List<String> oidList = new ArrayList<>();
+										oidList.add(oid);
+										//濡傛灉鏈夌敵璇峰氨鍘昏皟鐢ㄧ敵璇烽泦鍥㈢爜
+										if (isPersonApplyGroupCode) {
+											mdmIOService.sendApplyGroupcode(oidList, templateVO.getBtmTypeId(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue());
+											success.set(true);
+											mesg = "鏁版嵁淇濆瓨鎴愬姛锛岀瓑寰呯敵璇烽泦鍥㈢爜";
+										}
 									}
-								}
-							}*/
+								}*/
 							} catch (Exception e) {
 								log.error( "閮ㄩ棬鏁版嵁鎺ユ敹澶辫触:",e);
 								mesg=e.getMessage();
 								e.printStackTrace();
-								throw new ServiceException(e.getMessage());
+							//	throw new ServiceException(e.getMessage());
 							}finally {
 								XMLResultDataObjectDetailDO x=new XMLResultDataObjectDetailDO();
 								x.setId(rowData.getOid());
@@ -977,7 +981,7 @@
 								xDOs.add(x);
 							}
 						});
-					}).join();
+					//}).join();
 					resultDataObjectDetailDOs.addAll(xDOs);
 					boolean finalSuccess1 = success.get();
 					String finalMessage1 = message;
@@ -2422,8 +2426,13 @@
 		return codeOrderSecDTOList;
 	}
 
-	/***
+	/**
 	 * 鏍规嵁浼犲叆鐨勫弬鏁颁俊鎭牎楠岀爜娈佃鍒�
+	 * @param SectionVOList
+	 * @param ruleVO
+	 * @param classifyFullInfo
+	 * @return
+	 * @throws Throwable
 	 */
 	private List<CodeOrderSecDTO> getRuleCodeOrderSecDTOs(List<SectionVO> SectionVOList,CodeRuleVO ruleVO,CodeClassifyFullInfoBO classifyFullInfo) throws Throwable{
 		List<CodeBasicSecVO>  codeBasicSecVOS= ruleVO.getSecVOList();
@@ -2439,6 +2448,9 @@
 		//	String newSecName=codeBasicSecVO.getName();
 			String classifySecOid= codeBasicSecVO.getOid();
 			String message="";
+			//#NaN?琛ㄧず鐮佸�间负绌虹殑鍦烘櫙
+			String nullSymbol = EnumCache.getValue("nullSymbol", "NULL");
+			nullSymbol = Func.isBlank(nullSymbol) ? "#NaN?":nullSymbol;
 			if (!sectype.equals(CodeSecTypeEnum.CODE_SERIAL_SEC.getValue())) {
 				String name = codeBasicSecVO.getName();
 				String sectypeText = codeBasicSecVO.getSecTypeText();
@@ -2455,8 +2467,8 @@
 						List<CodeClassifyValue> codeClassifyValueDOList = codeClassifyValueService.list(Wrappers.<CodeClassifyValue>query().lambda().eq(CodeClassifyValue::getCodeClassifySecOid,classifySecOid));
 						if (!CollectionUtils.isEmpty(codeClassifyValueDOList)) {
 							Map<String, CodeClassifyValue> codeClassifyValueDOMap = codeClassifyValueDOList.stream().collect(Collectors.toMap(s -> s.getId(), t -> t, (o1, o2) -> o2));
-							if(codeClassifyValueDOMap.containsKey(sectypeValue)){
-								CodeClassifyValue codeClassifyValue=   codeClassifyValueDOMap.get(sectypeValue);
+							if(codeClassifyValueDOMap.containsKey(sectypeValue) || nullSymbol.equals(sectypeValue)){
+								CodeClassifyValue codeClassifyValue = codeClassifyValueDOMap.get(sectypeValue);
 								sectypeValue=codeClassifyValue.getOid();
 							}else {
 								//throw new Throwable("浼犲叆鐨勫垎绫荤爜娈碉細銆�" + name + " 鍊硷細" + sectypeValue + "銆戯紝涓嶇鍚堝綋鍓嶅垎绫诲眰绾т唬鍙�");
@@ -2731,7 +2743,7 @@
 							String dataValue = sourceKeyValueMap.get(sourceKey);
 							if (attrMapConfigMap.containsKey(sourceKey)) {
 								String targetKey = attrMapConfigMap.get(sourceKey);
-								log.info("xxxxx灞炴�ф槧灏勫��:sourceKey銆�"+sourceKey+"銆戔�斺�斻��+targetKey"+targetKey+":"+dataValue);
+								log.info("xxxxx灞炴�ф槧灏勫��:sourceKey銆�"+sourceKey+"銆戔�斺�斻��+targetKey---銆�"+targetKey+":"+dataValue);
 								keyValueMap.put(targetKey, StringUtils.isBlank(dataValue)?"":dataValue);
 							}
 						});
@@ -2865,6 +2877,7 @@
 							String dataValue = sourceKeyValueMap.get(sourceKey);
 							if (attrMapConfigMap.containsKey(sourceKey)) {
 								String targetKey = attrMapConfigMap.get(sourceKey);
+								log.info("xxxxx灞炴�ф槧灏勫��:sourceKey銆�"+sourceKey+"銆戔�斺�斻��+targetKey---銆�"+targetKey+":"+dataValue);
 								keyValueMap.put(targetKey, StringUtils.isBlank(dataValue)?"":dataValue);
 							}
 						});

--
Gitblit v1.9.3