Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
| | |
| | | } |
| | | }) |
| | | } |
| | | // 新增数据 |
| | | export function addSaveCode(data) { |
| | | return request({ |
| | | url: 'api/ubcs-code/ubcs-code/mdmEngineController/addSaveCode', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | //修改数据 |
| | | export function editSaveCode(data) { |
| | | return request({ |
| | | url: 'api/ubcs-code/ubcs-code/mdmEngineController/editSaveCode', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import {MasterTable, TableData, FindData} from "@/api/GetItem"; |
| | | import {MasterTable, TableData, FindData,addSaveCode,editSaveCode} from "@/api/GetItem"; |
| | | import {listCodeAttributeByClassId} from "@/api/integration/integration.js"; |
| | | import integrationTransfer from "@/views/integration/integrationTransfer"; |
| | | import SetPersonnel from "@/components/template/SetPersonnel"; |
| | |
| | | codeClassifyOid: { |
| | | handler(newval, oldval) { |
| | | this.codeClassifyOid = newval; |
| | | this.parameter.vars.codeClassifyOid = newval |
| | | this.parameter.vars.codeClassifyOid = newval; |
| | | console.log('子',newval) |
| | | }, |
| | | deep: true, |
| | | }, |
| | |
| | | }, |
| | | //多选 |
| | | handleSelectionChange(row) { |
| | | console.log(row) |
| | | if (this.row) { |
| | | this.rowOid = row[0].oid; |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | //增加保存 |
| | | AddSumbit() { |
| | | AddSumbit(val) { |
| | | this.addvisible = false; |
| | | console.log(val) |
| | | addSaveCode(val).then(res=>{ |
| | | console.log(res) |
| | | this.onLoad() |
| | | }) |
| | | }, |
| | | EditSumbit(val) { |
| | | this.editvisible = false; |
| | | console.log(val) |
| | | editSaveCode(val).then(res=>{ |
| | | console.log(res) |
| | | this.onLoad() |
| | | }) |
| | | }, |
| | | openBatchImport(type) { |
| | | this.batchImportData.visible = true |
| | | this.batchImportData.type = type |
| | | this.batchImportData.codeClassifyOid = this.codeClassifyOid |
| | | this.batchImportData.visible = true; |
| | | this.batchImportData.type = type; |
| | | this.batchImportData.codeClassifyOid = this.codeClassifyOid; |
| | | } |
| | | }, |
| | | }; |
| | |
| | | .el-table--scrollable-x .el-table__body-wrapper { |
| | | overflow: auto !important; |
| | | } |
| | | |
| | | .el-table__fixed-right-patch { |
| | | background-color: #f5f7fa !important; |
| | | } |
| | |
| | | this.TableRend(); // TableHeadRend() 方法完成后再执行 TableRend() |
| | | this.$emit('nodeClick',this.templateOids) |
| | | this.$emit("codeClassifyOid", this.nodeClickList.oid ) |
| | | console.log('树',this.nodeClickList.oid) |
| | | } catch (error) { |
| | | // 处理错误 |
| | | this.$message.error(error) |
| | |
| | | </script> |
| | | |
| | | <style scoped lang="scss" > |
| | | ///deep/ .el-button { |
| | | // margin: 0 10px 10px 0; |
| | | //} |
| | | .app el-button{ |
| | | z-index: 1; |
| | | margin: 0 10px 10px 0 !important; |
| | | .app { |
| | | /deep/ .el-button { |
| | | margin: 0 10px 10px 0; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <div> |
| | | <avue-form v-model="loneTreeNewForm" :option="option" v-if="flag == 'renonly'"> |
| | | </avue-form> |
| | | <avue-form v-model="loneTreeNewForm" :option="options" @submit="submits" v-else-if="flag == 'edit'"> |
| | | <avue-form v-model="loneTreeNewForm" :option="this.options" @submit="submits" v-else-if="flag == 'edit'"> |
| | | </avue-form> |
| | | <div> |
| | | <!-- 编码规则--> |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | options: { |
| | | |
| | | FormList: {}, |
| | | masterSelectList:[], |
| | | KeySelectLIst:[], |
| | | simSelectList:[], |
| | | btmSelectList:[] |
| | | } |
| | | }, |
| | | computed:{ |
| | | options(){ |
| | | return{ |
| | | column: [ |
| | | { |
| | | label: '主题库/分类编号', |
| | |
| | | prop: 'btmtypename', |
| | | labelWidth:128, |
| | | focus:this.btmFoucus, |
| | | readonly: true, |
| | | display:false, |
| | | // readonly: true, |
| | | display:this.TreeFlag, |
| | | rules: [{ |
| | | required: true, |
| | | message: "存储的业务类型", |
| | |
| | | }, |
| | | |
| | | ] |
| | | }, |
| | | FormList: {}, |
| | | masterSelectList:[], |
| | | KeySelectLIst:[], |
| | | simSelectList:[], |
| | | btmSelectList:[] |
| | | |
| | | } |
| | | } |
| | | }, |
| | | watch:{ |
| | |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | }, |
| | | TreeFlag:{ |
| | | handler(newval,oldval){ |
| | | console.log('树状态',newval,oldval) |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | <el-container> |
| | | <!-- 左侧菜单--> |
| | | <el-aside > |
| | | <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;"@click.native="handleClickOutside" > |
| | | <div @click.native="handleClickOutside"> |
| | | <basic-container style="height: 85vh; max-height: 155vh; overflow-y: scroll;"> |
| | | <div> |
| | | <div> |
| | | <div style="display: flex;justify-content: space-around"> |
| | | <el-button plain size="small" type="primary" @click="TreeAdd">添加</el-button> |
| | |
| | | <el-form-item label="编码规则:" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="业务类型:" label-width="150px" v-if="TreeFlag==false"> |
| | | <el-form-item label="业务类型:" label-width="150px" v-if="TreeFlagCode==false"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="关键属性查询规则:" label-width="150px"> |
| | |
| | | </el-dialog> |
| | | <!-- 修改对话框--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类"> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="TreeFlag" ::nodeClickList="nodeClickList"></classifyTreeform> |
| | | <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'" @MasterHandler="MasterHandler" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="TreeFlagCode" ::nodeClickList="nodeClickList"></classifyTreeform> |
| | | </el-dialog> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | |
| | | data() { |
| | | return { |
| | | //树节点显示隐藏 |
| | | TreeFlag:false, |
| | | TreeFlagCode:false, |
| | | //编码规则 |
| | | MasterdialogVisible:false, |
| | | masterData:[], |
| | |
| | | if (e.target.nodeName !== 'SPAN') { |
| | | this.$refs.tree.setCurrentKey(null) |
| | | this.nodeClickList = {} |
| | | this.TreeList=[] |
| | | this.TreeFlagCode=false |
| | | console.log('后TreeList',this.TreeList) |
| | | console.log('后nodeClickList',this.nodeClickList) |
| | | } |
| | | }, true) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | //树节点失去焦点 |
| | | handleClickOutside(event) { |
| | | const treeElement = this.$refs.tree.$el; |
| | | const targetElement = event.target; |
| | | if (!treeElement.contains(targetElement)) { |
| | | // 在树组件外部点击,清空选择状态 |
| | | // this.nodeClickList=[]; |
| | | // this.CloneTreeAvueform={} |
| | | console.log(this.nodeClickList ) |
| | | console.log(this.CloneTreeAvueform) |
| | | } |
| | | }, |
| | | //编码规则失焦 |
| | | CodeFoucus(){ |
| | | this.MasterdialogVisible=true; |
| | |
| | | }, |
| | | //修改回填 |
| | | TreeEdit() { |
| | | if (this.nodeClickList == "") { |
| | | if ( Object.keys(this.nodeClickList).length<1) { |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '请先从树上选择一条数据!' |
| | |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | //定义一个模板属性id,数据是模板管理表格里面的oid |
| | | console.log('树',data) |
| | | if(data.parentId == ""){ |
| | | this.TreeFlag=true; |
| | | this.TreeFlagCode=true; |
| | | } |
| | | this.nodeClickList = data |
| | | this.ProData=[] |
| | |
| | | type: Array |
| | | } |
| | | }, |
| | | watch:{ |
| | | btmType:{ |
| | | handler(newval,oldval){ |
| | | console.log('监听',newval,oldval) |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | |
| | | }, |
| | | // 属性池加载 |
| | | attrRefOnLoad(){ |
| | | if (!this.attrRef.queryNotIn || (this.attrRef.queryNotIn === '' && this.btmType.attributes !== [])){ |
| | | if (this.attrRef.queryNotIn != ''){ |
| | | this.attrRef.queryNotIn = ''; |
| | | this.btmType.attributes.forEach(item => { |
| | | this.attrRef.queryNotIn += (item.id + ",") |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | <avue-crud :option="this.option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | |
| | | remove, |
| | | update, |
| | | add, |
| | | setting, |
| | | // setting, |
| | | datasource, |
| | | packageInfo, |
| | | packageSetting |
| | |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | option: { |
| | | data: [], |
| | | settingForm: {}, |
| | | settingOption: { |
| | | column: [ |
| | | { |
| | | label: "账号额度", |
| | | prop: "accountNumber", |
| | | type: "number", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "过期时间", |
| | | prop: "expireTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | span: 24, |
| | | }, |
| | | ] |
| | | }, |
| | | datasourceForm: {}, |
| | | datasourceOption: { |
| | | column: [ |
| | | { |
| | | label: "数据源", |
| | | prop: "datasourceId", |
| | | search: true, |
| | | span: 24, |
| | | type: "select", |
| | | dicUrl: "/api/ubcs-develop/datasource/select", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择数据源", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | ] |
| | | }, |
| | | packageForm: {}, |
| | | packageOption: { |
| | | column: [ |
| | | { |
| | | label: "产品包", |
| | | prop: "packageId", |
| | | search: true, |
| | | span: 24, |
| | | type: "select", |
| | | dicUrl: "/api/ubcs-system/tenant-package/select", |
| | | props: { |
| | | label: "packageName", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | | label: "菜单预览", |
| | | prop: "menuId", |
| | | span: 24, |
| | | type: "tree", |
| | | dicData: [], |
| | | hide: true, |
| | | multiple: true, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | BooleanFlag:Boolean, |
| | | }; |
| | | }, |
| | | |
| | | created() { |
| | | this.initBoolean() |
| | | }, |
| | | watch: { |
| | | 'packageForm.packageId'() { |
| | | if (!validatenull(this.packageForm.packageId)) { |
| | | packageDetail(this.packageForm.packageId).then(res => { |
| | | this.packageForm.menuId = res.data.data.menuId; |
| | | this.initData(); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.tenant_add, false), |
| | | viewBtn: this.vaildData(this.permission.tenant_view, false), |
| | | delBtn: this.vaildData(this.permission.tenant_delete, false), |
| | | editBtn: this.vaildData(this.permission.tenant_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | tenantId() { |
| | | return this.selectionList[0].tenantId; |
| | | }, |
| | | option(){ |
| | | return{ |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | tip: false, |
| | |
| | | type: 'radio', |
| | | width: 100, |
| | | value:0, |
| | | disabled:Boolean, |
| | | disabled:this.BooleanFlag , |
| | | dicData: [{ |
| | | label: '开启', |
| | | value: 0 |
| | |
| | | span: 24, |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | | settingForm: {}, |
| | | settingOption: { |
| | | column: [ |
| | | { |
| | | label: "账号额度", |
| | | prop: "accountNumber", |
| | | type: "number", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "过期时间", |
| | | prop: "expireTime", |
| | | type: "date", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | span: 24, |
| | | }, |
| | | ] |
| | | }, |
| | | datasourceForm: {}, |
| | | datasourceOption: { |
| | | column: [ |
| | | { |
| | | label: "数据源", |
| | | prop: "datasourceId", |
| | | search: true, |
| | | span: 24, |
| | | type: "select", |
| | | dicUrl: "/api/ubcs-develop/datasource/select", |
| | | props: { |
| | | label: "name", |
| | | value: "id" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择数据源", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | ] |
| | | }, |
| | | packageForm: {}, |
| | | packageOption: { |
| | | column: [ |
| | | { |
| | | label: "产品包", |
| | | prop: "packageId", |
| | | search: true, |
| | | span: 24, |
| | | type: "select", |
| | | dicUrl: "/api/ubcs-system/tenant-package/select", |
| | | props: { |
| | | label: "packageName", |
| | | value: "id" |
| | | } |
| | | }, |
| | | { |
| | | label: "菜单预览", |
| | | prop: "menuId", |
| | | span: 24, |
| | | type: "tree", |
| | | dicData: [], |
| | | hide: true, |
| | | multiple: true, |
| | | props: { |
| | | label: "title" |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | }; |
| | | }, |
| | | |
| | | created() { |
| | | // 获取到true还是false直接赋值,定义方法会就是获取不到,不知道什么问题,强制用JSON.parse会在后面追加一个disabled,所以直接获取。后期如果添加cloumn会出现bug,用foreach循环出column在判断type是否等于radio,然后将单独radio的disabled改为res.data.data |
| | | this.$axios.get('/api/ubcs-system/tenant/find-ssa-enable').then(res => { |
| | | this.option.column[6].disabled= res.data.data |
| | | }); |
| | | }, |
| | | watch: { |
| | | 'packageForm.packageId'() { |
| | | if (!validatenull(this.packageForm.packageId)) { |
| | | packageDetail(this.packageForm.packageId).then(res => { |
| | | this.packageForm.menuId = res.data.data.menuId; |
| | | this.initData(); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.tenant_add, false), |
| | | viewBtn: this.vaildData(this.permission.tenant_view, false), |
| | | delBtn: this.vaildData(this.permission.tenant_delete, false), |
| | | editBtn: this.vaildData(this.permission.tenant_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | tenantId() { |
| | | return this.selectionList[0].tenantId; |
| | | } |
| | | }, |
| | | methods: { |
| | | initBoolean(){ |
| | | this.$axios.get('/api/ubcs-system/tenant/find-ssa-enable').then(res => { |
| | | this.BooleanFlag=res.data.data; |
| | | console.log('---',res) |
| | | }); |
| | | }, |
| | | initData() { |
| | | getMenuTree().then(res => { |
| | | const column = this.findObject(this.packageOption.column, "menuId"); |
| | |
| | | handlePackageSetting() { |
| | | this.packageSettingBox = true; |
| | | }, |
| | | handleSubmit(form, done, loading) { |
| | | setting(this.ids, form).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "配置成功!" |
| | | }); |
| | | done(); |
| | | this.box = false; |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | }, |
| | | // handleSubmit(form, done, loading) { |
| | | // setting(this.ids, form).then(() => { |
| | | // this.onLoad(this.page); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "配置成功!" |
| | | // }); |
| | | // done(); |
| | | // this.box = false; |
| | | // }, error => { |
| | | // window.console.log(error); |
| | | // loading(); |
| | | // }); |
| | | // }, |
| | | handleDatasourceSubmit(form, done, loading) { |
| | | datasource(this.tenantId, form.datasourceId).then(() => { |
| | | this.$message({ |
| | |
| | | //本地服务接口地址 |
| | | // target: 'http://localhost:37000', |
| | | // target: 'http://192.168.1.51:37000', |
| | | // target: 'http://192.168.1.46:37000', |
| | | target: 'http://dev.vci-tech.com:37000', |
| | | target: 'http://192.168.1.46:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | // target: 'http://192.168.1.51:37000/', |
| | | // target: 'http://192.168.1.104:37000', |
| | | // target: 'http://192.168.1.63:37000', |
| | |
| | | // //默认的属性都不用从前端拷贝 |
| | | // //设置编码需要的默认属性的内容 |
| | | copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false); |
| | | cbo.setOid(VciBaseUtil.getPk()); |
| | | cbo.setCreateTime(new Date()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setCreator(AuthUtil.getUser().getUserName()); |
| | | cbo.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | // //TODO:因为默认的属性都不拷贝,目前集团码叫name,并没有从DTO拷贝到cbo里。增加一个单独处理,以后再看要不要调整 |
| | | cbo.setName(orderDTO.getName() == null ? "" : orderDTO.getName()); |
| | | // //end -- modify by lihang @20220407 |
| | |
| | | // BeanUtils. |
| | | // BeanUtils.copyProperties(orderDTO.getData(),cbo); |
| | | // cbo.setMaterialtype(Short.valueOf("1001")); |
| | | // orderDTO.getData().forEach((key, value) -> { |
| | | // if (!edit || (!checkUnAttrUnEdit(key) && |
| | | // !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) { |
| | | // try { |
| | | // cbo.setAttributeValue(key, value); |
| | | // } catch (Exception e) { |
| | | // logger.error("设置属性的值错误", e); |
| | | // } |
| | | // } |
| | | // }); |
| | | orderDTO.getData().forEach((key, value) -> { |
| | | if (!edit || (!checkUnAttrUnEdit(key) && |
| | | !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) { |
| | | try { |
| | | cbo.getData().put(cbo.getData().containsKey(key.toUpperCase())?key.toUpperCase():key, value); |
| | | } catch (Exception e) { |
| | | logger.error("设置属性的值错误", e); |
| | | } |
| | | } |
| | | }); |
| | | // BeanMap beanMap = BeanMap.create(cbo); |
| | | // beanMap.putAll(orderDTO.getData()); |
| | | |
| | | try { |
| | | |
| | | BeanUtilForVCI.copyPropertiesIgnoreNull(BeanUtilForVCI.convertMap(BaseModel.class, orderDTO.getData()), cbo); |
| | | Map<String, String> data = new HashMap<>(); |
| | | data.put(CODE_CLASSIFY_OID_FIELD, classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | data.put(CODE_TEMPLATE_OID_FIELD, templateVO.getOid()); |
| | | data.put(CODE_FULL_PATH_FILED, fullPath); |
| | | cbo.setData(data); |
| | | cbo.setOid(VciBaseUtil.getPk()); |
| | | cbo.setCreateTime(new Date()); |
| | | data.put(cbo.getData().containsKey(CODE_CLASSIFY_OID_FIELD.toUpperCase())?CODE_CLASSIFY_OID_FIELD.toUpperCase():CODE_CLASSIFY_OID_FIELD, classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | data.put(cbo.getData().containsKey(CODE_TEMPLATE_OID_FIELD.toUpperCase())?CODE_TEMPLATE_OID_FIELD.toUpperCase():CODE_TEMPLATE_OID_FIELD, templateVO.getOid()); |
| | | data.put(cbo.getData().containsKey(CODE_FULL_PATH_FILED.toUpperCase())?CODE_FULL_PATH_FILED.toUpperCase():CODE_FULL_PATH_FILED, fullPath); |
| | | cbo.getData().putAll(data); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setCreator(AuthUtil.getUser().getUserName()); |
| | | cbo.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | // cbo.setCodeclsfid(classifyFullInfo.getCurrentClassifyVO().getOid()); |
| | | // cbo.setTemplateOid(templateVO.getOid()); |
| | | // cbo.setCodeclsfpath(fullPath); |
| | | cbo.setTs(new Date()); |
| | | if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) { |
| | | //TODO 先写固定,后面生命周期好了在编写 |
| | |
| | | if (CollectionUtils.isEmpty(cbos)) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | // QueryWrapper<CodeWupin> btmWrapper = new QueryWrapper<>(); |
| | | // btmWrapper.eq("OID",orderDTO.getOid()); |
| | | // CodeWupin cbo = codeWupinMapper.selectOne(btmWrapper); |
| | | BaseModel cbo = cbos.get(0); |
| | | // CodeClstemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | | // CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid()); |
| | | |
| | | if (cbo != null) { |
| | | if (cbo == null) { |
| | | throw new VciBaseException(DATA_OID_NOT_EXIST); |
| | | } |
| | | // ClientBusinessObject cbo = cbos.get(0); |
| | | if (!cbo.getTs().toString().contains(VciDateUtil.date2Str(orderDTO.getTs(), VciDateUtil.DateTimeFormat))) { |
| | | throw new VciBaseException("数据不是最新的,可能他人已经修改,请刷新后再试"); |
| | | } |
| | |
| | | |
| | | //注意模板不能使用数据存储的时候的模板,因为可能会变化 |
| | | |
| | | //1. 判断必输项 |
| | | String codeClassifyOid=cbo.getData().get(CODE_CLASSIFY_OID_FIELD.toUpperCase()); |
| | | orderDTO.setCodeClassifyOid(codeClassifyOid); |
| | | // CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | // CodeClassifyTemplateVO templateVO= this.getUsedTemplateByClassifyOid(orderDTO.getCodeClassifyOid()); |
| | | |
| | | |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | | orderDTO.setTemplateOid(templateVO.getOid()); |
| | | //1. 判断必输项 |
| | | checkRequiredAttrOnOrder(templateVO, orderDTO); |
| | | //2.先注入,再组合,最后校验 |
| | | switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO); |
| | |
| | | copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true); |
| | | //企业码和集团码的不修改 |
| | | cbo.setDescription(orderDTO.getDescription()); |
| | | cbo.setName(orderDTO.getName()); |
| | | // cbo.setName(orderDTO.getName()); |
| | | try { |
| | | cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription()) ? "" : orderDTO.getDescription()); |
| | | cbo.setName(orderDTO.getName()); |
| | | //// cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription()); |
| | | // cbo.setAttributeValue("name", orderDTO.getName()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // cbo.getData().putAll(orderDTO.getData()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), Collections.singletonList(cbo)); |
| | | // codeWupinMapper.updateById(cbo); |
| | | // |
| | | // List<CodeWupinEntity> cboList = new ArrayList<>(); |
| | | // |
| | | // //备注 |
| | | // cbo.setDescription(orderDTO.getDescription()); |
| | | // cboList.add(cbo); |
| | | //// |
| | | //// cboList.add(cbo); |
| | | // List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(),cboList); |
| | | // |
| | | // |
| | | // List<String> charList = new ArrayList<>(); |
| | | // for (CodeWupinEntity wupinEntity : cboList) { |
| | | // charList.add(wupinEntity.getId()); |
| | | // } |
| | | // batchSaveSelectChar(templateVO, charList); |
| | | // return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | |
| | | |
| | | //修改的时候,编码是不变的 |
| | | // BatchCBO batchCBO = new BatchCBO(); |
| | | // batchCBO.getUpdateCbos().add(cbo); |
| | | // List<ClientBusinessObject> cboList = new ArrayList<>(); |
| | | // cboList.add(cbo); |
| | | // boService.persistenceBatch(batchCBO); |
| | | batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); |
| | | // batchSaveSelectChar(templateVO, Arrays.asList(cbo.getId())); |
| | | } |
| | | |
| | | /** |