Merge remote-tracking branch 'origin/master'
# Conflicts:
# Source/UBCS-WEB/src/page/login/sso.vue
| | |
| | | "axios": "^0.18.0", |
| | | "babel-polyfill": "^6.26.0", |
| | | "classlist-polyfill": "^1.2.0", |
| | | "crypto-js": "^4.0.0", |
| | | "crypto-js": "^4.1.1", |
| | | "element-ui": "^2.15.6", |
| | | "instead": "^1.0.3", |
| | | "js-base64": "^2.5.1", |
| | |
| | | }) |
| | | } |
| | | // 分类授权 |
| | | export const batchAddSave = (params) => { |
| | | // export const batchAddSave = (systemOid,systemId,data) => { |
| | | // return request({ |
| | | // url: '/api/ubcs-code/codeApplyWebManagementController/batchAddSave', |
| | | // method: 'post', |
| | | // data: data |
| | | // }) |
| | | // } |
| | | // 分类授权 |
| | | export const batchAddSave = (systemOid, systemId, data) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/codeApplyWebManagementController/batchAddSave', |
| | | url: `/api/ubcs-code/codeApplyWebManagementController/batchAddSave?systemOid=${systemOid}&systemId=${systemId}`, |
| | | method: 'post', |
| | | params: params |
| | | }) |
| | | } |
| | | data: data |
| | | }); |
| | | }; |
| | |
| | | }) |
| | | } |
| | | //单点登录接口 |
| | | export const oaSsos =(userName) => { |
| | | export const ssoLogin =(empCode) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/passwordFree/oaSsos', |
| | | method: 'post', |
| | | url: '/api/ubcs-code/passwordFree/ssoLogin', |
| | | method: 'get', |
| | | params:{ |
| | | userName |
| | | }, |
| | | headers: { |
| | | 'empCode': 'ZVKcWmOH1JvFYaM7BuNVm1BWbaw6OcMi04aAT2H+X3Y=' |
| | | }, |
| | | empCode |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | trigger = "blur"; |
| | | } |
| | | let fieldMapKey='' |
| | | if( formItem.type == "refer"){ |
| | | if(!formItem.fieldMap){ |
| | | fieldMapKey=formItem.field+'Id' |
| | | } |
| | | if( formItem.type == "refer" && !formItem.fieldMap){ |
| | | fieldMapKey=formItem.field+'Id' |
| | | formItem.fieldMap={} |
| | | formItem.fieldMap[fieldMapKey]='id' |
| | | formItem.fieldMap[formItem.field+'id']='id' |
| | | } |
| | | let columnItem = { |
| | | label: formItem.text, |
| | |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | fieldMap:formItem.fieldMap || {fieldMapKey:'id'}, |
| | | fieldMap:formItem.fieldMap || {}, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig |
| | | } |
| | |
| | | |
| | | this.geDictData(dictKeys); |
| | | this.getFormDetail(); |
| | | // console.log('selfColumnConfig',this.selfColumnConfig) |
| | | |
| | | }, |
| | | //修改级联项 |
| | | changeChildItem(items,TreeValue) { |
| | | let column = this.option.column; |
| | | let group = this.option.group; |
| | | items.forEach((item) => { |
| | | let formItem = this.resetFormConfig(item); |
| | | if (formItem.field == "lcstatus") { |
| | | formItem.field = formItem.field + "_text"; |
| | | formItem.readOnly = true; |
| | | } |
| | | // 设置表单校验的规则,文本 |
| | | let message = "请选择"; |
| | | let trigger = "change"; |
| | | if (formItem.type === "text") { |
| | | message = "请输入"; |
| | | trigger = "blur"; |
| | | } |
| | | let fieldMapKey = '' |
| | | if (formItem.type == "refer" && !formItem.fieldMap) { |
| | | fieldMapKey = formItem.field + 'Id' |
| | | formItem.fieldMap = {} |
| | | formItem.fieldMap[fieldMapKey] = 'id' |
| | | formItem.fieldMap[formItem.field + 'id'] = 'id' |
| | | } |
| | | let columnItem = { |
| | | label: formItem.text, |
| | | labelslot: true, |
| | | prop: this.$utilFunc.isValuableObj(formItem.referConfig) |
| | | ? formItem.showField || formItem.field |
| | | : formItem.field, |
| | | field: formItem.field, |
| | | type: this.columnType[formItem.type], |
| | | dicData: this.getDataList(formItem.type, formItem.data), |
| | | disabled: this.type === "detail" ? true : formItem.readOnly || (formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ? true : false), |
| | | prepend: this.preOrSufFixShow("text", formItem.prefix), |
| | | append: this.preOrSufFixShow("text", formItem.suffix), |
| | | prefixIcon: this.preOrSufFixShow("icon", formItem.prefix), |
| | | suffixIcon: this.preOrSufFixShow("icon", formItem.suffix), |
| | | valueFormat: formItem.dateFormate, |
| | | format: formItem.dateFormate, |
| | | keyAttr: formItem.keyAttr, |
| | | value: (formItem.dicData && formItem.dicData.length > 0 && formItem.secType == "codefixedsec" ? formItem.dicData[0].id : null) || |
| | | (formItem.secType == "codedatesec" ? formItem.codeDateValue : null) || (TreeValue && formItem.secType == "codelevelsec" ? TreeValue : null), |
| | | placeholder: formItem.inputTip, |
| | | comboxKey: formItem.comboxKey, |
| | | tip: formItem.tooltips, |
| | | // hidden:formItem.secType && formItem.codeValueApplyStatus == 3 ? true : false, |
| | | // readonly:formItem.codeValueApplyStatus && formItem.codeValueApplyStatus == 2 ?true : false , |
| | | display: !formItem.hidden, |
| | | maxlength: formItem.maxlength, |
| | | filterable: true, |
| | | referConfig: |
| | | formItem.type == "refer" |
| | | ? { |
| | | title: formItem.text, |
| | | showField: formItem.showField || formItem.field, |
| | | field: formItem.field, |
| | | fieldMap: formItem.fieldMap || {}, |
| | | placeholder: formItem.inputTip, |
| | | options: formItem.referConfig |
| | | } |
| | | : {}, |
| | | span: formItem.span |
| | | ? formItem.span |
| | | : formItem.type === "textarea" |
| | | ? 24 |
| | | : this.localTrendsSpan, |
| | | rules: [ |
| | | { |
| | | required: formItem.required, |
| | | message: `${message}${formItem.text}`, |
| | | trigger, |
| | | }, |
| | | { |
| | | // 如果没有正则则匹配任何字符 |
| | | pattern: formItem.verify ? formItem.verify : /[\s\S.]*/g, |
| | | message: formItem.tooltips, |
| | | trigger, |
| | | }, |
| | | ], |
| | | props: { |
| | | label: "value", |
| | | value: "key", |
| | | }, |
| | | }; |
| | | |
| | | if (group.length === 0) { |
| | | this.slotColumnList.forEach((index, colItem) => { |
| | | if (colItem.field == columnItem.field) { |
| | | this.slotColumnList[index] = columnItem; |
| | | column[index] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | } else { |
| | | this.slotColumnList.forEach((index, colItem) => { |
| | | if (colItem.field == columnItem.field) { |
| | | this.slotColumnList[index] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | group.forEach((index, groupItem) => { |
| | | groupItem.column.forEach((colIndex, colItem) => { |
| | | if (colItem.field == columnItem.field) { |
| | | group[index].column[colIndex] = columnItem; |
| | | return; |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }); |
| | | this.$set(this.option, "column", column); |
| | | this.$set(this.option, "group", group); |
| | | }, |
| | | // 使用传入的表单数据配置 |
| | | resetFormConfig(formItem) { |
| | |
| | | ); |
| | | }, |
| | | setReferValue(data) { |
| | | debugger; |
| | | if (data.field) { |
| | | this.form[data.field] = data.value || ""; |
| | | this.form[data.showField] = data.text || ""; |
| | |
| | | this.form[key] = value.join(','); |
| | | } |
| | | } |
| | | this.$emit("getFormData", this.form); |
| | | this.$emit("referConfigDataUpdate", data); |
| | | this.$emit("getFormData", this.form); |
| | | } |
| | | }, |
| | | }, |
| | |
| | | @opened="openDialog" |
| | | > |
| | | <FormTemplate |
| | | key="masterForm" data-key="masterForm" |
| | | v-bind="$attrs" |
| | | :type="type" |
| | | :TreeValue="TreeValue" |
| | |
| | | <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> |
| | | <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply"> |
| | | <FormTemplate |
| | | v-bind="$attrs" |
| | | key="codeApplyForm" data-key="codeApplyForm" |
| | | secDTOListv-bind="$attrs" |
| | | :type="type" |
| | | :selfColumnType="selfColumnType" |
| | | :selfColumnConfig="selfColumnConfig" |
| | |
| | | }, |
| | | // 获取码值申请数据 |
| | | getCodeRule() { |
| | | let that = this; |
| | | getCodeRule({ codeClassifyOid: that.codeClassifyOid }).then((res) => { |
| | | let that = this; |
| | | getCodeRule({codeClassifyOid: that.codeClassifyOid}).then((res) => { |
| | | if (res.data && res.data.code === 200) { |
| | | that.codeRuleOid = res.data.data.oid; |
| | | const typeList = [ |
| | |
| | | if (that.secVOList.length > 0 && that.type === "add") { |
| | | that.showCodeApply = true; |
| | | that.activeName = "codeApply"; |
| | | that.$nextTick(() => { |
| | | that.$refs.CodeApply.templateRender(that.secVOList,this.TreeValue); |
| | | this.$nextTick(() => { |
| | | that.$refs.CodeApply.templateRender(that.secVOList, this.TreeValue); |
| | | }); |
| | | } else { |
| | | that.showCodeApply = false; |
| | |
| | | // 参照组件数据变更 |
| | | referConfigDataUpdate(data) { |
| | | const { field } = data; |
| | | let childItems=[]; |
| | | this.secVOList = this.secVOList.map((item) => { |
| | | if (item.parentClassifySecOid === field) { |
| | | this.$refs.CodeApply.form[item.oid] = undefined; |
| | | this.$refs.CodeApply.form[item.name] = undefined; |
| | | item.readOnly=false; |
| | | item.referConfig.extraParams.parentClassifyValueOid=data.value; |
| | | childItems.push(item) |
| | | } |
| | | return item; |
| | | }); |
| | | this.$refs.CodeApply.templateRender(this.secVOList,this.TreeValue); |
| | | //this.$refs.CodeApply.templateRender(this.secVOList,this.TreeValue); |
| | | this.$refs.CodeApply.changeChildItem(childItems); |
| | | }, |
| | | resembleQuerySubmit() { |
| | | this.activeName = "resembleQuery"; |
| | |
| | | { |
| | | label: "参照配置", |
| | | prop: "referConfig", |
| | | width: 105 |
| | | }, |
| | | { |
| | | label: "级联查询属性", |
| | |
| | | { |
| | | label: "取值范围", |
| | | prop: "valueArea", |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | // 存储表格数据 |
| | |
| | | </el-form> |
| | | <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> |
| | | <el-tab-pane label="最大流水号" name="codeApply"> |
| | | <form-template v-bind="$attrs" type="add" :selfColumnType="selfColumnType" :trendsSpan="24" |
| | | <form-template key="codeApplyMaxForm" data-key="codeApplyMaxForm" v-bind="$attrs" type="add" :selfColumnType="selfColumnType" :trendsSpan="24" |
| | | :selfColumnConfig="selfColumnConfig" ref="CodeApply" @getFormData="getCodeApplyFormData" |
| | | @referConfigDataUpdate="referConfigDataUpdate"></form-template> |
| | | </el-tab-pane> |
| | |
| | | // 参照组件数据变更 |
| | | referConfigDataUpdate(data) { |
| | | const {field} = data; |
| | | let childItems=[]; |
| | | this.secVOList = this.secVOList.map((item) => { |
| | | if (item.parentClassifySecOid === field) { |
| | | this.$refs.CodeApply.form[item.oid] = undefined; |
| | | this.$refs.CodeApply.form[item.name] = undefined; |
| | | item.readOnly = false; |
| | | item.referConfig.extraParams.parentClassifyValueOid = data.value; |
| | | childItems.push(item) |
| | | } |
| | | return item; |
| | | }); |
| | | this.$refs.CodeApply.templateRender(this.secVOList); |
| | | //this.$refs.CodeApply.templateRender(this.secVOList); |
| | | this.$refs.CodeApply.changeChildItem(childItems); |
| | | }, |
| | | isRequired(item) { |
| | | return item.nullableFlag != "true"; |
| | |
| | | <template> |
| | | <div v-if="display"> |
| | | <vciWebReferTree ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> |
| | | <vciWebReferTable v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> |
| | | <vciWebReferDefalut v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> |
| | | <vciWebReferTree :key="referConfig.field" :data-key="referConfig.field" ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> |
| | | <vciWebReferTable :key="referConfig.field" :data-key="referConfig.field" v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> |
| | | <vciWebReferDefalut :key="referConfig.field" :data-key="referConfig.field" v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | <template> |
| | | <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" :blur="valueChange" :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> |
| | | <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" |
| | | :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | props:["referConfig","value","text","title","disabled"], |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | options: this.referConfig.options, |
| | | lazy: this.referConfig.options.loadType == 'node', |
| | | isMuti:("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false, |
| | |
| | | |
| | | }, |
| | | getTree() { |
| | | //加载全部 |
| | | getTree(this.params, this.treeUrl).then(res => { |
| | | res.data.map(item => { |
| | | if (!item.attribute) { |
| | | item.attribute = { |
| | | if (!item.attributes) { |
| | | item.attributes = { |
| | | data: {} |
| | | } |
| | | } else { |
| | | item.attribute.data = item.attribute.data || {} |
| | | item.attributes.data = item.attributes.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | }) |
| | | }, |
| | | treeLoad: function (treeNode, resolve) { |
| | | //逐级加载 |
| | | const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid; |
| | | this.params.parentOid=parentOid.indexOf('@vcitreesep@') > -1 ? parentOid.split('@vcitreesep@')[1] : parentOid; |
| | | this.params.parentValue=this.params.parentOid; |
| | |
| | | } |
| | | getLazyTree(this.params,this.treeUrl).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | if(!item.attribute){ |
| | | item.attribute={ |
| | | if(!item.attributes){ |
| | | item.attributes={ |
| | | data:{} |
| | | } |
| | | }else{ |
| | | item.attribute.data=item.attribute.data || {} |
| | | item.attributes.data=item.attributes.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | } |
| | | }, |
| | | checked(checkedNode, checkedData) { |
| | | this.checkedData=checkedData |
| | | }, |
| | | valueChange(){ |
| | | if(this.isMuti){ |
| | | // this.setValue(this.checkedData) |
| | | } |
| | | this.setValue(checkedData) |
| | | }, |
| | | setValue:function (checkedData){ |
| | | this.checkedData=checkedData |
| | | var value = []; |
| | | var text = []; |
| | | const textSep =this.config.textSep; |
| | | const textSep =this.config.textSep;debugger; |
| | | for(var j =0;j<checkedData.checkedNodes.length;j++){ |
| | | const item=checkedData.checkedNodes[j]; |
| | | var v=this.config.valueField.indexOf("attribute.")>=0?(item.attributes[this.config.valueField.replace("attribute.","")] || item.attributes.data[this.config.valueField.replace("attribute.","")]):(item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField]) |
| | |
| | | i18n: (key, value) => i18n.t(key, value) |
| | | }); |
| | | //复制插件 |
| | | import VueClipboard from 'vue-clipboard2' |
| | | Vue.use( VueClipboard ) |
| | | import VueClipboard from 'vue-clipboard2' |
| | | Vue.use( VueClipboard ) |
| | | //时间插件 |
| | | import moment from 'moment'; |
| | | Vue.prototype.$moment = moment; |
| | |
| | | </h4> |
| | | <userLogin v-if="activeName==='user'"></userLogin> |
| | | <thirdLogin v-else-if="activeName==='third'"></thirdLogin> |
| | | <!-- <div class="login-menu">--> |
| | | <!-- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>--> |
| | | <!-- <a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>--> |
| | | <!-- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>--> |
| | | <!-- <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {oaSsos} from "@/api/system/user.js" |
| | | import {ssoLogin} from "@/api/system/user.js" |
| | | import {mapGetters} from "vuex"; |
| | | import {setStore} from "@/util/store"; |
| | | |
| | | export default { |
| | | name: "sso", |
| | | data() { |
| | | return {} |
| | | return { |
| | | PathString:'', |
| | | } |
| | | }, |
| | | computed: {}, |
| | | computed: { |
| | | ...mapGetters(["tagWel"]) |
| | | }, |
| | | created() { |
| | | this.onLoad() |
| | | }, |
| | | |
| | | methods: { |
| | | onLoad() { |
| | | |
| | | console.log(info); |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: 'Loading', |
| | | spinner: 'el-icon-loading', |
| | | background: 'rgba(0, 0, 0, 0.7)' |
| | | }); |
| | | setTimeout(() => { |
| | | loading.close(); |
| | | }, 2000); |
| | | |
| | | this.PathString=this.$route.query.empCode; |
| | | this.$store.dispatch("LoginBySso", { PathString: this.PathString }).then((res) => { |
| | | console.log('res', res) |
| | | this.$router.push({ path: this.tagWel.value }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | }, |
| | | handleLogin: function () { |
| | | debugger |
| | | this.userInfo = this.$store.state.upadatastatus |
| | | localStorage.setItem('username', this.loginForm.username) |
| | | this.$refs.loginForm.validate(valid => { |
| | |
| | | import {deepClone} from '@/util/util' |
| | | import website from '@/config/website' |
| | | import {loginByUsername, loginBySocial, loginBySso, getUserInfo, logout, refreshToken, getButtons} from '@/api/user' |
| | | import {oaSsos} from "@/api/system/user.js" |
| | | import {ssoLogin} from "@/api/system/user.js" |
| | | import {getTopMenu, getRoutes} from '@/api/system/menu' |
| | | import md5 from 'js-md5' |
| | | |
| | |
| | | }) |
| | | }, |
| | | //根据单点信息登录 |
| | | LoginBySso({commit}) { |
| | | LoginBySso({commit},{PathString}) { |
| | | return new Promise((resolve) => { |
| | | oaSsos().then(res => { |
| | | ssoLogin(PathString).then(res => { |
| | | const data = res.data; |
| | | if (data.error_description) { |
| | | Message({ |
| | |
| | | prop: 'interfaceStatus', |
| | | value:7 |
| | | }, |
| | | { |
| | | label: '标准申请', |
| | | prop: 'applyCodeForBZ', |
| | | value:8 }, |
| | | { |
| | | label: '部门申请', |
| | | prop: 'syncDataForOrg', |
| | | value:9 |
| | | }, |
| | | { |
| | | label: '人员申请', |
| | | prop: 'syncDataForPerson', |
| | | value:10 |
| | | }, |
| | | ], |
| | | }, |
| | | loading: false, |
| | |
| | | calcHeight: 0, |
| | | tip: false, |
| | | searchShow: false, |
| | | // searchMenuSpan: 12, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | sortable:true, |
| | | overHidden: true, |
| | | width: 140 |
| | | }, |
| | | { |
| | | label: '标准申请', |
| | | prop: 'applyCodeForBZ', |
| | | sortable:true, |
| | | width: 130 |
| | | }, |
| | | { |
| | | label: '部门申请', |
| | | prop: 'syncDataForOrg', |
| | | sortable:true, |
| | | width: 130 |
| | | }, |
| | | { |
| | | label: '人员申请', |
| | | prop: 'syncDataForPerson', |
| | | sortable:true, |
| | | width: 130 |
| | | }, |
| | | { |
| | | label: '集成系统编号', |
| | |
| | | value: "key" |
| | | }, |
| | | formatter : function (row, column) { |
| | | return row.interfaceStatus == 'true' || row.interfaceStatus == '' ? '<i class="el-icon-check" style="color: limegreen;font-size: 20px;font-weight: 800"></i>' : '<i class="el-icon-close" style="color: red;font-size: 20px;font-weight: 800"></i>' |
| | | return row.interfaceStatus == 'true' || row.interfaceStatus == '' ? '<i class="el-icon-check" style="color: #32cd32;font-size: 20px;font-weight: 800"></i>' : '<i class="el-icon-close" style="color: #ff0000;font-size: 20px;font-weight: 800"></i>' |
| | | } |
| | | }, |
| | | ] |
| | |
| | | |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog :visible.sync="dialogVisible" append-to-body class="avue-dialog avue-dialog--top" title="分类授权" top="-50px"> |
| | | <el-dialog :visible.sync="dialogVisible" append-to-body class="avue-dialog avue-dialog--top" title="分类授权" |
| | | top="-50px"> |
| | | |
| | | <el-row> |
| | | <el-col :span="10"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <div slot="footer" class="dialog-footer" style="height: 50px;line-height: 50px"> |
| | | <el-button type="primary" icon="el-icon-plus" size="small" @click="empower">授 权</el-button> |
| | | <el-button icon="el-icon-close" size="small" type="danger">重 置</el-button> |
| | | </div> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="empower">授 权</el-button> |
| | | <el-button icon="el-icon-close" size="small" type="danger">重 置</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import {getSysInfoList, sysInfoAdd, sysInfoEdit, sysInfoDel, sysInfoTree,batchAddSave} from '@/api/integration/sysInfo.js' |
| | | import { |
| | | getSysInfoList, |
| | | sysInfoAdd, |
| | | sysInfoEdit, |
| | | sysInfoDel, |
| | | sysInfoTree, |
| | | batchAddSave |
| | | } from '@/api/integration/sysInfo.js' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | checkAll:[], |
| | | checkAll: {}, |
| | | ParentList: [], |
| | | ParentRemoveList:[], |
| | | //避免缓存 |
| | | reload: Math.random(), |
| | | TreeLoading: false, |
| | |
| | | }, |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | empower(){ |
| | | batchAddSave({systemOid: this.checkAll.oid, systemId: this.checkAll.id}).then(res=>{ |
| | | empower() { |
| | | batchAddSave(this.checkAll.oid, this.checkAll.id, this.ParentList).then(res => { |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | //分类授权多选回调 |
| | | checkChange(row,checked) { |
| | | if(checked){ |
| | | // console.log('row',row) |
| | | this.checkAll.push(row); |
| | | console.log('checkAll',this.checkAll) |
| | | checkChange(row, checked) { |
| | | if (checked) { |
| | | if (!row.parentId && row.children) { |
| | | const parentRecord = { |
| | | oid: row.oid, |
| | | classifyId: row.attributes.classifyId, |
| | | classifyOid: row.attributes.classifyOid, |
| | | classParentOid: row.parentId, |
| | | }; |
| | | this.ParentList.push(parentRecord); |
| | | // 如果row的children不为空,继续循环children中的每个对象 |
| | | if (row.children && row.children.length > 0) { |
| | | for (let child of row.children) { |
| | | const childRecord = { |
| | | oid: child.oid, |
| | | classifyId: child.attributes.classifyId, |
| | | classifyOid: child.attributes.classifyOid, |
| | | classParentOid: child.parentId, |
| | | }; |
| | | this.ParentList.push(childRecord); |
| | | // 如果子对象的children不为空,继续循环获取数据 |
| | | if (child.children && child.children.length > 0) { |
| | | for (let subChild of child.children) { |
| | | const subRecord = { |
| | | oid: subChild.oid, |
| | | classifyId: subChild.attributes.classifyId, |
| | | classifyOid: subChild.attributes.classifyOid, |
| | | classParentOid: subChild.parentId, |
| | | }; |
| | | this.ParentList.push(subRecord); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | console.log(this.ParentList); |
| | | } |
| | | } else { |
| | | if (!row.parentId && row.children) { |
| | | this.ParentRemoveList = this.ParentList.filter(record => record.oid !== row.oid); |
| | | |
| | | if (row.children && row.children.length > 0) { |
| | | for (let child of row.children) { |
| | | this.ParentRemoveList = this.ParentList.filter(record => record.oid !== child.oid); |
| | | |
| | | if (child.children && child.children.length > 0) { |
| | | for (let subChild of child.children) { |
| | | this.ParentRemoveList = this.ParentList.filter(record => record.oid !== subChild.oid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | console.log(this.ParentRemoveList) |
| | | } |
| | | }, |
| | | //分类授权 |
| | | classifyHandler(row) { |
| | | this.loading = true; |
| | | this.checkAll = row |
| | | sysInfoTree({systemOid: row.oid, systemId: row.id}).then(res => { |
| | | this.TreeData = res.data; |
| | | this.ModifyProperties(this.TreeData, 'text', 'label'); |
| | |
| | | }, |
| | | // enter搜索 |
| | | handleEnter() { |
| | | this.getDataList() |
| | | this.getDataList() |
| | | }, |
| | | // 输入框清空 |
| | | handleClear() { |
| | |
| | | @XStreamAsAttribute |
| | | private String editor; |
| | | |
| | | /*** |
| | | * 是否修订 |
| | | */ |
| | | private boolean amendmentFlag; |
| | | /*** |
| | | *是否是系列标准 |
| | | */ |
| | | private boolean seriesStandardFlag; |
| | | /** |
| | | * 是否继续编号 |
| | | */ |
| | | private boolean continueNumberFlag; |
| | | /*** |
| | | * 年代号 |
| | | */ |
| | | private String yearNumber; |
| | | |
| | | /*** |
| | | * 数据属性对象 |
| | | */ |
| | |
| | | public void setProp(List<ProppertyVO> prop) { |
| | | this.prop = prop; |
| | | } |
| | | |
| | | public boolean isAmendmentFlag() { |
| | | return amendmentFlag; |
| | | } |
| | | |
| | | public void setAmendmentFlag(boolean amendmentFlag) { |
| | | this.amendmentFlag = amendmentFlag; |
| | | } |
| | | |
| | | public boolean isSeriesStandardFlag() { |
| | | return seriesStandardFlag; |
| | | } |
| | | |
| | | public void setSeriesStandardFlag(boolean seriesStandardFlag) { |
| | | this.seriesStandardFlag = seriesStandardFlag; |
| | | } |
| | | |
| | | public boolean isContinueNumberFlag() { |
| | | return continueNumberFlag; |
| | | } |
| | | |
| | | public void setContinueNumberFlag(boolean continueNumberFlag) { |
| | | this.continueNumberFlag = continueNumberFlag; |
| | | } |
| | | |
| | | public String getYearNumber() { |
| | | return yearNumber; |
| | | } |
| | | |
| | | public void setYearNumber(String yearNumber) { |
| | | this.yearNumber = yearNumber; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ApplyDataVO{" + |
| | |
| | | */ |
| | | @XStreamImplicit |
| | | private List<ProppertyVO> prop; |
| | | /*** |
| | | * 是否修订 |
| | | */ |
| | | private boolean amendmentFlag; |
| | | /*** |
| | | *是否是系列标准 |
| | | */ |
| | | private boolean seriesStandardFlag; |
| | | /** |
| | | * 是否继续编号 |
| | | */ |
| | | private boolean continueNumberFlag; |
| | | /*** |
| | | * 年代号 |
| | | */ |
| | | private String yearNumber; |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getCreator() { |
| | | return creator; |
| | | } |
| | | |
| | | public void setCreator(String creator) { |
| | | this.creator = creator; |
| | | } |
| | | |
| | | public String getEditor() { |
| | | return editor; |
| | | } |
| | | |
| | | public void setEditor(String editor) { |
| | | this.editor = editor; |
| | | } |
| | | |
| | | public List<ProppertyVO> getProp() { |
| | | return prop; |
| | | } |
| | | |
| | | public void setProp(List<ProppertyVO> prop) { |
| | | this.prop = prop; |
| | | } |
| | | |
| | | public boolean isAmendmentFlag() { |
| | | return amendmentFlag; |
| | | } |
| | | |
| | | public void setAmendmentFlag(boolean amendmentFlag) { |
| | | this.amendmentFlag = amendmentFlag; |
| | | } |
| | | |
| | | public boolean isSeriesStandardFlag() { |
| | | return seriesStandardFlag; |
| | | } |
| | | |
| | | public void setSeriesStandardFlag(boolean seriesStandardFlag) { |
| | | this.seriesStandardFlag = seriesStandardFlag; |
| | | } |
| | | |
| | | public boolean isContinueNumberFlag() { |
| | | return continueNumberFlag; |
| | | } |
| | | |
| | | public void setContinueNumberFlag(boolean continueNumberFlag) { |
| | | this.continueNumberFlag = continueNumberFlag; |
| | | } |
| | | |
| | | public String getYearNumber() { |
| | | return yearNumber; |
| | | } |
| | | |
| | | public void setYearNumber(String yearNumber) { |
| | | this.yearNumber = yearNumber; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ApplyBZDataVO{" + |
| | | "id='" + id + '\'' + |
| | | ", code='" + code + '\'' + |
| | | ", status='" + status + '\'' + |
| | | ", creator='" + creator + '\'' + |
| | | ", editor='" + editor + '\'' + |
| | | ", prop=" + prop + |
| | | ", amendmentFlag=" + amendmentFlag + |
| | | ", seriesStandardFlag=" + seriesStandardFlag + |
| | | ", continueNumberFlag=" + continueNumberFlag + |
| | | ", yearNumber='" + yearNumber + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.thoughtworks.xstream.annotations.XStreamAlias; |
| | | import com.thoughtworks.xstream.annotations.XStreamAsAttribute; |
| | | import com.vci.ubcs.code.vo.webserviceModel.apply.ClassfyVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.apply.UserVO; |
| | | |
| | | /** |
| | | *数据信息 |
| | | */ |
| | |
| | | /** |
| | | * 数据集合 |
| | | */ |
| | | private ApplyDatasVO objects; |
| | | private ApplyBZDatasVO objects; |
| | | |
| | | public String getClassCode() { |
| | | return classCode; |
| | |
| | | this.fullclsfNamePath = fullclsfNamePath; |
| | | } |
| | | |
| | | public ApplyDatasVO getObjects() { |
| | | public ApplyBZDatasVO getObjects() { |
| | | return objects; |
| | | } |
| | | |
| | | public void setObjects(ApplyDatasVO objects) { |
| | | public void setObjects(ApplyBZDatasVO objects) { |
| | | this.objects = objects; |
| | | } |
| | | |
| | |
| | | { |
| | | "data":{ |
| | | "systemId": "MPM", |
| | | "systemId": "PDM", |
| | | "user": { |
| | | "userName": "weidy", |
| | | "trueName": "魏大勇", |
| | |
| | | "library": { |
| | | "id": "wupin", |
| | | "classifyid":[ |
| | | "020201", |
| | | "020202" |
| | | "020201" |
| | | ] |
| | | } |
| | | } |
| | |
| | | { |
| | | "data": { |
| | | "classifys": { |
| | | "classfy": [ |
| | | "classify": [ |
| | | { |
| | | "fullclsfNamePath": "物品##VCI##标准件##VCI##螺栓", |
| | | "classCode": "020101", |
| | |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return R.success("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 接口程序授权管理中分类授权功能 |
| | | * @param list 授权选中的数据 |
| | | * @param systemOid 系统的oid |
| | | * @param systemId 系统的id |
| | | * @return |
| | | */ |
| | | @PostMapping( "/batchAddSave") |
| | | public R batchAddSave(@RequestBody List<SystemClassifyRole> list,String systemOid,String systemId){ |
| | | return codeApplyWebManagementService.batchAddSave(list,systemOid,systemId); |
| | | // return R.success("dddd"); |
| | | } |
| | | |
| | | /** |
| | | * 编码分类树查询接口 |
| | | * @param systemOid 系统的oid |
| | | * @param systemId 系统的id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getSystemClassifyRoleTree") |
| | | public List<Tree> getSystemClassifyRoleTree(String systemOid,String systemId){ |
| | | return codeApplyWebManagementService.getSystemClassifyRoleTree(systemOid,systemId); |
| | | } |
| | | |
| | | /** |
| | | * 标准请码界面,授权了的才能查询到,编码分类树查询接口 |
| | | * @param paramMap systemOid系统的oid,systemId系统的id,library编码分类编号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAuthTree") |
| | | public List<Tree> getAuthTree(@RequestParam HashMap<String,String> paramMap){ |
| | | return codeApplyWebManagementService.getAuthTree(paramMap); |
| | | } |
| | | } |
| | |
| | | /*** |
| | | * 数据查询 |
| | | */ |
| | | TYPE_ACCPET_QUERYDATA("queryData","数据查询"); |
| | | TYPE_ACCPET_QUERYDATA("queryData","数据查询"), |
| | | |
| | | /*** |
| | | * 标准申请 |
| | | */ |
| | | TYPE_ACCPET_APPLYCODEFORBZ("applyCodeForBZ","标准申请"), |
| | | |
| | | /*** |
| | | * 部门申请 |
| | | */ |
| | | TYPE_ACCPET_SYNCDATAFORORG("syncDataForOrg","部门申请"), |
| | | |
| | | |
| | | /*** |
| | | * 人员申请 |
| | | */ |
| | | TYPE_ACCPET_SYNCDATAFORPERSON("syncDataForPerson","人员申请"); |
| | | |
| | | /** |
| | | * 枚举的值 |
| | |
| | | package com.vci.ubcs.code.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.SystemClassifyRole; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface SystemClassifyRoleMapper extends BaseMapper<SystemClassifyRole> { |
| | | public List<SystemClassifyRole> getListSystemClassifyRole(String systemOid, String systemId); |
| | | |
| | | public List<CodeClassify> getListClassifyRole(String systemOid, String systemId,String library); |
| | | } |
| | |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | public interface ICodeApplyWebManagementService extends IService<SystemClassifyRole> { |
| | | R batchAddSave(List<SystemClassifyRole> list,String systemOid,String systemId); |
| | | |
| | | List<Tree> getSystemClassifyRoleTree(String systemOid, String systemId); |
| | | |
| | | List<Tree> getAuthTree(HashMap<String, String> paramMap); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.SystemClassifyRole; |
| | | import com.vci.ubcs.code.enumpack.FrameworkDataLCStatus; |
| | | import com.vci.ubcs.code.mapper.SystemClassifyRoleMapper; |
| | |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import jodd.util.StringUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | */ |
| | | @Resource |
| | | private RevisionModelUtil revisionModelUtil; |
| | | @Resource |
| | | private CodeClassifyServiceImpl classifyService; |
| | | |
| | | |
| | | @Override |
| | |
| | | }); |
| | | return tree; |
| | | } |
| | | |
| | | @Override |
| | | public List<Tree> getAuthTree(HashMap<String, String> paramMap) { |
| | | //查询已经授权了的分类 |
| | | List<CodeClassify> listClassifyRole = baseMapper.getListClassifyRole(paramMap.get("systemOid"), paramMap.get("systemId"), paramMap.get("library")); |
| | | if(listClassifyRole.size() == 0){ |
| | | throw new ServiceException("还未授权,请联系编码资源管理系统管理员授权!"); |
| | | } |
| | | List<CodeClassifyVO> voList = classifyService.codeClassifyDO2VOs(listClassifyRole); |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(classifyService.PARENT_FIELD_NAME); |
| | | //转换成树形结构 |
| | | List<Tree> tree= revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyVO s) ->{ |
| | | //可以在这里处理树节点的显示 |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" 【停用】 ") : ""); |
| | | }); |
| | | return tree; |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.code.util.ClientBusinessObject; |
| | | import com.vci.ubcs.code.util.gennerAttrMapUtil; |
| | | import com.vci.ubcs.code.vo.pagemodel.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.applybz.ApplyBZParamVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.applybz.ApplyBZVO; |
| | | import com.vci.ubcs.code.vo.webserviceModel.applybz.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.person.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.apply.*; |
| | | import com.vci.ubcs.code.vo.webserviceModel.attrmap.*; |
| | |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | import com.vci.ubcs.system.vo.RoleVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.tools.ant.taskdefs.condition.Http; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.jws.WebMethod; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.ws.rs.core.Context; |
| | | import javax.xml.ws.WebServiceContext; |
| | | import javax.xml.ws.handler.MessageContext; |
| | | import java.util.*; |
| | |
| | | return resultStr; |
| | | } |
| | | |
| | | /*** |
| | | * 标准化生成接口 |
| | | * @param data 数据信息 |
| | | * @param dataType 数据格式类型 |
| | | * @return |
| | | */ |
| | | public String applyCodeForBZ(String data,String dataType){ |
| | | String resultStr = ""; |
| | | // log.info("方法->applyCodeForBZ start"); |
| | | // |
| | | // final String[] errorid = {"0"}; |
| | | // msg="成功"; |
| | | // objerrorCode="0"; |
| | | // objerrorMsg="成功"; |
| | | // log.info("申请编码的数据参数:->"+data); |
| | | // log.info("申请编码的数据类型:->"+dataType); |
| | | // String systemId=""; |
| | | // List<XMLResultClassfyVO> resultClassfyVOList = new ArrayList<>(); |
| | | // LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>(); |
| | | // try{ |
| | | // try { |
| | | // if(StringUtils.isBlank(data)) { |
| | | // errorid[0] ="101"; |
| | | // throw new Throwable("接口参数:传递为空"); |
| | | // } |
| | | // ApplyBZParamVO applyBZParamVO =new ApplyBZParamVO(); |
| | | // //如果dataType是xml则,通过xml序列化成对象形式,如果是json则通过json转换成对象格式 |
| | | // try { |
| | | // if ("xml".equals(dataType)) { |
| | | // XStream xStream = new XStream(new DomDriver()); |
| | | // xStream.processAnnotations(RootDataVO.class); |
| | | // xStream.autodetectAnnotations(true); |
| | | // ApplyBZVO rootDataVO = (ApplyBZVO) xStream.fromXML(data); |
| | | // applyBZParamVO.setData(rootDataVO); |
| | | // } else { |
| | | // applyBZParamVO = JSONObject.toJavaObject(JSONObject.parseObject(data), ApplyBZParamVO.class); |
| | | // } |
| | | // }catch (Throwable e){ |
| | | // errorid[0] ="101"; |
| | | // throw new Throwable("接口参数:传入数据参数解析失败"); |
| | | // } |
| | | // ClassfysVO classfysVO = interParameterVO.getData().getClassifys(); |
| | | // systemId = interParameterVO.getData().getSystemId(); |
| | | // UserVO userVo = interParameterVO.getData().getUser(); |
| | | // //免密登录申请token,request中添加用户信息 |
| | | // passwordFreeLoginService.passwordFreeLogin(userVo.getUserName(),this.getRequest()); |
| | | // AuthUtil.getUser(); |
| | | // List<ClassfyVO> classVOList = classfysVO.getClassify(); |
| | | // InterParameterVO finalInterParameterVO = interParameterVO; |
| | | // //这是账号信息 |
| | | // SessionInfo sessionInfo = new SessionInfo(); |
| | | // sessionInfo.setUserId(userVo.getUserName()); |
| | | // sessionInfo.setUserName(userVo.getTrueName()); |
| | | // sessionInfo.setIp(userVo.getIp()); |
| | | // VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | //// List<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new ArrayList<>(); |
| | | // String finalSystemId = systemId; |
| | | // } catch (Throwable e) { |
| | | // List<ApplyDataVO> applyDataVOList= classVO.getObjects().getObject(); |
| | | // objerrorCode="1"; |
| | | // if(!CollectionUtils.isEmpty(applyDataVOList)) { |
| | | // applyDataVOList.stream().forEach(applyDataVO -> { |
| | | // XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | // xmlResultDataObjectDetailDO.setCode(""); |
| | | // xmlResultDataObjectDetailDO.setId(applyDataVO.getId()); |
| | | // xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | // xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | // resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | // }); |
| | | // }else{ |
| | | // XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | // xmlResultDataObjectDetailDO.setCode(""); |
| | | // xmlResultDataObjectDetailDO.setId(""); |
| | | // xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | // xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | // resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | // } |
| | | // e.printStackTrace(); |
| | | // }finally { |
| | | // XMLResultClassfyVO resultClassfyVO = new XMLResultClassfyVO(); |
| | | // resultClassfyVO.setClassCode(classVO.getClassCode()); |
| | | // resultClassfyVO.setLibrary(classVO.getLibrary()); |
| | | // resultClassfyVO.setFullclsfNamePath(classVO.getFullclsfNamePath()); |
| | | // resultClassfyVO.setObjects(resultDataObjectDetailDOs); |
| | | // resultClassfyVOList.add(resultClassfyVO); |
| | | // } |
| | | // XMLResultSystemVO xmlResultSystemVO=new XMLResultSystemVO(); |
| | | // xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // xmlResultSystemVO.setMsg(msg); |
| | | // xmlResultSystemVO.setErrorid(errorid[0]); |
| | | // resultStr= transferResultXMl(xmlResultSystemVO,dataType); |
| | | // }catch (Throwable e){ |
| | | // e.printStackTrace(); |
| | | // msg="申请编码失败:"+e.getMessage(); |
| | | // /* XMLResultSystemVO XMLResultSystemVO=new XMLResultSystemVO(); |
| | | // XMLResultSystemVO.setErrorid(errorid); |
| | | // XMLResultSystemVO.setMsg("申请编码失败:->"+e.getMessage()); |
| | | // XMLResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // resultStr=transferResultXMl(XMLResultSystemVO,dataType); |
| | | // |
| | | // log.error("申请编码失败:->"+e); |
| | | // return resultStr;*/ |
| | | // }finally { |
| | | // XMLResultSystemVO xmlResultSystemVO=new XMLResultSystemVO(); |
| | | // xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | // xmlResultSystemVO.setMsg(msg); |
| | | // xmlResultSystemVO.setErrorid(errorid[0]); |
| | | // resultStr= transferResultXMl(xmlResultSystemVO,dataType); |
| | | // final boolean[] issucess = {true}; |
| | | // if(!errorid[0].equals("0")) { |
| | | // issucess[0] = false; |
| | | // }else { |
| | | // if(!CollectionUtils.isEmpty(resultClassfyVOList)) { |
| | | // resultClassfyVOList.stream().forEach(xMLResultClassfyVO -> { |
| | | // xMLResultClassfyVO.getObjects().stream().forEach(objec -> { |
| | | // if (!(objec.getErrorid().equals("0") || objec.getErrorid().equals("204"))) { |
| | | // issucess[0] = false; |
| | | // msg=objec.getMsg(); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // } |
| | | // } |
| | | // try { |
| | | // //记录日志 |
| | | // this.saveLogs(systemId, systemId, data, resultStr, issucess[0], msg, "applyCodeForBZ"); |
| | | // }catch (Throwable e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // log.info("返回参数:"+resultStr); |
| | | log.info("方法->applyCodeForBZ start"); |
| | | final String[] errorid = {"0"}; |
| | | msg="成功"; |
| | | objerrorCode="0"; |
| | | objerrorMsg="成功"; |
| | | log.info("申请编码的数据参数:->"+data); |
| | | log.info("申请编码的数据类型:->"+dataType); |
| | | String systemId=""; |
| | | List<XMLResultClassfyVO> resultClassfyVOList = new ArrayList<>(); |
| | | LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>(); |
| | | try { |
| | | ClassfyBZVO classfyBZVO = null; |
| | | if (StringUtils.isBlank(data)) { |
| | | errorid[0] = "101"; |
| | | throw new Throwable("接口参数:dataString 传递为空"); |
| | | } |
| | | ApplyBZParamVO applyBZParamVO = new ApplyBZParamVO(); |
| | | //如果dataType是xml则,通过xml序列化成对象形式,如果是json则通过json转换成对象格式 |
| | | try { |
| | | if ("xml".equals(dataType)) { |
| | | XStream xStream = new XStream(new DomDriver()); |
| | | xStream.processAnnotations(RootDataVO.class); |
| | | xStream.autodetectAnnotations(true); |
| | | ApplyBZVO rootDataVO = (ApplyBZVO) xStream.fromXML(data); |
| | | applyBZParamVO.setData(rootDataVO); |
| | | } else { |
| | | applyBZParamVO = JSONObject.toJavaObject(JSONObject.parseObject(data), ApplyBZParamVO.class); |
| | | } |
| | | } catch (Throwable e) { |
| | | errorid[0] = "101"; |
| | | throw new Throwable("接口参数:传入数据参数解析失败"); |
| | | } |
| | | classfyBZVO = applyBZParamVO.getData().getClassify(); |
| | | systemId = applyBZParamVO.getData().getSystemId(); |
| | | UserVO userVo = applyBZParamVO.getData().getUser(); |
| | | //免密登录申请token,request中添加用户信息 |
| | | passwordFreeLoginService.pwdFreeLoginByBoolean(userVo.getUserName(), this.getRequest()); |
| | | AuthUtil.getUser(); |
| | | //这是账号信息 |
| | | SessionInfo sessionInfo = new SessionInfo(); |
| | | sessionInfo.setUserId(userVo.getUserName()); |
| | | sessionInfo.setUserName(userVo.getTrueName()); |
| | | sessionInfo.setIp(userVo.getIp()); |
| | | VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); |
| | | // List<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new ArrayList<>(); |
| | | String finalSystemId = systemId; |
| | | String libray=""; |
| | | boolean isCodeOrGroupCode=false; |
| | | try { |
| | | libray = classfyBZVO.getLibrary(); |
| | | CodeClassifyVO codeClassifyVO = getClassfy(classfyBZVO,libray); |
| | | log.info("end:分类查询完毕"); |
| | | //获取分类模板信息 |
| | | if(codeClassifyVO==null || StringUtils.isBlank(codeClassifyVO.getOid())){ |
| | | objerrorCode="100"; |
| | | throw new Throwable ("根据传输的分类,未获取到分类信息"); |
| | | } |
| | | String operation=""; |
| | | if(CODE_CHECKCONFIG) { |
| | | //校验是否配置 |
| | | DockingSystemConfig dockingSystemConfig=null; |
| | | dockingSystemConfig=checkIspass(finalSystemId, SysIntegrationDataFlowTypeEnum.ACCEPT.getValue(), sysIntegrationPushTypeEnum.ACCPET_APPCODE.getValue(),codeClassifyVO.getOid()); |
| | | if(dockingSystemConfig==null){ |
| | | errorid[0] ="101"; |
| | | throw new Throwable("系统标识为【"+ finalSystemId +"】,集成分类为【"+codeClassifyVO.getName()+"】以上分类,"+sysIntegrationPushTypeEnum.ACCPET_APPCODE.getText()+"接口配置已停用或者未配置,请联系编码管理员!"); |
| | | } |
| | | isCodeOrGroupCode="true".equals(dockingSystemConfig.getIsGroupCodeFlag())?true:false; |
| | | } |
| | | CodeClassifyTemplateVO templateVO = engineService.getUsedTemplateByClassifyOid(codeClassifyVO.getOid()); |
| | | if(templateVO==null||StringUtils.isBlank(templateVO.getOid())){ |
| | | objerrorCode="1"; |
| | | throw new Throwable ("根据传输的分类,未获取MDM系统中对应模板"); |
| | | } |
| | | log.info("end:模板查询完毕"); |
| | | ApplyBZDatasVO applyDatasVO = classfyBZVO.getObjects(); |
| | | DataObjectVO dataObjectVO = new DataObjectVO(); |
| | | List<CodeClassifyTemplateAttrVO> attrVOS = templateVO.getAttributes().stream().filter(s -> !DEFAULT_SYNC_ATTR_LIST.contains(s.getId()) && VciBaseUtil.getBoolean(s.getFormDisplayFlag()) |
| | | ).collect(Collectors.toList()); |
| | | //this.getConfigDatas(finalSystemId, libray, applyDatasVO, attrVOS, dataObjectVO); |
| | | log.info("end:数据组织完毕"); |
| | | //规则的主键需要去获取 |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyVO.getOid()); |
| | | if(classifyFullInfo==null ||classifyFullInfo.getCurrentClassifyVO()==null || StringUtils.isBlank(classifyFullInfo.getCurrentClassifyVO().getOid())){ |
| | | objerrorCode="1"; |
| | | log.info("classifyFullInfo:"+"根据传输的分类,未获取分类相关信息"); |
| | | throw new Throwable ("根据传输的分类,未获取分类相关信息"); |
| | | } |
| | | CodeRuleVO ruleVO = engineService.getCodeRuleByClassifyFullInfo(classifyFullInfo); |
| | | if(ruleVO==null||StringUtils.isBlank(ruleVO.getOid())){ |
| | | objerrorCode="102"; |
| | | throw new Throwable ("根据传输的分类,未获取MDM系统中对应规则"); |
| | | } |
| | | log.info("end:规则获取完毕"); |
| | | //List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(ruleVO,classifyFullInfo); |
| | | log.info("end:码段获取完毕"); |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | | orderDTO.setCodeClassifyOid(codeClassifyVO.getOid());//分类主键 |
| | | //orderDTO.setSecDTOList(codeOrderSecDTOList);//分类码段 |
| | | mdmIOService.batchSyncApplyCode(orderDTO, dataObjectVO, resultDataObjectDetailDOs,isCodeOrGroupCode); |
| | | //allResultDataObjectDetailDOS.add(resultDataObjectDetailDOs); |
| | | log.info("end:申请获取完毕"); |
| | | } catch (Throwable e) { |
| | | List<ApplyBZDataVO> applyDataVOList = classfyBZVO.getObjects().getObject(); |
| | | objerrorCode = "1"; |
| | | if (!CollectionUtils.isEmpty(applyDataVOList)) { |
| | | applyDataVOList.stream().forEach(applyDataVO -> { |
| | | XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | xmlResultDataObjectDetailDO.setCode(""); |
| | | xmlResultDataObjectDetailDO.setId(applyDataVO.getId()); |
| | | xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | }); |
| | | } else { |
| | | XMLResultDataObjectDetailDO xmlResultDataObjectDetailDO = new XMLResultDataObjectDetailDO(); |
| | | xmlResultDataObjectDetailDO.setCode(""); |
| | | xmlResultDataObjectDetailDO.setId(""); |
| | | xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | xmlResultDataObjectDetailDO.setMsg("编码申请失败:" + e.getMessage()); |
| | | resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | } |
| | | e.printStackTrace(); |
| | | } finally { |
| | | XMLResultClassfyVO resultClassfyVO = new XMLResultClassfyVO(); |
| | | resultClassfyVO.setClassCode(classfyBZVO.getClassCode()); |
| | | resultClassfyVO.setLibrary(classfyBZVO.getLibrary()); |
| | | resultClassfyVO.setFullclsfNamePath(classfyBZVO.getFullclsfNamePath()); |
| | | resultClassfyVO.setObjects(resultDataObjectDetailDOs); |
| | | resultClassfyVOList.add(resultClassfyVO); |
| | | } |
| | | XMLResultSystemVO xmlResultSystemVO = new XMLResultSystemVO(); |
| | | xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | xmlResultSystemVO.setMsg(msg); |
| | | xmlResultSystemVO.setErrorid(errorid[0]); |
| | | resultStr = transferResultXMl(xmlResultSystemVO, dataType); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | msg="申请编码失败:"+e.getMessage(); |
| | | }finally { |
| | | XMLResultSystemVO xmlResultSystemVO=new XMLResultSystemVO(); |
| | | xmlResultSystemVO.setClassifys(resultClassfyVOList); |
| | | xmlResultSystemVO.setMsg(msg); |
| | | xmlResultSystemVO.setErrorid(errorid[0]); |
| | | resultStr= transferResultXMl(xmlResultSystemVO,dataType); |
| | | final boolean[] issucess = {true}; |
| | | if(!errorid[0].equals("0")) { |
| | | issucess[0] = false; |
| | | }else { |
| | | if(!CollectionUtils.isEmpty(resultClassfyVOList)) { |
| | | resultClassfyVOList.stream().forEach(xMLResultClassfyVO -> { |
| | | xMLResultClassfyVO.getObjects().stream().forEach(objec -> { |
| | | if (!(objec.getErrorid().equals("0") || objec.getErrorid().equals("204"))) { |
| | | issucess[0] = false; |
| | | msg=objec.getMsg(); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | try { |
| | | //记录日志 |
| | | this.saveLogs(systemId, systemId, data, resultStr, issucess[0], msg, "applyCodeForBZ"); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | log.info("返回参数:"+resultStr); |
| | | //调用集团申请接口申请集团码 |
| | | return resultStr; |
| | | } |
| | |
| | | * @param classfyVO |
| | | */ |
| | | private CodeClassifyVO getClassfy(ClassfyVO classfyVO,String libray) throws Throwable{ |
| | | CodeClassifyVO classifyVO = new CodeClassifyVO(); |
| | | try { |
| | | String classCode = classfyVO.getClassCode(); |
| | | String className = classfyVO.getFullclsfNamePath(); |
| | | //根据分类代号查询分类信息 |
| | | if (StringUtils.isNotBlank(classfyVO.getClassCode())) { |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | List<CodeClassify> codeClassifyList = classifyService.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getId, classCode)); |
| | | final CodeClassify[] newCodeClassify = {new CodeClassify()}; |
| | | if (!CollectionUtils.isEmpty(codeClassifyList)) { |
| | | codeClassifyList.stream().forEach(codeClassify -> { |
| | | CodeClassifyVO codeClassifyVO= classifyService.getTopClassifyVO(codeClassify.getOid()); |
| | | if(codeClassifyVO.getId().equals(libray)){ |
| | | newCodeClassify[0] =codeClassify; |
| | | } |
| | | }); |
| | | classifyVO = new CodeClassifyVO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(newCodeClassify[0], classifyVO); |
| | | //将DTO转换为DO |
| | | if(StringUtils.isBlank(classifyVO.getOid())){ |
| | | throw new Throwable("申请编码的分类:【"+classCode+"】不属于库节点【"+libray+"】,请检查参数分类节点/库节点信息是否匹配"); |
| | | } |
| | | }else{ |
| | | throw new Throwable("根据分类代号未查询到相应的分类信息"); |
| | | } |
| | | } else { |
| | | classifyVO = classifyService.getObjectByClsfNamePath(className.replace(separator, "/")); |
| | | if(StringUtils.isBlank(classifyVO.getOid())){ |
| | | throw new Throwable("根据分类名称路径未查询到相应的分类信息"); |
| | | } |
| | | } |
| | | }catch (Throwable e){ |
| | | objerrorCode="100"; |
| | | throw new Throwable("获取分类信息失败:"+e.getMessage()); |
| | | } |
| | | return classifyVO; |
| | | } |
| | | /*** |
| | | * 查询校验分类信息 |
| | | * @param classfyVO |
| | | */ |
| | | private CodeClassifyVO getClassfy(ClassfyBZVO classfyVO,String libray) throws Throwable{ |
| | | CodeClassifyVO classifyVO = new CodeClassifyVO(); |
| | | try { |
| | | String classCode = classfyVO.getClassCode(); |
| | |
| | | }); |
| | | return clientBusinessObjectList; |
| | | } |
| | | |
| | | |
| | | private List<CodeOrderSecDTO> getRuleCodeOrderSecDTOsBZ(CodeRuleVO ruleVO,CodeClassifyFullInfoBO classifyFullInfo){ |
| | | List<CodeBasicSecVO> codeBasicSecVOS= ruleVO.getSecVOList(); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList=new ArrayList<>(); |
| | | Map<String,String> errorMap=new HashMap<>(); |
| | | for(CodeBasicSecVO codeBasicSecVO: codeBasicSecVOS) { |
| | | String sectype = codeBasicSecVO.getSecType(); |
| | | String classifySecOid= codeBasicSecVO.getOid(); |
| | | String message=""; |
| | | } |
| | | return codeOrderSecDTOList; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * 根据穿入的参数信息校验码段规则 |
| | | */ |
| | |
| | | SectionVOList.stream().forEach(SectionVO->{ |
| | | sectionVOMap.put(SectionVO.getName(),SectionVO.getValue()); |
| | | }); |
| | | Map<String,CodeClassifyVO> codeClassifyVOMap= classifyFullInfo.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getId(), t -> t,(o1, o2)->o2)); |
| | | //Map<String,CodeClassifyVO> codeClassifyVOMap= classifyFullInfo.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getId(), t -> t,(o1, o2)->o2)); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList=new ArrayList<>(); |
| | | Map<String,String> errorMap=new HashMap<>(); |
| | | for(CodeBasicSecVO codeBasicSecVO: codeBasicSecVOS) { |
| | |
| | | pc.SYSTEMID, |
| | | p.oid CLASSIFYOID, |
| | | p.id CLASSIFYID, |
| | | case when pc.selected is null then false else pc.SELECTED end SELECTED, |
| | | case when pc.selected is null then false when pc.selected = 0 then false else pc.SELECTED end SELECTED, |
| | | p.PARENTCODECLASSIFYOID CLASSPARENTOID |
| | | from PL_CODE_CLASSIFY p , |
| | | PL_CODE_SYSTEM_CLASSIFY_ROLE pc |
| | |
| | | and '${systemId}' = pc.SYSTEMID(+) |
| | | </select> |
| | | |
| | | <select id="getListClassifyRole" resultType="com.vci.ubcs.code.entity.CodeClassify"> |
| | | select * |
| | | from PL_CODE_CLASSIFY |
| | | where oid in( select classifyoid |
| | | from PL_CODE_SYSTEM_CLASSIFY_ROLE |
| | | start with classifyid = #{library} |
| | | and SYSTEMID=#{systemId} |
| | | and SYSTEMOID = #{systemOid} |
| | | connect by prior classifyoid = classparentoid) |
| | | </select> |
| | | |
| | | </mapper> |