From 1f238ae264c0dfca87bba9ea9da5456153991eaa Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 04 七月 2023 17:22:03 +0800
Subject: [PATCH] 修改system服务部分接口
---
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java | 2
Source/UBCS-WEB/src/views/code/code.vue | 31 +++++++++------
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java | 4 ++
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java | 2
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java | 3 +
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java | 19 ++++++++-
Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java | 10 ++++-
Source/UBCS-WEB/src/const/code/codebasic.js | 4 +
Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java | 5 ++
Source/UBCS-WEB/src/const/code/mdmrule.js | 4 ++
10 files changed, 63 insertions(+), 21 deletions(-)
diff --git a/Source/UBCS-WEB/src/const/code/codebasic.js b/Source/UBCS-WEB/src/const/code/codebasic.js
index 72a8b1f..3780dcd 100644
--- a/Source/UBCS-WEB/src/const/code/codebasic.js
+++ b/Source/UBCS-WEB/src/const/code/codebasic.js
@@ -14,7 +14,7 @@
menuWidth:260,
dialogClickModal: false,
refreshBtn: true,
- columnBtn: true,
+ columnBtn: false,
searchShowBtn: false,
highlightCurrentRow: true, //琛岄�変腑鏃堕珮浜�
rowKey: "oid", //琛屾暟鎹殑 Key锛岀敤鏉ヤ紭鍖� Table 鐨勬覆鏌�
@@ -25,6 +25,7 @@
search: true,
searchLabelWidth: 80,
searchSpan: 6,
+ sortable: true,
},
{
label: "鐮佹鍚嶇О",
@@ -32,6 +33,7 @@
search: true,
searchLabelWidth: 80,
searchSpan: 6,
+ sortable: true,
},
{
label: "鐮佹鎻忚堪",
diff --git a/Source/UBCS-WEB/src/const/code/mdmrule.js b/Source/UBCS-WEB/src/const/code/mdmrule.js
index 82f4ac4..72b707a 100644
--- a/Source/UBCS-WEB/src/const/code/mdmrule.js
+++ b/Source/UBCS-WEB/src/const/code/mdmrule.js
@@ -10,6 +10,8 @@
viewBtn: true,
selection: true,
dialogClickModal: false,
+ columnBtn: false,
+ searchShowBtn: false,
highlightCurrentRow: true,
rowKey: "oid", //琛屾暟鎹殑 Key锛岀敤鏉ヤ紭鍖� Table 鐨勬覆鏌�
column: [
@@ -19,6 +21,7 @@
search: true,
searchLabelWidth: 45,
searchSpan: 4,
+ sortable: true,
rules: [{
required: true,
message: "璇疯緭鍏ョ紪鍙�",
@@ -31,6 +34,7 @@
search: true,
searchLabelWidth: 45,
searchSpan: 4,
+ sortable: true,
rules: [{
required: true,
message: "璇疯緭鍏ュ悕绉�",
diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index 26918c0..ecb6eac 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -529,7 +529,7 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
+ <el-form-item v-if="form.codeFillType!='code_fill_none'" label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
<el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
<el-option
v-for="item in enumParam.codeFillSeparator"
@@ -577,7 +577,7 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item id="ShowOrHide" v-mode="showCutLength" v-if="showCutLength==true" label="鍊兼埅鍙栭暱搴�:" :label-width="rightFormLabelWidth">
+ <el-form-item id="ShowOrHide" v-if="form.valueCutType!='code_cut_none'" label="鍊兼埅鍙栭暱搴�:" :label-width="rightFormLabelWidth">
<el-input v-model.number="form.valueCutLength" ref="valueCutLength" :readonly="basicSecOnlyRead"></el-input>
</el-form-item>
<el-form-item label="鍙栧�肩被鍨�:" :label-width="rightFormLabelWidth">
@@ -669,7 +669,7 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
+ <el-form-item v-if="form.codeFillType!='code_fill_none'" label="琛ヤ綅鏃剁殑瀛楃:" :label-width="rightFormLabelWidth">
<el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="璇烽�夋嫨" :disabled="basicSecOnlyRead">
<el-option
v-for="item in enumParam.codeFillSeparator"
@@ -840,7 +840,6 @@
total: 0
},
selectionList: [],
- showCutLength: false,
/*缂栫爜瑙勫垯琛ㄦ牸閰嶇疆*/
optionRule: optionRule,
data: [],
@@ -1096,6 +1095,9 @@
},
watch:{
+ },
+ mounted(){
+ this.loadTotalEnum();
},
methods: {
@@ -1697,6 +1699,8 @@
window.console.log(error);
});
this.loadBasic(this.selectionList[0]);
+ // 鍏抽棴瀵硅瘽妗�
+ this.addBasicCodeSettingBox = false
}
},
// 鍥犱负elementui鐨勮〃鍗曟牎楠岃缃笉涓婃墍浠ラ噰鐢ㄥ垽鏂殑鏂瑰紡鏉ュ仛琛ㄥ崟妫�楠屾柟寮�
@@ -2289,6 +2293,7 @@
},
// 娣诲姞
rowSave(row, done, loading) {
+ console.log(row);
add(row).then(() => {
this.onLoad(this.page);
this.$message({
@@ -2386,13 +2391,11 @@
},
changeCutType(value){
if (value != 'code_cut_none'){
- this.showCutLength = true;
if(this.form.valueCutLength == ''){
this.form.valueCutLength = 1;
}
}else{
this.form.valueCutLength = '';
- this.showCutLength = false;
}
},
// 鍗曞嚮缂栫爜瑙勫垯瀹炵幇琛岄�夋嫨
@@ -2604,12 +2607,6 @@
valueCutLength: row!=null&&row.valueCutLength != '' ? row.valueCutLength:'', //
codeGetValueType: row!=null&&row.codeGetValueType != '' ? row.codeGetValueType:'code_get_value_all_up', //鍙栧�肩被鍨� 鏋氫妇鏌ヨ
});
- if(this.form.valueCutType === 'code_cut_none'){
- this.showCutLength = false;
- }else{
- this.showCutLength = true;
- }
-
this.loadCodeLevelType();
this.loadCodeCutType();
this.loadCodeGetValueType();
@@ -2661,6 +2658,16 @@
}
return enumCach;
},
+ // 缁熶竴鍔犺浇鎵�鏈夋灇涓炬煡璇紝涓昏鏄负閬垮厤鍒囨崲鐮佹绫诲瀷鏃惰繕鏈姞杞藉畬鎴愮殑鎯呭喌
+ loadTotalEnum(){
+ this.loadCodeSecType();
+ this.loadCodeSecLength();
+ this.loadCodeFillType();
+ this.loadCodeFillSeparator();
+ this.loadCodeLevelType();
+ this.loadCodeCutType();
+ this.loadCodeGetValueType();
+ },
//鏋氫妇鍜屽彲杈撳彲閫夊唴瀹规煡璇�
loadCodeSecType(){
this.enumParam.secTypeList = this.getLocalStorageEnum("codeSecType");
diff --git a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java
index 24a4dee..bd66981 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeBasicSec.java
@@ -11,6 +11,7 @@
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.Alias;
+import javax.validation.constraints.NotBlank;
import java.sql.Clob;
/**
@@ -33,16 +34,19 @@
/**
* 鐮佹淇℃伅
*/
+ @NotBlank(message = "鐮佹淇℃伅涓嶈兘涓虹┖")
private String id;
/**
* 鐮佹鍚嶇О
*/
+ @NotBlank(message = "鐮佹鍚嶇О涓嶈兘涓虹┖")
private String name;
/**
* 鐮佹绫诲瀷
*/
+ @NotBlank(message = "鐮佹绫诲瀷涓嶈兘涓虹┖")
private String secType;
/**
@@ -55,6 +59,7 @@
/**
* 鎵�灞炵紪鐮佽鍒�
*/
+ @NotBlank(message = "鎵�灞炵紪鐮佽鍒欎笉鑳戒负绌�")
private String pkCodeRule;
/**
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 dca7936..f622bdd 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
@@ -24,6 +24,8 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
+import javax.validation.constraints.NotBlank;
+
/**
* 缂栫爜瑙勫垯 瀹炰綋绫�
*
@@ -44,11 +46,13 @@
/**
* 瑙勫垯缂栧彿
*/
+ @NotBlank(message = "瑙勫垯缂栧彿涓嶈兘涓虹┖")
private String id;
/**
* 瑙勫垯鐨勫悕绉�
*/
+ @NotBlank(message = "瑙勫垯鐨勫悕绉颁笉鑳戒负绌�")
private String name;
/**
diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java
index 08f5c65..79f9102 100644
--- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java
+++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeBasicSecController.java
@@ -62,7 +62,7 @@
@PostMapping( "/addSave")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "澧炲姞 鐮佹鍩虹淇℃伅", notes = "codeBasicSecDTO")
- public R addSave(@RequestBody CodeBasicSecDTO codeBasicSecDTO){
+ public R addSave(@Valid @RequestBody CodeBasicSecDTO codeBasicSecDTO){
boolean resBoolean;
try {
resBoolean = codeBasicSecService.addSave(codeBasicSecDTO);
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 c2379f4..90d67cb 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
@@ -456,7 +456,7 @@
public R deleteCodeBasicSecByPrimaryKey(String oid) throws VciBaseException {
CodeBasicSec codeBasicSecDO = selectByOid(oid);
boolean isLinked = checkIsLinked(codeBasicSecDO.getPkCodeRule(), oid);
- if (!isLinked) {
+ if (isLinked) {
return R.fail("缂栫爜瑙勫垯宸茶寮曠敤锛屼笉鍏佽缂栬緫鎴栧垹闄�");
}
//鎵ц鍒犻櫎鎿嶄綔
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 1ff109b..4d6d88b 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
@@ -132,8 +132,9 @@
@Override
public boolean addSave(CodeRuleDTO codeRuleDTO) throws VciBaseException {
VciBaseUtil.alertNotNull(codeRuleDTO, "闇�瑕佹坊鍔犵殑鏁版嵁瀵硅薄");
- //灏咲TO杞崲涓篋O
+ // 灏咲TO杞崲涓篋O
CodeRule codeRule = Objects.requireNonNull(BeanUtil.copy(codeRuleDTO, CodeRule.class));
+ // 濉厖榛樿鍊�
DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeRule, MdmBtmTypeConstant.CODE_RULE);
codeRule.setLctid(CODE_RULE_LC);
codeRule.setLcStatus(FRAMEWORK_RELEASE_EDITING);
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java
index 831bbd2..6e445e7 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/TenantController.java
@@ -37,10 +37,12 @@
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -66,6 +68,12 @@
private final ITenantService tenantService;
private final ITenantPackageService tenantPackageService;
+
+ /**
+ * 瓒呯绉熸埛id
+ */
+ @Value("${user-info.tenant-id}")
+ private String tenantId;
/**
* 璇︽儏
@@ -218,15 +226,20 @@
}
/**
- * 鏌ヨ绉熸埛淇℃伅锛岀畝閿�煎褰㈠娍
+ * 鏌ヨ绉熸埛淇℃伅锛岄敭鍊煎褰㈠紡
* @return
*/
@GetMapping("/tenant-map")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "涓嬫媺绉熸埛淇℃伅")
public R<List> findAll() {
- List<Map<String, Object>> map = tenantService.selectMaps();
- return R.data(map);
+ List<Map<String, Object>> mapList = tenantService.selectMaps();
+ if(Func.isNotEmpty(tenantId)){
+ Map<String, Object> map = new HashMap<>();
+ map.put("绠$悊缁�", tenantId);
+ mapList.add(map);
+ }
+ return R.data(mapList);
}
/**
diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java
index 3a3f857..565deda 100644
--- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java
@@ -34,6 +34,7 @@
import org.springblade.core.tool.node.ForestNodeMerger;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringPool;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -50,6 +51,11 @@
private static final String TENANT_ID = "tenantId";
private static final String PARENT_ID = "parentId";
+ /**
+ * nacos閰嶇疆鐨勭鐞嗙粍绉熸埛id
+ */
+ @Value("${user-info.tenant-id}")
+ private String tenantId;
@Override
public IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param, Query query) {
@@ -80,10 +86,10 @@
return baseMapper.lazyList(tenantId, parentId, param, Condition.getPage(query));
}
-
@Override
public List<DeptVO> tree(String tenantId) {
- List<DeptVO> tree = baseMapper.tree(tenantId);
+ // 杩欓噷鍒ゆ柇鎴戜滑鑷繁閰嶇疆鐨勭鐞嗙粍绉熸埛锛屽彲浠ユ煡璇㈡墍鏈�
+ List<DeptVO> tree = baseMapper.tree(tenantId.equals(this.tenantId) ? "":tenantId);
return ForestNodeMerger.merge(tree);
}
--
Gitblit v1.9.3