Merge remote-tracking branch 'origin/master'
# Conflicts:
# Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
| | |
| | | tipList: [ |
| | | "1.标题带五角星的表示关键属性,带星号表示必输项", |
| | | "2.企业编码,集团码和状态都需要导入", |
| | | "3.每次仅能最多导入10000条数据,如果出错会返回错误的数据和原因,但是正确的数据会保存", |
| | | "3.每次仅能最多导入5000条数据(可通过nacos进行配置,推荐5000/次导入),如果出错会返回错误的数据和原因,但是正确数据可以继续保存", |
| | | "4.分类的路径需要用#分隔。仅填写当前选的分类树上的下级分类的路径,如果当前分类已经是叶子节点,则不填写", |
| | | ], |
| | | action: "/api/ubcs-code/mdmEngineController/batchImportHistoryData", |
| | |
| | | }, |
| | | onError(err) { |
| | | this.pageLoading.close(); |
| | | console.log('onError') |
| | | //console.log('onError') |
| | | }, |
| | | uploadChange(file) { |
| | | if (file.status === "success" || file.status === "error") { |
| | | this.pageLoading.close(); |
| | | console.log('uploadChange') |
| | | //console.log('uploadChange') |
| | | } |
| | | }, |
| | | }, |
| | |
| | | <template> |
| | | <div> |
| | | <avue-form |
| | | v-model="form" |
| | | :option="option" |
| | | v-loading="loading" |
| | | ref="form" |
| | | :style="{ minHeight: loading ? '300px' : '' }" |
| | | :key="updateIndex" |
| | | ref="form" |
| | | v-model="form" |
| | | v-loading="loading" |
| | | :option="option" |
| | | :style="{ minHeight: loading ? '300px' : '' }" |
| | | > |
| | | <template :slot="item.prop + 'Label'" v-for="item in slotColumnList"> |
| | | <template v-for="item in slotColumnList" :slot="item.prop + 'Label'"> |
| | | <span> |
| | | <span>{{ item.label }} </span> |
| | | <el-tooltip |
| | | v-if="item.keyAttr" |
| | | class="item" |
| | | effect="dark" |
| | | content="该属性为关键属性" |
| | | effect="dark" |
| | | placement="top-start" |
| | | > |
| | | <i class="el-icon-star-on key_attr_icon"></i> |
| | | </el-tooltip> |
| | | </span> |
| | | </template> |
| | | <template :slot="item.prop + ''" v-for="item in slotColumnList"> |
| | | <template v-for="item in slotColumnList" :slot="item.prop + ''"> |
| | | <vciWebRefer |
| | | :key="item.dataKey" :data-key="item.dataKey" |
| | | v-if="item.type == 'refer'" |
| | | :referConfig="item.referConfig || {}" |
| | | :value="form[item.referConfig.field] || item.value" |
| | | :text="form[item.referConfig.showField]" |
| | | v-if="item.type == 'refer'" :key="item.dataKey" |
| | | :data-key="item.dataKey" |
| | | :disabled="item.disabled" |
| | | :display="item.display" |
| | | :referConfig="item.referConfig || {}" |
| | | :reloadData="item.referConfig.reloadData || false" |
| | | :text="form[item.referConfig.showField]" |
| | | :value="form[item.referConfig.field] || item.value" |
| | | @setReferValue="setReferValue" |
| | | ></vciWebRefer> |
| | | </template> |
| | |
| | | import { getFormDetail } from "@/api/formTemplate"; |
| | | import { getEnumDictionary } from "../../api/system/dict"; |
| | | import vciWebRefer from "../refer/vciWebRefer.vue"; |
| | | |
| | | export default { |
| | | name: "FormTemplate", |
| | | components: { vciWebRefer }, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | attrList: [], |
| | | add:'', |
| | | codeattrsecValue:'', |
| | | ValidataValue:false, |
| | |
| | | immediate: true, |
| | | handler(newV) { |
| | | this.$emit("getFormData", newV); |
| | | // console.log("getFormData", newV) |
| | | }, |
| | | }, |
| | | |
| | | attrList: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newVal, oldVal) { |
| | | if (newVal) { |
| | | this.$emit("attrList", newVal) |
| | | } |
| | | } |
| | | }, |
| | | TreeValue:{ |
| | | handler(newval,oldval){ |
| | |
| | | formItemList.forEach((formItem) => { |
| | | // console.log('formItem',formItem) |
| | | formItem = this.resetFormConfig(formItem); |
| | | // if(formItem.type === "datetime"){ |
| | | // return; |
| | | // } |
| | | if (formItem.secType === "codeattrsec") { |
| | | this.attrList.push(formItem); |
| | | } |
| | | if (formItem.type === "line") { |
| | | group.push({ |
| | | label: formItem.text, |
| | |
| | | :selfColumnConfig="selfColumnConfig" |
| | | ref="CodeApply" |
| | | @getFormData="getCodeApplyFormData" |
| | | @attrList="attrListForm" |
| | | @referConfigDataUpdate="referConfigDataUpdate" |
| | | ></FormTemplate> |
| | | </el-tab-pane> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | attrList:[], |
| | | eventList:[], |
| | | //码值的第二种只读隐藏情况 |
| | | codeValueApplyStatus:'', |
| | |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form; |
| | | //属性码段赋值 |
| | | if (this.attrList) { |
| | | this.attrList.forEach(item => { |
| | | if (this.form.hasOwnProperty(item.referAttributeId)) { |
| | | this.codeApplyForm[item.oid] = this.form[item.referAttributeId]; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //属性码段赋值 |
| | | attrListForm(attrListForm){ |
| | | this.attrList=attrListForm; |
| | | }, |
| | | getCodeApplyFormData(codeApplyForm) { |
| | | this.codeApplyForm = codeApplyForm; |
| | |
| | | }, |
| | | value: { |
| | | handler(newval, oldval) { |
| | | console.log('value', newval) |
| | | //console.log('value', newval) |
| | | } |
| | | } |
| | | }, |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-row> |
| | | <!-- 申请--> |
| | | <FormTemplateDialog :TreeValue="TreeValue" :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" :templateOid="templateOid" |
| | | :visible.sync="applyvisible" |
| | | type="add" |
| | | @submit="applySumbit"> |
| | | </FormTemplateDialog> |
| | | <!-- 修订--> |
| | | <FormTemplateDialog :codeClassifyOid="this.codeClassifyOid" :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" :rowOid="rowOid" :templateOid="templateOid" :title="'修改编码信息'" |
| | | :visible.sync="amendvisible" |
| | | type="edit" @submit="amendSumbit"></FormTemplateDialog> |
| | | <!-- 新增--> |
| | | <FormTemplateDialog :TreeValue="TreeValue" :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" :disabledProp="disabledProp" :templateOid="templateOid" |
| | |
| | | label: "name", |
| | | }, |
| | | tableHeadFindDatas: [], |
| | | applyvisible:false, |
| | | amendvisible:false, |
| | | addvisible: false, |
| | | editvisible: false, |
| | | findvisible: false, |
| | |
| | | }, |
| | | //标准申请 |
| | | codeApplyHandler(){ |
| | | console.log('1') |
| | | this.$nextTick(() => { |
| | | this.applyvisible = true; |
| | | }); |
| | | }, |
| | | applySumbit(){ |
| | | |
| | | }, |
| | | amendSumbit(){ |
| | | |
| | | }, |
| | | //标准修订 |
| | | codeAMENDHandler(){ |
| | | console.log('2') |
| | | if (this.selectRow.length !== 1) { |
| | | this.$message.warning("请选择一条数据"); |
| | | } else if (this.selectRow[0].lcstatus !== "Editing") { |
| | | this.$message.warning("编码状态不是“编辑中”,不可编辑"); |
| | | } else { |
| | | this.amendvisible = true; |
| | | this.rowOid = this.selectRow[0].oid; |
| | | } |
| | | }, |
| | | addSaveHandler(){ |
| | | this.$nextTick(() => { |
| | |
| | | }, |
| | | //编辑 |
| | | editHandler() { |
| | | if (this.selectRow.length <= 0) { |
| | | if (this.selectRow.length !== 1) { |
| | | this.$message.warning("请选择一条数据"); |
| | | } else if (this.selectRow.length > 1) { |
| | | this.$message.warning("只能选择一条数据"); |
| | | } else if (this.selectRow[0].lcstatus != "Editing") { |
| | | this.$message.warning("编码状态不是“编辑中”,不可编辑"); |
| | | } else if (this.selectRow[0].lcstatus !== "Editing") { |
| | | this.$message.warning("编码状态不是“编辑中”,不可编辑"); |
| | | } else { |
| | | this.editvisible = true; |
| | | this.rowOid = this.selectRow[0]['oid'] |
| | | this.rowOid = this.selectRow[0].oid; |
| | | } |
| | | }, |
| | | //高级查询按钮 |
| | |
| | | @blur="saveRows(row)" |
| | | ></el-input> |
| | | <el-input-number v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" |
| | | v-show="!AddCellFlag" |
| | | v-model="row[item.prop]" |
| | | :style="{width:(item.width-10)+'px'}" |
| | | controls-position="right" |
| | | size="small" @blur="saveRows"></el-input-number> |
| | | <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" |
| | | <el-select v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " slot="prepend" :clearable="true" |
| | | v-model="row[item.prop]" allow-create default-first-option |
| | | filterable |
| | | filterable v-show="!AddCellFlag" |
| | | @blur="selectChangeHandler(item.editConfig,index)"> |
| | | <el-option |
| | | v-for="optionItem in item.data" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" :disabled="!editOpenFlag" active-value="true" v-show="!AddCellFlag" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | |
| | | // 新函数用于执行batchAddSave方法 |
| | | const executeBatchAddSave = () => { |
| | | batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { |
| | | this.$message.success('保存成功') |
| | | this.editOpenFlag = false; |
| | | this.$message.success('保存成功') |
| | | // 调用父组件修改按钮状态 |
| | | this.$emit('editCloseChildren') |
| | | this.AddCellFlag = true; |
| | |
| | | } else { |
| | | this.injectOption.classifyNumber = 0; |
| | | } |
| | | // console.log(this.ProData) |
| | | this.injectVisible = false; |
| | | }, |
| | | //分类注入清空 |
| | | injectHandleReset() { |
| | | this.$set(this.CurrentCell, 'classifyInvokeText', '') |
| | | this.$set(this.CurrentCell, 'classifyInvokeAttr:', '') |
| | | this.$set(this.CurrentCell, 'classitwInvokeAttrName', '') |
| | | this.$set(this.CurrentCell, 'classifyInvokeEditFlag', 'false') |
| | | this.$set(this.CurrentCell, 'classifyInvokeLevel', 'none') |
| | | this.CurrentCell.classifyInvokeText = null; |
| | | this.CurrentCell.classifyInvokeAttr = ''; |
| | | this.CurrentCell.classifyInvokeAttrName = ''; |
| | | this.CurrentCell.classifyInvokeEditFlag = ''; |
| | | this.CurrentCell.classifyInvokeLevel = null; |
| | | // console.log(this.ProData) |
| | | this.injectVisible = false; |
| | | }, |
| | | // 分类注入取消 |
| | |
| | | focus: this.simFouce, |
| | | readonly: true, |
| | | }, |
| | | |
| | | { |
| | | label: '是否参与关键属性校验', |
| | | prop: 'isParticipateCheck', |
| | | type: 'switch', |
| | | activeColor: "#13ce66", |
| | | inactiveColor: "#ff4949", |
| | | labelWidth:160, |
| | | dicData: [{ |
| | | label: '否', |
| | | value: 0 |
| | | }, { |
| | | label: '是', |
| | | value: 1 |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | } |
| | |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px" |
| | | @focus="Keyfouce"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="是否参与关键属性校验:" label-width="170px"> |
| | | <el-switch |
| | | v-model="TreeAddform.codeKeyAttrValue" |
| | | active-text="是" |
| | | inactive-text="否" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | @change="switchChange"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="相似查询规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="simFouce"></el-input> |
| | |
| | | //编码规则 |
| | | codeRuleOidName: "", |
| | | //存储的业务类型 |
| | | btmTypeName: "" |
| | | btmTypeName: "", |
| | | codeKeyAttrValue:true, |
| | | isParticipateCheck:1 |
| | | }, |
| | | rules: { |
| | | id: [ |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | // switch |
| | | switchChange(){ |
| | | this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0; |
| | | // console.log(this.TreeAddform.isParticipateCheck) |
| | | }, |
| | | //存储的业务类型关闭 |
| | | BtmEscHandler() { |
| | | this.SelectFInd = ''; |
| | |
| | | }, |
| | | //树节点取消事件 |
| | | TreeEscHandler() { |
| | | this.TreeAddform = {}; |
| | | for (let key in this.TreeAddform) { |
| | | if (key !== 'codeKeyAttrValue' && key !== 'isParticipateCheck') { |
| | | this.TreeAddform[key] = ""; |
| | | } |
| | | } |
| | | this.TreeAddform.codeKeyAttrValue = true; |
| | | this.TreeAddform.isParticipateCheck = 1; |
| | | this.TreeAddFormVisible = false; |
| | | // 关闭弹窗清空校验 |
| | | this.$refs.myForm.clearValidate(); |
| | |
| | | }); |
| | | Object.keys(this.TreeAddform).forEach(key => { |
| | | this.TreeAddform[key] = ""; |
| | | this.TreeAddform.codeKeyAttrValue = true; |
| | | this.TreeAddform.isParticipateCheck = 1; |
| | | }); |
| | | this.getAttr(); |
| | | this.TreeAddFormVisible = false; |
| | |
| | | this.crudOid = '' |
| | | } |
| | | this.TreeList = res3.data.data; |
| | | if(this.TreeList.isParticipateCheck === null || this.TreeList.isParticipateCheck === undefined ||this.TreeList.isParticipateCheck === ""){ |
| | | this.$set(this.TreeList,"isParticipateCheck",1) |
| | | return |
| | | } |
| | | } catch (error) { |
| | | this.$message.error(error); |
| | | } |
| | |
| | | :referConfig="this.referConfig || {}" |
| | | :display="true" |
| | | :value="form.customCodeSerialClass" |
| | | :text="form.customCodeSerialClassText" |
| | | :text="form.customCodeSerialClass" |
| | | @setReferValue="setReferValue" |
| | | ></vciWebRefer> |
| | | <!-- <el-input--> |
| | |
| | | //自定义流水失焦 |
| | | setReferValue(data){ |
| | | console.log(data) |
| | | if(data.field){ |
| | | this.form[data.field] = data.value || ""; |
| | | // this.form[data.showField] = data.text || ""; |
| | | } |
| | | }, |
| | | /** 转移规则所有者对话框 */ |
| | | escapeOwner() { |
| | |
| | | //转换成JSON字符串进行父组件回显 |
| | | let submitFormJson = JSON.stringify(content); |
| | | this.form.referConfig = submitFormJson || ""; |
| | | debugger; |
| | | // debugger; |
| | | }, |
| | | /** 引用码段为【参照引用的业务类型】选取值之后的内容回显时调用 */ |
| | | echoReferBtmType(content) { |
| | |
| | | this.releadDisabled = false; |
| | | }); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | }).catch((error) => { |
| | | this.releadDisabled = false; |
| | | }); |
| | | this.releadDisabled = false; |
| | |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | console.log(this.form) |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | |
| | | }, |
| | | /** 码段类型改变时,增加对应的form表单中的属性*/ |
| | | changeSectypeFormItems(row) { |
| | | console.log(row) |
| | | if ( |
| | | func.isEmpty(this.enumParam.secTypeList) || |
| | | this.enumParam.secTypeList.length == 0 |
| | |
| | | pkCodeRule: row != null ? row.pkCodeRule : this.form.pkCodeRule, //所属编码规则 |
| | | prefixCode: row != null ? row.prefixCode : this.form.prefixCode, //前缀 |
| | | suffixCode: row != null ? row.suffixCode : this.form.suffixCode, //后缀 |
| | | // customCodeSerialClass: row != null ? row.customCodeSerialClass : this.form.customCodeSerialClass |
| | | }; |
| | | if (this.form.secType === "codefixedsec") { |
| | | //固定码段 |
| | |
| | | this.basicSecTypes = basicSecTypes; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private String codeResembleRuleOidName; |
| | | |
| | | /** |
| | | * 是否参与校验,0:不参与;1:参与 |
| | | */ |
| | | private Integer isParticipateCheck; |
| | | |
| | | public boolean getAblechildren() { |
| | | return ablechildren; |
| | | } |
| | |
| | | this.codeResembleRuleOidName = codeResembleRuleOidName; |
| | | } |
| | | |
| | | public Integer getIsParticipateCheck() { |
| | | return isParticipateCheck; |
| | | } |
| | | |
| | | public void setIsParticipateCheck(Integer isParticipateCheck) { |
| | | this.isParticipateCheck = isParticipateCheck; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CodeClassifyDTO{" + |
| | |
| | | private String codeResembleRuleOid; |
| | | |
| | | /** |
| | | * 是否参与校验,0:不参与;1:参与 |
| | | */ |
| | | private Integer isParticipateCheck; |
| | | |
| | | /** |
| | | * 相似项查询规则名称 |
| | | */ |
| | | @Transient(referColumn = "codeResembleRuleOid.name") |
| | |
| | | */ |
| | | package com.vci.ubcs.code.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.starter.constant.CodeTableNameConstant; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | |
| | | private Integer dataLevel; |
| | | |
| | | /** |
| | | * 是否参与校验,0:不参与;1:参与 |
| | | */ |
| | | private Integer isParticipateCheck; |
| | | |
| | | /** |
| | | * 层级的路径 |
| | | */ |
| | | private String path; |
| | |
| | | private String firstV; |
| | | |
| | | private String creator; |
| | | |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | |
| | | private Date createTime; |
| | | |
| | | private String lastModifier; |
| | | |
| | | @DateTimeFormat( |
| | | pattern = "yyyy-MM-dd HH:mm:ss" |
| | | ) |
| | |
| | | }); |
| | | tree.setOid((String)oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); |
| | | tree.setName((String) VciBaseUtil.getValueFromField("name", doObject)); |
| | | // TODO:业务数据总数统计暂时没完善 |
| | | String total = (String) VciBaseUtil.getValueFromField("total", doObject); |
| | | Integer isParticipateCheck = (Integer) VciBaseUtil.getValueFromField("isParticipateCheck", doObject); |
| | | if(Func.isNotEmpty(total)){ |
| | | tree.setCount("【"+total+"】"); |
| | | } |
| | |
| | | baseModel.setLastR("1"); |
| | | baseModel.setLastV("1"); |
| | | baseModel.setRevisionSeq(1); |
| | | // TODO:目前只有编码规则中有用到,后期需要去掉这段代码的话,就把他加在编码规则新增中去 |
| | | if(Func.isBlank(baseModel.getOwner())){ |
| | | // 设置所有者 |
| | | baseModel.setOwner(AuthUtil.getUserId().toString()); |
| | |
| | | private String index; |
| | | private Map<String, String> attributes = new HashMap(); |
| | | |
| | | |
| | | |
| | | public Tree() { |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Tree{oid='" + this.oid + '\'' + ", text='" + this.text + '\'' + ", leaf=" + this.leaf + ", showCheckbox=" + this.showCheckbox + ", checked=" + this.checked + ", children=" + this.children + ", icon='" + this.icon + '\'' + ", iconCls='" + this.iconCls + '\'' + ", parentId='" + this.parentId + '\'' + ", parentName='" + this.parentName + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", expanded=" + this.expanded + ", href='" + this.href + '\'' + ", index='" + this.index + '\'' + ", attributes=" + this.attributes + '}'; |
| | |
| | | } |
| | | return listHasList; |
| | | } |
| | | |
| | | /** |
| | | * 是否默认的属性 |
| | | * @param fieldNames 属性的名字 |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * 密级的字段 |
| | | */ |
| | | public static final String SECRET_FIELD = "secretgrade"; |
| | | |
| | | /** |
| | | * 创建者字段 |
| | | */ |
| | | public static final String CODE_CREATOR = "creator"; |
| | | |
| | | /** |
| | | * 更改者字段 |
| | | */ |
| | | public static final String CODE_EDITOR = "lastmodifier"; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | public static final String CODE_EDITOR_TIME = "lastmodifytime"; |
| | | |
| | | /** |
| | | * 版本规则 |
| | | */ |
| | | public static final String CODE_REVISION_RULE = "revisionrule"; |
| | | |
| | | /** |
| | | * 版本步长 |
| | | */ |
| | | public static final String CODE_REVISION_SEQ = "revisionseq"; |
| | | |
| | | /** |
| | | * 版本规则 |
| | | */ |
| | | public static final String CODE_VISION_RULE = "versionrule"; |
| | | |
| | | public static final String CODE_VISION_SEQ = "versionseq"; |
| | | |
| | | public static final String CODE_VISION_VLUE = "versionvalue"; |
| | | |
| | | public static final String CODE_LASTR = "lastr"; |
| | | |
| | | public static final String CODE_FIRSTR = "firstr"; |
| | | |
| | | public static final String CODE_LASTV = "lastv"; |
| | | |
| | | public static final String CODE_FIRSTV = "firstv"; |
| | | |
| | | /** |
| | | * 版本规则oid |
| | | */ |
| | | public static final String CODE_REVISION_OID = "revisionoid"; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | public static final String CODE_TENANTID = "tenantid"; |
| | | |
| | | /** |
| | | * nameoid |
| | | */ |
| | | public static final String CODE_NAME_OID = "nameOid"; |
| | | |
| | | /** |
| | | * 业务类型名称 |
| | | */ |
| | | public static final String CODE_BTMNAME = "btmname"; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | public static final String CODE_CREATE_TIME = "createtime"; |
| | | |
| | | /** |
| | | * 时间戳 |
| | | */ |
| | | public static final String CODE_TS = "ts"; |
| | | |
| | | /** |
| | | * 所有者 |
| | | */ |
| | | public static final String CODE_OWNER = "owner"; |
| | | |
| | | /** |
| | | * 升版 |
| | | */ |
| | | public static final String CODE_COPYFORMVERSION = "copyfromversion"; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | public static final String CODE_OID = "oid"; |
| | | |
| | | /** |
| | | * 默认的属性列表 |
| | | */ |
| | |
| | | add(CODE_CLASSIFY_OID_FIELD); |
| | | add(CODE_TEMPLATE_OID_FIELD); |
| | | add(CODE_FULL_PATH_FILED); |
| | | add(SECRET_FIELD); |
| | | add(CODE_CREATOR); |
| | | add(CODE_EDITOR); |
| | | add(CODE_EDITOR_TIME); |
| | | add(CODE_REVISION_RULE); |
| | | add(CODE_REVISION_SEQ); |
| | | add(CODE_REVISION_RULE); |
| | | add(CODE_VISION_RULE); |
| | | add(CODE_VISION_SEQ); |
| | | add(CODE_LASTR); |
| | | add(CODE_FIRSTR); |
| | | add(CODE_LASTV); |
| | | add(CODE_FIRSTV); |
| | | add(CODE_REVISION_OID); |
| | | add(CODE_TENANTID); |
| | | add(CODE_NAME_OID); |
| | | add(CODE_BTMNAME); |
| | | add(CODE_CREATE_TIME); |
| | | add(CODE_TS); |
| | | add(CODE_OWNER); |
| | | add(CODE_COPYFORMVERSION); |
| | | add(CODE_OID); |
| | | add(CODE_VISION_VLUE); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | add(CODE_CLASSIFY_OID_FIELD); |
| | | add(CODE_TEMPLATE_OID_FIELD); |
| | | add(CODE_FULL_PATH_FILED); |
| | | add(CODE_EDITOR); |
| | | add(SECRET_FIELD); |
| | | add(CODE_CREATOR); |
| | | add(CODE_EDITOR); |
| | | add(CODE_EDITOR_TIME); |
| | | add(CODE_REVISION_RULE); |
| | | add(CODE_REVISION_SEQ); |
| | | add(CODE_REVISION_RULE); |
| | | add(CODE_VISION_RULE); |
| | | add(CODE_VISION_SEQ); |
| | | add(CODE_LASTR); |
| | | add(CODE_FIRSTR); |
| | | add(CODE_LASTV); |
| | | add(CODE_FIRSTV); |
| | | add(CODE_REVISION_OID); |
| | | add(CODE_TENANTID); |
| | | add(CODE_NAME_OID); |
| | | add(CODE_BTMNAME); |
| | | add(CODE_CREATE_TIME); |
| | | add(CODE_TS); |
| | | add(CODE_OWNER); |
| | | add(CODE_COPYFORMVERSION); |
| | | add(CODE_OID); |
| | | add(CODE_VISION_VLUE); |
| | | }}; |
| | | |
| | | /** |
| | |
| | | @Api(value = "关键属性查重规则", tags = "关键属性查重规则接口") |
| | | public class CodeKeyAttrRepeatController extends BladeController { |
| | | |
| | | private final ICodeKeyAttrRepeatService plCodeKeyattrrepeatService; |
| | | private final ICodeKeyAttrRepeatService codeKeyattrrepeatService; |
| | | |
| | | CodeKeyAttrRepeatMapper codeKeyattrrepeatMapper; |
| | | |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入plCodeKeyattrrepeat") |
| | | public R<CodeKeyAttrRepeatVO> detail(CodeKeyAttrRepeat plCodeKeyattrrepeat) { |
| | | CodeKeyAttrRepeat detail = codeKeyattrrepeatMapper.selectOne(Condition.getQueryWrapper(plCodeKeyattrrepeat)); |
| | | public R<CodeKeyAttrRepeatVO> detail(CodeKeyAttrRepeat codeKeyattrrepeat) { |
| | | CodeKeyAttrRepeat detail = codeKeyattrrepeatMapper.selectOne(Condition.getQueryWrapper(codeKeyattrrepeat)); |
| | | return R.data(CodeKeyAttrRepeatWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入plCodeKeyattrrepeat") |
| | | public R<IPage<CodeKeyAttrRepeatVO>> list(CodeKeyAttrRepeat plCodeKeyattrrepeat, Query query) { |
| | | IPage<CodeKeyAttrRepeat> pages = codeKeyattrrepeatMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(plCodeKeyattrrepeat)); |
| | | public R<IPage<CodeKeyAttrRepeatVO>> list(CodeKeyAttrRepeat codeKeyAttrRepeat, Query query) { |
| | | IPage<CodeKeyAttrRepeat> pages = codeKeyattrrepeatMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(codeKeyAttrRepeat)); |
| | | return R.data(CodeKeyAttrRepeatWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入plCodeKeyattrrepeat") |
| | | public R<IPage<CodeKeyAttrRepeatVO>> page(CodeKeyAttrRepeatVO plCodeKeyattrrepeat, Query query) { |
| | | IPage<CodeKeyAttrRepeatVO> pages = plCodeKeyattrrepeatService.selectPlCodeKeyattrrepeatPage(Condition.getPage(query), plCodeKeyattrrepeat); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入plCodeKeyattrrepeat") |
| | | public R save(@Valid @RequestBody CodeKeyAttrRepeat plCodeKeyattrrepeat) { |
| | | return R.status(SqlHelper.retBool(codeKeyattrrepeatMapper.insert(plCodeKeyattrrepeat))); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入plCodeKeyattrrepeat") |
| | | public R update(@Valid @RequestBody CodeKeyAttrRepeat plCodeKeyattrrepeat) { |
| | | return R.status(SqlHelper.retBool(codeKeyattrrepeatMapper.updateById(plCodeKeyattrrepeat))); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 新增或修改 |
| | | * @param codeKeyAttrRepeat |
| | | * @return |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入plCodeKeyattrrepeat") |
| | | public R submit(@Valid @RequestBody CodeKeyAttrRepeat plCodeKeyattrrepeat) { |
| | | if(plCodeKeyattrrepeat.getOid() != null){ |
| | | return R.status(SqlHelper.retBool(codeKeyattrrepeatMapper.updateById(plCodeKeyattrrepeat))); |
| | | @ApiOperation(value = "新增或修改", notes = "传入codeKeyattrrepeat") |
| | | public R submit(@Valid @RequestBody CodeKeyAttrRepeat codeKeyAttrRepeat) { |
| | | if(codeKeyAttrRepeat.getOid() != null){ |
| | | return R.status(codeKeyattrrepeatService.update(codeKeyAttrRepeat)); |
| | | } |
| | | return R.status(SqlHelper.retBool(codeKeyattrrepeatMapper.insert(plCodeKeyattrrepeat))); |
| | | return R.status(codeKeyattrrepeatService.addSave(codeKeyAttrRepeat)); |
| | | } |
| | | |
| | | /** |
| | | * 关键属性查重规则 删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(SqlHelper.retBool(codeKeyattrrepeatMapper.deleteBatchIds(Func.toLongList(ids)))); |
| | | return R.status(codeKeyattrrepeatService.deleteByOids(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R listCodeKeyAttrRepeatRuleByOids(@ApiParam(value = "主键集合", required = true) @RequestParam String oids) { |
| | | return R.data(codeKeyattrrepeatMapper.selectBatchIds(Func.toLongList(oids))); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.rmi.ServerException; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | return R.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 申请编码保存 |
| | | * @param orderDTO 编码申请相关的信息,需要有属性和码段相关的信息 |
| | |
| | | public R addSaveCode(@RequestBody CodeOrderDTO orderDTO) throws Exception { |
| | | return R.success(engineService.addSaveCode(orderDTO)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用模板的主键获取表单的定义 |
| | |
| | | //TODO后续可以定义查询模板来查询 |
| | | return engineService.gridTableDataByClassifyOid(codeClassifyOid,templateOid,queryObject.getConditionMap(),queryObject.getPageHelper()); |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 获取分类对象 |
| | |
| | | * @param oid 分类的主键 |
| | | * @return 数据集合 |
| | | */ |
| | | List<CodeClassify> selectAllLevelChildHasPath(@Param("oid") String oid,@Param("fieldInPath")String fieldInPath); |
| | | |
| | | List<CodeClassify> selectAllLevelChildHasPath(@Param("oid") String oid,@Param("fieldInPath")String fieldInPath,@Param("tenantId")String tenantId); |
| | | |
| | | @MapKey("OID") |
| | | List<Map<String,Object>> selectAllLevelParentByOid(@Param("oid") String oid); |
| | |
| | | @MapKey("OID") |
| | | List<Map<String,Object>> selectAllLevelParents(@Param("oid") String oid); |
| | | |
| | | |
| | | @MapKey("OID") |
| | | List<Map<String,Object>> selectByFieldPath(@Param("fieldPath") String fieldPath); |
| | | |
| | | |
| | | /** |
| | | * 查根据id层级获取对象 |
| | |
| | | List<CodeClassify> selectByFieldNamePath(@Param("fieldPath") String fieldPath,@Param("fieldName") String fieldName); |
| | | |
| | | public List<CodeClassify> getIdPathToNamePathByParentId(@Param("parentId")String parentId); |
| | | |
| | | |
| | | CodeClassify selectByIdRel(@Param("oid") String oid); |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<CodeClassify> getRMLibByName(List<String> libNames,@Param("lcstatus")String lcstatus,@Param("tenantId") String tenantId); |
| | | |
| | | /*** |
| | | * 根据分类描述备注和库节点查询分类信息 |
| | | * @param desc |
| | | * @param codeLibName |
| | | * @param lcstatus |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | List<CodeClassify> getRMTypeByDesc(@Param("desc")String desc,@Param("lcstatus")String lcstatus,@Param("tenantId") String tenantId); |
| | |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | List<CodeClassify> selectAllClassifyByOid(@Param("oid") String oid,@Param("tenantId") String tenantId); |
| | | List<CodeClassify> selectAllClassifyByOid(@Param("oid") String oid,@Param("fieldInPath")String fieldInPath,@Param("tenantId") String tenantId); |
| | | |
| | | /** |
| | | * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid |
| | | * @param topOid |
| | | * @param currentOid |
| | | * @return |
| | | */ |
| | | List<CodeClassify> selectLeafByParentClassifyOid(@Param("topOid") String topOid,@Param("currentOid")String currentOid); |
| | | |
| | | } |
| | |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid;import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.api.R; |
| | | import java.io.File; |
| | |
| | | /** |
| | | * 根据分类描述备注和库节点查询分类信息 |
| | | * @param oid |
| | | * @param fieldInPath |
| | | * @return |
| | | */ |
| | | List<CodeClassifyVO> selectAllClassifyByOid(String oid); |
| | | List<CodeClassifyVO> selectAllClassifyByOid(String oid, String fieldInPath); |
| | | |
| | | /** |
| | | * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid |
| | | * @param topOid |
| | | * @param currentOid |
| | | * @return |
| | | */ |
| | | String selectLeafByParentClassifyOid(String topOid, String currentOid); |
| | | |
| | | } |
| | |
| | | * @return 关键数据查重规则显示对象 |
| | | */ |
| | | CodeKeyAttrRepeatRuleVO getObjectByOid(String oid); |
| | | |
| | | /** |
| | | * 修改关键属性查重规则 |
| | | * @param codeKeyattrrepeat |
| | | * @return |
| | | */ |
| | | boolean addSave(CodeKeyAttrRepeat codeKeyattrrepeat); |
| | | |
| | | /** |
| | | * 新增关键属性查重规则 |
| | | * @param codeKeyattrrepeat |
| | | * @return |
| | | */ |
| | | boolean update(CodeKeyAttrRepeat codeKeyattrrepeat); |
| | | |
| | | /** |
| | | * 删除关键属性查重规则 |
| | | * @param oids |
| | | * @return |
| | | */ |
| | | boolean deleteByOids(String oids); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R editSave(CodeClassify codeClassifyEntity) { |
| | | if(codeClassifyEntity == null || codeClassifyEntity.getOid() == null){ |
| | | return R.fail("传入数据不能为空!"); |
| | |
| | | codeClassifyEntity.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | codeClassifyEntity.setLastModifyTime(new Date()); |
| | | codeClassifyEntity.setTs(new Date()); |
| | | int insertNumber = codeClassifyMapper.updateById(codeClassifyEntity); |
| | | int updateEntity = codeClassifyMapper.updateById(codeClassifyEntity); |
| | | // 如果不是叶子结点,则需要修改其下所有的子分类,是否参与关键属性校验的值 |
| | | String oid = codeClassifyEntity.getOid(); |
| | | List<CodeClassify> codeClassifies = codeClassifyMapper.selectStartWithCurrentOid(oid); |
| | | int updateAttr = 0; |
| | | // 不为空就需要该当前分类下所有子分类的isParticipateCheck |
| | | if(!codeClassifies.isEmpty()){ |
| | | List<String> oids = codeClassifies.stream().map(CodeClassify::getOid).collect(Collectors.toList()); |
| | | updateAttr = codeClassifyMapper.update( |
| | | null, |
| | | Wrappers.<CodeClassify>update() |
| | | .lambda().in(CodeClassify::getOid, oids) |
| | | .set(CodeClassify::getIsParticipateCheck, codeClassifyEntity.getIsParticipateCheck()) |
| | | ); |
| | | } |
| | | |
| | | // //处理数据集成逻辑,成功后执行集成第一步,分类数据特殊处理。只有启用状态的分类才推送 |
| | | // if(FRAMEWORK_DATA_ENABLED.equals(codeClassifyDO.getLcStatus())); |
| | | // { |
| | | // codeDuckingServiceI.insertCache1(CACHE_TYPE_CLASSIFY_EDIT,FRAMEWORK_DATA_ENABLED,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, codeClassifyDO.getOid(), codeClassifyDTO.getTs()); |
| | | // } |
| | | return R.status(SqlHelper.retBool(insertNumber)); |
| | | // return BaseResult.success(codeClassifyDO2VO(codeClassifyDO)); |
| | | return R.status(SqlHelper.retBool(updateAttr) & SqlHelper.retBool(updateEntity)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | public List<CodeClassifyVO> selectAllClassifyByOid(String oid){ |
| | | List<CodeClassify> codeClassifyList=codeClassifyMapper.selectAllClassifyByOid(oid,AuthUtil.getTenantId()); |
| | | public List<CodeClassifyVO> selectAllClassifyByOid(String oid, String fieldInPath){ |
| | | List<CodeClassify> codeClassifyList=codeClassifyMapper.selectAllClassifyByOid(oid,AuthUtil.getTenantId(),fieldInPath); |
| | | List<CodeClassifyVO> voList = codeClassifyDO2VOs(codeClassifyList); |
| | | return voList; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid |
| | | * @param topOid |
| | | * @param currentOid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String selectLeafByParentClassifyOid(String topOid, String currentOid) { |
| | | List<CodeClassify> codeClassifies = codeClassifyMapper.selectLeafByParentClassifyOid(topOid, currentOid); |
| | | if(codeClassifies.isEmpty()){ |
| | | return ""; |
| | | } |
| | | String oids = codeClassifies.stream().map(CodeClassify::getOid).collect(Collectors.joining(",")); |
| | | return oids; |
| | | } |
| | | |
| | | /*** |
| | | * 根据分类描述备注和库节点查询分类信息 |
| | | * @param desc |
| | |
| | | @Override |
| | | public List<CodeClassifyVO> listChildrenClassify(String codeClassifyOid, boolean allLevel, String fieldInPath, boolean enable) { |
| | | if(allLevel){ |
| | | List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid,fieldInPath); |
| | | List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid,fieldInPath,AuthUtil.getTenantId()); |
| | | if(!CollectionUtils.isEmpty(classifyDOS)){ |
| | | // 这儿用stream有点慢 |
| | | classifyDOS = classifyDOS.parallelStream().filter(s->FRAMEWORK_DATA_ENABLED.equalsIgnoreCase(s.getLcStatus())).collect(Collectors.toList()); |
| | | } |
| | | return codeClassifyDO2VOs(classifyDOS); |
| | |
| | | Map<String/**路径**/,String/**主键**/> oidPathMap = new HashMap<>(); |
| | | |
| | | //我们需要查询所有已经存在的分类,主要是路径,用来判断分类的数据 |
| | | List<CodeClassify> existClassifyDOs = codeClassifyMapper.selectAllLevelChildHasPath("",null); |
| | | List<CodeClassify> existClassifyDOs = codeClassifyMapper.selectAllLevelChildHasPath("",null,AuthUtil.getTenantId()); |
| | | Map<String/**路径**/, CodeClassify/**已经存在的数据**/> pathDOMap = Optional.ofNullable(existClassifyDOs).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(s -> { |
| | | String path = s.getPath(); |
| | | if(StringUtils.isNotBlank(path) && path.startsWith("#")){ |
| | |
| | | return codeClassifyMapper.selectCount(wrapper).intValue(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.entity.CodeKeyAttrRepeat; |
| | | import com.vci.ubcs.code.enumpack.FrameworkDataLCStatus; |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeKeyAttrRepeatRuleVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Service |
| | | public class CodeKeyAttrRepeatServiceImpl implements ICodeKeyAttrRepeatService { |
| | | |
| | | @Autowired |
| | | CodeKeyAttrRepeatMapper codeKeyattrrepeatMapper; |
| | | @Resource |
| | | CodeKeyAttrRepeatMapper codeKeyAttrRepeatMapper; |
| | | |
| | | @Override |
| | | public IPage<CodeKeyAttrRepeatVO> selectPlCodeKeyattrrepeatPage(IPage<CodeKeyAttrRepeatVO> page, CodeKeyAttrRepeatVO plCodeKeyattrrepeat) { |
| | | return page.setRecords(codeKeyattrrepeatMapper.selectPlCodeKeyattrrepeatPage(page, plCodeKeyattrrepeat)); |
| | | return page.setRecords(codeKeyAttrRepeatMapper.selectPlCodeKeyattrrepeatPage(page, plCodeKeyattrrepeat)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(!CollectionUtils.isEmpty(oidCollections)){ |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | | for(Collection<String> oids: oidCollectionsList){ |
| | | List<CodeKeyAttrRepeat> tempDOList = codeKeyattrrepeatMapper.selectBatchIds(oids); |
| | | List<CodeKeyAttrRepeat> tempDOList = codeKeyAttrRepeatMapper.selectBatchIds(oids); |
| | | if(!CollectionUtils.isEmpty(tempDOList)){ |
| | | codeKeyAttrRepeatRuleDOList.addAll(tempDOList); |
| | | } |
| | |
| | | BeanUtils.copyProperties(codeKeyAttrRepeatRuleVO,codeKeyattrrepeatVO); |
| | | return codeKeyAttrRepeatRuleVO; |
| | | } |
| | | |
| | | /** |
| | | * 修改关键属性查重规则 |
| | | * @param codeKeyattrrepeat |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean addSave(CodeKeyAttrRepeat codeKeyattrrepeat) { |
| | | // 设置默认值 |
| | | codeKeyattrrepeat.setCreator(AuthUtil.getUserAccount()); |
| | | codeKeyattrrepeat.setCreatetime(new Date()); |
| | | codeKeyattrrepeat.setLastmodifier(AuthUtil.getUserAccount()); |
| | | codeKeyattrrepeat.setLastmodifytime(new Date()); |
| | | codeKeyattrrepeat.setBtmname(MdmBtmTypeConstant.CODE_KEY_ATTR_REPEAT_RULE); |
| | | codeKeyattrrepeat.setFirstr("1"); |
| | | codeKeyattrrepeat.setFirstv("1"); |
| | | codeKeyattrrepeat.setLastr("1"); |
| | | codeKeyattrrepeat.setLastv("1"); |
| | | codeKeyattrrepeat.setLcstatus("Enabled"); |
| | | codeKeyattrrepeat.setRevisionseq(1); |
| | | codeKeyattrrepeat.setRevisionoid(VciBaseUtil.getPk()); |
| | | codeKeyattrrepeat.setRevisionvalue("1"); |
| | | codeKeyattrrepeat.setRevisionrule("1"); |
| | | codeKeyattrrepeat.setVersionseq(1); |
| | | codeKeyattrrepeat.setVersionrule("0"); |
| | | codeKeyattrrepeat.setVersionvalue("1"); |
| | | return SqlHelper.retBool(codeKeyAttrRepeatMapper.insert(codeKeyattrrepeat)); |
| | | } |
| | | |
| | | /** |
| | | * 新增关键属性查重规则 |
| | | * @param codeKeyattrrepeat |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean update(CodeKeyAttrRepeat codeKeyattrrepeat) { |
| | | // 设置默认值 |
| | | codeKeyattrrepeat.setLastmodifier(AuthUtil.getUserAccount()); |
| | | codeKeyattrrepeat.setLastmodifytime(new Date()); |
| | | return SqlHelper.retBool(codeKeyAttrRepeatMapper.updateById(codeKeyattrrepeat)); |
| | | } |
| | | |
| | | /** |
| | | * 删除关键属性查重规则 |
| | | * @param oids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean deleteByOids(String oids) { |
| | | return SqlHelper.retBool(codeKeyAttrRepeatMapper.deleteById(oids)); |
| | | } |
| | | |
| | | /** |
| | | * 主键查询数据对象 |
| | | * @param oid 主键 |
| | |
| | | private CodeKeyAttrRepeat selectByOid(String oid) { |
| | | VciBaseUtil.alertNotNull(oid,"主键"); |
| | | |
| | | CodeKeyAttrRepeat codeKeyAttrRepeatRuleDO = codeKeyattrrepeatMapper.selectById(oid.trim()); |
| | | CodeKeyAttrRepeat codeKeyAttrRepeatRuleDO = codeKeyAttrRepeatMapper.selectById(oid.trim()); |
| | | // .selectByPrimaryKey(oid.trim()); |
| | | if(codeKeyAttrRepeatRuleDO == null || StringUtils.isBlank(codeKeyAttrRepeatRuleDO.getOid())){ |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | return codeKeyAttrRepeatRuleDO; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化业务类型 |
| | | * --创建人默认为当前用户,如果需要修改,可以在获取后自行处理 |
| | |
| | | cbo.setName(orderDTO.getName()); |
| | | //数据的时候,编码是不变的 |
| | | cbo.setCreateTime(cbo.getCreateTime()); |
| | | cbo.setCreator(cbo.getCreator()); |
| | | cbo.setLastModifyTime(cbo.getLastModifyTime()); |
| | | cbo.setTenantId(AuthUtil.getTenantId()); |
| | | oldCbo.setLastV("0"); |
| | |
| | | toBo.setLastV(String.valueOf(1)); |
| | | // 数据升版不需要重新设置创建人,只对最后修改人做更新就可以了 |
| | | //toBo.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | toBo.setCreateTime(new Date()); |
| | | toBo.setCreateTime(fromBo.getCreateTime()); |
| | | // toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | toBo.setLastModifyTime(new Date()); |
| | |
| | | String idFieldName = attrVOS.stream().filter(s -> VciQueryWrapperForDO.ID_FIELD.equalsIgnoreCase(s.getId())).findFirst().orElseGet(() -> new CodeClassifyTemplateAttrVO()).getName(); |
| | | getFieldIndexMap(titleRowData, attrNameIdMap, fieldIndexMap); |
| | | //先不用管属性是否都存在,先转换一下数据 |
| | | List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | List<ClientBusinessObject> cboList = new CopyOnWriteArrayList<>(); |
| | | String fullPath = getFullPath(classifyFullInfo); |
| | | //我们需要获取到所有的下级分类的oid的路径,因为后面需要 |
| | | Map<String/**主键**/, String/**路径**/> childOidPathMap = getChildClassifyPathMap(classifyFullInfo, fullPath); |
| | |
| | | if (CollectionUtils.isEmpty(ruleOidMap.values())) { |
| | | throw new VciBaseException("导入的数据所选择的分类都没有设置编码规则"); |
| | | } |
| | | // TODO: 改用oid查询规则的,别用id |
| | | // TODO: 该用oid查询规则的,别用id |
| | | Map<String, CodeRuleVO> ruleVOMap = ruleService.listCodeRuleByOids(ruleOidMap.values()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | //校验编码规则和码段是否正确 |
| | | Map<String, List<String>> ruleRowIndexMap = new ConcurrentHashMap<>(); |
| | |
| | | total += commonsMapper.queryCountBySql(countSql); |
| | | } |
| | | }else{ |
| | | |
| | | total = commonsMapper.queryCountBySql(countSql); |
| | | } |
| | | List<String> selectFieldList = new ArrayList<>(); |
| | |
| | | |
| | | //都转换完了。需要批量检查 |
| | | //如果出错了,我们依然执行有效的数据,无效的数据写回到excel中 |
| | | |
| | | |
| | | Map<String,String> errorKeyMap=new HashMap<>(); |
| | | //1.分类注入 |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * excel转换为cbo的对象 |
| | | * @param classifyFullInfo 分类的全部信息 |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * 校验分类对应的模板信息 |
| | | * @param titleRowData |
| | |
| | | } |
| | | return codeClassifyTemplateVOList ; |
| | | } |
| | | |
| | | /** |
| | | * 从属性上获取参照的内容 |
| | | * @param attrVO 属性的信息 |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理分类注入 |
| | | * @param attrVOS 模板属性 |
| | |
| | | //因为数据量很大,所以得想办法并行 |
| | | //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | Map<String,List<BaseModel>> indexTODataMap=new ConcurrentHashMap<>(); |
| | | // 查询不需要参与关键属性校验的除自己以外的所有分类oid |
| | | String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | List<ClientBusinessObject> repeatDataMap = cboList.parallelStream().filter(cbo -> { |
| | | //每行都得查询.如果其中出现了错误,我们就直接抛出异常,其余的显示 |
| | | //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | |
| | | engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap); |
| | | }); |
| | | if (!CollectionUtils.isEmpty(ketAttrMap)) { |
| | | // 添加不参与关键属性校验的分类oid判断 |
| | | if(Func.isNotBlank(isParticipateCheckOids)){ |
| | | conditionMap.put("t.codeclsfid",QueryOptionConstant.NOTIN+isParticipateCheckOids); |
| | | } |
| | | CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, null); |
| | | boolean isKeyCheck= commonsMapper.queryCountBySql(sqlBO.getSqlCount()) > 0; |
| | | if(isKeyCheck){ |
| | |
| | | TreeQueryObject treeQueryObject=new TreeQueryObject(); |
| | | treeQueryObject.setParentOid(oid); |
| | | treeQueryObject.setQueryAllLevel(true); |
| | | dataCodeClassifyVOList=classifyService.selectAllClassifyByOid(oid);//.selectCodeClassifyDOByTree(treeQueryObject); |
| | | dataCodeClassifyVOList=classifyService.selectAllClassifyByOid(oid,"oid");//.selectCodeClassifyDOByTree(treeQueryObject); |
| | | //dataCodeClassifyVOList.add(CodeClassifyWrapper.build().entityVO(currentCodeClassify[0])); |
| | | Map<String, CodeClassifyVO> oidCodeclassifyDOMap = dataCodeClassifyVOList.stream().filter(systeDataObject -> systeDataObject != null && StringUtils.isNotBlank(systeDataObject.getOid())).collect(Collectors.toList()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | |
| | |
| | | <result property="referBtmName" column="REFERBTMNAME" jdbcType="VARCHAR"/> |
| | | <result property="referBtmId" column="REFERBTMID" jdbcType="VARCHAR"/> |
| | | <result property="referCodeClassifyOidName" column="c__name" jdbcType="VARCHAR"/> |
| | | <result property="prefixCode" column="PREFIXCODE" jdbcType="VARCHAR"/> |
| | | <result property="suffixCode" column="SUFFIXCODE" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectCodeBasicSecPage" resultMap="CodeBasicsecMap"> |
| | |
| | | PL_CODE_BASICSEC.serialdependorder, |
| | | PL_CODE_BASICSEC.nullableflag, |
| | | PL_CODE_BASICSEC.codefilllimit, |
| | | PL_CODE_BASICSEC.prefixcode, |
| | | PL_CODE_BASICSEC.suffixcode, |
| | | btm_codebasicsec_1.name as b__name, |
| | | platformbtm_codeclassify.name as c__name, |
| | | COUNT(*) OVER () "##VCI_COUNT_VCI##" |
| | |
| | | <result column="CODERULEOID" property="codeRuleOid"/> |
| | | <result column="CODEKEYATTRREPEATOID" property="codeKeyAttrRepeatOid"/> |
| | | <result column="CODERESEMBLERULEOID" property="codeResembleRuleOid"/> |
| | | <result column="ISPARTICIPATECHECK" property="isParticipateCheck"/> |
| | | <result column="TENANT_ID" property="tenantId"/> |
| | | <result column="TOTAL" property="total"/> |
| | | </resultMap> |
| | |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | | coderesembleruleoid.name as codeResembleRuleOidName, |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck |
| | | from pl_code_classify codeclassify0 |
| | | left join pl_code_rule coderuleoid |
| | | on codeclassify0.codeRuleOid = coderuleoid.oid |
| | |
| | | codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName, |
| | |
| | | on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid |
| | | START WITH |
| | | <if test="oid != null "> |
| | | codeclassify0.parentCodeClassifyOid = '${oid}' |
| | | codeclassify0.parentCodeClassifyOid = #{oid} |
| | | </if> |
| | | <if test="oid == null "> |
| | | codeclassify0.parentCodeClassifyOid is null |
| | | </if> |
| | | <if test="tenantId != null and tenantId != ''"> |
| | | and codeclassify0.tenant_id = #{tenantId} |
| | | </if> |
| | | CONNECT BY PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid |
| | | </select> |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.namePath as namepath, |
| | | codeclassify0.idPath as idpath |
| | | codeclassify0.idPath as idpath, |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck |
| | | from (select plcodeclassify.*, |
| | | SYS_CONNECT_BY_PATH(name, '#') as namePath, |
| | | SYS_CONNECT_BY_PATH(id, '#') as idPath |
| | |
| | | codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.paths as paths |
| | | codeclassify0.paths as paths, |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck |
| | | from (select plcodeclassify.*, |
| | | <choose> |
| | | <when test='fieldName=="name"'> |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | | coderesembleruleoid.name as codeResembleRuleOidName, |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck |
| | | from pl_code_classify codeclassify0 |
| | | left join pl_code_rule coderuleoid |
| | | on codeclassify0.codeRuleOid = coderuleoid.oid |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | |
| | | </if> |
| | | order by id asc |
| | | </select> |
| | | |
| | | <!--获取所有下级节点,不要动这个方法sql--> |
| | | <select id="selectAllClassifyByOid" resultMap="plCodeClassifyResultMap"> |
| | | select codeclassify0.OWNER as owner, |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | |
| | | codeclassify0.LCSTATUS as lcstatus, |
| | | codeclassify0.TS as ts, |
| | | codeclassify0.TENANT_ID as tenantId , |
| | | codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, |
| | | coderuleoid.name as codeRuleOidName, |
| | | codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, |
| | | coderesembleruleoid.name as codeResembleRuleOidName |
| | |
| | | connect by p.oid = prior p.PARENTCODECLASSIFYOID |
| | | </select> |
| | | |
| | | <select id="selectLeafByParentClassifyOid" resultType="com.vci.ubcs.code.entity.CodeClassify"> |
| | | select * |
| | | from ( |
| | | select |
| | | oid, |
| | | name, |
| | | id, |
| | | level lvl, |
| | | isparticipatecheck, |
| | | nvl((select 'N' |
| | | from PL_CODE_CLASSIFY pcc1 |
| | | where pcc.oid = pcc1.PARENTCODECLASSIFYOID |
| | | and rownum < 2),'Y') is_leaf |
| | | from PL_CODE_CLASSIFY pcc |
| | | start with pcc.PARENTCODECLASSIFYOID = #{topOid} |
| | | connect by pcc.PARENTCODECLASSIFYOID = prior oid |
| | | ) plcls |
| | | where |
| | | is_leaf = 'Y' |
| | | and isparticipatecheck = 0 |
| | | and oid != #{currentOid} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |