From cb4e11b19446843188cf628ac8f6be5fe1fa68c7 Mon Sep 17 00:00:00 2001 From: fujunling <2984387807@qq.com> Date: 星期二, 06 六月 2023 18:01:52 +0800 Subject: [PATCH] 配置 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java | 76 ++++++++++++++++++++++++++++++-------- 1 files changed, 60 insertions(+), 16 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 ed02a92..4c46eb9 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 @@ -16,14 +16,14 @@ import com.vci.ubcs.code.mapper.CodeBasicSecMapper; import com.vci.ubcs.code.mapper.CodeClassifyValueMapper; import com.vci.ubcs.code.mapper.CodeFixedValueMapper; -import com.vci.ubcs.code.service.ICodeBasicSecService; -import com.vci.ubcs.code.service.ICodeClassifyValueService; -import com.vci.ubcs.code.service.ICodeFixedValueService; -import com.vci.ubcs.code.service.ICodeRuleService; +import com.vci.ubcs.code.service.*; +import com.vci.ubcs.code.vo.CodeReferConfigVO; import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; import com.vci.ubcs.code.vo.pagemodel.CodeFixedValueVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; +import com.vci.ubcs.omd.cache.EnumCache; +import com.vci.ubcs.omd.enums.EnumEnum; import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.revision.service.RevisionModelUtil; import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; @@ -83,6 +83,9 @@ @Resource private ICodeClassifyValueService codeClassifyValueService; + + @Resource + private ICodeReferConfigService codeReferConfigService; @Resource private IDictBizClient iDictBizClient; @@ -215,11 +218,11 @@ CodeBasicSec codeBasicSecDO = new CodeBasicSec(); BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); //text杞崲 - codeBasicSecDO.setSecTypeText(CodeSecTypeEnum.getTextByValue(codeBasicSecDTO.getSecType())); - codeBasicSecDO.setCodeLevelTypeText(CodeLevelTypeEnum.getTextByValue(codeBasicSecDTO.getCodeLevelType())); - codeBasicSecDO.setCodeSecLengthTypeText(CodeSecLengthTypeEnum.getTextByValue(codeBasicSecDTO.getCodeSecLengthType())); - codeBasicSecDO.setValueCutTypeText(CodeCutTypeEnum.getValueByText(codeBasicSecDTO.getValueCutType())); - codeBasicSecDO.setCodeGetValueTypeText(CodeGetValueTypeEnum.getValueByText(codeBasicSecDTO.getCodeGetValueType())); + codeBasicSecDO.setSecTypeText(EnumCache.getValue(EnumEnum.CODE_SEC_TYPE,codeBasicSecDTO.getSecType())); + codeBasicSecDO.setCodeLevelTypeText(EnumCache.getValue(EnumEnum.CODE_LEVEL_TYPE,codeBasicSecDTO.getCodeLevelType())); + codeBasicSecDO.setCodeSecLengthTypeText(EnumCache.getValue(EnumEnum.CODE_SEC_LENGTH,codeBasicSecDTO.getCodeSecLengthType())); + codeBasicSecDO.setValueCutTypeText(EnumCache.getValue(EnumEnum.CODE_CUT_TYPE,codeBasicSecDTO.getValueCutType())); + codeBasicSecDO.setCodeGetValueTypeText(EnumCache.getValue(EnumEnum.CODE_GET_VALUE_TYPE,codeBasicSecDTO.getCodeGetValueType())); //濉厖涓�浜涢粯璁ゅ�� DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeBasicSecDO,MdmBtmTypeConstant.CODE_BASIC_SEC); //鎺掑簭鍙凤紝榛樿绛変簬褰撳墠宸叉湁鐨勬暟閲忓姞1 @@ -237,15 +240,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("寮曠敤鐮佹鐨勬椂鍊欙紝闇�瑕佸~鍐� 鍙傜収閰嶇疆 鐨勫唴瀹�"); } 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); + } + if(codeReferConfigVO.getIsPersistence()=="true"){ + codeReferConfigService.insert(codeReferConfigVO); } } boolean resBoolean = codeBasicSecMapper.insert(codeBasicSecDO) > 0; @@ -687,13 +697,14 @@ if(StringUtils.isBlank(ruleOid)){ return new ArrayList<>(); } - Map<String,String> conditionMap = new HashMap<>(); - conditionMap.put("pkCodeRule",ruleOid); +// Map<String,String> conditionMap = new HashMap<>(); +// conditionMap.put("pkCodeRule",ruleOid); // PageHelper pageHelper = new PageHelper(-1); // pageHelper.addDefaultAsc("ordernum"); QueryWrapper<CodeBasicSec> wrapper = new QueryWrapper<>(); + wrapper.eq("pkCodeRule",ruleOid); wrapper.orderByAsc("ordernum"); - List<CodeBasicSec> secDOList = codeBasicSecMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper); + List<CodeBasicSec> secDOList = baseMapper.selectList(wrapper);//.selectByCondition(conditionMap, pageHelper); return codeBasicSecDO2VOs(secDOList,true); } @@ -730,6 +741,27 @@ } /** + * 鎵归噺鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞� + * + * @param codeBasicSecDOs 鏁版嵁瀵硅薄鍒楄〃 + * @return 鏄剧ず瀵硅薄 + * @throws VciBaseException 鍙傛暟涓虹┖鎴栬�呬笉瀛樺湪鐨勬椂鍊欎細鎶涘嚭寮傚父 + */ + @Override + public List<CodeBasicSecVO> codeBasicSecDO2VOs(Collection<CodeBasicSec> codeBasicSecDOs) throws VciBaseException { + List<CodeBasicSecVO> voList = new ArrayList<CodeBasicSecVO>(); + if (!CollectionUtils.isEmpty(codeBasicSecDOs)) { + for (CodeBasicSec s : codeBasicSecDOs) { + CodeBasicSecVO vo = codeBasicSecDO2VO(s); + if (vo != null) { + voList.add(vo); + } + } + } + return voList; + } + + /** * 鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞� * * @param codeBasicSecDO 鏁版嵁瀵硅薄 @@ -738,14 +770,26 @@ */ @Override public CodeBasicSecVO codeBasicSecDO2VO(CodeBasicSec codeBasicSecDO) throws VciBaseException { - CodeBasicSecVO vo = new CodeBasicSecVO(); + CodeBasicSecVO codeBasicSecVO = new CodeBasicSecVO(); if (codeBasicSecDO != null) { - BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDO, vo); + BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecVO, codeBasicSecVO); + codeBasicSecVO.setSecTypeText(CodeSecTypeEnum.getTextByValue(codeBasicSecVO.getSecType())); + codeBasicSecVO.setCodeLevelTypeText(CodeLevelTypeEnum.getTextByValue(codeBasicSecVO.getCodeLevelType())); + codeBasicSecVO.setCodeSecLengthTypeText(CodeSecLengthTypeEnum.getTextByValue(codeBasicSecVO.getCodeSecLengthType())); + codeBasicSecVO.setValueCutTypeText(CodeCutTypeEnum.getValueByText(codeBasicSecVO.getValueCutType())); + codeBasicSecVO.setCodeGetValueTypeText(CodeGetValueTypeEnum.getValueByText(codeBasicSecVO.getCodeGetValueType())); + // 濡傛灉鏄垎绫荤爜娈甸渶瑕佹煡璇㈡墍灞炲垎绫荤殑涓枃鍚嶇О + if(codeBasicSecDO.getSecType().equals("codeclassifysec") && Func.isNotEmpty(codeBasicSecDO.getParentClassifySecOid())){ + CodeBasicSec codeBasicSec = codeBasicSecMapper.selectOne(Wrappers.<CodeBasicSec>query().lambda() + .eq(CodeBasicSec::getOid, codeBasicSecDO.getParentClassifySecOid()) + .eq(CodeBasicSec::getSecType, codeBasicSecDO.getSecType())); + codeBasicSecVO.setParentClassifySecText(codeBasicSec.getName()); + } //濡傛灉鏈塴cstatus鐨勭被鐨勮瘽 if (true) { //vo.setLcStatusText({lcStatusFullClassName}.getTextByValue(vo.getLcStatus())); } } - return vo; + return codeBasicSecVO; } } -- Gitblit v1.9.3