From 58e84408a3cdcd57a349fcd7faadf832361965ff Mon Sep 17 00:00:00 2001 From: ludc Date: 星期一, 17 七月 2023 14:17:37 +0800 Subject: [PATCH] 代码提交 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeBasicSecWrapper.java | 17 ----- Source/UBCS-WEB/src/views/code/code.vue | 10 ++- Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java | 5 + Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java | 4 + Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue | 2 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java | 83 +++++++++++++++++++++++---- 6 files changed, 86 insertions(+), 35 deletions(-) diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue index cf0f19d..cc7d07c 100644 --- a/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue +++ b/Source/UBCS-WEB/src/components/code-dialog-page/referConfigFormDialog.vue @@ -1211,7 +1211,7 @@ }else{ // 閫夋嫨鏄剧ず瀛楁 data.selectedArrary.forEach(item => { - console.log(item); + // console.log(item); this.codeShowFieldConfigVOS.push( { field: item.id, diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue index 2c009fa..c1a1e3a 100644 --- a/Source/UBCS-WEB/src/views/code/code.vue +++ b/Source/UBCS-WEB/src/views/code/code.vue @@ -1330,12 +1330,13 @@ this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�!"); return false; } + const attr = this.selectAttrParams.selectionChangeAttrList[0]; //璋冪敤瀛愮粍浠跺苟浼犻�掑綋鍓嶉�変腑鐨勫弬鏁板�硷紝瀹炵幇鍥炴樉 this.form = Object.assign({}, this.form, { - referAttributeId:this.selectAttrParams.selectionChangeAttrList[0].id, - referAttributeName:this.selectAttrParams.selectionChangeAttrList[0].name, - referCodeClassifyOid: this.currentSelectTreeData.key, - referCodeClassifyOidName: this.currentSelectTreeData.title, + referAttributeId: attr.id || '', + referAttributeName: attr.name || attr.id, + referCodeClassifyOid: this.currentSelectTreeData.key || '', + referCodeClassifyOidName: this.currentSelectTreeData.title || '', }) this.isShowSelectAttrOption = false; }, @@ -2541,6 +2542,7 @@ openAttrSelectOrGetValue(condition){ if(condition === 'attr'){ this.isShowSelectAttrOption = true; + this.loadlistClassifyLinkAttr(); }else if(condition === 'value'){ //鎵撳紑鍏紡缂栬緫妗嗭紝绗簩灞傚祵濂楀璇濇 //this.$refs.formulaEditor.isShowformulaEdit = true; diff --git a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java index 02c3ee5..abccfd4 100644 --- a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java +++ b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java @@ -66,4 +66,9 @@ @NotBlank(message = "瑙勫垯渚濇嵁涓嶈兘涓虹┖") private String accordingTo; + /** + * 鍩虹鐮佹鐨勭爜娈电被鍨嬮『搴忔嫾鎺ヨ�屾垚鐨勫瓧绗︿覆 + */ + private String basicSecTypes; + } diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java index 14d4f22..07731f0 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/enumpack/CodeSecTypeEnum.java @@ -22,18 +22,22 @@ * 鍙彉鐮佹 */ CODE_VARIABLE_SEC("codevariablesec","鍙彉鐮佹"), + /** * 鏃ユ湡鐮佹 */ CODE_DATE_SEC("codedatesec","鏃ユ湡鐮佹"), + /** * 鍒嗙被鐮佹 */ CODE_CLASSIFY_SEC("codeclassifysec","鍒嗙被鐮佹"), + /** * 灞炴�х爜娈� */ CODE_ATTR_SEC("codeattrsec","灞炴�х爜娈�"), + /** * 娴佹按鐮佹 */ diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java index 8bd5db7..b0bb55c 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant; import com.vci.ubcs.code.constant.MdmBtmTypeConstant; import com.vci.ubcs.code.dto.CodeBasicSecDTO; import com.vci.ubcs.code.dto.CodeRuleDTO; @@ -40,6 +41,8 @@ import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.code.wrapper.CodeClassifyWrapper; import com.vci.ubcs.code.wrapper.CodeRuleWrapper; +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; @@ -64,6 +67,7 @@ import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_EDITING; import static com.vci.ubcs.code.constant.FrameWorkLangCodeConstant.DATA_OID_NOT_EXIST; @@ -437,6 +441,9 @@ if (!CodeRuleLC.EDITING.getValue().equals(codeRuleDO.getLcStatus())) { return R.fail("闈炵紪杈戠姸鎬佺殑缂栫爜瑙勫垯鏃犳硶鍙戝竷"); } + // 鍙戝竷鏃跺皢鐮佹绫诲瀷鎸夌収瀛楃涓插垎闅旂殑褰㈠紡鎷兼帴骞跺瓨鍌� + String secTypeStr = codeBasicSecService.listCodeBasicSecByRuleOid(codeRuleDO.getOid()).stream().map(CodeBasicSecVO::getSecType).collect(Collectors.joining(",")); + codeRuleDO.setBasicSecTypes(secTypeStr); count = codeRuleMapper.update(null,wrapper.set(CodeRule::getLcStatus, CodeRuleLC.RELEASED.getValue())); } else { return R.fail("鏆備笉鏀寔鐨勬搷浣滅被鍨�"); @@ -501,27 +508,77 @@ public R checkLikeCodeRule(String oid) throws VciBaseException { // 1銆佹煡璇㈠嚭褰撳墠瑕佸彂甯冪殑瑙勫垯 CodeRuleVO codeRuleVO = getObjectHasSecByOid(oid); - // 2銆佹壘鍑轰笌褰撳墠鍙戝竷鐨勮鍒欑爜娈甸『搴忎竴鑷寸殑瑙勫垯 - if(Func.isNotEmpty(codeRuleVO.getSecVOList())){ - String secType = codeRuleVO.getSecVOList().stream().map(CodeBasicSecVO::getSecType).collect(Collectors.joining(",")); - + // 褰撳墠鍙戝竷鐨勮鍒欎笉瀛樺湪鐮佹淇℃伅 + if(Func.isEmpty(codeRuleVO.getSecVOList())){ + return R.data(null); } + // 2銆佹壘鍑轰笌褰撳墠鍙戝竷鐨勮鍒欑爜娈甸『搴忎竴鑷寸殑瑙勫垯 + String secTypes = codeRuleVO.getSecVOList().stream().map(CodeBasicSecVO::getSecType).collect(Collectors.joining(",")); + //鍏堟煡璇㈠嚭鎵�鏈夊凡鍙戝竷鐨勭紪鐮佽鍒� + List<CodeRule> codeRuleList = codeRuleMapper.selectList(Wrappers.<CodeRule>query().lambda().eq(CodeRule::getLcStatus, FrameWorkDefaultValueConstant.FRAMEWORK_RELEASE_RELEASED)); + List<CodeRuleVO> codeRuleVOS = codeRuleDO2VOs(codeRuleList, true); + // 婊¤冻鐮佹绫诲瀷椤哄簭涓�鑷寸殑瑕佹眰鐨勭紪鐮佽鍒欙紝鍙互杩涘叆涓嬩竴姝ユ瘮杈冭鍒� + List<CodeRuleVO> codeRuleVOStream = codeRuleVOS.parallelStream().filter(item -> { + // 瀵笲asicSec浣跨敤orderNum鎺掑簭(鏌ヨ鐨勬椂鍊欏叾瀹炲凡缁忔帓杩囦竴娆″簭浜�)锛屽苟灏唖ecType鐢ㄩ�楀彿鍒嗛殧鎷兼帴鎴愪竴涓瓧绗︿覆 + String itemSecTypes = item.getSecVOList().parallelStream().sorted(Comparator.comparing(CodeBasicSecVO::getOrderNum)).map(CodeBasicSecVO::getSecType).collect(Collectors.joining(",")); + if (secTypes.equals(itemSecTypes)) { + return true; + } + return false; + }).collect(Collectors.toList()); + // 3銆佸悇绫荤爜娈靛垎鍒繘琛屾瘮瀵� + codeRuleVOStream.parallelStream().filter(item->{ + item.getSecVOList().stream().filter(basicSec->{ + switch (basicSec.getSecType()){ + // 灞炴�х爜娈碉紝姣斿灞炴�у拰灞炴�ф墍鍦ㄥ垎绫�(referCodeClassifyOid) + case "codeattrsec": + List<CodeBasicSecVO> codeattrsec = this.getBasicSecBySecType("codeattrsec", codeRuleVO); - // TODO 寰呭畬鍠� + break; + // 鍙彉鐮佹锛屾瘮瀵圭爜娈甸暱搴︼紝缂栫爜琛ヤ綅鏂瑰紡鍜岃ˉ浣嶆椂鐨勫瓧绗� + case "codevariablesec": + break; + // 鍥哄畾鐮佹姣斿鎸夊崌搴忔帓搴忕殑鐮佸�硷紝 + case "codefixedsec": + break; + // 鍒嗙被鐮佹姣斿鎸夊崌搴忔帓搴忕爜鍊� + case "codeclassifysec": + break; + // 鏃ユ湡鐮佹姣斿鏃ユ湡鏍煎紡 + case "codedatesec": + break; + // 寮曠敤鐮佹锛屾瘮瀵瑰弬鐓у簲鐢ㄧ殑涓氬姟绫诲瀷 + case "coderefersec": + break; + // 灞傜骇鐮佹锛屾瘮瀵瑰眰绾х被鍨嬨�佸眰绾х殑鍊笺�佸瓧绗︽埅鍙栫被鍨嬨�佸彇鍊肩被鍨� + case "codelevelsec": + break; + case "codeserialsec": + // 娴佹按鐮佹姣斿鐮佹鐨勯暱搴� - - // 2銆佸湪1銆佺殑鍩虹涓婂啀姣斿鐮佹绫诲瀷鐨勯『搴忎竴鑷寸殑缂栫爜璺潃 - - // 3銆佸湪2銆佺殑鍩虹涓婃瘮杈冪爜娈电爜鍊奸暱搴︼紝瀵规瘮鍑洪暱搴︾浉鍚岀殑缂栫爜瑙勫垯 - - // 4銆佸湪3銆佺殑鍩虹涓婃瘮杈冪爜鍊兼槸鍚︾浉鍚� - - + break; + default: + return false; + } + return false; + }); + return false; + }); // 鏈�鍚庡皢缁撴灉杩涜杩斿洖 return null; } + private List<CodeBasicSecVO> getBasicSecBySecType(String secType,CodeRuleVO codeRuleVO){ + List<CodeBasicSecVO> codeBasicSecVOList = codeRuleVO.getSecVOList().parallelStream().filter(item -> { + if (item.getSecType().equals(secType)) { + return true; + } + return false; + }).collect(Collectors.toList()); + return codeBasicSecVOList; + } + /** * 鎵归噺鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞� * diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeBasicSecWrapper.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeBasicSecWrapper.java index c58fd2e..ce9d18a 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeBasicSecWrapper.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/CodeBasicSecWrapper.java @@ -1,22 +1,5 @@ package com.vci.ubcs.code.wrapper; -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 搴勯獮 (smallchill@163.com) - */ - import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.vci.ubcs.code.entity.CodeBasicSec; import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO; -- Gitblit v1.9.3