| | |
| | | }) |
| | | } |
| | | |
| | | export const getLazyMenuList = (parentId, params) => { |
| | | export const getLazyMenuList = (parentId, params, current, size) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/menu/lazy-menu-list', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | parentId |
| | | parentId, |
| | | current, |
| | | size, |
| | | } |
| | | }) |
| | | } |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getList = (current, size, params) => { |
| | | export const getPage = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/role/list', |
| | | url: '/api/ubcs-system/role/page', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | |
| | | :props="transferProps" @save="handelTransferSave"></integration-transfer> |
| | | </el-button> |
| | | <el-button size="small" type="primary" plain @click="findvisible=true">查询 |
| | | <advancedQuery :visible.sync="findvisible" :options="this.options"></advancedQuery> |
| | | <advanced-query :visible.sync="findvisible" :options="options"></advanced-query> |
| | | </el-button> |
| | | <el-button size="small" type="primary" plain>相似项查询</el-button> |
| | | <el-button size="small" type="primary" plain style="margin-left: 1px;margin-top:10px">刷新</el-button> |
| | |
| | | editAttr:"", |
| | | loading: false, |
| | | data: [], |
| | | options:{}, |
| | | options:[], |
| | | option: { |
| | | column: [] |
| | | }, |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-click="clickRowChange" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | :table-loading="loading" |
| | | :page.sync="page" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-click="clickRowChange" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @tree-load="treeLoad"> |
| | | <template slot-scope="{row}" slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-setting" |
| | |
| | | option: { |
| | | lazy: true, |
| | | tip: false, |
| | | simplePage: true, |
| | | //simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: "60%", |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query), page.currentPage, page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data.records; |
| | | this.page.total = data.total; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | resolve(res.data.data.records); |
| | | }); |
| | | }, |
| | | // 数据权限模块 |
| | |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | |
| | | option: { |
| | | lazy: true, |
| | | tip: false, |
| | | simplePage: true, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: "60%", |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | getLazyMenuList(this.parentId, Object.assign(params, this.query), page.currentPage, page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data.records; |
| | | this.page.total = data.total; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyMenuList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | resolve(res.data.data.records); |
| | | }); |
| | | }, |
| | | // 数据权限模块 |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-click="clickRowChange" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | :table-loading="loading" |
| | | :data="data" |
| | | ref="crud" |
| | | :page.sync="page" |
| | | v-model="form" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @row-del="rowDel" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-click="clickRowChange" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role"; |
| | | import {add, getPage, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role"; |
| | | import {mapGetters} from "vuex"; |
| | | import website from '@/config/website'; |
| | | |
| | |
| | | option: { |
| | | height: "auto", |
| | | tip: false, |
| | | simplePage: true, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | tree: true, |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | this.data = res.data.data; |
| | | getPage(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data.records; |
| | | this.page.total = data.total; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | |
| | | size="small" |
| | | icon="el-icon-search" |
| | | plain |
| | | :disabled="selectionList.length <= 0" |
| | | @click="openAdvancedQuery('codeBasicSec')"> |
| | | 高级查询 |
| | | </el-button> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | |
| | | //console.log(conditionMaps); |
| | | } |
| | | }, |
| | | |
| | | /* 公式编辑框内容改变,子组件编辑完公式之后内容回显时调用 */ |
| | | updateFormulaContent(content){ |
| | | this.form.getValueClass = content; |
| | |
| | | let parentClsParam = this.parentClsfyParams; |
| | | parentClsParam.classifyDialogLoading = true; |
| | | let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid; |
| | | let conditionMaps = this.paramsToConditionMa({"pkCodeRule":oid}); |
| | | let conditionMaps = {}; |
| | | conditionMaps['conditionMap[pkCodeRule]'] = oid; |
| | | refDataGridClassifySec( |
| | | page.currentPage, |
| | | page.pageSize, |
| | |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false |
| | | } |
| | | |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }else{ |
| | | editSave(this.form).then(() => { |
| | | // 关闭对话框 |
| | |
| | | }, error => { |
| | | window.console.log(error); |
| | | }); |
| | | this.loadBasic(this.selectionList[0]); |
| | | } |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }, |
| | | // 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式 |
| | | checkForm(){ |
| | |
| | | this.$message.warning('(编码补位方式)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){ |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparator == ''){ |
| | | this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空'); |
| | | return false; |
| | | } |
| | |
| | | this.$refs.codeFillLimit.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | if(form.codeFillFlag == ''){ |
| | | this.$message.warning('(流水是否补码)'+tipsMsg); |
| | | this.$refs.switch.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | // if(form.codeFillFlag == '' || ){ |
| | | // this.$message.warning('(流水是否补码)'+tipsMsg); |
| | | // return false; |
| | | // } |
| | | }else if(this.form.secType==='codelevelsec'){ |
| | | //层级码段 |
| | | if(form.codeLevelType == ''){ |
| | |
| | | this.$message.warning('(编码补位方式)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){ |
| | | // console.log(form); |
| | | if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){ |
| | | this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空'); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | // console.log(row.oid); |
| | | //存储当前关联的编码规则相关信息 |
| | | this.currentCodeRuleOid = row.oid; |
| | | this.currentRuleLcStatus = row.lcStatus; |
| | | this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false); |
| | | if(row!='' || row!=null){ |
| | | this.currentCodeRuleOid = row.oid; |
| | | this.currentRuleLcStatus = row.lcStatus; |
| | | this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false); |
| | | } |
| | | }, |
| | | // 发送加载基础码段的请求 |
| | | sendGridCodeBasicSec(condition,isAdancedQuery/** 是否高级查询 */){ |
| | |
| | | let conditionMaps = {}; |
| | | if(condition && !isAdancedQuery){ |
| | | Object.keys(condition).forEach(key=>{ |
| | | conditionMaps['conditionMap[pl_code_basicsec.'+key+']'] = condition[key].trim(); |
| | | conditionMaps['conditionMap['+key+']'] = condition[key].trim(); |
| | | }); |
| | | } |
| | | if(isAdancedQuery){ |
| | | condition['conditionMap[pl_code_basicsec.pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' |
| | | condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' |
| | | ? this.selectionList[0].oid:this.currentCodeRuleOid; |
| | | } |
| | | gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => { |
| | |
| | | }, |
| | | // 基础码段刷新时查询 |
| | | refreshChangeBasicSec(){ |
| | | this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid}); |
| | | this.loadBasic(this.selectionList.at(-1)); |
| | | }, |
| | | // 操作基础码段中搜索清空等按钮的显示/隐藏 |
| | | hideBasicTable(hideBoolean){ |
| | |
| | | this.$refs.crudBasic.option.columnBtn = hideBoolean; |
| | | this.$refs.crudBasic.option.column[0].search = hideBoolean; |
| | | this.$refs.crudBasic.option.column[1].search = hideBoolean; |
| | | if(!hideBoolean){ |
| | | this.selectionList = []; |
| | | this.basicData = []; |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** 编码规则相关方法 */ |
| | | // 打开高级查询窗口 |
| | | openAdvancedQuery(condition){ |
| | | // MasterTable({ |
| | | // codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | // functionId: 5, |
| | | // }).then(res=>{ |
| | | // console.log(res.data.tableDefineVO.seniorQueryColumns); |
| | | // }) |
| | | if(condition=='codeRule'){ |
| | | this.advancedQueryParam.options = [ |
| | | { |
| | |
| | | data: [], |
| | | title: '码段编号', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.id', |
| | | queryField: 'id', |
| | | },{ |
| | | data: [], |
| | | title: '码段名称', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.name', |
| | | queryField: 'name', |
| | | },{ |
| | | data: [], |
| | | title: '描述', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.description', |
| | | queryField: 'description', |
| | | },{ |
| | | data: [], |
| | | title: '码段类型', |
| | | fieldType: 'combox', |
| | | queryField: 'pl_code_basicsec.secType', |
| | | queryField: 'secType', |
| | | comboxKey: 'codeSecType', |
| | | } |
| | | ] |
| | |
| | | // 刷新使用范围列表 |
| | | refreshUseRangeChange(){ |
| | | this.getRangeCodeList(); |
| | | }, |
| | | // 单击编码规则实现行选择 |
| | | codeRuleRowClick (row) { |
| | | // 这儿应该可以不要,因为toggleRowSelection也会触发行选择时间 |
| | | this.selectionList = row; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.setCurrentRow(row); |
| | | this.$refs.crud.toggleRowSelection(row); //选中当前行 |
| | | if(row!=''){ |
| | | this.loadBasic(row); |
| | | } |
| | | }, |
| | | // 启用与停用 |
| | | enableOrDeactivatse(oId,update){ |
| | |
| | | this.selectionOtherCloneCodeBasicList = list; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]); |
| | | }, |
| | | // 从其他编码规则中克隆码段信息 |
| | | // 从其他编码规则中克隆码段信息 |
| | | saveOtherCodeBasic(){ |
| | | let oid = this.selectionList[0].oid; |
| | | let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; |
| | |
| | | //console.log(res); |
| | | let oidArr = []; |
| | | fromDialogPkCodebasic.forEach(ele => { |
| | | oidArr.push(ele.id); |
| | | oidArr.push(ele.oid); |
| | | }); |
| | | let data = { |
| | | "pkCodeRule": oid, |
| | |
| | | let requestData = {}; |
| | | if(params){ |
| | | Object.keys(params).forEach(key=>{ |
| | | requestData["conditionMap"+'['+key+']'] = params[key].trim(); |
| | | requestData["conditionMap"+'['+key+'_like]'] = params[key].trim(); |
| | | }); |
| | | } |
| | | this.query = requestData; |
| | |
| | | // 编码规则当前选中行变化的时候触发 |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); |
| | | //当前选中行为空的时候就将码段管理表格数据置空,并禁用相关功能 |
| | | if(list == ''){ |
| | | this.basicData = []; |
| | | if(this.selectionList.length <= 0){ |
| | | this.hideBasicTable(false); |
| | | } |
| | | if(this.selectionList.length > 0){ |
| | | if (this.selectionList.length > 0) { |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); |
| | | this.currentCodeRuleOid = this.selectionList[list.length-1].oid; |
| | | this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus; |
| | | this.loadBasic(this.selectionList[list.length-1]); |
| | | } |
| | | }, |
| | | // 单击编码规则实现行选择 |
| | | codeRuleRowClick (row) { |
| | | // console.log(this.currentRuleLcStatus); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleRowSelection(row); //选中当前行 |
| | | |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | |
| | | // 查询的值为空时,要将码段管理相关的内容禁用 |
| | | if(data.records.length <= 0) { |
| | | this.hideBasicTable(false); |
| | | this.selectionList = []; |
| | | this.basicData = []; |
| | | return; |
| | | } |
| | | this.loadBasic(this.data[0]) |
| | |
| | | // 补位时的字符,实现可输可选 |
| | | inputSelectBlur(e){ |
| | | if (e.target.value) { |
| | | this.form.codeFillSeparatorSelect = e.target.value; |
| | | this.form.codeFillSeparator = e.target.value; |
| | | } |
| | | }, |
| | | // 码段类型改变时,增加对应的form表单中的属性 |
| | |
| | | serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1, //流水号起始值 |
| | | serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1, //流水的步长 |
| | | codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码补位方式 |
| | | codeFillSeparatorSelect: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparatorSelect:0, //补位时的字符,选中的下拉框的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0, //补位时的字符 |
| | | // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //补位时的字符,选中的下拉框的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符 |
| | | codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'', //填充长度 |
| | | codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'', //流水上限 |
| | | codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ? true:false :false, //流水是否补码 |
| | |
| | | this.form = Object.assign({}, this.form,{ |
| | | codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'', //码段的长度 |
| | | codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码部位方式,枚举查询 |
| | | codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //选中的补位时的字符的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //补位时的字符,可输可选查询 |
| | | // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //选中的补位时的字符的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符,可输可选查询 |
| | | }); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | |
| | | :option="optionParent" |
| | | :table-loading="loading" |
| | | :data="dataParent" |
| | | :page="pageParent" |
| | | :page.sync="pageParent" |
| | | ref="crud" |
| | | v-model="formParent" |
| | | :permission="permissionList" |
| | |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-setting" |
| | | @click="handleSetting">授权配置 |
| | | </el-button> |
| | | </el-tooltip> |
| | | <el-tooltip class="item" effect="dark" content="给租户配置独立数据源以实现数据库隔离" placement="top"> |
| | | <el-button size="small" |
| | | plain |
| | |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | console.log(done) |
| | | // console.log(done) |
| | | }, error => { |
| | | window.console.log(error); |
| | | loading(); |
| | |
| | | :value="item.id" |
| | | class="seloption" |
| | | > |
| | | |
| | | </el-option> |
| | | </el-select> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | overflow: scroll; |
| | | } |
| | | .selects{ |
| | | width: 400px; |
| | | margin-left: 92px; |
| | | width: 100%; |
| | | } |
| | | .seloption{ |
| | | margin-left: 10px; |
| | |
| | | * 租户ID |
| | | * @TableField(value = "tenant_id")这里必须要写,并且必须是要小写的 |
| | | */ |
| | | @TableField(value = "tenant_id",exist = false) |
| | | @TableField(value = "tenant_id") |
| | | private String tenantId; |
| | | |
| | | private String description; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void buildConditionByAs(Map<String, Object> query, MPJLambdaWrapper<?> qw, String tableAlias){ |
| | | buildConditionMPJ(query,qw,tableAlias); |
| | | } |
| | | |
| | | public static void buildCondition(Map<String, Object> query, MPJLambdaWrapper<?> qw) { |
| | | buildConditionMPJ(query,qw,null); |
| | | } |
| | | |
| | | private static void buildConditionMPJ(Map<String, Object> query, MPJLambdaWrapper<?> qw, String tableAlias){ |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | | if (!Func.hasEmpty(new Object[]{k, v}) && !k.endsWith("_ignore")) { |
| | | if (k.endsWith("_like")) { |
| | | qw.like(getColumn(k, "_like"), v); |
| | | qw.like(tableAlias+"."+getColumn(k, "_like"), v); |
| | | } else if (k.endsWith("_notequal")) { |
| | | qw.ne(getColumn(k, "_notequal"), v); |
| | | qw.ne(tableAlias+"."+getColumn(k, "_notequal"), v); |
| | | } else if (k.endsWith("_likeleft")) { |
| | | qw.likeLeft(getColumn(k, "_likeleft"), v); |
| | | qw.likeLeft(tableAlias+"."+getColumn(k, "_likeleft"), v); |
| | | } else if (k.endsWith("_likeright")) { |
| | | qw.likeRight(getColumn(k, "_likeright"), v); |
| | | qw.likeRight(tableAlias+"."+getColumn(k, "_likeright"), v); |
| | | } else if (k.endsWith("_notlike")) { |
| | | qw.notLike(getColumn(k, "_notlike"), v); |
| | | qw.notLike(tableAlias+"."+getColumn(k, "_notlike"), v); |
| | | } else if (k.endsWith("_ge")) { |
| | | qw.ge(getColumn(k, "_ge"), v); |
| | | qw.ge(tableAlias+"."+getColumn(k, "_ge"), v); |
| | | } else if (k.endsWith("_le")) { |
| | | qw.le(getColumn(k, "_le"), v); |
| | | qw.le(tableAlias+"."+getColumn(k, "_le"), v); |
| | | } else if (k.endsWith("_gt")) { |
| | | qw.gt(getColumn(k, "_gt"), v); |
| | | qw.gt(tableAlias+"."+getColumn(k, "_gt"), v); |
| | | } else if (k.endsWith("_lt")) { |
| | | qw.lt(getColumn(k, "_lt"), v); |
| | | qw.lt(tableAlias+"."+getColumn(k, "_lt"), v); |
| | | } else if (k.endsWith("_datege")) { |
| | | qw.ge(getColumn(k, "_datege"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | qw.ge(tableAlias+"."+getColumn(k, "_datege"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | } else if (k.endsWith("_dategt")) { |
| | | qw.gt(getColumn(k, "_dategt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | qw.gt(tableAlias+"."+getColumn(k, "_dategt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | } else if (k.endsWith("_dateequal")) { |
| | | qw.eq(getColumn(k, "_dateequal"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | qw.eq(tableAlias+"."+getColumn(k, "_dateequal"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | } else if (k.endsWith("_datele")) { |
| | | qw.le(getColumn(k, "_datele"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | qw.le(tableAlias+"."+getColumn(k, "_datele"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | } else if (k.endsWith("_datelt")) { |
| | | qw.lt(getColumn(k, "_datelt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | qw.lt(tableAlias+"."+getColumn(k, "_datelt"), DateUtil.parse(String.valueOf(v), "yyyy-MM-dd HH:mm:ss")); |
| | | } else if (k.endsWith("_null")) { |
| | | qw.isNull(getColumn(k, "_null")); |
| | | qw.isNull(tableAlias+"."+getColumn(k, "_null")); |
| | | } else if (k.endsWith("_notnull")) { |
| | | qw.isNotNull(getColumn(k, "_notnull")); |
| | | qw.isNotNull(tableAlias+"."+getColumn(k, "_notnull")); |
| | | } else { |
| | | qw.eq(getColumn(k, "_equal"), v); |
| | | qw.eq(tableAlias+"."+getColumn(k, "_equal"), v); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void buildConditionByMapString(Map<String, String> query, MPJLambdaWrapper<?> qw) { |
| | | if (!Func.isEmpty(query)) { |
| | | query.forEach((k, v) -> { |
| | |
| | | MPJLambdaWrapper<CodeBasicSec> mpjLambdaWrapper = new MPJLambdaWrapper<>(CodeBasicSec.class, CodeTableNameEnum.PL_CODE_BASICSEC.getText()) |
| | | .selectAll(CodeBasicSec.class) |
| | | .selectAs(CodeClassify::getName, CodeBasicSec::getReferCodeClassifyOidName) |
| | | .leftJoin(CodeClassify.class,CodeTableNameEnum.PL_CODE_CLASSIFY.getText(), CodeClassify::getOid, CodeBasicSec::getReferCodeClassifyOid); |
| | | .leftJoin(CodeClassify.class, CodeTableNameEnum.PL_CODE_CLASSIFY.getText(), CodeClassify::getOid, CodeBasicSec::getReferCodeClassifyOid) |
| | | .leftJoin(CodeBasicSec.class,CodeTableNameEnum.PL_CODE_BASICSEC.getText()+1,CodeBasicSec::getOid,CodeBasicSec::getParentClassifySecOid |
| | | ,ext->ext.selectAs(CodeBasicSec::getName,CodeBasicSec::getParentClassifySecText)); |
| | | // 添加where条件 |
| | | UBCSSqlKeyword.buildCondition(conditionMap,mpjLambdaWrapper); |
| | | UBCSSqlKeyword.buildConditionByAs(conditionMap,mpjLambdaWrapper,CodeTableNameEnum.PL_CODE_BASICSEC.getText()); |
| | | IPage<CodeBasicSec> codeBasicSecIPage = codeBasicSecMapper.selectPage(UBCSCondition.getPage(query), mpjLambdaWrapper); |
| | | return CodeBasicSecWrapper.build().pageVO(codeBasicSecIPage); |
| | | } |
| | |
| | | } |
| | | List<CodeBasicSec> createList = new ArrayList<>(); |
| | | List<CodeBasicSec> basicSecDOS = codeBasicSecMapper.selectBatchIds(oidList); |
| | | if(basicSecDOS.isEmpty()){ |
| | | return R.fail("克隆的码段信息不存在!"); |
| | | } |
| | | basicSecDOS.forEach(sec -> { |
| | | CodeBasicSec newSecDO = new CodeBasicSec(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(sec,newSecDO); |
| | | newSecDO.setOid(""); |
| | | newSecDO.setNameOid(""); |
| | | newSecDO.setRevisionOid(""); |
| | | newSecDO.setOid(VciBaseUtil.getPk()); |
| | | newSecDO.setNameOid(VciBaseUtil.getPk()); |
| | | newSecDO.setRevisionOid(VciBaseUtil.getPk()); |
| | | newSecDO.setId(newSecDO.getId() + "_copy"); |
| | | newSecDO.setName(newSecDO.getName() + "_copy"); |
| | | newSecDO.setPkCodeRule(pkCodeRule); |
| | | createList.add(newSecDO); |
| | | }); |
| | | boolean b = saveBatch(createList); |
| | | boolean resBoolean = saveBatch(createList); |
| | | //codeBasicSecMapper.insertBatch(createList); |
| | | return R.data(b,"克隆码段信息成功"); |
| | | return resBoolean ? R.data(resBoolean,"克隆码段信息成功"):R.fail("克隆码段信息失败!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "懒加载列表", notes = "传入dept") |
| | | public R<List<DeptVO>> lazyList(@ApiIgnore @RequestParam Map<String, Object> dept, Long parentId, BladeUser bladeUser) { |
| | | List<DeptVO> list = deptService.lazyList(bladeUser.getTenantId(), parentId, dept); |
| | | return R.data(DeptWrapper.build().listNodeLazyVO(list)); |
| | | public R<IPage<DeptVO>> lazyList(@ApiIgnore @RequestParam Map<String, Object> dept, Query query, Long parentId, BladeUser bladeUser) { |
| | | IPage<DeptVO> list = deptService.lazyList(bladeUser.getTenantId(), parentId, dept, query); |
| | | return R.data(DeptWrapper.build().pageNodeLazyVO(list)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | package com.vci.ubcs.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.entity.TopMenu; |
| | |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "懒加载菜单列表", notes = "传入menu") |
| | | public R<List<MenuVO>> lazyMenuList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu) { |
| | | List<MenuVO> list = menuService.lazyMenuList(parentId, menu); |
| | | return R.data(MenuWrapper.build().listNodeLazyVO(list)); |
| | | public R<IPage<MenuVO>> lazyMenuList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu, Query query) { |
| | | IPage<MenuVO> menuVOIPage = menuService.lazyMenuPage(parentId, menu,query); |
| | | return R.data(MenuWrapper.build().pageNodeLazyVO(menuVOIPage)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.cache.SysCache; |
| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * 分页列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @GetMapping("/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleName", value = "参数名称", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "roleAlias", value = "角色别名", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "列表", notes = "传入role") |
| | | public R<List<RoleVO>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) { |
| | | public R<IPage<RoleVO>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser, Query query) { |
| | | QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class); |
| | | List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | return R.data(RoleWrapper.build().listNodeVO(list)); |
| | | IPage<Role> page = roleService.page(Condition.getPage(query), |
| | | (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper); |
| | | return R.data(RoleWrapper.build().pageNodeVO(page)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.service.IStrategyService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "分页查询", notes = "传入分页参数query") |
| | | public R<Page<Strategy>> queryByPage(Query query) { |
| | | Page<Strategy> strategyPage = strategyService.queryAllByPage(query); |
| | | public R<IPage<Strategy>> queryByPage(Query query) { |
| | | IPage<Strategy> strategyPage = strategyService.queryAllByPage(query); |
| | | return R.data(strategyPage); |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.system.entity.Dept; |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param); |
| | | IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param,IPage page); |
| | | |
| | | /** |
| | | * 获取树形节点 |
| | |
| | | package com.vci.ubcs.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.tool.node.TreeNode; |
| | | import com.vci.ubcs.system.dto.MenuDTO; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<MenuVO> lazyMenuList(Long parentId, Map<String, Object> param); |
| | | IPage<MenuVO> lazyMenuPage(Long parentId, Map<String, Object> param, IPage page); |
| | | |
| | | /** |
| | | * 树形结构 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.vci.ubcs.system.entity.Strategy; |
| | | |
| | |
| | | * @param page 分页对象 |
| | | * @return 对象列表 |
| | | */ |
| | | List<Strategy> queryAllByPage(IPage page); |
| | | IPage<Strategy> queryAllByPage(IPage page); |
| | | |
| | | /** |
| | | * 统计总行数 |
| | |
| | | */ |
| | | package com.vci.ubcs.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.system.entity.Dept; |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param); |
| | | IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param, Query query); |
| | | |
| | | /** |
| | | * 树形结构 |
| | |
| | | */ |
| | | package com.vci.ubcs.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.node.TreeNode; |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | List<MenuVO> lazyMenuList(Long parentId, Map<String, Object> param); |
| | | IPage<MenuVO> lazyMenuPage(Long parentId, Map<String, Object> param, Query query); |
| | | |
| | | /** |
| | | * 菜单树形结构 |
| | |
| | | package com.vci.ubcs.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.core.mp.support.Query; |
| | | import com.vci.ubcs.system.entity.Strategy; |
| | |
| | | * @param query 分页对象 |
| | | * @return 查询结果 |
| | | */ |
| | | PageImpl<Strategy> queryAllByPage(Query query); |
| | | IPage<Strategy> queryAllByPage(Query query); |
| | | |
| | | /** |
| | | * 新增数据或修改数据 |
| | |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectMaps() { |
| | | List<Map<String, Object>> maps = listMaps(new QueryWrapper<Combination>().select("ID", "NAME")); |
| | | List<Map<String, Object>> maps = listMaps( |
| | | new QueryWrapper<Combination>().lambda().select(Combination::getId, Combination::getName) |
| | | ); |
| | | return maps; |
| | | } |
| | | |
| | |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | |
| | | import com.vci.ubcs.system.service.IDeptService; |
| | | import com.vci.ubcs.system.vo.DeptVO; |
| | | import com.vci.ubcs.system.wrapper.DeptWrapper; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | private static final String PARENT_ID = "parentId"; |
| | | |
| | | @Override |
| | | public List<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param) { |
| | | public IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param, Query query) { |
| | | // 设置租户ID |
| | | if (AuthUtil.isAdministrator()) { |
| | | tenantId = StringPool.EMPTY; |
| | |
| | | if (Func.isEmpty(param.get(PARENT_ID)) && param.size() > 1 && Func.toLong(parentId) == 0L) { |
| | | parentId = null; |
| | | } |
| | | return baseMapper.lazyList(tenantId, parentId, param); |
| | | return baseMapper.lazyList(tenantId, parentId, param, Condition.getPage(query)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.system.cache.SysCache; |
| | |
| | | import com.vci.ubcs.system.wrapper.MenuWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MenuVO> lazyMenuList(Long parentId, Map<String, Object> param) { |
| | | public IPage<MenuVO> lazyMenuPage(Long parentId, Map<String, Object> param, Query query) { |
| | | if (Func.isEmpty(Func.toStr(param.get(PARENT_ID)))) { |
| | | parentId = null; |
| | | } |
| | | return baseMapper.lazyMenuList(parentId, param); |
| | | return baseMapper.lazyMenuPage(parentId, param, Condition.getPage(query)); |
| | | } |
| | | |
| | | |
| | |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public PageImpl<Strategy> queryAllByPage(Query query) { |
| | | public IPage<Strategy> queryAllByPage(Query query) { |
| | | Page<Strategy> strategyPage = new Page<>(query.getCurrent(), query.getSize()); |
| | | return new PageImpl<>(this.strategyMapper.queryAllByPage(strategyPage)); |
| | | return this.strategyMapper.queryAllByPage(strategyPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | package com.vci.ubcs.system.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vci.ubcs.common.utils.PageDO2PageVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | return ForestNodeMerger.merge(collect); |
| | | } |
| | | |
| | | public IPage<DeptVO> pageNodeLazyVO(IPage<DeptVO> page) { |
| | | List<DeptVO> deptVOS = page.getRecords().stream().peek(dept -> { |
| | | String category = DictCache.getValue(DictEnum.ORG_CATEGORY, dept.getDeptCategory()); |
| | | Objects.requireNonNull(dept).setDeptCategoryName(category); |
| | | }).collect(Collectors.toList()); |
| | | List<DeptVO> list = ForestNodeMerger.merge(deptVOS); |
| | | page.setRecords(list); |
| | | return page; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.system.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | return ForestNodeMerger.merge(list); |
| | | } |
| | | |
| | | public IPage<MenuVO> pageNodeLazyVO(IPage<MenuVO> page) { |
| | | List<MenuVO> merge = ForestNodeMerger.merge(page.getRecords()); |
| | | page.setRecords(merge); |
| | | return page; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.system.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vci.ubcs.common.utils.PageDO2PageVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | return roleVO; |
| | | } |
| | | |
| | | |
| | | public List<RoleVO> listNodeVO(List<Role> list) { |
| | | List<RoleVO> collect = list.stream().map(this::entityVO).collect(Collectors.toList()); |
| | | return ForestNodeMerger.merge(collect); |
| | | } |
| | | |
| | | public IPage<RoleVO> pageNodeVO(IPage<Role> page) { |
| | | List<RoleVO> collect = page.getRecords().stream().map(this::entityVO).collect(Collectors.toList()); |
| | | List<RoleVO> mergeList = ForestNodeMerger.merge(collect); |
| | | IPage<RoleVO> roleVOIPage = new Page<>(); |
| | | roleVOIPage.setRecords(mergeList); |
| | | return PageDO2PageVO.pageDO2PageVO(page,roleVOIPage); |
| | | } |
| | | |
| | | } |
| | |
| | | ORDER BY menu.sort |
| | | </select> |
| | | |
| | | <select id="lazyMenuList" resultMap="menuVOResultMap"> |
| | | <select id="lazyMenuPage" resultMap="menuVOResultMap"> |
| | | SELECT |
| | | menu.*, |
| | | ( |
| | |
| | | } |
| | | //获取用户采用的密码策略 |
| | | Strategy strategy = sysClient.getByUserId(userId).getData(); |
| | | // 几乎不会出现这种情况 |
| | | if(ObjectUtil.isEmpty(strategy)) { |
| | | throw new ServiceException("当前用户未应用密码策略!"); |
| | | } |
| | |
| | | if(reqType>=strategy.getRequiredType()){ |
| | | break; |
| | | } |
| | | if(!Func.isEmpty(RegexUtil.findResult(regexs.get(i),newPassword1))){ |
| | | if(RegexUtil.find(regexs.get(i),newPassword1)){ |
| | | reqType++; |
| | | } |
| | | } |
| | |
| | | if(reqType<strategy.getRequiredType()){ |
| | | throw new ServiceException(resException); |
| | | } |
| | | // 是否属于组合方式中的类型 |
| | | // 是否属于组合方式中的类型,以前是密码必须是包含在组合方式中的类型 |
| | | String regex = sysClient.getRegex(Arrays.asList(strategy.getCombinationIds().split(","))).getData(); |
| | | regex = "^"+regex+"{"+strategy.getRequiredType()+",}$"; |
| | | boolean result = RegexUtil.find(regex, newPassword1); |
| | | if(!result){ |
| | | throw new ServiceException(resException); |
| | | throw new ServiceException("密码中只能存在【"+strategy.getCombinationNames()+"】中包含的字符!"); |
| | | } |
| | | //修改密码同时,改变用户信息中的密码修改状态字段,密码修改时间 |
| | | return this.update(Wrappers.<User>update().lambda() |
| | |
| | | boolean oauthTemp = userOauthService.updateById(userOauth); |
| | | return (userTemp && oauthTemp); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatePlatform(Long userId, Integer userType, String userExt) { |
| | | if (userType.equals(UserEnum.WEB.getCategory())) { |