已添加5个文件
已修改38个文件
已重命名1个文件
| | |
| | | trim: true |
| | | }) |
| | | } |
| | | // è·åè§è²æ°æ®æé |
| | | export function findByRoleId (data) { |
| | | return request.post('visitsAdmin/cloudService/system/dataPermission/findByRoleId', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | |
| | | export function createRolePermission (data) { |
| | | return request.post('/visitsAdmin/cloudService/system/role/createRolePermission', data) |
| | | } |
| | | export function createRoleDataPermission (data) { |
| | | return request.post('/visitsAdmin/cloudService/system/role/createRoleDataPermission', data) |
| | | } |
| | | |
| | | // é
ç½®èå |
| | | export function createRoleMenu (data) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/systemTimer/cloudService/business/quartz/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function create (data) { |
| | | return request.post('/systemTimer/cloudService/business/quartz/create', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function updateById (data) { |
| | | return request.post('/systemTimer/cloudService/business/quartz/updateById', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | // æ ¹æ®IDæ¥è¯¢ |
| | | export function queryById (id) { |
| | | return request.get(`/systemTimer/cloudService/business/quartz/${id}`) |
| | | } |
| | | export function pauseById (id) { |
| | | return request.get(`/systemTimer/cloudService/business/quartz/pause/${id}`) |
| | | } |
| | | export function resumeById (id) { |
| | | return request.get(`/systemTimer/cloudService/business/quartz/resume/${id}`) |
| | | } |
| | | export function runOnceById (id) { |
| | | return request.get(`/systemTimer/cloudService/business/quartz/runOnce/${id}`) |
| | | } |
| | |
| | | this.__afterDelete() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | |
| | | this.__afterDelete(this.tableData.selectedRows.length) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="60%" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <p class="tip">æ£å¨ä¸ºè§è²ã <em>{{role.name || '-'}}</em>ã é
ç½®æ°æ®æé</p> |
| | | <p class="tip-warn"><i class="el-icon-warning"></i>æéï¼æéé
ç½®åééæ°ç»å½åçæ</p> |
| | | <el-form :model="form" ref="form" style="margin-top:15px"> |
| | | <el-form-item label="æéç±»åï¼" prop="type"> |
| | | <el-select v-model="form.type" clearable filterable placeholder="è¯·éæ©æéç±»å"> |
| | | <el-option |
| | | v-for="(item, index) in options" |
| | | :key="index" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type == 4" label="èªå®ä¹é¨é¨ï¼" prop="customData"> |
| | | <el-cascader |
| | | :options="departments" |
| | | v-model="form.customData" |
| | | :props=defaultProps |
| | | clearable |
| | | ></el-cascader> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { createRoleDataPermission } from '@/api/system/role' |
| | | import { fetchList } from '@/api/business/company' |
| | | // import the styles |
| | | import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
| | | export default { |
| | | name: 'OperaSystemRoleWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | options: [ |
| | | { name: 'å
¨é¨', id: 0 }, |
| | | { name: 'æå±é¨é¨åä¸å±é¨é¨', id: 1 }, |
| | | { name: 'æå±é¨é¨åå
¶ååé¨é¨', id: 2 }, |
| | | { name: 'ä»
æå±é¨é¨', id: 3 }, |
| | | { name: 'èªå®ä¹é¨é¨', id: 4 } |
| | | ], |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | businessCode: null, |
| | | createTime: null, |
| | | createUser: null, |
| | | customData: [], |
| | | id: null, |
| | | roleId: null, |
| | | type: 0 |
| | | }, |
| | | defaultProps: { |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | // children: 'children', |
| | | label: 'name', |
| | | value: 'id', |
| | | emitPath: false |
| | | }, |
| | | role:{}, |
| | | departments: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/system/role', |
| | | 'field.id': 'id' |
| | | }) |
| | | this.treeComList() |
| | | }, |
| | | methods: { |
| | | // é¨é¨æ ç¶ç»ææ°æ® |
| | | treeComList () { |
| | | fetchList() |
| | | .then(res => { |
| | | // this.departments = this.tree([res]) |
| | | this.departments =this.newTree(res) |
| | | }) |
| | | }, |
| | | open (title, target,role) { |
| | | // console.log(title, target) |
| | | this.title = title |
| | | this.visible = true |
| | | this.role=role |
| | | // æ°å»º |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | console.log(target); |
| | | if (target.customData === undefined ||target.customData === null || target.customData === '') { |
| | | this.form.customData = [] |
| | | } else { |
| | | const customD = this.form.customData.split(',') |
| | | this.form.customData = customD.map((item) => { return parseInt(item) }) |
| | | } |
| | | }) |
| | | }, |
| | | newTree(tree) { |
| | | if(tree ==null){ |
| | | return [] |
| | | } |
| | | return tree.map(item => { |
| | | let newItem = {...item} |
| | | if(newItem){ |
| | | newItem.children=newItem.childList |
| | | } |
| | | if (item.children && item.children.length == 0) { |
| | | this.$delete( newItem, 'children' ) |
| | | } else { |
| | | newItem.children = this.newTree(newItem.children) |
| | | } |
| | | return newItem |
| | | }); |
| | | }, |
| | | __confirmCreate () { |
| | | // console.log(JSON.stringify(this.form.customData)); |
| | | // return |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | |
| | | this.isWorking = true |
| | | let data = JSON.parse(JSON.stringify(this.form)) |
| | | if (this.form.type === 4) { |
| | | data.customData = this.form.customData.join(',') |
| | | } else { |
| | | data.customData = '' |
| | | } |
| | | createRoleDataPermission(data) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('æ°å»ºæå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | }, |
| | | __confirmEdit () { |
| | | // console.log(JSON.stringify(this.form.customData)); |
| | | // return |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | // è°ç¨æ´æ°æ¥å£ |
| | | this.isWorking = true |
| | | let data = JSON.parse(JSON.stringify(this.form)) |
| | | if (this.form.type === 4) { |
| | | data.customData = this.form.customData.join(',') |
| | | } else { |
| | | data.customData = '' |
| | | } |
| | | createRoleDataPermission(data) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$tip.apiSuccess('ä¿®æ¹æå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="140px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['system:role:update', 'system:role:createRolePermission', 'system:role:createRoleMenu', 'system:role:delete'])" |
| | | v-if="containPermissions(['system:role:update', 'system:role:createRolePermission','system:datapermission:create', 'system:role:createRoleMenu', 'system:role:delete'])" |
| | | label="æä½" |
| | | min-width="270" |
| | | fixed="right" |
| | | > |
| | | <template v-if="isAdmin || (row.code !== adminCode && userInfo.roles.findIndex(code => code === row.code) === -1)" slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaRoleWindow.open('ç¼è¾è§è²', row)" icon="el-icon-edit" v-permissions="['system:role:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaRoleWindow.open('ç¼è¾è§è²', row)" v-permissions="['system:role:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="setData(row)" v-permissions="['system:datapermission:create']">æ°æ®æé</el-button> |
| | | <el-button type="text" @click="$refs.permissionConfigWindow.open(row)" v-permissions="['system:role:createRolePermission']">é
ç½®æé</el-button> |
| | | <el-button type="text" @click="$refs.menuConfigWindow.open(row)" icon="el-icon-menu" v-permissions="['system:role:createRoleMenu']">ææèå</el-button> |
| | | <el-button v-if="!row.fixed" type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['system:role:delete']">å é¤</el-button> |
| | |
| | | <PermissionConfigWindow ref="permissionConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> |
| | | <!-- ææèå --> |
| | | <MenuConfigWindow ref="menuConfigWindow" @success="handlePageChange(tableData.pagination.pageIndex)"/> |
| | | <OperaSystemRoleDataWindow ref="OperaSystemRoleDataWindow" @success="handlePageChange(tableData.pagination.pageIndex)" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import OperaRoleWindow from '@/components/system/role/OperaRoleWindow' |
| | | import PermissionConfigWindow from '@/components/system/role/PermissionConfigWindow' |
| | | import MenuConfigWindow from '@/components/system/role/MenuConfigWindow' |
| | | import OperaSystemRoleDataWindow from '@/components/system/role/OperaSystemRoleDataWindow' |
| | | import { findByRoleId } from '@/api/system/role' |
| | | export default { |
| | | name: 'SystemRole', |
| | | extends: BaseTable, |
| | | components: { MenuConfigWindow, PermissionConfigWindow, OperaRoleWindow, TableLayout, Pagination }, |
| | | components: { MenuConfigWindow, PermissionConfigWindow, OperaRoleWindow, TableLayout, OperaSystemRoleDataWindow, Pagination }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | |
| | | }] |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | setData (row) { |
| | | findByRoleId({ roleId: row.id }) |
| | | .then(res => { |
| | | if (!res) { |
| | | this.$refs.OperaSystemRoleDataWindow.open('æ°æ®æé', { roleId: row.id },row) |
| | | } else { |
| | | this.$refs.OperaSystemRoleDataWindow.open('æ°æ®æé', res,row) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | this.$tip.error(err) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalAlertWindow |
| | | v-loading="isUploading" |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules" label-width="120px" label-suffix="ï¼"> |
| | | <el-form-item label="Beanåç§°" prop="beanName"> |
| | | <el-input v-model="form.beanName" placeholder="请è¾å
¥Beanåç§°" :maxlength="10" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="模ååç§°" prop="module"> |
| | | <el-input v-model="form.module" placeholder="请è¾å
¥æ¨¡ååç§°" :maxlength="10" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="Cron表达å¼" prop="cronExpres"> |
| | | <el-input v-model="form.cronExpres" placeholder="请è¾å
¥Cron表达å¼" :maxlength="10" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" :maxlength="10" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æ§è¡åæ°" prop="params"> |
| | | <el-input v-model="form.params" type="textarea" placeholder="请è¾å
¥æ§è¡åæ°" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalAlertWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalAlertWindow from '@/components/common/GlobalAlertWindow' |
| | | export default { |
| | | name: 'OperaTimerWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalAlertWindow }, |
| | | data () { |
| | | |
| | | return { |
| | | isUploading: false, |
| | | uploadData: { |
| | | folder: 'projects' |
| | | }, |
| | | timeRange: ['', ''], |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | beanName: null, |
| | | params: null, |
| | | createTime: null, |
| | | module: '', |
| | | remark: '' , |
| | | cronExpres: '' |
| | | |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | beanName: [ |
| | | { required: true, message: '请è¾å
¥Beanåç§°', tigger: 'blur' } |
| | | ], |
| | | module: [ |
| | | { required: true, message: '请è¾å
¥æ¨¡ååç§°', tigger: 'blur' } |
| | | ], |
| | | cronExpres: [ |
| | | { required: true, message: '请è¾å
¥Cron表达å¼', tigger: 'blur' } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/timer/timer', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æå¼çªå£ |
| | | * @title çªå£æ é¢ |
| | | * @target ç¼è¾ç对象 |
| | | */ |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | // æ°å»º |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/style/alertstyle.scss"; |
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:devices:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="Beanåç§°" prop="beanName"> |
| | | <el-input v-model="searchForm.beanName" placeholder="请è¾å
¥åå¸äºº" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="模ååç§°" prop="module"> |
| | | <el-input v-model="searchForm.module" placeholder="请è¾å
¥åå¸äºº" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <!-- <el-button type="primary" :loading="isWorking.export" v-permissions="['business:devices:exportExcel']" @click="exportExcel">导åº</el-button> --> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:quartz:create']"> |
| | | <li><el-button type="primary" @click="$refs.OperaTimerWindow.open('æ°å»ºä»»å¡')" icon="el-icon-plus" v-permissions="['business:devices:create']">æ°å»º</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="index" prop="index" label="åºå·" align="center" min-width="50px"></el-table-column> |
| | | <el-table-column prop="beanName" label="BEANåç§°" align="center" min-width="150px"></el-table-column> |
| | | <el-table-column prop="module" label="模ååç§°" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="params" label="æ§è¡åæ°" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="state" label="ç¶æ" align="center" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.state ==1" style="color:green">æ£å¸¸</span> |
| | | <span v-if="row.state ==2" style="color: red">æå</span> |
| | | <span v-if="row.state ==3" style="color: red">å·²å é¤</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="cronExpres" label="表达å¼" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" align="center" min-width="180px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:quartz:update'])" |
| | | label="æä½" |
| | | fixed="right" |
| | | min-width="220" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.OperaTimerWindow.open('ç¼è¾ä»»å¡', row)" v-permissions="['business:quartz:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="runById(row)" v-permissions="['business:quartz:update']">æ§è¡ä¸æ¬¡</el-button> |
| | | <el-button type="text" v-if="row.state == 1" style="color: red" @click="pauseById(row)" v-permissions="['business:quartz:update']">æå</el-button> |
| | | <el-button type="text" v-if="row.state == 2" style="color: green" @click="resumeById(row)" v-permissions="['business:quartz:update']">æ¢å¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaTimerWindow ref="OperaTimerWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaTimerWindow from '@/views/timer/components/OperaTimerWindow' |
| | | import {runOnceById} from "@/api/timer/timer"; |
| | | export default { |
| | | name: 'Devices', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaTimerWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | beanName: '', |
| | | module: '' |
| | | }, |
| | | pausing:false, |
| | | running:false, |
| | | resuming:false, |
| | | room: [] |
| | | } |
| | | }, |
| | | provide() { |
| | | return { |
| | | room: () => this.room |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ç®¡çä¿¡æ¯è¡¨', |
| | | api: '/timer/timer', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | pauseById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æå该任å¡å?') |
| | | .then(() => { |
| | | this.pausing = true |
| | | this.api.paustById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æåæå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.pausing = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | resumeById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ¢å¤è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.resuming = true |
| | | this.api.resumeById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ¢å¤æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.resuming = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | runById (row) { |
| | | this.__checkApi() |
| | | this.$dialog.actionConfirm('确认æ§è¡ä¸æ¬¡è¯¥ä»»å¡å?') |
| | | .then(() => { |
| | | this.running = true |
| | | this.api.runOnceById(row.id) |
| | | .then(() => { |
| | | this.$message.info('æ§è¡æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.running = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | }, |
| | | } |
| | | |
| | | </script> |
| | |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDataPermissionBiz; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.DataPermissionConstants; |
| | |
| | | import com.doumee.service.system.SystemDataPermissionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDataPermissionBiz systemDataPermissionBiz; |
| | | |
| | | @ApiOperation("æ ¹æ®roleIdæ¥è¯¢ä¼ä¸æ°æ®æé") |
| | | @PostMapping("/findByRoleId") |
| | | @CloudRequiredPermission("system:datapermission:query") |
| | | public ApiResponse<SystemDataPermission> findByRoleId (@RequestBody SystemDataPermission pageWrap) { |
| | | return ApiResponse.success(systemDataPermissionService.findByRoleId(pageWrap)); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("system:datapermission:create") |
| | | @CloudRequiredPermission("system:datapermission:create") |
| | | public ApiResponse create(@RequestHeader(Constants.HEADER_USER_TOKEN) String token, @Validated(OperaType.Create.class) @RequestBody SystemDataPermission systemDataPermission) { |
| | | systemDataPermission.setCreateUser(this.getLoginUser(token).getId()); |
| | | return ApiResponse.success(systemDataPermissionBiz.create(systemDataPermission)); |
| | |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("system:datapermission:delete") |
| | | @CloudRequiredPermission("system:datapermission:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | systemDataPermissionService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("system:datapermission:delete") |
| | | @CloudRequiredPermission("system:datapermission:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | |
| | | |
| | | @ApiOperation("ä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("system:datapermission:update") |
| | | @CloudRequiredPermission("system:datapermission:update") |
| | | public ApiResponse updateById(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated(OperaType.Update.class) @RequestBody SystemDataPermission systemDataPermission) { |
| | | systemDataPermission.setUpdateUser(this.getLoginUser(token).getId()); |
| | | systemDataPermissionBiz.update(systemDataPermission); |
| | |
| | | |
| | | @ApiOperation("ä¿®æ¹ç¶æ") |
| | | @PostMapping("/updateStatus") |
| | | @RequiresPermissions("system:datapermission:update") |
| | | @CloudRequiredPermission("system:datapermission:update") |
| | | public ApiResponse updateStatus(@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated(OperaType.UpdateStatus.class) @RequestBody SystemDataPermission systemDataPermission) { |
| | | systemDataPermission.setCreateUser(this.getLoginUser(token).getId()); |
| | | systemDataPermission.setLoginUserInfo(this.getLoginUser(token)); |
| | | systemDataPermissionBiz.updateStatus(systemDataPermission); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("system:datapermission:query") |
| | | @CloudRequiredPermission("system:datapermission:query") |
| | | public ApiResponse<PageData<SystemDataPermissionListVO>> findPage (@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestBody PageWrap<SystemDataPermission> pageWrap) { |
| | | return ApiResponse.success(systemDataPermissionService.findPage(pageWrap)); |
| | | } |
| | |
| | | import com.doumee.dao.system.dto.CreateRoleMenuDTO; |
| | | import com.doumee.dao.system.dto.CreateRolePermissionDTO; |
| | | import com.doumee.dao.system.dto.QuerySystemRoleDTO; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.vo.SystemRoleListVO; |
| | | import com.doumee.service.system.SystemRoleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("é
ç½®è§è²æ°æ®æé") |
| | | @PostMapping("/createRoleDataPermission") |
| | | @CloudRequiredPermission("system:datapermission:create") |
| | | public ApiResponse createRoleDataPermission (@RequestHeader(Constants.HEADER_USER_TOKEN) String token,@Validated @RequestBody SystemDataPermission dto) { |
| | | dto.setLoginUserInfo(this.getLoginUser(token)); |
| | | systemRoleBiz.createRoleDataPermission(dto); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("system:role:create") |
| | |
| | | |
| | | import com.doumee.dao.system.dto.CreateRoleMenuDTO; |
| | | import com.doumee.dao.system.dto.CreateRolePermissionDTO; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | |
| | | import java.util.List; |
| | |
| | | * @date 2023/03/21 14:49 |
| | | */ |
| | | void createRoleMenu(CreateRoleMenuDTO dto); |
| | | |
| | | void createRoleDataPermission(SystemDataPermission dto); |
| | | } |
| | |
| | | import com.doumee.biz.system.SystemRoleBiz; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.system.dto.CreateRoleMenuDTO; |
| | | import com.doumee.dao.system.dto.CreateRolePermissionDTO; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.model.SystemRoleMenu; |
| | | import com.doumee.dao.system.model.SystemRolePermission; |
| | | import com.doumee.service.system.SystemDataPermissionService; |
| | | import com.doumee.service.system.SystemRoleMenuService; |
| | | import com.doumee.service.system.SystemRolePermissionService; |
| | | import com.doumee.service.system.SystemRoleService; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Autowired |
| | | private SystemRoleMenuService systemRoleMenuService; |
| | | @Autowired |
| | | private SystemDataPermissionService systemDataPermissionService; |
| | | |
| | | @Override |
| | | public Integer create(SystemRole systemRole) { |
| | |
| | | systemRoleMenuService.create(newRoleMenu); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void createRoleDataPermission(SystemDataPermission dto) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user ==null){ |
| | | user = dto.getLoginUserInfo(); |
| | | } |
| | | if(dto.getRoleId()==null || dto.getType()==null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼è¯·æ±åæ°ä¸æ£ç¡®ï¼"); |
| | | } |
| | | // å é¤å
³èæé |
| | | SystemDataPermission deleteDto = new SystemDataPermission(); |
| | | deleteDto.setRoleId(dto.getRoleId()); |
| | | |
| | | systemDataPermissionService.delete(deleteDto); |
| | | // æ°å¢æ°çæé |
| | | dto.setDeleted(Boolean.FALSE); |
| | | dto.setBusinessCode("DEPARTMENT"); |
| | | dto.setCreateTime(DateUtil.getCurrentDate()); |
| | | dto.setCreateUser(user.getId()); |
| | | dto.setDisabled(Boolean.FALSE); |
| | | systemDataPermissionService.create(dto); |
| | | } |
| | | } |
| | |
| | | .addPathPatterns(Constants.CLOUD_SERVICE_URL_INDEX+"/**"); |
| | | } |
| | | |
| | | @Bean |
| | | public FilterRegistrationBean addRequestWrapperFilter() { |
| | | FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>(); |
| | | registration.setFilter(new RequestWrapperFilter()); |
| | | registration.setName("RequestWrapperFilter"); |
| | | registration.addUrlPatterns(Constants.CLOUD_SERVICE_URL_INDEX+"/**"); |
| | | registration.setOrder(1); |
| | | return registration; |
| | | } |
| | | // @Bean |
| | | // public FilterRegistrationBean addRequestWrapperFilter() { |
| | | // FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>(); |
| | | // registration.setFilter(new RequestWrapperFilter()); |
| | | // registration.setName("RequestWrapperFilter"); |
| | | // registration.addUrlPatterns(Constants.CLOUD_SERVICE_URL_INDEX+"/**"); |
| | | // registration.setOrder(1); |
| | | // return registration; |
| | | // } |
| | | } |
| | |
| | | // return this.defaultData(loginUserInfo.getId()); |
| | | // } |
| | | SystemDataPermission systemDataPermission = new SystemDataPermission(); |
| | | systemDataPermission.setType((short)0); |
| | | systemDataPermission.setType(0); |
| | | List<SystemDataPermission> dataPermissions = new ArrayList<>(); |
| | | dataPermissions.add(systemDataPermission); |
| | | // æè§è²çæ°æ®æéä¼å
级è¿åæ°æ® |
| | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.PropertyNamingStrategy; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLDecoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | |
| | | public static final String CLOUD_SERVICE_URL_INDEX = "/cloudService"; |
| | | public static final String VISIT_TIPS = "VISIT_TIPS"; |
| | | public static final String VISIT_GUIDEMAP = "VISIT_GUIDEMAP"; |
| | | public static final String HIDDEN_DANGER_FILE = "HIDDEN_DANGER_FILE"; |
| | | public static final String LOG_DEL_DAYS_LIMIT ="LOG_DEL_DAYS_LIMIT" ; |
| | | public static final String HK_LOG_DEL_DAYS_LIMIT ="HK_LOG_DEL_DAYS_LIMIT" ; |
| | | |
| | | public static boolean DEALING_HK_SYNCPRIVILEGE= false; |
| | | public static boolean DEALING_HK_SYNCDEVICE = false; |
| | | public static boolean DEALING_HK_SYNCDEVICE_STATUS = false; |
| | |
| | | // è¶
æ¶é¢è¦é
ç½® |
| | | public static final String TIMEOUT_WARNING = "TIMEOUT_WARNING"; |
| | | // FTPæä»¶æå¡å¨èµæºè®¿é®å°å |
| | | |
| | | public interface DATAPERMISSION_TYPE{ |
| | | public static final int all = 0; |
| | | public static final int departAndChild = 1; |
| | | public static final int departAndLeaf = 2; |
| | | public static final int depart = 3; |
| | | public static final int custom = 4; |
| | | public static final int self = -1; |
| | | } |
| | | public static Date getBirthdyByCardNo(String idCard){ |
| | | if(idCard ==null || idCard.length()<14){ |
| | | return null; |
| | |
| | | this.info = info; |
| | | } |
| | | } |
| | | /** |
| | | * å
³è对象类å |
| | | å
³è对象类å 0ä¼ä¸è¥ä¸æ§ç
§ 1çèµæ¥æ¡äºæ
è§é¢æå¾ç 2çèµåå·¥å
³ç³»è¯æææ 3çèµé¨è¯èµæ 4çèµä½é¢èµæ 5çèµä¼¤æ®èµæ 6çèµèµä»ç»æ¡ææ 7ä¼ä¸èº«ä»½è¯å· 8ä¿åç³è¯·è¡¨PDF 9ç¾ç½²åä¿åç³è¯·è¡¨PDF 10ä¼ä¸ç¾ç« 11æç»æ¥å |
| | | */ |
| | | public enum MultiFile{ |
| | | HIDDEN_DANGER_SUBMIT(0, "éæ£éææææ¥", "éæ£éææææ¥"), |
| | | HIDDEN_DANGER_DEAL_BEFORE(1, "鿣鿿å¤çå", "鿣鿿å¤çå"), |
| | | HIDDEN_DANGER_DEAL_AFTER(2, "鿣鿿å¤çå ", "鿣鿿å¤çå "), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | | private int key; |
| | | private String noteinfo;// æè¿° |
| | | |
| | | // æé æ¹æ³ |
| | | MultiFile(int key, String name, String noteinfo) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.noteinfo = noteinfo; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getName(int index) { |
| | | for (MultiFile c : MultiFile.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getInfo(int index) { |
| | | for (MultiFile c : MultiFile.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.noteinfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set æ¹æ³ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getNoteinfo() { |
| | | return noteinfo; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /** |
| | | * å®¡æ¹æ¨¡æç±»å 0éæ½å·¥äººå访客ç³è¯· 1éæ½å·¥äººå访客ç³è¯· 2访客æ¥å¤ 3å
¬è½¦å¸å
ç¨è½¦ 4å
¬è½¦å®¤å¤ç¨è½¦ 5å¸å
¬å¸ç©æµè½¦é¢çº¦ |
| | | */ |
| | | public enum ApproveTmplType{ |
| | | NOT_SG_VISIT(0, "éæ½å·¥äººå访客ç³è¯·", "éæ½å·¥äººå访客ç³è¯·"), |
| | | SG_VISIT(1, "æ½å·¥äººå访客ç³è¯·", "æ½å·¥äººå访客ç³è¯·"), |
| | | CAR_VISIT(2, "访客æ¥å¤ ", "访客æ¥å¤ "), |
| | | IN_CITY_CAR_USE(3, "å
¬è½¦å¸å
ç¨è½¦ ", "å
¬è½¦å¸å
ç¨è½¦ "), |
| | | OUT_CITY_CAR_USE(4, "å
¬è½¦å®¤å¤ç¨è½¦ ", "å
¬è½¦å®¤å¤ç¨è½¦ "), |
| | | CITY_WLC_BOOK(5, "å¸å
¬å¸ç©æµè½¦é¢çº¦ ", "5å¸å
¬å¸ç©æµè½¦é¢çº¦ "), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | | private int key; |
| | | private String noteinfo;// æè¿° |
| | | |
| | | // æé æ¹æ³ |
| | | ApproveTmplType(int key, String name, String noteinfo) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.noteinfo = noteinfo; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getName(int index) { |
| | | for (ApproveTmplType c : ApproveTmplType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getInfo(int index) { |
| | | for (ApproveTmplType c : ApproveTmplType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.noteinfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set æ¹æ³ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getNoteinfo() { |
| | | return noteinfo; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | public enum NoticeObjectType { |
| | | MEETING_BOOK_SUCCESS(0, "ä¼ä¸é¢å®æå","ä¼ä¸é¢å®æå"), |
| | | MEETING_CACEL(1, "ä¼è®®åæ¶","ä¼è®®åæ¶"), |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.vo.SystemDataPermissionListVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return List<SystemDataPermissionListVO> |
| | | */ |
| | | List<SystemDataPermissionListVO> selectManageList(@Param("dto") SystemDataPermission dto, @Param("orderByClause") String orderByClause); |
| | | |
| | | List<SystemDataPermissionListVO> selectUserList(@Param("dto") SystemDataPermission dto, @Param("role") SystemRole role, @Param("userId") Integer userId); |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "æä»¶å°å") |
| | | @TableField(exist = false) |
| | | private String fileFullUrl; |
| | | private String fileurlFull; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "æéç±»åï¼0å
¨é¨ï¼1èªå®ä¹ï¼2ä»
ç¨æ·æå±ï¼3ç¨æ·æå±åå
¶åæ°æ®ï¼", example = "1") |
| | | @NotNull(message = "æéç±»åä¸è½ä¸ºç©º", groups = {OperaType.Create.class, OperaType.Update.class}) |
| | | private Short type; |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "èªå®ä¹æ°æ®") |
| | | private String customData; |
| | |
| | | import javax.validation.constraints.Pattern; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç³»ç»ç¨æ· |
| | |
| | | @ApiModelProperty(value = "0 å¯ç¨ 1 ç¦ç¨") |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | @ApiModelProperty(value = "æ°æ®æéå
é¨é¨ç¼ç éå") |
| | | @TableField(exist = false) |
| | | private List<Integer> companyIdList; |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.system.vo.SystemDataPermissionListVO; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return long |
| | | */ |
| | | long count(SystemDataPermission systemDataPermission); |
| | | |
| | | List<Integer> selectHighRole(SystemDataPermission systemDataPermission, SystemRole rt, SystemUser user); |
| | | |
| | | SystemDataPermission findByRoleId(SystemDataPermission pageWrap); |
| | | } |
| | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | |
| | | queryWrapper.selectAll(Notices.class); |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.eq(Notices::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | |
| | | }else{ |
| | | queryWrapper.orderByDesc(Notices::getCreateDate); |
| | | } |
| | | |
| | | PageData<Notices> pageData = PageData.from(noticesMapper.selectJoinPage(page,Notices.class, queryWrapper)); |
| | | |
| | | return pageData; |
| | |
| | | package com.doumee.service.system.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.system.SystemDataPermissionMapper; |
| | | import com.doumee.dao.system.SystemRoleMapper; |
| | | import com.doumee.dao.system.model.SystemDataPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.system.vo.SystemDataPermissionListVO; |
| | | import com.doumee.service.system.SystemDataPermissionService; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ°æ®æéé
ç½®Serviceå®ç° |
| | |
| | | |
| | | @Autowired |
| | | private SystemRoleMapper systemRoleMapper; |
| | | @Autowired |
| | | private CompanyMapper companyMapper; |
| | | |
| | | @Override |
| | | public Integer create(SystemDataPermission systemDataPermission) { |
| | |
| | | Wrapper<SystemDataPermission> wrapper = new QueryWrapper<>(systemDataPermission); |
| | | return systemDataPermissionMapper.selectCount(wrapper); |
| | | } |
| | | @Override |
| | | public SystemDataPermission findByRoleId(SystemDataPermission pageWrap){ |
| | | if ( pageWrap.getRoleId() == null) { |
| | | return null; |
| | | } |
| | | |
| | | // æ¥è¯¢æ°æ®æé |
| | | QueryWrapper<SystemDataPermission> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda() |
| | | .eq(SystemDataPermission::getBusinessCode, "DEPARTMENT") |
| | | .eq(SystemDataPermission::getRoleId, pageWrap.getRoleId()) |
| | | .eq(SystemDataPermission::getDeleted, Boolean.FALSE) |
| | | .eq(SystemDataPermission::getDisabled, Boolean.FALSE); |
| | | List<SystemDataPermission> result = systemDataPermissionMapper.selectList(queryWrapper); |
| | | if(result!=null && result.size()>0){ |
| | | return result.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Integer> selectHighRole(SystemDataPermission model, SystemRole role, SystemUser user) { |
| | | List<SystemDataPermissionListVO>list = systemDataPermissionMapper.selectUserList(model,role,user.getId()) ; |
| | | if(list !=null){ |
| | | boolean all = false; |
| | | boolean departAndChild=false; |
| | | boolean depart=false; |
| | | boolean departAndLeaf=false; |
| | | boolean custom=false; |
| | | String c = ""; |
| | | for(SystemDataPermissionListVO d : list){ |
| | | if(!all && Constants.equalsInteger(d.getType(),Constants.DATAPERMISSION_TYPE.all)){ |
| | | all =true; |
| | | } |
| | | if(!depart && Constants.equalsInteger(d.getType(),Constants.DATAPERMISSION_TYPE.depart)){ |
| | | depart =true; |
| | | } |
| | | if(!departAndChild && Constants.equalsInteger(d.getType(),Constants.DATAPERMISSION_TYPE.departAndChild)){ |
| | | departAndChild =true; |
| | | } |
| | | if(!departAndLeaf && Constants.equalsInteger(d.getType(),Constants.DATAPERMISSION_TYPE.departAndLeaf)){ |
| | | departAndLeaf =true; |
| | | } |
| | | if( Constants.equalsInteger(d.getType(),Constants.DATAPERMISSION_TYPE.custom)){ |
| | | custom =true; |
| | | c += StringUtils.defaultString(d.getCustomData(),""); |
| | | } |
| | | } |
| | | Company department = new Company(); |
| | | department.setId(user.getCompanyId()); |
| | | |
| | | if(all){ |
| | | return null; |
| | | }else{ |
| | | List<Integer> dList = new ArrayList<>(); |
| | | dList.add(-1);//èæé¨é¨ï¼ææ¥ç©ºéå |
| | | if(custom) { |
| | | //妿æèªå®ä¹é¨é¨ |
| | | String[] idStrs = c.split(","); |
| | | for(String s :idStrs){ |
| | | try { |
| | | Integer si = Integer.parseInt(s); |
| | | if(!isExists(si,dList)){ |
| | | dList.add(si); |
| | | } |
| | | }catch (Exception e){ |
| | | } |
| | | } |
| | | } |
| | | if(departAndLeaf){ |
| | | if(department!= null){ |
| | | dList.addAll(userDataPermissonList(department,true)); |
| | | } |
| | | }else if(departAndChild){ |
| | | if(department!= null) { |
| | | dList.addAll(userDataPermissonList(department, false)); |
| | | } |
| | | }else if(depart){ |
| | | if(department!= null && !isExists(department.getId(), dList)){ |
| | | dList.add(department.getId()); |
| | | } |
| | | } |
| | | return dList; |
| | | } |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | public List<Integer> userDataPermissonList(Company depart ,boolean isleaf) { |
| | | List<Integer> pool = new ArrayList<>(); |
| | | List<Company> departList = companyMapper.selectList(new QueryWrapper<Company>().lambda() |
| | | .eq(Company::getIsdeleted,Constants.ZERO ) ); |
| | | pool.add(depart.getId()); |
| | | this.fillDepartChildren(pool, Arrays.asList(depart.getId()),isleaf,departList); |
| | | return pool; |
| | | } |
| | | |
| | | private void fillDepartChildren(List<Integer> pool, List<Integer> asList, boolean isleaf, List<Company> departList) { |
| | | List<Company> departments = getDepartListByParentIds(asList,departList); |
| | | List<Integer> ids = departments.stream().map(Company::getId).collect(Collectors.toList()); |
| | | if(isleaf){ |
| | | if (ids.size() > 0) { |
| | | pool.addAll(ids); |
| | | this.fillDepartChildren(pool, ids,isleaf,departList); |
| | | } |
| | | }else{ |
| | | pool.addAll(ids); |
| | | } |
| | | |
| | | } |
| | | |
| | | private List<Company> getDepartListByParentIds(List<Integer> asList, List<Company> departList) { |
| | | List<Company> list = new ArrayList<>(); |
| | | if(asList.size()>0){ |
| | | for(Integer id : asList){ |
| | | list.addAll(getDepartListByParentId(id,departList)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | private List<Company> getDepartListByParentId(Integer pId, List<Company> departList) { |
| | | List<Company> list = new ArrayList<>(); |
| | | if(departList!= null){ |
| | | for(Company d :departList){ |
| | | if(Constants.equalsInteger(d.getParentId(),pId)){ |
| | | list.add(d); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | private boolean isExists(Integer s, List<Integer> dList) { |
| | | if(dList!=null){ |
| | | for(Integer t : dList){ |
| | | if(Constants.equalsInteger(s,t)){ |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.system.dto.LoginDTO; |
| | | import com.doumee.dao.system.model.SystemLoginLog; |
| | | import com.doumee.dao.system.model.SystemPermission; |
| | | import com.doumee.dao.system.model.SystemRole; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.system.model.*; |
| | | import com.doumee.service.common.CaptchaService; |
| | | import com.doumee.service.system.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Autowired |
| | | private SystemUserService systemUserService; |
| | | |
| | | @Lazy |
| | | @Autowired |
| | | private SystemDataPermissionService systemDataPermissionService; |
| | | @Lazy |
| | | @Autowired |
| | | private SystemRoleService systemRoleService; |
| | |
| | | // è·åç»å½ç¨æ·ä¿¡æ¯ |
| | | List<SystemRole> roles = systemRoleService.findByUserId(user.getId()); |
| | | List<SystemPermission> permissions = systemPermissionService.findByUserId(user.getId()); |
| | | |
| | | SystemRole rt = new SystemRole(); |
| | | rt.setDeleted(Boolean.FALSE); |
| | | //æ°æ®é¨é¨æééå |
| | | user.setCompanyIdList(systemDataPermissionService.selectHighRole(new SystemDataPermission(),rt,user)); |
| | | |
| | | LoginUserInfo userInfo = LoginUserInfo.from(user, roles, permissions,null); |
| | | return userInfo; |
| | | } |
| | |
| | | package com.doumee.service.timer; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.timer.entity.JobState; |
| | | import com.doumee.dao.timer.entity.QuartzJob; |
| | | import com.doumee.dao.timer.mapper.QuartzJobMapper; |
| | |
| | | quartzManage.run(quartzJob); |
| | | } |
| | | } |
| | | |
| | | public PageData<QuartzJob> findPage(PageWrap<QuartzJob> pageWrap) { |
| | | IPage<QuartzJob> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<QuartzJob> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.lambda() |
| | | .eq(pageWrap.getModel().getId() != null, QuartzJob::getId, pageWrap.getModel().getId()) |
| | | .eq(pageWrap.getModel().getParams() != null, QuartzJob::getParams, pageWrap.getModel().getParams()) |
| | | .like(pageWrap.getModel().getBeanName() != null, QuartzJob::getBeanName, pageWrap.getModel().getBeanName()) |
| | | .eq(pageWrap.getModel().getState() != null, QuartzJob::getState, pageWrap.getModel().getState()) |
| | | .eq(pageWrap.getModel().getRemark() != null, QuartzJob::getRemark, pageWrap.getModel().getRemark()) |
| | | .like(pageWrap.getModel().getModule() != null, QuartzJob::getModule, pageWrap.getModel().getModule()) |
| | | ; |
| | | return PageData.from(quartzJobMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | |
| | | public void updateById(QuartzJob model) { |
| | | QuartzJob quartzJob = quartzJobMapper.selectById(model.getId()) ; |
| | | if (Objects.isNull(quartzJob)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | pause(model.getId());//æå |
| | | //å
å é¤å°±ä»»å¡ |
| | | quartzManage.deleteJob(model.getId()); |
| | | quartzJob.setState(JobState.JOB_STOP.getStatus()); |
| | | quartzJobMapper.updateById(quartzJob) ; |
| | | } |
| | | } |
| | |
| | | </where> |
| | | ${orderByClause} |
| | | </select> |
| | | |
| | | <select id="selectUserList" resultMap="SystemDataPermissionListVO"> |
| | | SELECT |
| | | sdp.`ID`, sdp.`BUSINESS_CODE`, sdp.`ROLE_ID`, sdp.`TYPE`, sdp.`CUSTOM_DATA`, sdp.`DISABLED`, sdp.`REMARK`, sdp.DISABLED, sdp.`CREATE_TIME`, sdp.`UPDATE_TIME`, |
| | | role.`ID` AS ROLE_ID, role.`CODE` AS ROLE_CODE, role.`NAME` AS ROLE_NAME, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_DATA_PERMISSION sdp |
| | | INNER JOIN `SYSTEM_ROLE` role ON role.ID = sdp.ROLE_ID |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = sdp.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = sdp.UPDATE_USER |
| | | <where> |
| | | sdp.DELETED = 0 |
| | | <if test="dto.businessCode != null and dto.businessCode != ''"> |
| | | AND sdp.`BUSINESS_CODE` = #{dto.businessCode} |
| | | </if> |
| | | <if test="dto.roleId != null"> |
| | | AND role.`ID` = #{dto.roleId} |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | AND sdp.`TYPE` = #{dto.type} |
| | | </if> |
| | | <if test="role.companyId != null"> |
| | | AND role.`COMPANY_ID` = #{role.companyId} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND exists (select sr.id from system_user_role sr where sr.role_id=sdp.role_id and sr.user_id=#{userId} and sr.STATUS=0 and sr.deleted=0) |
| | | </if> |
| | | </where> |
| | | order by role.`TYPE` asc |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.timer; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.timer.entity.QuartzJob; |
| | | import com.doumee.service.timer.QuartzJobService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @since 2024/04/28 16:06 |
| | | */ |
| | | @Api(tags = "ä½ä¸è°åº¦å¹³å°æ¥å£äº¤äºè®°å½") |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/quartz") |
| | | public class QuartzCloudController extends BaseController { |
| | | |
| | | @Autowired |
| | | private QuartzJobService quartzJobService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:quartz:create") |
| | | public ApiResponse create(@RequestBody QuartzJob quartzJob ,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | quartzJobService.insert(quartzJob) ; |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:quartz:update") |
| | | public ApiResponse updateById(@RequestBody QuartzJob quartzJob,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | quartzJobService.update(quartzJob); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation( "忢任å¡") |
| | | @GetMapping("/pause/{id}") |
| | | @CloudRequiredPermission("business:quartz:update") |
| | | public ApiResponse pause(@PathVariable("id") Integer id) { |
| | | quartzJobService.pause(id); return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation( "æ¢å¤ä»»å¡") |
| | | @GetMapping("/resume/{id}") |
| | | @CloudRequiredPermission("business:quartz:update") |
| | | public ApiResponse resume(@PathVariable("id") Integer id) { |
| | | quartzJobService.resume(id) ; return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation( "æ§è¡ä¸æ¬¡") |
| | | @GetMapping("/runOnce/{id}") |
| | | @CloudRequiredPermission("business:quartz:update") |
| | | public ApiResponse runOnce(@PathVariable("id") Integer id) { |
| | | quartzJobService.runOnce(id) ; return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:quartz:query") |
| | | public ApiResponse<PageData<QuartzJob>> findPage (@RequestBody PageWrap<QuartzJob> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(quartzJobService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:quartz:query") |
| | | public ApiResponse<QuartzJob> findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success( quartzJobService.getById(id)); |
| | | } |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/quartz") |
| | | @RequestMapping( "/business/quartz") |
| | | @Api(tags = "宿¶ä»»å¡æ¥å£") |
| | | public class QuartzController { |
| | | |
| ÎļþÃû´Ó server/visits/admin_timer/src/main/java/com/doumee/api/HkLogTimerController.java ÐÞ¸Ä |
| | |
| | | package com.doumee.api; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.service.business.InterfaceLogService; |
| | | import com.doumee.service.business.impl.hksync.HkSyncVisitServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncVisitFromHKServiceImpl; |
| | | import com.doumee.service.business.PlatformInterfaceLogService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | |
| | | @Api(tags = "æ¥å¿å®æ¶å¨æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/timer/log") |
| | | public class HkLogTimerController extends BaseController { |
| | | public class InterfaceLogTimerController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InterfaceLogService interfaceLogService; |
| | | @Autowired |
| | | private PlatformInterfaceLogService platformInterfaceLogService; |
| | | @ApiOperation("å¼å¯å®æ¶æ¥å£æ¥å¿æ¸
ç") |
| | | @GetMapping("/clearThreeMonthLog") |
| | | public ApiResponse clearThreeMonthLog() { |
| | | interfaceLogService.clearThreeMonthLog(); |
| | | platformInterfaceLogService.clearThreeMonthLog(); |
| | | return ApiResponse.success("å¼å¯å®æ¶æ¥å£æ¥å¿æ¸
çæå"); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:approvetempl:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | approveTemplService.deleteById(id); |
| | | approveTemplService.deleteById(id,this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:approvetempl:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | approveTemplService.deleteByIdInBatch(this.getIdList(ids)); |
| | | approveTemplService.deleteByIdInBatch(this.getIdList(ids),this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:hiddendangerparam:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | hiddenDangerParamService.deleteById(id); |
| | | hiddenDangerParamService.deleteById(id,this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:hiddendangerparam:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | hiddenDangerParamService.deleteByIdInBatch(this.getIdList(ids)); |
| | | hiddenDangerParamService.deleteByIdInBatch(this.getIdList(ids),this.getLoginUser(null)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:approvetempl:create") |
| | | public ApiResponse create(@RequestBody ApproveTempl approveTempl,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | approveTempl.setLoginUserInfo(this.getLoginUser(token)); |
| | | return ApiResponse.success(approveTemplService.create(approveTempl)); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("å叿¨¡ç") |
| | | @PostMapping("/save") |
| | | @CloudRequiredPermission("business:approvetempl:create") |
| | | public ApiResponse save(@RequestBody ApproveTempl approveTempl,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | approveTempl.setLoginUserInfo(this.getLoginUser(token)); |
| | | return ApiResponse.success(approveTemplService.save(approveTempl)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:approvetempl:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | approveTemplService.deleteById(id); |
| | | approveTemplService.deleteById(id,this.getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:approvetempl:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | approveTemplService.deleteByIdInBatch(this.getIdList(ids)); |
| | | approveTemplService.deleteByIdInBatch(this.getIdList(ids),this.getLoginUser(token)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:approvetempl:update") |
| | | public ApiResponse updateById(@RequestBody ApproveTempl approveTempl,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | approveTempl.setLoginUserInfo(this.getLoginUser(token)); |
| | | approveTemplService.updateById(approveTempl); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.ApproveParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/28 11:46 |
| | | */ |
| | | public interface ApproveParamMapper extends BaseMapper<ApproveParam> { |
| | | |
| | | void insertBatchSomeColumn(List<ApproveParam> paramList); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.HiddenDanger; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @since 2024/04/28 16:06 |
| | | */ |
| | | public interface HiddenDangerMapper extends BaseMapper<HiddenDanger> { |
| | | public interface HiddenDangerMapper extends MPJBaseMapper<HiddenDanger> { |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="ERP审æ¹ç¼ç ") |
| | | private String erpId; |
| | | |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0å¾
å®¡æ¹ 1审æ¹ä¸ 2审æ¹éè¿ 3å®¡æ¹æªéè¿ 4ä»äººå·²å¤ç", example = "1") |
| | | @ExcelColumn(name="审æ¹ç¶æ 0å¾
å®¡æ¹ 1审æ¹ä¸ 2审æ¹éè¿ 3å®¡æ¹æªéè¿ 4ä»äººå·²å¤ç") |
| | | @ApiModelProperty(value = "审æ¹ç¶æ 0å¾
èªå·±å®¡æ¹å®¡æ¹ 1å¾
èªå·±å®¡æ¹ 2审æ¹éè¿ 3å®¡æ¹æªéè¿ 4ä»äººå·²å¤ç ", example = "1") |
| | | @ExcelColumn(name="审æ¹ç¶æ 0å¾
èªå·±å®¡æ¹å®¡æ¹ 1å¾
èªå·±å®¡æ¹ 2审æ¹éè¿ 3å®¡æ¹æªéè¿ 4ä»äººå·²å¤ç") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "ç¶æä¿¡æ¯") |
| | |
| | | @ApiModelProperty(value = "审æ¹äººç¼ç ï¼å¤ä¸ªç¨è±æéå·éå¼") |
| | | @ExcelColumn(name="审æ¹äººç¼ç ï¼å¤ä¸ªç¨è±æéå·éå¼") |
| | | private String objIds; |
| | | @ApiModelProperty(value = "模çId") |
| | | @ExcelColumn(name="模çId") |
| | | private Integer templId; |
| | | @ApiModelProperty(value = "æ¯å¦æå®å¸æºé¡¹ 0å¦ 1æ¯") |
| | | @ExcelColumn(name="æ¯å¦æå®å¸æºé¡¹ 0å¦ 1æ¯") |
| | | private Integer driverParam; |
| | | @ApiModelProperty(value = "æ¯å¦ä¿®æ¹ç®çå° 0å¦ 1æ¯") |
| | | @ExcelColumn(name="æ¯å¦ä¿®æ¹ç®çå° 0å¦ 1æ¯") |
| | | private Integer addrParam; |
| | | |
| | | @ApiModelProperty(value = "审æ¹ä¸»ç®¡ç级 0ç´æ¥ä¸»ç®¡ 1äºçº§ä¸»ç®¡ 2ä¸çº§ä¸»ç®¡ 4å级主管", example = "1") |
| | | @ExcelColumn(name="审æ¹ä¸»ç®¡ç级 0ç´æ¥ä¸»ç®¡ 1äºçº§ä¸»ç®¡ 2ä¸çº§ä¸»ç®¡ 4å级主管") |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å®¡æ¹æ¨¡çä¿¡æ¯è¡¨ |
| | |
| | | @ExcelColumn(name="åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "å®¡æ¹æ¨¡çé
ç½®æç»éå") |
| | | @TableField(exist = false) |
| | | private List<ApproveParam> paramList; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éæ£ä¿¡æ¯è¡¨ |
| | |
| | | @ApiModelProperty(value = "æ¥è¯¢æªæ¢å§æ¶é´ï¼åºäºææ¥æ¶é´ï¼", example = "2024-05-20 11:48:46") |
| | | @TableField(exist = false) |
| | | private Date queryEndTime; |
| | | @ApiModelProperty(value = "ç°åºæ
嵿æ¥éä»¶éå") |
| | | @TableField(exist = false) |
| | | private List<Multifile> submitFileList; |
| | | @ApiModelProperty(value = "å¤çåéä»¶éå") |
| | | @TableField(exist = false) |
| | | private List<Multifile> dealBeforeFileList; |
| | | @ApiModelProperty(value = "å¤çåéä»¶éå") |
| | | @TableField(exist = false) |
| | | private List<Multifile> dealAfterFileList; |
| | | |
| | | } |
| | |
| | | private String imgurl; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0å³å¡è®¿å®¢ 1æ®é访客 2å
é¨äººå", example = "1") |
| | | @ExcelColumn(name="ç±»å 0å³å¡è®¿å®¢ 1æ®é访客 2å
é¨äººå") |
| | | @ExcelColumn(name="ç±»å 0å³å¡è®¿å®¢ 1æ®é访客 2å
é¨äººå") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "访客åç§°/å
é¨äººå") |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.ApproveTempl; |
| | |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | void deleteById(Integer id, LoginUserInfo user); |
| | | |
| | | /** |
| | | * å é¤ |
| | |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | void deleteByIdInBatch(List<Integer> ids, LoginUserInfo user); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | |
| | | * @return long |
| | | */ |
| | | long count(ApproveTempl approveTempl); |
| | | |
| | | int save(ApproveTempl approveTempl); |
| | | } |
| | |
| | | * @return long |
| | | */ |
| | | long count(PlatformInterfaceLog platformInterfaceLog); |
| | | |
| | | void clearThreeMonthLog(); |
| | | } |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.ApproveParamMapper; |
| | | import com.doumee.dao.business.ApproveTemplMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.model.ApproveTempl; |
| | | import com.doumee.dao.business.model.CarDriver; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.ApproveTemplService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | |
| | | @Autowired |
| | | private ApproveTemplMapper approveTemplMapper; |
| | | @Autowired |
| | | private ApproveParamMapper approveParamMapper; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public int save(ApproveTempl model) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(loginUserInfo == null){ |
| | | loginUserInfo = model.getLoginUserInfo(); |
| | | } |
| | | if(model.getType() == null || Constants.ApproveTmplType.getName(model.getType()) == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | ApproveTempl template = approveTemplMapper.selectOne(new QueryWrapper<ApproveTempl>().lambda() |
| | | .eq(ApproveTempl::getType,model.getType() ) |
| | | .eq(ApproveTempl::getIsdeleted,Constants.ZERO) |
| | | .last("limit 1")); |
| | | Date date =new Date(); |
| | | if(template == null){ |
| | | //å¦ææ¨¡çæ²¡æï¼åæ°å¢ |
| | | template = new ApproveTempl(); |
| | | template.setType(model.getType()); |
| | | template.setCreateDate(date); |
| | | template.setCreator(loginUserInfo.getId()); |
| | | template.setEditDate(date); |
| | | template.setIsdeleted(Constants.ZERO); |
| | | template.setEditor(loginUserInfo.getId()); |
| | | template.setName(Constants.ApproveTmplType.getName(model.getType())); |
| | | approveTemplMapper.insert(template); |
| | | } |
| | | if(model.getParamList()!=null && model.getParamList().size()>0){ |
| | | for(ApproveParam param : model.getParamList()){ |
| | | param.setCreateDate(date); |
| | | param.setCreator(loginUserInfo.getId()); |
| | | param.setEditDate(date); |
| | | param.setEditor(loginUserInfo.getId()); |
| | | param.setIsdeleted(Constants.ZERO); |
| | | param.setTemplId(template.getId()); |
| | | param.setType(Constants.formatIntegerNum(param.getType())); |
| | | param.setAddrParam(Constants.formatIntegerNum(param.getAddrParam())); |
| | | param.setDriverParam(Constants.formatIntegerNum(param.getDriverParam())); |
| | | param.setApproveType(Constants.formatIntegerNum(param.getApproveType())); |
| | | } |
| | | //å
æ¸
é¤åæ¥ææçå°±éªé
ç½® |
| | | approveParamMapper.delete(new UpdateWrapper<ApproveParam>().lambda() |
| | | .eq(ApproveParam::getTemplId,template.getId())); |
| | | //æ¹éæå
¥æ°çé
ç½® |
| | | approveParamMapper.insertBatchSomeColumn(model.getParamList()); |
| | | } |
| | | return model.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer create(ApproveTempl model) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | approveTemplMapper.deleteById(id); |
| | | public void deleteById(Integer id, LoginUserInfo userInfo) { |
| | | ApproveTempl model = new ApproveTempl(); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(userInfo.getId()); |
| | | model.setId(id); |
| | | model.setIsdeleted(Constants.ONE); |
| | | approveTemplMapper.updateById(model); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | public void deleteByIdInBatch(List<Integer> ids, LoginUserInfo user) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | approveTemplMapper.deleteBatchIds(ids); |
| | | for(Integer id:ids){ |
| | | deleteById(id,user); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(loginUserInfo.getId()); |
| | | model.setStatus(Constants.ZERO); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | hiddenDangerParamMapper.insert(model); |
| | | return model.getId(); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | import com.doumee.dao.business.HiddenDangerMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.doumee.service.business.HiddenDangerService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * éæ£ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | |
| | | @Autowired |
| | | private HiddenDangerMapper hiddenDangerMapper; |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | |
| | |
| | | |
| | | @Override |
| | | public HiddenDanger findById(Integer id) { |
| | | return hiddenDangerMapper.selectById(id); |
| | | } |
| | | MPJLambdaWrapper<HiddenDanger> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(HiddenDanger.class) |
| | | .selectAs(HiddenDangerParam::getName,HiddenDanger::getCategoryName) |
| | | .select("t1.name", HiddenDanger::getMemberName) |
| | | .select("t1.phone",HiddenDanger::getMemberPhone) |
| | | .select("t2.name",HiddenDanger::getCheckorName) |
| | | .select("t3.phone",HiddenDanger::getCheckorPhone) |
| | | .select("t4.company_name_path",HiddenDanger::getCompanyName); |
| | | queryWrapper.leftJoin(Member.class,Member::getId,HiddenDanger::getMemberId) |
| | | .leftJoin("company t4 on t1.company_id=t4.id") |
| | | .leftJoin(Member.class,Member::getId,HiddenDanger::getCheckUserId) |
| | | .leftJoin(HiddenDangerParam.class,HiddenDangerParam::getId,HiddenDanger::getCateId); |
| | | queryWrapper |
| | | .eq(HiddenDanger::getId, id).last("limit 1"); |
| | | |
| | | HiddenDanger model = hiddenDangerMapper.selectJoinOne(HiddenDanger.class,queryWrapper); |
| | | if(model ==null || Constants.equalsObject(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | initFiles(model); |
| | | return model; |
| | | } |
| | | private void initFiles(HiddenDanger unionChange) { |
| | | List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId, unionChange.getId() ) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{Constants.MultiFile.HIDDEN_DANGER_SUBMIT.getKey() |
| | | ,Constants.MultiFile.HIDDEN_DANGER_DEAL_BEFORE.getKey() |
| | | ,Constants.MultiFile.HIDDEN_DANGER_DEAL_AFTER.getKey()})) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO)); |
| | | if(multifiles!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.OSS,Constants.HIDDEN_DANGER_FILE).getCode(); |
| | | for(Multifile f : multifiles){ |
| | | if(StringUtils.isBlank(f.getFileurl())){ |
| | | continue; |
| | | } |
| | | f.setFileurlFull(path+f.getFileurl()); |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HIDDEN_DANGER_SUBMIT.getKey())){ |
| | | //ç°åºæ
åµ |
| | | if(unionChange.getSubmitFileList() == null){ |
| | | unionChange.setSubmitFileList(new ArrayList<>()); |
| | | } |
| | | unionChange.getSubmitFileList().add(f); |
| | | } |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HIDDEN_DANGER_DEAL_BEFORE.getKey())){ |
| | | //å¤çåéä»¶ |
| | | if(unionChange.getDealBeforeFileList() == null){ |
| | | unionChange.setDealBeforeFileList(new ArrayList<>()); |
| | | } |
| | | unionChange.getDealBeforeFileList().add(f); |
| | | } |
| | | if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.HIDDEN_DANGER_DEAL_AFTER.getKey())){ |
| | | //å¤çåéä»¶ |
| | | if(unionChange.getDealAfterFileList() == null){ |
| | | unionChange.setDealAfterFileList(new ArrayList<>()); |
| | | } |
| | | unionChange.getDealAfterFileList().add(f); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public HiddenDanger findOne(HiddenDanger hiddenDanger) { |
| | | QueryWrapper<HiddenDanger> wrapper = new QueryWrapper<>(hiddenDanger); |
| | |
| | | .eq(pageWrap.getModel().getChecklInfo() != null, HiddenDanger::getChecklInfo, pageWrap.getModel().getChecklInfo()) |
| | | .eq(pageWrap.getModel().getCheckUserId() != null, HiddenDanger::getCheckUserId, pageWrap.getModel().getCheckUserId()) |
| | | .eq(pageWrap.getModel().getAreaName() != null, HiddenDanger::getAreaName, pageWrap.getModel().getAreaName()) |
| | | |
| | | .and(StringUtils.isNotBlank(pageWrap.getModel().getMemberName()), ms->ms.like(Member::getName,pageWrap.getModel().getMemberName()) |
| | | .or().like(Member::getPhone,pageWrap.getModel().getMemberName())) |
| | | .ge(Objects.nonNull(pageWrap.getModel().getQueryStartTime()), Empower::getCreateDate,pageWrap.getModel().getQueryStartTime()) |
| | |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(hiddenDangerMapper.selectPage(page, queryWrapper)); |
| | | return PageData.from(hiddenDangerMapper.selectJoinPage(page,HiddenDanger.class, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.InterfaceLogMapper; |
| | | import com.doumee.dao.business.model.InterfaceLog; |
| | |
| | | |
| | | @Autowired |
| | | private InterfaceLogMapper interfaceLogMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Override |
| | | public Integer create(InterfaceLog interfaceLog) { |
| | |
| | | } |
| | | @Override |
| | | public void clearThreeMonthLog() { |
| | | int days =15; |
| | | try { |
| | | days = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.HK_LOG_DEL_DAYS_LIMIT).getCode()); |
| | | }catch (Exception e){} |
| | | interfaceLogMapper.delete(new UpdateWrapper<InterfaceLog>().lambda() |
| | | .apply("to_days(create_date)+15 < to_days(now())") |
| | | .like(InterfaceLog::getUrl,"/artemis/api/")); |
| | | .apply("to_days(create_date)+"+days+" < to_days(now())") ); |
| | | } |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.PlatformInterfaceLogMapper; |
| | | import com.doumee.dao.business.model.InterfaceLog; |
| | | import com.doumee.dao.business.model.PlatformInterfaceLog; |
| | | import com.doumee.service.business.PlatformInterfaceLogService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | */ |
| | | @Service |
| | | public class PlatformInterfaceLogServiceImpl implements PlatformInterfaceLogService { |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private PlatformInterfaceLogMapper platformInterfaceLogMapper; |
| | |
| | | QueryWrapper<PlatformInterfaceLog> wrapper = new QueryWrapper<>(platformInterfaceLog); |
| | | return platformInterfaceLogMapper.selectCount(wrapper); |
| | | } |
| | | @Override |
| | | public void clearThreeMonthLog() { |
| | | int days =15; |
| | | try { |
| | | days = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.LOG_DEL_DAYS_LIMIT).getCode()); |
| | | }catch (Exception e){} |
| | | platformInterfaceLogMapper.delete(new UpdateWrapper<PlatformInterfaceLog>().lambda() |
| | | .apply("to_days(create_date)+"+days+" < to_days(now())")); |
| | | } |
| | | } |