From 20fca8636706f19c2b53de0b77617d314ecc1306 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 14 六月 2023 14:43:31 +0800
Subject: [PATCH] 编码批量申请接口添加

---
 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
index 8bc42d2..8565672 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -8,6 +8,7 @@
 import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO;
 import com.vci.ubcs.code.bo.CodeTemplateAttrSqlBO;
 import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant;
+import com.vci.ubcs.code.constant.MdmBtmTypeConstant;
 import com.vci.ubcs.code.dto.CodeDeleteBatchDTO;
 import com.vci.ubcs.code.dto.CodeOrderDTO;
 import com.vci.ubcs.code.dto.datapush.BaseModelDTO;
@@ -322,6 +323,7 @@
 		}
 		return comboboxKVs;
 	}
+
 	/**
 	 * 淇敼鐘舵��
 	 *
@@ -333,6 +335,11 @@
 		VciBaseUtil.alertNotNull(baseModelDTO, "鏁版嵁淇℃伅", baseModelDTO.getOid(), "涓婚敭", baseModelDTO.getBtmname(), "涓氬姟绫诲瀷", baseModelDTO.getLcStatus(), "鐩爣鐘舵��");
 		List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid());
 //		List<ClientBusinessObject> cboList = boService.selectCBOByOidCollection(oids, baseModelDTO.getBtmname());
+		// TODO 鎻掍釜鐐� 涓氬姟绫诲瀷瀹屾垚鍚庨渶瑕佷慨鏀�
+		QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>();
+		wrapper.eq("BTMNAME",baseModelDTO.getBtmname());
+		wrapper.in("OID",oids);
+		// TODO 寰呭畬鍠�
 		//鎻掍釜鐐� 涓氬姟绫诲瀷瀹屾垚鍚庨渶瑕佷慨鏀�
 //		QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>();
 		List<BaseModel> baseModels = new ArrayList<>();
@@ -358,6 +365,10 @@
 			commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(),VciBaseUtil.toInSql(baseModelDTO.getOid()));
 			// BatchCBO batchCBO = new BatchCBO();
 			// batchCBO.getDeleteCbos().addAll(cboList);
+
+			// TODO 寰呭畬鍠�
+			//btmTypeClient.deleteBatchIds(cboList);
+
 			//boService.persistenceBatch(batchCBO);
 		} else {
 			for (BaseModel baseModel : baseModels) {
@@ -636,9 +647,10 @@
 		//娌℃湁闄愬埗鍒嗙被锛屼絾鏄竴涓ā鏉垮彧鍙兘鍦ㄤ竴涓笟鍔$被鍨嬮噷闈紝鎵�浠ョ洿鎺ユ煡璇㈣繖涓笟鍔$被鍨嬪嵆鍙�
 
 		if (!CollectionUtils.isEmpty(conditionMap)) {
-			//琛ㄩ渶瑕佹敼
 //			final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "};
-			final String[] sql = {"select count(*) from pl_code_wupin t where 1 = 1 "};
+			R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmtypeid()));
+//				String referTable = VciBaseUtil.getTableName(referVO.getReferType());
+			final String[] sql = {"select count(*) from "+ listR.getData().get(0).getTableName() +" t where 1 = 1 "};
 			conditionMap.forEach((key, value) -> {
 				sql[0] += " and " + key + " = " + value;
 			});
@@ -1733,9 +1745,7 @@
 			}
 			whereSql += " and ( t.secretGrade <= " + userSecret + ") ";
 		}
-		//瑕佹敼锛岃〃鏄庤幏鍙栨湁闂
 //		String tableName = VciBaseUtil.getTableName(btmType);
-//		String tableName = "pl_code_wupin";
 		R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
 //				String referTable = VciBaseUtil.getTableName(referVO.getReferType());
 		String tableName = listR.getData().get(0).getTableName();
@@ -1871,10 +1881,10 @@
 	 */
 	private String getSqlByValue(String selectKey, String value, Map<String, CodeClassifyTemplateAttrVO> attrVOMap) {
 		StringBuilder sql = new StringBuilder();
-		//寰呭畬鍠�
-//		if (!selectKey.contains(".") && (attrVOMap.containsKey(selectKey.toLowerCase(Locale.ROOT)) || attributeService.isDefaultAttr(selectKey) || selectKey.matches(RegExpConstant.LETTER))) {
-//			sql.append("t.");
-//		}
+		// TODO 寰呭畬鍠�
+		//	if (!selectKey.contains(".") && (attrVOMap.containsKey(selectKey.toLowerCase(Locale.ROOT)) || attributeService.isDefaultAttr(selectKey) || selectKey.matches(RegExpConstant.LETTER))) {
+		//		sql.append("t.");
+		//	}
 		if (value.startsWith(QueryOptionConstant.IN)) {
 			sql.append(selectKey)
 				.append(SPACE)
@@ -2185,10 +2195,13 @@
 		if (!classifyService.checkHasChild(codeClassifyOid)) {
 			conditionMap.put("t."+CODE_CLASSIFY_OID_FIELD, codeClassifyOid);
 		} else {
-			//琛ㄩ渶瑕佹敼
 //			conditionMap.put(CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from " + VciBaseUtil.getTableName(MdmBtmTypeConstant.CODE_CLASSIFY)
-			conditionMap.put("t."+CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from pl_code_classify where lcstatus='" + FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED +
-				"' start with parentCodeClassifyOid = '" + codeClassifyOid + "' CONNECT BY PRIOR OID = parentCodeClassifyOid )");
+
+			conditionMap.put("t."+CODE_CLASSIFY_OID_FIELD, QueryOptionConstant.IN + "(select oid from "+
+				btmTypeClient.selectByIdCollection(Collections.singletonList(MdmBtmTypeConstant.CODE_CLASSIFY))
+					.getData().get(0).getTableName() +" where lcstatus='" + FrameWorkDefaultValueConstant
+				.FRAMEWORK_DATA_ENABLED + "' start with parentCodeClassifyOid = '" + codeClassifyOid +
+				"' CONNECT BY PRIOR OID = parentCodeClassifyOid )");
 		}
 		conditionMap.put("t.lastr", "1");
 		conditionMap.put("t.lastv", "1");

--
Gitblit v1.9.3