From e153f2a76bb592864db894a1eb1aa83a1eb42bf7 Mon Sep 17 00:00:00 2001
From: fujunling <2984387807@qq.com>
Date: 星期五, 09 六月 2023 18:19:26 +0800
Subject: [PATCH] 详情接口
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java | 92 +++++++++++++++++++++++++++++++++-------------
1 files changed, 66 insertions(+), 26 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 5f36b78..3837b3e 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
@@ -13,7 +13,6 @@
import com.vci.ubcs.code.dto.datapush.BaseModelDTO;
import com.vci.ubcs.code.entity.*;
import com.vci.ubcs.code.enumpack.*;
-import com.vci.ubcs.code.mapper.CodeOsbtmtypeMapper;
import com.vci.ubcs.code.mapper.CodeWupinMapper;
import com.vci.ubcs.code.mapper.CommonsMapper;
import com.vci.ubcs.code.service.*;
@@ -21,6 +20,7 @@
import com.vci.ubcs.code.vo.pagemodel.UITableFieldVO;
import com.vci.ubcs.code.vo.pagemodel.UITablePageVO;
import com.vci.ubcs.code.vo.pagemodel.*;
+import com.vci.ubcs.omd.feign.IAttributeClient;
import com.vci.ubcs.omd.feign.IBtmTypeClient;
import com.vci.ubcs.omd.feign.IEnumClient;
import com.vci.ubcs.omd.feign.IRevisionRuleClient;
@@ -90,28 +90,28 @@
*/
@Resource
private CodeClstemplateServiceImpl templateService;
- /**
- * 妯℃澘鐨勬湇鍔�
- */
+
@Resource
- private CodeOsbtmtypeMapper codeOsbtmtypeMapper;
- @Resource
- private CodeOsattributeServiceImpl attributeService;
+ private IAttributeClient attributeClient;
+
/**
* 鐢熸垚缂栫爜鐨勬湇鍔�
*/
@Resource
private MdmProductCodeService productCodeService;
+
/**
* 鍙緭鍙�夌殑鏈嶅姟
*/
@Resource
IDictBizClient iDictBizClient;
+
/**
* 瀛楀吀鐨勬湇鍔�
*/
@Resource
IEnumClient enumClient;
+
/**
* 鍏紡鐨勬湇鍔�
*/
@@ -316,10 +316,11 @@
List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid());
// List<ClientBusinessObject> cboList = boService.selectCBOByOidCollection(oids, baseModelDTO.getBtmname());
//鎻掍釜鐐� 涓氬姟绫诲瀷瀹屾垚鍚庨渶瑕佷慨鏀�
- QueryWrapper<CodeOsbtmtypeEntity> wrapper = new QueryWrapper<>();
+ QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>();
wrapper.eq("BTMNAME",baseModelDTO.getBtmname());
wrapper.in("OID",oids);
- List<CodeOsbtmtypeEntity> cboList = codeOsbtmtypeMapper.selectList(wrapper);
+ // 寰呭畬鍠�
+ List<BtmTypeVO> cboList = null; // btmTypeClient.selectList(wrapper);
//杩橀渶瑕佷慨鏀筧llCode鐨勭敓鍛藉懆鏈�
// Map<String, String> conditionMap = new HashMap<>();
QueryWrapper<CodeAllCode> allCodeWrapper = new QueryWrapper<>();
@@ -331,16 +332,18 @@
// List<ClientBusinessObject> codeCbos = boService.queryCBO(MdmBtmTypeConstant.CODE_ALL_CODE, conditionMap);
// 鍥炴敹闇�瑕佷笟鍔℃暟鎹垹闄�
if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) {
-// BatchCBO batchCBO = new BatchCBO();
-// batchCBO.getDeleteCbos().addAll(cboList);
- codeOsbtmtypeMapper.deleteBatchIds(cboList);
-// boService.persistenceBatch(batchCBO);
- } else {
-// lifeCycleService.transCboStatus(cboList, baseModelDTO.getLcStatus());
- }
-// lifeCycleService.transCboStatus(codeCbos, baseModelDTO.getLcStatus());
- }
+ // BatchCBO batchCBO = new BatchCBO();
+ // batchCBO.getDeleteCbos().addAll(cboList);
+ // 寰呭畬鍠�
+ //btmTypeClient.deleteBatchIds(cboList);
+
+ //boService.persistenceBatch(batchCBO);
+ } else {
+ // lifeCycleService.transCboStatus(cboList, baseModelDTO.getLcStatus());
+ }
+ // lifeCycleService.transCboStatus(codeCbos, baseModelDTO.getLcStatus());
+ }
/**
* 鐢宠鍗曚竴缂栫爜
@@ -1064,6 +1067,7 @@
itemVO.setPrefix(attrVO.getPrefixValue());
itemVO.setSuffix(attrVO.getSuffixValue());
itemVO.setTooltips(attrVO.getExplain());
+ itemVO.setInputTip(attrVO.getInputTip());
itemVO.setSelectLibFlag(attrVO.getLibraryIdentification());
//鐪嬬湅鏄惁鏈夋灇涓�
if ((StringUtils.isNotBlank(attrVO.getEnumString())
@@ -1574,11 +1578,12 @@
selectFieldList.add(referTableNick + "." + showFieldInSource + " as " + referShowField);
});
}
- Optional.ofNullable(attributeService.getDefaultAttributeVOMap()).orElseGet(() -> new HashMap<>()).keySet().stream().forEach(attrId -> {
- if (!selectFieldList.contains(attrId) && !"secretgrade".equalsIgnoreCase(attrId)) {
- selectFieldList.add(attrId);
- }
- });
+ // 寰呭畬鍠�
+// Optional.ofNullable(attributeService.getDefaultAttributeVOMap()).orElseGet(() -> new HashMap<>()).keySet().stream().forEach(attrId -> {
+// if (!selectFieldList.contains(attrId) && !"secretgrade".equalsIgnoreCase(attrId)) {
+// selectFieldList.add(attrId);
+// }
+// });
if (!selectFieldList.contains(CODE_FIELD)) {
selectFieldList.add(CODE_FIELD);
}
@@ -1781,9 +1786,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.");
- }
+ // 寰呭畬鍠�
+// 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)
@@ -3059,4 +3065,38 @@
}
return "";
}
+
+ /**
+ * 浼犲叆涓氬姟绫诲瀷浠ュ強鐩稿叧鏁版嵁杩涜鎵归噺鏇存柊鎿嶄綔
+ *
+ * @param btmType 涓氬姟绫诲瀷
+ * @param baseModels 澶勭悊鏁版嵁
+ * @return 澶勭悊鐘舵��
+ */
+ @Override
+ public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) throws Exception {
+ //浣跨敤浼犲叆鐨勪笟鍔$被鍨嬫煡璇㈣〃
+ R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
+ if(listR.getData().size() == 0){
+ throw new VciBaseException("浼犲叆涓氬姟绫诲瀷鏈煡璇㈠埌鐩稿簲琛ㄥ崟锛岃妫�鏌ワ紒");
+ }
+ //灏哹ean杞负map,mybatis缁熶竴澶勭悊
+ List<Map<String,String>> maps = new ArrayList<>();
+
+ baseModels.stream().forEach(model-> {
+ try {
+ maps.add(VciBaseUtil.convertBean2Map(model));
+ } catch (Exception e) {
+ throw new VciBaseException("绫诲瀷杞崲閿欒锛�" + e.getMessage());
+ }
+ });
+ try {
+ //娉ㄦ剰姝ゅ鏇存柊鎴愬姛鏄繑鍥炵殑-1
+ commonsMapper.updateBatchByBaseModel(listR.getData().get(0).getTableName(), maps);
+ }catch (Exception e){
+ return R.fail("鏇存柊澶辫触锛�"+e.getMessage());
+ }
+
+ return R.success("鏇存柊鎴愬姛锛�");
+ }
}
--
Gitblit v1.9.3