| | |
| | | export function create (data) { |
| | | return request.post('/business/category/create', data) |
| | | } |
| | | export function updateStatus (data) { |
| | | return request.post('/business/category/updateStatus', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤" prop="deleted"> |
| | | <el-input v-model="form.deleted" placeholder="请è¾å
¥æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤" v-trim/> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ:0=å¯ç¨ï¼1=ç¦ç¨ï¼" prop="status"> |
| | | <el-input v-model="form.status" placeholder="请è¾å
¥ç¶æ:0=å¯ç¨ï¼1=ç¦ç¨ï¼" v-trim/> |
| | | <el-form-item v-if="form.type == 1 || form.type == 2" :label=" form.type == 1?'车è¾è§æ ¼':'餿 é
ç½®'" prop="detailList"> |
| | | <el-input v-model="form.detailList" placeholder="请è¾å
¥å
容" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å建人ç¼ç " prop="createUser"> |
| | | <el-input v-model="form.createUser" placeholder="请è¾å
¥å建人ç¼ç " v-trim/> |
| | | <el-form-item v-if="form.type == 1" label="徿 " prop="icon"> |
| | | <UploadAvatarImage |
| | | :file="{ imgurlfull: form.iconFull, imgurl: form.icon }" |
| | | :uploadData="uploadData" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´" prop="createTime"> |
| | | <el-date-picker v-model="form.createTime" value-format="yyyy-MM-dd" placeholder="请è¾å
¥å建æ¶é´"></el-date-picker> |
| | | <el-form-item v-if="form.type == 1" label="æ¯å¦åºå®è½¦è¾" prop="isFixed"> |
| | | <el-radio-group v-model="form.isFixed"> |
| | | <el-radio :label="0">éåºå®</el-radio> |
| | | <el-radio :label="1">åºå®è½¦å</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ°äººç¼ç " prop="updateUser"> |
| | | <el-input v-model="form.updateUser" placeholder="请è¾å
¥æ´æ°äººç¼ç " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ°æ¶é´" prop="updateTime"> |
| | | <el-date-picker v-model="form.updateTime" value-format="yyyy-MM-dd" placeholder="请è¾å
¥æ´æ°æ¶é´"></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="åä½åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åä½åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" prop="type"> |
| | | <el-input v-model="form.type" placeholder="请è¾å
¥ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" prop="detail"> |
| | | <el-input v-model="form.detail" placeholder="请è¾å
¥å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="徿 ï¼è½¦è¾ç±»å使ç¨ï¼" prop="icon"> |
| | | <el-input v-model="form.icon" placeholder="请è¾å
¥å¾æ ï¼è½¦è¾ç±»å使ç¨ï¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" prop="isFixed"> |
| | | <el-input v-model="form.isFixed" placeholder="请è¾å
¥æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" v-trim/> |
| | | <el-form-item label="æåºç " prop="sortnum"> |
| | | <el-input v-model="form.sortnum" placeholder="请è¾å
¥æåºç " v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | export default { |
| | | name: 'OperaCategoryWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | components: { GlobalWindow ,UploadAvatarImage}, |
| | | data () { |
| | | return { |
| | | isUploading: false, |
| | | uploadData: { |
| | | folder: 'category' |
| | | }, |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | deleted: '', |
| | | status: '', |
| | | createUser: '', |
| | | createTime: '', |
| | | updateUser: '', |
| | | updateTime: '', |
| | | remark: '', |
| | | status: 0, |
| | | sortnum: null, |
| | | name: '', |
| | | type: '', |
| | | detail: '', |
| | | type: null, |
| | | detailList: [], |
| | | icon: '', |
| | | isFixed: '' |
| | | isFixed: 0 |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | |
| | | api: '/business/category', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods:{ |
| | | uploadAvatarSuccess (file) { |
| | | this.$set(this.param, 'icon', file.imgurl) |
| | | this.$set(this.param, 'iconFull', file.imgurlfull) |
| | | }, |
| | | open(title, target, type) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.form = { |
| | | id: null, |
| | | status: 0, |
| | | sortnum: null, |
| | | name: '', |
| | | type: type, |
| | | detailList: [], |
| | | icon: '', |
| | | isFixed: 0 |
| | | } |
| | | // æ°å»º |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | this.form.type = type |
| | | }) |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-input type="textarea" rows="5" v-model="form.auditRemark" placeholder="请è¾å
¥è®¤è¯å®¡æ ¸å¤æ³¨" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button @click="checkDo(2)" type="primary" class="status-red">åæ</el-button> |
| | | <el-button @click="checkDo(3)" type="danger" >æç»</el-button> |
| | | <el-button @click="checkDo(2)" :loading="dealing" type="primary" class="status-red">åæ</el-button> |
| | | <el-button @click="checkDo(3)" :loading="dealing" type="danger" >æç»</el-button> |
| | | </div> |
| | | </div> |
| | | </GlobalWindow> |
| | |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import { getById } from '@/api/business/member' |
| | | import { fetchList as renzhengList,audit } from '@/api/business/identityInfo' |
| | | import { fetchList as renzhengList, audit } from '@/api/business/identityInfo' |
| | | export default { |
| | | components: { |
| | | GlobalWindow |
| | |
| | | extends: BaseOpera, |
| | | data () { |
| | | return { |
| | | dealing: false, |
| | | form: { |
| | | id: null, |
| | | auditRemark: null |
| | |
| | | open (title, row) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.activeTabs = 0 |
| | | this.type = 0 |
| | | this.page0 = 1 |
| | | this.pageSize = 10 |
| | | this.tableData = {} |
| | | this.tableData1 = {} |
| | | this.tableData2 = [] |
| | | this.id = row.id |
| | | this.form.id = this.id |
| | | this.form.auditRemark =null |
| | | this.memberId = row.memberId |
| | | this.searchForm = { |
| | | type: 0, |
| | | startTime: null, |
| | | endTime: null, |
| | | optType: null, |
| | | acceptMemberId: -1, |
| | | releaseMemberId: -1, |
| | | transactionNo: null |
| | | } |
| | | this.getData() |
| | | }, |
| | | getData () { |
| | |
| | | |
| | | }, |
| | | checkDo (status) { |
| | | console.log( this.$refs.formCheck.length) |
| | | console.log(this.$refs.formCheck.length) |
| | | this.$refs.formCheck.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | this.$dialog.actionConfirm('æ¨ç¡®è®¤ã' + (status === 3 ? 'æç»' : 'åæ') + 'ã该ç³è¯·åï¼','æä½ç¡®è®¤') |
| | | this.$dialog.actionConfirm('æ¨ç¡®è®¤ã' + (status === 3 ? 'æç»' : 'åæ') + 'ã该ç³è¯·åï¼', 'æä½ç¡®è®¤') |
| | | .then(() => { |
| | | this.dealing = true |
| | | audit({ |
| | |
| | | auditRemark: this.form.auditRemark |
| | | }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess('å¤çæå') |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.getData() |
| | | this.isShowProblem = false |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.dealing = false |
| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºå类信æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºåç§é
ç½®',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="id" label="主é®" min-width="100px"></el-table-column> |
| | | <el-table-column prop="deleted" label="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ:0=å¯ç¨ï¼1=ç¦ç¨ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createUser" label="å建人ç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äººç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="åä½åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="type" label="ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" label="å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 ï¼è½¦è¾ç±»å使ç¨ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="isFixed" label="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="æåºç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateUserName" label="æä½äºº" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æè¿æä½æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:category:update', 'business:category:delete'])" |
| | | label="æä½" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾å类信æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾æ°å»ºåç§é
ç½®', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | deleted: '', |
| | | status: '', |
| | | createUser: '', |
| | | createTime: '', |
| | | updateUser: '', |
| | | updateTime: '', |
| | | remark: '', |
| | | name: '', |
| | | type: '', |
| | | detail: '', |
| | | icon: '', |
| | | isFixed: '' |
| | | type: 0 |
| | | } |
| | | } |
| | | }, |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeStatus (e, row) { |
| | | this.working = true |
| | | this.api.updateStatus({ id: row.id, status: e }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'æä½æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.working = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:category:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºå类信æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äººç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="åä½åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="type" label="ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" label="å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 ï¼è½¦è¾ç±»å使ç¨ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="isFixed" label="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" min-width="100px"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:category:update', 'business:category:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾å类信æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCategoryWindow ref="operaCategoryWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCategoryWindow from '@/components/business/OperaCategoryWindow' |
| | | export default { |
| | | name: 'Category', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCategoryWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | deleted: '', |
| | | status: '', |
| | | createUser: '', |
| | | createTime: '', |
| | | updateUser: '', |
| | | updateTime: '', |
| | | remark: '', |
| | | name: '', |
| | | type: '', |
| | | detail: '', |
| | | icon: '', |
| | | isFixed: '' |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'å类信æ¯è¡¨', |
| | | api: '/business/category', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-option :value="1" label="æ¥åæ¹"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <!-- <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="searchForm.status" @keypress.enter.native="search" clearable placeholder="ç¶æ"> |
| | | <el-option label="å¯ç¨" value="0"></el-option> |
| | | <el-option label="ç¦ç¨" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </el-form-item>--> |
| | | <el-form-item label="æ³¨åæ¶é´" prop="eventType"> |
| | | <el-date-picker type="datetime" style="width: 120px" v-model="searchForm.startTime" clearable value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="å¼å§æ¶é´" />- |
| | |
| | | {{row.autoReciveStatus ==1?"æ¯":"å¦"}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <!-- <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column>--> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:member:update', 'business:member:delete'])" |
| | | label="æä½" |
| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.system.model.SystemJob; |
| | | import com.doumee.service.business.CategoryService; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | categoryService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("ä¿®æ¹ç¶æ") |
| | | @PostMapping("/updateStatus") |
| | | @RequiresPermissions("system:category:update") |
| | | public ApiResponse updateStatus( @RequestBody Category param) { |
| | | categoryService.updateById(param); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/07/09 12:00 |
| | | */ |
| | | public interface CategoryMapper extends BaseMapper<Category> { |
| | | public interface CategoryMapper extends MPJBaseMapper<Category> { |
| | | |
| | | } |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å类信æ¯è¡¨ |
| | |
| | | @ApiModelProperty(value = "徿 ï¼è½¦è¾ç±»å使ç¨ï¼") |
| | | @ExcelColumn(name="徿 ï¼è½¦è¾ç±»å使ç¨ï¼") |
| | | private String icon; |
| | | @ApiModelProperty(value = "æåºç ï¼ååºï¼") |
| | | @ExcelColumn(name="æåºç ï¼ååºï¼") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | @ExcelColumn(name="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼") |
| | | private Integer isFixed; |
| | | @ApiModelProperty(value = "æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String updateUserName; |
| | | @ApiModelProperty(value = "餿 çé
置项éå", example = "1") |
| | | @TableField(exist = false) |
| | | private List<String> detailList; |
| | | |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.CategoryMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.CategoryService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @Override |
| | | public PageData<Category> findPage(PageWrap<Category> pageWrap) { |
| | | IPage<Category> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Category> queryWrapper = new QueryWrapper<>(); |
| | | MPJLambdaWrapper<Category> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | pageWrap.getModel().setDeleted(Constants.ZERO); |
| | | queryWrapper.selectAll(Category.class) |
| | | .selectAs(SystemUser::getUsername, Category::getUpdateUserName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Category::getUpdateUser); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(Category::getId, pageWrap.getModel().getId()); |
| | | queryWrapper.eq(Category::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getDeleted() != null) { |
| | | queryWrapper.lambda().eq(Category::getDeleted, pageWrap.getModel().getDeleted()); |
| | | queryWrapper.eq(Category::getDeleted, pageWrap.getModel().getDeleted()); |
| | | } |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.lambda().eq(Category::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.eq(Category::getStatus, pageWrap.getModel().getStatus()); |
| | | } |
| | | if (pageWrap.getModel().getCreateUser() != null) { |
| | | queryWrapper.lambda().eq(Category::getCreateUser, pageWrap.getModel().getCreateUser()); |
| | | queryWrapper.eq(Category::getCreateUser, pageWrap.getModel().getCreateUser()); |
| | | } |
| | | if (pageWrap.getModel().getCreateTime() != null) { |
| | | queryWrapper.lambda().ge(Category::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime())); |
| | | queryWrapper.lambda().le(Category::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime())); |
| | | queryWrapper.ge(Category::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime())); |
| | | queryWrapper.le(Category::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime())); |
| | | } |
| | | if (pageWrap.getModel().getUpdateUser() != null) { |
| | | queryWrapper.lambda().eq(Category::getUpdateUser, pageWrap.getModel().getUpdateUser()); |
| | | queryWrapper.eq(Category::getUpdateUser, pageWrap.getModel().getUpdateUser()); |
| | | } |
| | | if (pageWrap.getModel().getUpdateTime() != null) { |
| | | queryWrapper.lambda().ge(Category::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime())); |
| | | queryWrapper.lambda().le(Category::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime())); |
| | | queryWrapper.ge(Category::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime())); |
| | | queryWrapper.le(Category::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime())); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(Category::getRemark, pageWrap.getModel().getRemark()); |
| | | queryWrapper.eq(Category::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getName() != null) { |
| | | queryWrapper.lambda().eq(Category::getName, pageWrap.getModel().getName()); |
| | | queryWrapper.like(Category::getName, pageWrap.getModel().getName()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(Category::getType, pageWrap.getModel().getType()); |
| | | queryWrapper.eq(Category::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getDetail() != null) { |
| | | queryWrapper.lambda().eq(Category::getDetail, pageWrap.getModel().getDetail()); |
| | | queryWrapper.eq(Category::getDetail, pageWrap.getModel().getDetail()); |
| | | } |
| | | if (pageWrap.getModel().getIcon() != null) { |
| | | queryWrapper.lambda().eq(Category::getIcon, pageWrap.getModel().getIcon()); |
| | | queryWrapper.eq(Category::getIcon, pageWrap.getModel().getIcon()); |
| | | } |
| | | if (pageWrap.getModel().getIsFixed() != null) { |
| | | queryWrapper.lambda().eq(Category::getIsFixed, pageWrap.getModel().getIsFixed()); |
| | | queryWrapper.eq(Category::getIsFixed, pageWrap.getModel().getIsFixed()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(categoryMapper.selectPage(page, queryWrapper)); |
| | | queryWrapper.orderByAsc(Category::getSortnum); |
| | | return PageData.from(categoryMapper.selectJoinPage(page, Category.class,queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void audit(AuditDTO auditDTO){ |
| | | if(Objects.isNull(auditDTO) |
| | | || Objects.isNull(auditDTO.getId()) |
| | | || Objects.isNull(auditDTO.getAuditStatus())){ |
| | | || Objects.isNull(auditDTO.getId()) |
| | | || Objects.isNull(auditDTO.getAuditStatus()) |
| | | || auditDTO.getAuditStatus()<2 |
| | | || auditDTO.getAuditStatus()>3){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | if(!Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已审æ¹ï¼è¯·å¿é夿ä½"); |
| | | } |
| | | Date date = new Date(); |
| | | identityInfoMapper.update(new UpdateWrapper<IdentityInfo>().lambda() |
| | | .set(IdentityInfo::getAuditStatus,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) |
| | | .set(IdentityInfo::getAuditStatus, auditDTO.getAuditStatus() ) |
| | | .set(StringUtils.isNotBlank(auditDTO.getAuditRemark()),IdentityInfo::getAuditRemark,auditDTO.getAuditRemark()) |
| | | .set(IdentityInfo::getAuditTime,"now()") |
| | | .set(IdentityInfo::getAuditTime,date) |
| | | .set(IdentityInfo::getUpdateUser,user.getId()) |
| | | .set(IdentityInfo::getUpdateTime,"now()") |
| | | .set(IdentityInfo::getUpdateTime,date) |
| | | .eq(IdentityInfo::getId,identityInfo.getId()) |
| | | ); |
| | | |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getUpdateUser,user.getId()) |
| | | .set(Member::getUpdateTime,"now()") |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO)?Constants.TWO:Constants.THREE) |
| | | .set(Member::getUpdateTime,date) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity, auditDTO.getAuditStatus() ) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity , auditDTO.getAuditStatus() ) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity , auditDTO.getAuditStatus() ) |
| | | .eq(Member::getId,identityInfo.getMemberId()) |
| | | ); |
| | | |