Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue
@@ -6,17 +6,6 @@ append-to-body top="5vh" > <!-- <div> <FormTemplate v-if="type === 'batchApplyCode'" type="add" :selfColumnType="selfColumnType" :selfColumnConfig="selfColumnConfig" ref="CodeApply" @getFormData="getCodeApplyFormData" @referConfigDataUpdate="referConfigDataUpdate" ></FormTemplate> </div> --> <div class="flex_box"> <div class="left" @@ -75,10 +64,21 @@ v-if="cloNamesList.length > 1" > <el-table-column v-if="type !== 'batchApplyCode'" type="selection" width="100px" align="center" ></el-table-column> <el-table-column v-else type="operate" width="100px" align="center" > <template> <el-button type="text">重新编辑</el-button> </template> </el-table-column> <el-table-column type="index" label="序号" @@ -134,9 +134,17 @@ </div> </el-tab-pane> <el-tab-pane :label="tab2Name" name="tab2"> <el-table border :data="tab2Table" height="600px"> <el-table border :data="tab2Table" :height=" type === 'batchApplyCode' && tab2Table.length > 0 ? '400px' : '700px' " > <el-table-column v-for="item in cloNamesList" v-for="item in successTableColumns" :key="item.field" :prop="item.field" :label="item.title" @@ -145,6 +153,23 @@ > </el-table-column> </el-table> <el-card style="min-height: 200px; margintop: 10px" v-if="type === 'batchApplyCode' && tab2Table.length > 0" > <div slot="header" class="clearfix"> <h4>编码申请</h4> </div> <FormTemplate v-if="type === 'batchApplyCode'" type="add" :selfColumnType="selfColumnType" :selfColumnConfig="selfColumnConfig" ref="CodeApply" @getFormData="getCodeApplyFormData" @referConfigDataUpdate="referConfigDataUpdate" ></FormTemplate> </el-card> </el-tab-pane> </el-tabs> </div> @@ -183,7 +208,7 @@ export default { name: "ShowImportData", components: { ResembleQuery, FormTemplate }, // mixins: [codeApply], mixins: [codeApply], props: { title: { type: String, @@ -221,6 +246,13 @@ this.$emit("update:visible", val); }, }, successTableColumns() { if (this.type === "batchApplyCode") { return this.cloNamesList.slice(1); } else { return this.cloNamesList; } }, }, data() { return { @@ -236,6 +268,7 @@ activeTab: "tab1", cloNamesList: [], //列表头部字段 localCodeClassifyOid: "", codeRuleOid: '', resembleColumList: [], //相似项查出来的列表字段 currentSelectedResemble: [], currentSelectedResembleRow: { @@ -245,6 +278,7 @@ formTemplateVisible: false, }, secVOList: [], batchApplyCodeTableData: {}, }; }, @@ -261,23 +295,55 @@ } this.isExpand = !this.isExpand; }, treeNodeClick(data) { async treeNodeClick(data) { console.log(data); this.localCodeClassifyOid = data.codeClassifyOid; this.cloNamesList = data.cloNamesList; this.templateOid = data.oid; if (this.type === "batchApplyCode") { this.codeRuleOid = data.codeRuleOid if (!this.batchApplyCodeTableData[data.codeRuleOid]) { this.batchApplyCodeTableData[data.codeRuleOid] = {}; } else { console.log(this.$refs.CodeApply, 'this.$refs.CodeApply'); if (this.$refs.CodeApply) { console.log(this.$refs.CodeApply.validate(), 'this.$refs.CodeApply.validate()'); if (!(await this.$refs.CodeApply.validate())) { this.$message.warning('请填写便编码申请!') return false } } // 校验 } } getResembleTable({ codeClassifyOid: this.templateOid, codeClassifyOid: this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid, redisOid: this.redisOid + "-resemble", }).then((res) => { this.tab1Table = res.data.data; if (this.type === "batchApplyCode" && this.tab1Table.length > 0) { this.batchApplyCodeTableData[data.codeRuleOid]["tab1"] = res.data.data; } }); // 获取正确数据 getSuccessTable({ codeClassifyOid: this.templateOid, codeClassifyOid: this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid, redisOid: this.redisOid + "-ok", }).then((res) => { this.tab2Table = res.data.data; if (this.tab2Table.length > 0 && this.type === "batchApplyCode") { this.batchApplyCodeTableData[data.codeRuleOid]["codeApply"] = {} this.batchApplyCodeTableData[data.codeRuleOid]["tab2"] = res.data.data; if (this.$refs.CodeApply) { this.$refs.CodeApply.loading = true; } this.getCodeRule(); } }); getFormTemplate({ templateOid: data.oid, Source/UBCS-WEB/src/components/BatchImport/index.vue
@@ -271,6 +271,7 @@ cloNamesList: item.cloNamesList, oid: item.codeTemplateOid, codeClassifyOid: item.codeClassifyOid, codeRuleOid: item.codeRuleOid, name: item.codeRuleVO.name } } else { Source/UBCS-WEB/src/mixins/codeApply.js
@@ -41,15 +41,10 @@ codeApplyForm: {}, } }, created() { if (this.type === 'batchImportApply') { this.getCodeRule() } }, methods: { // 获取码值申请数据 getCodeRule() { getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => { getCodeRule({ codeClassifyOid: this.localCodeClassifyOid }).then((res) => { if (res.data && res.data.code === 200) { const typeList = [ "codefixedsec", @@ -73,6 +68,7 @@ }, getCodeApplyFormData(codeApplyForm) { this.codeApplyForm = codeApplyForm; this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm }, getType(item) { console.log(item.secType, 'item.secType'); Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue
@@ -374,7 +374,7 @@ }, // 属性池检索 attrRefSearch(form,done){ this.attrRef.key = form.key; this.attrRef.key = form.id; this.attrRefOnLoad(); done(); this.attrRef.key = null; Source/UBCS-WEB/src/views/modeling/originalAdd.vue
@@ -39,14 +39,14 @@ </el-form-item> <el-tabs v-model="activeName" @tab-click="handleClick" stretch="true"> <el-tab-pane label="参照" name="referTab"> <el-form-item label="参照类型" label-width="100px"> <el-form-item label="参照类型" label-width="100px" class="referTypeForm"> <el-select v-model="attribute.referTypeKey" @change="referTypeSelectChange"> <el-option v-for="item in btmRefer.referTypeList" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </el-form-item> <el-form-item label="参照名称" label-width="100px"> <el-form-item label="参照名称" label-width="100px" class="referNameForm"> <el-input v-model="attribute.referToName" @focus="openReferConfig" clearable="true" :disabled="referToFlag" @clear="clearReferTo"> <i slot="suffix" class="el-input__icon el-icon-search"></i> @@ -486,4 +486,16 @@ .attributeForm>.el-form-item>.el-form-item__content>.el-select>.el-input>.el-input__inner { width: 200px; }</style> } .attributeForm>.el-form-item>.el-form-item__content{ width :190px; } .referTypeForm > .el-form-item__content > .el-select > .el-input>.el-input__inner { width: 200px; } .referNameForm > .el-form-item__content > .el-input > .el-input__inner { width: 200px; } </style> Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/AttributeController.java
@@ -95,8 +95,8 @@ @GetMapping("/query-page") @ApiImplicitParams({ @ApiImplicitParam(name = "key",value = "属性名模糊",paramType = "query",dataType = "string"), @ApiImplicitParam(name = "notIn",value = "属性名排除",paramType = "query",dataType = "string") @ApiImplicitParam(name = "key",value = "属性编号模糊",paramType = "query",dataType = "string"), @ApiImplicitParam(name = "notIn",value = "属性编号排除",paramType = "query",dataType = "string") }) @ApiOperationSupport(order = 6) @ApiOperation(value = "查询列表",notes = "传入查的值和不查的值") Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/mapper/AttributeMapper.java
@@ -28,4 +28,12 @@ * @return */ List<BtmType> selectApplyRange(String oid); /** * 检验属性编号是否已经存在 * @param id 属性编号 * @param oid 数据主键 * @return 条数 */ Long checkIdExist(String id, String oid); } Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/AttributeServiceImpl.java
@@ -27,10 +27,7 @@ import org.springframework.util.CollectionUtils; import javax.validation.constraints.NotEmpty; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -77,13 +74,9 @@ @Override public boolean submit(AttributeDTO dto) { VciBaseUtil.alertNotNull(dto.getId(),"属性编号",dto.getName(),"属性名称",dto.getTypeKey(),"属性类型",dto.getMaxLength(),"属性长度"); if (!Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ throw new VciBaseException("属性编号{0}只能是英文",new Object[]{dto.getId()}); } LambdaQueryWrapper<Attribute> wrapper = Wrappers.<Attribute>query().lambda().eq(Attribute::getId, dto.getId()); Long count = baseMapper.selectCount((Func.isEmpty(dto.getOid())) ? wrapper : wrapper.notIn(Attribute::getOid, dto.getOid())); if (count > 0L) { throw new ServiceException("属性编号已存在!"); String msg = checkAttributeId(dto.getId(),dto.getOid()); if (StringUtils.isNotBlank(msg)){ throw new VciBaseException(msg); } Attribute attribute = AttributeWrapper.build().copyBeforeSave(dto); CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); @@ -91,6 +84,23 @@ } /** * 元数据的ID校验 * @param id 编号值 * @param oid 数据主键 * @return 校验结果 */ private String checkAttributeId(String id, String oid) { if (!Pattern.compile(REGEXP).matcher(id).matches()){ return "属性编号"+id+"只能是英文"; } Long count = baseMapper.checkIdExist(id.toLowerCase(Locale.ROOT),oid); if (count > 0L) { return "属性编号"+id+"(不区分大小写)已存在!"; } return null; } /** * 删除 * * @param oids 主键集合 Source/UBCS/ubcs-service/ubcs-omd/src/main/resources/mapper/AttributeMapper.xml
@@ -58,4 +58,12 @@ where attr.oid = #{oid} </select> <select id="checkIdExist" resultType="java.lang.Long"> select COUNT(*) FROM <include refid="tableName"/> where LOWER(ID) = #{id} <if test="oid != null"> and OID != #{oid} </if> </select> </mapper>