From 738b846113ae39fbd0594ff98d968f559e9a8a90 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 24 七月 2023 11:17:23 +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/CodeBasicSecServiceImpl.java | 40 ++++++++++++++++++++++++++--------------
1 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
index 5a02f9f..d8cbf35 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
@@ -2,6 +2,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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -272,7 +273,7 @@
throw new VciBaseException("寮曠敤鐮佹鐨勬椂鍊欙紝鍙傜収閰嶇疆鐨勫唴瀹圭殑鏍煎紡涓嶆纭�,",new String[0],e);
}
// 鍒ゆ柇鏄惁涓哄紩鐢ㄧ爜娈碉紝濡傛灉鏄簲鐢ㄧ爜娈电殑璇濓紝涓轰簡閫傞厤鍓嶇缁勪欢锛岃繖閲岃瀵硅〃杩涜澶勭悊涓�涓嬶紝鎸夌収浠ュ墠鐨勫弬鐓ф牸寮忚繘琛岃浆鎹�
- codeBasicSecDO.setReferValueInfo(referConfigTOUIUiTable(codeReferConfigVO));
+ codeBasicSecDO.setReferValueInfo(referConfigToUIUiTable(codeReferConfigVO));
if(codeReferConfigVO.getIsPersistence()=="true"){
codeReferConfigService.insert(codeReferConfigVO);
}
@@ -296,7 +297,7 @@
* @param codeReferConfig
* @return
*/
- private String referConfigTOUIUiTable(CodeReferConfigVO codeReferConfig){
+ private String referConfigToUIUiTable(CodeReferConfigVO codeReferConfig){
// 鎷疯礉涓轰互鍓嶇殑鑰佸璞�
UIReferConfigFormVO uiFormReferVO = new UIReferConfigFormVO();
BeanUtil.copy(codeReferConfig,uiFormReferVO);
@@ -308,7 +309,7 @@
List<TableColVO> uiTableFieldVOs = new ArrayList<>();
// 蹇�熸煡璇㈠垪
List<TableColVO> queryColumns = new ArrayList<>();
- if(!codeReferConfig.getCodeShowFieldConfigVOS().isEmpty()){
+ if(!CollectionUtils.isEmpty(codeReferConfig.getCodeShowFieldConfigVOS())){
codeReferConfig.getCodeShowFieldConfigVOS().stream().forEach(showField ->{
TableColVO tableColVO = new TableColVO();
BeanUtil.copy(showField,tableColVO);
@@ -366,15 +367,22 @@
&& StringUtils.isBlank(codeBasicSecDO.getCodeFillSeparator())){
throw new VciBaseException("褰撹ˉ浣嶆柟寮忎负宸﹁ˉ浣嶆垨鑰呭彸琛ヤ綅鐨勬椂鍊欙紝琛ヤ綅瀛楃涓嶈兘涓虹┖");
}
+ CodeReferConfigVO codeReferConfigVO = null;
//寮曠敤鐮佹鐨勬椂鍊欙紝闇�瑕佸垽鏂弬鐓х殑淇℃伅鏄惁姝g‘
if(CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(codeBasicSecDO.getSecType())){
if(StringUtils.isBlank(codeBasicSecDO.getReferConfig())){
- throw new VciBaseException("寮曠敤鐮佹鐨勬椂鍊欙紝闇�瑕佸~鍐� 鍙傜収閰嶇疆 鐨勫唴瀹�");
+ throw new VciBaseException("寮曠敤鐮佹鐨勬椂鍊欙紝闇�瑕佸~鍐欏弬鐓ч厤缃殑鍐呭");
}
try{
- JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class);
+ // JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class);
+ codeReferConfigVO = JSONObject.parseObject(codeBasicSecDO.getReferConfig(), CodeReferConfigVO.class);
}catch (Throwable e){
throw new VciBaseException("寮曠敤鐮佹鐨勬椂鍊欙紝鍙傜収閰嶇疆鐨勫唴瀹圭殑鏍煎紡涓嶆纭�,",new String[0],e);
+ }
+ // 鍒ゆ柇鏄惁涓哄紩鐢ㄧ爜娈碉紝濡傛灉鏄簲鐢ㄧ爜娈电殑璇濓紝涓轰簡閫傞厤鍓嶇缁勪欢锛岃繖閲岃瀵硅〃杩涜澶勭悊涓�涓嬶紝鎸夌収浠ュ墠鐨勫弬鐓ф牸寮忚繘琛岃浆鎹�
+ codeBasicSecDO.setReferValueInfo(referConfigToUIUiTable(codeReferConfigVO));
+ if(codeReferConfigVO.getIsPersistence()=="true"){
+ codeReferConfigService.insert(codeReferConfigVO);
}
}
revisionModelUtil.copyFromDTOIgnore(codeBasicSecDTO, codeBasicSecDO);
@@ -537,7 +545,7 @@
return null;
}
conditionMap.put("secType",(CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue()));
- return refDataGridCodeBasicSec(query.setAscs("ordernum"),conditionMap);
+ return refDataGridCodeBasicSec(query.setAscs("orderNum"),conditionMap);
}
/**
@@ -751,21 +759,21 @@
return codeBasicSecDO;
}
-
/**
* 浣跨敤瑙勫垯鐨勪富閿幏鍙栧搴旂殑鐮佹鍐呭
*
- * @param conditionMap 瑙勫垯鐨勫唴瀹�
+ * @param ruleOid 瑙勫垯鐨勫唴瀹�
* @return 鐮佹鐨勫唴瀹�
*/
@Override
- public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(Map<String,Object> conditionMap)throws ServiceException {
- if(Func.isBlank(conditionMap.getOrDefault("pkCodeRule","").toString())){
+ public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid)throws ServiceException {
+ if(StringUtils.isBlank(ruleOid)){
return new ArrayList<>();
}
- QueryWrapper<CodeBasicSec> wrapper = UBCSCondition.getQueryWrapper(conditionMap, CodeBasicSec.class);
- wrapper.orderByAsc("orderNum");
- List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper);
+ LambdaQueryWrapper<CodeBasicSec> wrapper = Wrappers.<CodeBasicSec>query().lambda()
+ .eq(CodeBasicSec::getPkCodeRule, ruleOid)
+ .orderByAsc(CodeBasicSec::getOrderNum);
+ List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);//
return codeBasicSecDO2VOs(secDOList,true);
}
@@ -854,7 +862,10 @@
CodeBasicSec codeBasicSec = codeBasicSecMapper.selectOne(Wrappers.<CodeBasicSec>query().lambda()
.eq(CodeBasicSec::getOid, codeBasicSecDO.getParentClassifySecOid())
.eq(CodeBasicSec::getSecType, codeBasicSecDO.getSecType()));
- codeBasicSecVO.setParentClassifySecText(codeBasicSec.getName());
+ if(Func.isNotEmpty(codeBasicSec)){
+ codeBasicSecVO.setParentClassifySecOid(codeBasicSec.getOid());
+ codeBasicSecVO.setParentClassifySecText(codeBasicSec.getName());
+ }
}
//濡傛灉鏈塴cstatus鐨勭被鐨勮瘽
if (true) {
@@ -863,4 +874,5 @@
}
return codeBasicSecVO;
}
+
}
--
Gitblit v1.9.3