| | |
| | | <option name="url" value="https://repo.maven.apache.org/maven2" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="nexus" /> |
| | | <option name="name" value="Nexus" /> |
| | | <option name="url" value="http://47.97.118.181:8089/nexus/content/groups/public/" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="central" /> |
| | | <option name="name" value="Maven Central repository" /> |
| | | <option name="url" value="https://repo1.maven.org/maven2" /> |
| | |
| | | <option name="name" value="JBoss Community repository" /> |
| | | <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="central" /> |
| | | <option name="name" value="Central Repository" /> |
| | | <option name="url" value="http://47.97.118.181:8089/nexus/content/groups/public/" /> |
| | | </remote-repository> |
| | | </component> |
| | | </project> |
| | |
| | | trim: true |
| | | }) |
| | | } |
| | | export function findAll (data) { |
| | | return request.post('/business/category/list', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/business/importRecord/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/business/importRecord/create', data) |
| | | } |
| | | export function updateStatus (data) { |
| | | return request.post('/business/importRecord/updateStatus', data) |
| | | } |
| | | |
| | | // 导åºExcel |
| | | export function exportExcel (data) { |
| | | return request.post('/business/importRecord/exportExcel', data, { |
| | | download: true |
| | | }) |
| | | } |
| | | export function importExcel (data) { |
| | | return request.post('/business/importRecord/importExcel', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/business/importRecord/updateById', data) |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/business/importRecord/delete/${id}`) |
| | | } |
| | | export function getById (id) { |
| | | return request.get(`/business/importRecord/${id}`) |
| | | } |
| | | |
| | | // æ¹éå é¤ |
| | | export function deleteByIdInBatch (ids) { |
| | | return request.get('/business/importRecord/delete/batch', { |
| | | params: { |
| | | ids |
| | | } |
| | | }) |
| | | } |
| | |
| | | download: true |
| | | }) |
| | | } |
| | | export function importExcel (data) { |
| | | return request.post('/business/member/importExcel', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-if="form.type !=3" v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | <el-select v-else v-model="form.name" placeholder="è¯·éæ©è®¢åç±»å" v-trim> |
| | | <el-option :value="'0'" label="ç¨å·¥å"></el-option> |
| | | <el-option :value="'1'" label="è´§è¿å"></el-option> |
| | | <el-option :value="'2'" label="订é¤å"></el-option> |
| | | </el-select> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type ==3 " label="æç»è´¹ï¼%ï¼" prop="detail"> |
| | | <el-input type="number" v-model="form.detail" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | <el-form-item label="æåºç¼ç " prop="detail" v-if="form.type ==0" > |
| | | <el-input v-model="form.detail" placeholder="请è¾å
¥æåºç¼ç " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type == 1 || form.type == 2" :label=" form.type == 1?'车è¾è§æ ¼':'餿 é
ç½®ï¼å
ï¼'" prop="detailList"> |
| | | <div style="display: flex;flex-direction: column"> |
| | | <div style="position: relative;display: block;width: 100%;" v-for="(item,index) in form.detailList" > |
| | | <el-input :type="form.type == 1?'text':'number'" style="display:inline-block;width: 60%;margin:5px ;float: left" v-model="form.detailList[index]" placeholder="请è¾å
¥å
容" v-trim/> |
| | | <el-button style="display:inline-block;margin : 5px " @click="del(index)" v-if="form.detailList.length>0">x</el-button> |
| | | </div> |
| | | <div style="position: relative;display: block;width: 100%;"> |
| | | <el-button style="width: 100px;margin: 5px;" type="primary" @click="add()">æ·»å è§æ ¼</el-button> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type == 1" label="徿 " prop="icon"> |
| | | <el-form-item v-if="form.type == 3" label="徿 " prop="icon"> |
| | | <UploadAvatarImage |
| | | :file="{ imgurlfull: form.iconFull, imgurl: form.icon }" |
| | | :uploadData="uploadData" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.id ==null && 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 v-if="form.type == 1" label="æè¡æ¦å¾é" prop="icon"> |
| | | <UploadImage |
| | | :fileList="tempfileList" |
| | | :uploadData="uploadData" |
| | | @beginUpload="isUploading=true" |
| | | @endUpload="isUploading=false"/> |
| | | <p class="tip-warn"> |
| | | 建议尺寸ï¼750px X 750pxï¼ä¸é6å¼ |
| | | æ¯æpngãjpgãjpegæ ¼å¼ï¼å¤§å°ä¸è¶
è¿2Mï¼ä¸ä¼ å¾çä¸å
许æ¶åæ¿æ²»ææä¸è²æ
, |
| | | </p> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç " prop="sortnum"> |
| | | <el-input v-model="form.sortnum" placeholder="请è¾å
¥æåºç " v-trim/> |
| | | <el-input v-model="form.sortnum" type="" placeholder="请è¾å
¥æåºç " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥æè¿°" v-trim/> |
| | | <el-input type="textarea" v-model="form.remark" placeholder="请è¾å
¥æè¿°" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import UploadImage from '@/components/common/UploadImage' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | export default { |
| | | name: 'OperaCategoryWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow ,UploadAvatarImage}, |
| | | components: { GlobalWindow, UploadAvatarImage,UploadImage }, |
| | | data () { |
| | | return { |
| | | isUploading: false, |
| | | uploadData: { |
| | | folder: 'category' |
| | | folder: 'dianjiang/category' |
| | | }, |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | |
| | | type: null, |
| | | detail: null, |
| | | remark: null, |
| | | detailList: [''], |
| | | fileList: [], |
| | | icon: '', |
| | | iconFull: '', |
| | | isFixed: 0 |
| | | }, |
| | | tempfileList: [], |
| | | // éªè¯è§å |
| | | rules: { |
| | | name: [{ required: true, message: '请è¾å
¥é
ç½®åç§°' }] |
| | | name: [{ required: true, message: '请è¾å
¥åç§°' }] |
| | | } |
| | | } |
| | | }, |
| | |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods:{ |
| | | del(index){ |
| | | if(this.form.detailList.length<=1){ |
| | | methods: { |
| | | del (index) { |
| | | if (this.form.detailList.length <= 1) { |
| | | return |
| | | } |
| | | this.form.detailList.splice(index,1) |
| | | this.form.detailList.splice(index, 1) |
| | | }, |
| | | add(){ |
| | | add () { |
| | | this.form.detailList.push('') |
| | | }, |
| | | uploadAvatarSuccess (file) { |
| | | this.$set(this.form, 'icon', file.imgurl) |
| | | this.$set(this.form, 'iconFull', file.imgurlfull) |
| | | }, |
| | | open(title, target, type) { |
| | | confirm () { |
| | | this.form.fileList = this.tempfileList |
| | | if (this.form[this.configData['field.id']] == null || this.form[this.configData['field.id']] === '') { |
| | | this.__confirmCreate() |
| | | return |
| | | } |
| | | this.__confirmEdit() |
| | | }, |
| | | open (title, target, type) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.tempfileList = [] |
| | | this.form = { |
| | | id: null, |
| | | status: 0, |
| | |
| | | detail: null, |
| | | type: type, |
| | | remark: null, |
| | | detailList: [''], |
| | | fileList: [], |
| | | icon: '', |
| | | iconFull: '', |
| | | isFixed: 0 |
| | |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | if(this.form.detailList==null){ |
| | | this.form.detailList = [''] |
| | | } |
| | | this.form.fileList = this.form.fileList||[] |
| | | this.form.fileList.forEach(item=>{ |
| | | this.tempfileList.push({ |
| | | fileurl: item.fileurl, |
| | | name: item.name, |
| | | url: item.url |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | class="center-title" |
| | | :title="title" |
| | | width="500px" |
| | | top="30vh" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <p class="tip-warn"><i class="el-icon-warning"></i>导å
¥è¯´æï¼<br> |
| | | 1.请å
ä¸è½½æä»¶æ¨¡æ¿ï¼å¹¶æç
§æ¨¡æ¿è¦å»å¡«åè¡¨æ ¼å
容;<br> |
| | | </p> |
| | | <el-form class="demo-form-inline" > |
| | | <el-form-item label="èå¸åå" required> |
| | | <div style="width: 100%;display: flex;align-items: center;"> |
| | | <el-button type="primary" :loading="importing" @click="clickRef">ç¹å»ä¸ä¼ </el-button> |
| | | <el-button type="text" @click="exportTemplate">ç¹å»ä¸è½½æ¨¡ç.EXCEL</el-button> |
| | | </div> |
| | | <div style="font-size: 14px; color: black;" v-if="fileName">{{fileName}}</div> |
| | | </el-form-item> |
| | | </el-form> |
| | | <input type="file" style="position: fixed; left: 0; top: -50px;" accept=".xlsx" ref="fileExcel" @change="result" /> |
| | | <template v-slot:footer> |
| | | <el-button @click="visible=false">è¿å</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { importExcel } from '@/api/business/importRecord' |
| | | export default { |
| | | name: 'OperaMemberImportWindow', |
| | | extends: BaseOpera, |
| | | // eslint-disable-next-line vue/no-unused-components |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | importing: false, |
| | | fileName: '', |
| | | type: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | open (title) { |
| | | this.title = title |
| | | this.fileName = '' |
| | | this.visible = true |
| | | this.type = 0 |
| | | }, |
| | | // å¯¼åºæ¨¡æ¿ |
| | | exportTemplate () { |
| | | // æä¿ç³è¯· |
| | | window.open('/template/member.xlsx') |
| | | }, |
| | | clickRef () { |
| | | this.$refs.fileExcel.click() |
| | | }, |
| | | result (e) { |
| | | this.importing=true |
| | | const data = new FormData() |
| | | data.append('file', e.target.files[0]) |
| | | data.append('type', this.type) |
| | | importExcel(data) |
| | | .then(res => { |
| | | this.$message.success('ååå·²ä¸ä¼ æåï¼å¯åå¾ã导å
¥è®°å½ãè忥ç任塿§è¡è¿åº¦ã') |
| | | this.$emit('success') |
| | | this.visible = false |
| | | }) |
| | | .catch(err => { |
| | | this.fileName = '' |
| | | }) |
| | | .finally(() => { |
| | | this.$refs.fileExcel.value = null |
| | | this.importing=false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
| | |
| | | data() { |
| | | return { |
| | | loading: null, |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/web/public/upload' |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload' |
| | | } |
| | | }, |
| | | |
| | |
| | | accept=".jpg,.png" |
| | | :before-upload="beforeUpload" |
| | | :on-success="uploadSuccess" |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :on-error="fail" |
| | | > |
| | | <i class="el-icon-plus icon"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | | :src="file.url" alt="" |
| | | style="width: 100px;height: 100px;" |
| | | > |
| | | <span class="el-upload-list__item-actions"> |
| | | <span |
| | | class="el-upload-list__item-preview" |
| | | @click="handlePictureCardPreview(file)" |
| | | > |
| | | <i class="el-icon-zoom-in"></i> |
| | | </span> |
| | | <span |
| | | class="el-upload-list__item-delete" |
| | | @click="handleRemove(file)" |
| | | > |
| | | <i class="el-icon-delete"></i> |
| | | </span> |
| | | </span> |
| | | </div> |
| | | </el-upload> |
| | | <el-image-viewer |
| | | <el-image-viewer |
| | | v-if="showViewer" |
| | | :on-close="closeViewer" |
| | | :initialIndex="tempIndex" |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | uploadData: Object, |
| | | maxNum: { |
| | | type: Number, |
| | | default: () => null |
| | | }, |
| | | uploadData: Object |
| | | }, |
| | | data() { |
| | | data () { |
| | | return { |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/web/public/uploadLocal', |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/upload', |
| | | realList: [], |
| | | srcList: [], |
| | | // srcList: [], |
| | | tempIndex: 0, |
| | | showViewer: false, |
| | | showViewer: false |
| | | } |
| | | }, |
| | | computed:{ |
| | | srcList(){ |
| | | return this.fileList.map(item => { return item.url }) |
| | | } |
| | | }, |
| | | watch: { |
| | | fileList: { |
| | | handler(val) { |
| | | console.log(val); |
| | | if (val.length==0) { |
| | | this.realList = [] |
| | | this.srcList = [] |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | beforeUpload(file) { |
| | | handlePreview(file) { |
| | | // console.log('é¢è§æä»¶ï¼', file,this.fileList); |
| | | this.tempIndex = this.srcList.findIndex(item => item == file.url) |
| | | this.showViewer = true |
| | | }, |
| | | beforeUpload (file) { |
| | | this.$emit('beginUpload') |
| | | const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png' |
| | | const isLt2M = file.size / 1024 / 1024 < 1; // 500kb |
| | | if (!isJPGOrPNG) { |
| | | this.$message.error('ä¸ä¼ 头åå¾çåªè½æ¯ JPG/PNG æ ¼å¼!'); |
| | | return false |
| | | } |
| | | if (!isLt2M) { |
| | | this.$message.error('ä¸ä¼ 头åå¾ç大å°ä¸è½è¶
è¿ 500KB!'); |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // ä¸ä¼ å¾çæå |
| | | uploadSuccess (res, file, fileList) { |
| | | // console.log('this.fileList', this.fileList); |
| | | // console.log('fileList', fileList); |
| | | this.$emit('uploadEnd') |
| | | this.realList = fileList |
| | | this.srcList.push(res.data.url) |
| | | // console.log('file', file); |
| | | // ä¸ä¼ å¾çæå |
| | | uploadSuccess (res, file, fileList) { |
| | | this.$emit('endUpload') |
| | | console.log('ä¸ä¼ æå1ï¼',fileList); |
| | | if (res.code === 200) { |
| | | this.fileList.push( |
| | | { |
| | | fileurl: res.data.imgaddr, |
| | | name: res.data.originname, |
| | | url: res.data.url |
| | | } |
| | | ) |
| | | this.fileList.push({ |
| | | fileurl: res.data.imgaddr, |
| | | name: res.data.originname, |
| | | url: res.data.url |
| | | }) |
| | | console.log('ä¸ä¼ æå2ï¼', this.fileList); |
| | | } else { |
| | | this.$message.error(res.msg || 'ä¸ä¼ 失败') |
| | | } |
| | | }, |
| | | fail (err, file, fileList) { |
| | | this.$emit('uploadEnd') |
| | | this.$emit('endUpload') |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | }, |
| | | handlePictureCardPreview(file) { |
| | | // this.tempIndex = this.srcList.findIndex(item => item == file.response.data.url ) |
| | | // console.log(file); |
| | | this.tempIndex = this.fileList.findIndex(item => item.url == file.url ) |
| | | // console.log( this.tempIndex); |
| | | this.srcList = this.fileList.map(item => item.url) |
| | | this.showViewer = true |
| | | }, |
| | | closeViewer() { |
| | | closeViewer () { |
| | | this.showViewer = false |
| | | }, |
| | | handleRemove(file) { |
| | | console.log(this.fileList); |
| | | let tempIndex = this.realList.findIndex(item => item.url === file.url) |
| | | // debugger |
| | | this.realList.splice(tempIndex, 1) |
| | | this.fileList.splice(tempIndex, 1) |
| | | this.srcList.splice(tempIndex, 1) |
| | | |
| | | handleRemove (file) { |
| | | const tempIndex = this.fileList.findIndex(item => item.url === file.url) |
| | | if(tempIndex >= 0){ |
| | | this.fileList.splice(tempIndex, 1) |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | height: 90px !important; |
| | | } |
| | | </style> |
| | | |
| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <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('æ°å»ºåç§é
ç½®',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> |
| | | <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 type="primary" icon="el-icon-refresh" v-permissions="['business:category:create']">忥</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="åä½åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="æåºåç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" 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" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <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> |
| | | <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" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <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('æ°å»ºè´§è¿é
ç½®',null,searchForm.type)" 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" :selectable="isChangeSelected" width="55"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 " min-width="100px"> |
| | | <el-table-column prop="name" label="åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="æè¡æ¦å¾é" min-width="220px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image v-if="row.iconFull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.iconFull" |
| | | :preview-src-list="[row.iconFull]"> |
| | | </el-image> |
| | | <div style="display: flex; flex-wrap: wrap;width: 200px;" v-if="row.fileList && row.fileList.length"> |
| | | <div v-for="item in row.fileList" :key="row.id+'_img'+item.id" style=" box-sizing: border-box; margin-right: 10px; " > |
| | | <el-image style="width: 50px; height: 50px;" :src="item.url" |
| | | :preview-src-list="[item.url]"> |
| | | </el-image> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </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 :disabled="row.isFixed ==1" @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <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="$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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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('æ°å»ºæ
é¿é¢å',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 |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" :selectable="isChangeSelected" width="55"></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 :disabled="row.isFixed ==1" @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="remark" label="æè¿°" min-width="100px"></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="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <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> |
| | | </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: { |
| | | name: '', |
| | | type: 2 |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'å类信æ¯è¡¨', |
| | | api: '/business/category', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | isChangeSelected(row,index){ |
| | | // if(row.isFixed ==1) { |
| | | // return false |
| | | // } |
| | | return true |
| | | }, |
| | | 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('æ°å»ºèå¸ç级',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 |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" :selectable="isChangeSelected" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 " min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image v-if="row.iconFull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.iconFull" |
| | | :preview-src-list="[row.iconFull]"> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch :disabled="row.isFixed ==1" @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="remark" label="æè¿°" min-width="100px"></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="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <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> |
| | | </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: { |
| | | name: '', |
| | | type: 3 |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'å类信æ¯è¡¨', |
| | | api: '/business/category', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | isChangeSelected(row,index){ |
| | | // if(row.isFixed ==1) { |
| | | // return false |
| | | // } |
| | | return true |
| | | }, |
| | | 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> |
| | |
| | | <TableLayout :permissions="['business:member:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="ææºå·" prop="telephone"> |
| | | <el-input v-model="searchForm.telephone" clearable placeholder="请è¾å
¥ææºå·" @keypress.enter.native="search"></el-input> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" style="width: 150px" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="çå®å§å" prop="name"> |
| | | <el-input v-model="searchForm.name" clearable placeholder="请è¾å
¥çå®å§å" @keypress.enter.native="search"></el-input> |
| | | <el-form-item label="å·¥å·" prop="code"> |
| | | <el-input v-model="searchForm.code" style="width: 150px" placeholder="请è¾å
¥å·¥å·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å" prop="type"> |
| | | <el-select v-model="searchForm.type" clearable placeholder="è¯·éæ©ç±»å" @change="search"> |
| | | <el-option :value="0" label="å
¨é¨"></el-option> |
| | | <el-option :value="1" label="æ¥åæ¹"></el-option> |
| | | <el-form-item label="æåº" prop="fieldIdList"> |
| | | <el-select |
| | | v-model="searchForm.fieldIdList" |
| | | style="width: 150px" |
| | | placeholder="æåº" |
| | | clearable |
| | | multiple |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in cateList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <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-form-item label="åä¸åç±»å" prop="busTypeIdList"> |
| | | <el-select |
| | | v-model="searchForm.busTypeIdList" |
| | | style="width: 150px" |
| | | placeholder="åä¸åç±»å" |
| | | clearable |
| | | multiple |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in cateList1" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </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="å¼å§æ¶é´" />- |
| | | <el-date-picker type="datetime" style="width: 120px" v-model="searchForm.endTime" clearable value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="ç»ææ¶é´" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ
é¿é¢å" prop="levelIdList"> |
| | | <el-select |
| | | v-model="searchForm.levelIdList" |
| | | style="width: 150px" |
| | | placeholder="æ
é¿é¢å" |
| | | clearable |
| | | multiple |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in cateList2" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="èå¸ç级" prop="levelIdList"> |
| | | <el-select |
| | | v-model="searchForm.levelIdList" |
| | | style="width: 150px" |
| | | placeholder="èå¸ç级" |
| | | clearable |
| | | multiple |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in cateList3" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select |
| | | v-model="searchForm.status" |
| | | placeholder="ç¶æ" |
| | | clearable |
| | | style="width: 150px" |
| | | @change="search" |
| | | > |
| | | <el-option :key="0" :value="0" label="å¯ç¨"></el-option> |
| | | <el-option :key="1" :value="1" label="ç¦ç¨"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | <el-button type="primary" :loading="isWorking.export" @click="exportExcel">导åº</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <!-- <ul class="toolbar" v-permissions="['business:member:create', 'business:member:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaMemberWindow.open('æ°å»ºä¼åä¿¡æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:member:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:member:delete']">å é¤</el-button></li> |
| | | </ul>--> |
| | | <ul class="toolbar" v-permissions="['business:member:create', 'business:member:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaMemberWindow.open('æ°å»ºèå¸',null)" icon="el-icon-plus" v-permissions="['business:member:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-refresh" v-permissions="['business:member:create']" @click="$refs.OperaMemberImportWindow.open('èå¸å¯¼å
¥', searchForm.companyType)">æ¹é导å
¥</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:member:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="openid" label="openid" min-width="100px"> |
| | | <el-table-column prop="imgurl" label="å¾ç" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span style="cursor: pointer;color: #2E68EC" @click="openDetail(row)">{{row.openid}}</span> |
| | | <el-image v-if="row.imgurlfull" style="width: 50px; height: 50px; margin-right: 10px" :src="row.imgurlfull" |
| | | :preview-src-list="[row.imgurlfull]"> |
| | | </el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="nickName" label="æµç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="çå®å§å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="telephone" label="ææºå·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="workerIdentity" label="身份" min-width="100px"> |
| | | <el-table-column prop="code" label="å·¥å·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="å§å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="sex" label="æ§å«" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | ååæ¹<span v-if="row.workerIdentity == 2 || row.driverIdentity == 2 || row.chefIdentity == 2">{{' | æ¥åæ¹'}}</span> |
| | | <span v-if="row.sex ==0">ç·</span> |
| | | <span v-if="row.sex ==1">女</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="workerIdentity" label="æ¥å认è¯èº«ä»½" width="120px"> |
| | | <el-table-column prop="position" label="å²ä½" min-width="120px"></el-table-column> |
| | | <el-table-column prop="levelName" label="ç级" min-width="100px"></el-table-column> |
| | | <el-table-column prop="jobYear" label="ä»ä¸å¹´ä»½" min-width="100px"></el-table-column> |
| | | <el-table-column prop="serveNum" label="æå¡ååº" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <div v-if="row.workerIdentity == 2" class="renzhen">工人</div> |
| | | <div v-if=" row.driverIdentity == 2" class="renzhen">叿º</div> |
| | | <div v-if="row.chefIdentity == 2" class="renzhen">ä¾é¤</div> |
| | | <span v-if="row.serveNum">{{row.serveNum}}个</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="amount" label="å½åä½é¢(å
)" min-width="100px"> |
| | | <el-table-column prop="caseNum" label="æ ææ¡ä¾" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span class="yellowstate">{{((row.amount || 0)/100).toFixed(2)}}</span> |
| | | <span v-if="row.caseNum">{{row.caseNum}}个</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createTime" label="æ³¨åæ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="autoReciveStatus" label="æ¥åèªå¨æ´¾å" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{row.autoReceiveStatus ==1?"æ¯":"å¦"}} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="ç¶æ"> |
| | | <el-table-column prop="busTypeNames" label="åä¸åç±»å" min-width="200px"></el-table-column> |
| | | <el-table-column prop="areaNames" label="æå¡æåº" min-width="200px"></el-table-column> |
| | | <el-table-column prop="fieldNames" label="æ
é¿é¢å" min-width="200px"></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"> |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:member:update', 'business:member:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <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:member:update', 'business:member:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaMemberWindow.open('ç¼è¾ä¼åä¿¡æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:member:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:member:delete']">å é¤</el-button> |
| | | <el-button type="text" @click="$refs.operaMemberWindow.open('ç¼è¾èå¸', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:member:update']">ç¼è¾</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:member:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column>--> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaMemberDetailWindow ref="OperaMemberDetailWindow" /> |
| | | <OperaMemberWindow ref="operaMemberWindow" @success="handlePageChange"/> |
| | | <OperaMemberImportWindow ref="OperaMemberImportWindow" @success="handlePageChange" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaMemberWindow from '@/components/business/OperaMemberWindow' |
| | | import OperaMemberDetailWindow from '@/components/business/OperaMemberDetailWindow' |
| | | import OperaMemberImportWindow from '@/components/business/OperaMemberImportWindow' |
| | | import { findAll as cateList } from '@/api/business/category' |
| | | export default { |
| | | name: 'Member', |
| | | name: 'Category', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaMemberDetailWindow, OperaMemberWindow }, |
| | | components: { TableLayout, Pagination, OperaMemberWindow ,OperaMemberImportWindow}, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | type: 0, |
| | | startTime: '', |
| | | endTime: '', |
| | | telephone: '', |
| | | name: '', |
| | | status: '' |
| | | } |
| | | code: '', |
| | | status: null, |
| | | levelIdList:[], |
| | | fieldIdList: [], |
| | | busTypeIdList:[], |
| | | type: 0 |
| | | }, |
| | | cateList:[], |
| | | cateList1:[], |
| | | cateList2:[], |
| | | cateList3:[], |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ä¼åä¿¡æ¯è¡¨', |
| | | module: '讲å¸ä¿¡æ¯è¡¨', |
| | | api: '/business/member', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | cateList({ |
| | | type: 0 , //æåº |
| | | }).then(res => { |
| | | this.cateList = res |
| | | }) |
| | | cateList({ |
| | | type: 1 , //åä¸å |
| | | }).then(res => { |
| | | this.cateList1 = res |
| | | }) |
| | | cateList({ |
| | | type: 2 , //æ
é¿é¢ç¨ |
| | | }).then(res => { |
| | | this.cateList2 = res |
| | | }) |
| | | cateList({ |
| | | type: 3 , //ç级 |
| | | }).then(res => { |
| | | this.cateList3 = res |
| | | }) |
| | | }, |
| | | methods: { |
| | | reset () { |
| | | this.searchForm = { |
| | | type: 0, |
| | | startTime: '', |
| | | endTime: '', |
| | | telephone: '', |
| | | name: '', |
| | | status: '' |
| | | } |
| | | this.search() |
| | | }, |
| | | openDetail (row) { |
| | | this.$refs.OperaMemberDetailWindow.open('ç¨æ·è¯¦æ
', row.id) |
| | | }, |
| | | changeStatus (e, row) { |
| | | this.working = true |
| | | this.api.updateStatus({ id: row.id, workStatus: e }) |
| | | this.api.updateStatus({ id: row.id, status: e }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'æä½æå') |
| | | this.search() |
| | |
| | | .finally(() => { |
| | | this.working = false |
| | | }) |
| | | .catch(() => { }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .renzhen{ |
| | | margin: 5px; |
| | | line-height: 30px; |
| | | color:#67c23a; |
| | | height: 30px; |
| | | text-align:center; |
| | | border-color: #e1f3d8; |
| | | background-color: #f0f9eb; |
| | | } |
| | | </style> |
| | |
| | | public ApiResponse<PageData<Category>> findPage (@RequestBody PageWrap<Category> pageWrap) { |
| | | return ApiResponse.success(categoryService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("å表æ¥è¯¢") |
| | | @PostMapping("/list") |
| | | @RequiresPermissions("business:category:query") |
| | | public ApiResponse<List<Category>> findList (@RequestBody Category pageWrap) { |
| | | return ApiResponse.success(categoryService.findList(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | |
| | | import com.doumee.dao.business.model.ImportRecord; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.service.business.ImportRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | |
| | | /** |
| | | * å类信æ¯è¡¨Controllerå®ä¹ |
| | | * @author doumee |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(importRecordService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿¡æ¯å¯¼å
¥" ,notes = "ä¿åç³è¯·") |
| | | @PostMapping("/importExcel") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | @ApiImplicitParam(name = "导å
¥ç±»å 0人å 1æ¡ä¾", value = "type", required = true, paramType = "query", dataType = "Integer",example = "0",dataTypeClass = Integer.class), |
| | | }) |
| | | public ApiResponse<String> importExcel (@ApiParam(value = "file") MultipartFile file, @ApiParam(value = "type") Integer type) { |
| | | ImportRecord importRecord = importRecordService.importBatch(file,type); |
| | | importRecordService.dealImporTask(importRecord); |
| | | return ApiResponse.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | } |
| | |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.service.business.MemberService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | |
| | | /** |
| | | * ä¼åä¿¡æ¯è¡¨Controllerå®ä¹ |
| | | * @author doumee |
| | |
| | | ExcelExporter.build(Member.class).export(memberService.findPage(pageWrap).getRecords(), "ä¼åä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:member:query") |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.40</version> |
| | | </dependency> |
| | | <!-- Shiro --> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | |
| | | <!--æ¬å°çjacob.jarçè·¯å¾--> |
| | | <systemPath>${project.basedir}/lib/zos-sdk.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.8.40</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFPictureData; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * æ é¢è¡å· |
| | | */ |
| | | private CellType changeType; |
| | | |
| | | private Map<String, XSSFPictureData> pictureList; |
| | | /** |
| | | * æé 彿° |
| | | * @param--path 导å
¥æä»¶ï¼è¯»å第ä¸ä¸ªå·¥ä½è¡¨ |
| | |
| | | this.sheet = this.wb.getSheetAt(sheetIndex); |
| | | this.headerNum = headerNum; |
| | | this.changeType = cellType; |
| | | this.pictureList = ExcelPictureUtil.getExcelPictures(in); |
| | | log.debug("Initialize success."); |
| | | } |
| | | |
| | |
| | | } |
| | | return val; |
| | | } |
| | | public Map<String,XSSFPictureData> getExcelPictures(){ |
| | | return this.pictureList; |
| | | } |
| | | |
| | | /** |
| | | * è·å导å
¥æ°æ®å表 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.annotation.excel; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.XML; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.map.HashedMap; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.openxml4j.opc.PackagePartName; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.usermodel.WorkbookFactory; |
| | | import org.apache.poi.xssf.usermodel.*; |
| | | |
| | | import java.io.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipInputStream; |
| | | |
| | | |
| | | /** |
| | | * @author bianhl |
| | | * @version 1.0 |
| | | * @description è·åå¾çèµæº |
| | | * @date 2024å¹´4æ28æ¥08:44:42 |
| | | */ |
| | | @Slf4j |
| | | public class ExcelPictureUtil { |
| | | |
| | | public static Map<String, XSSFPictureData> getExcelPictures(InputStream is) { |
| | | byte[] fileData = getFileStream(is); |
| | | Map<String, XSSFPictureData> pictures = getPictures(fileData); |
| | | pictures.forEach((id, xssfPictureData) -> { |
| | | System.out.println("idï¼" + id); |
| | | String fileName = xssfPictureData.getPackagePart().getPartName().getName(); |
| | | System.out.println("fileNameï¼" + fileName); |
| | | }); |
| | | return pictures; |
| | | } |
| | | |
| | | /** |
| | | * è·åæµ®å¨å¾çï¼ä»¥ map å½¢å¼è¿åï¼é®ä¸ºè¡åæ ¼å¼ x-yã |
| | | * |
| | | * @param xssfSheet WPS å·¥ä½è¡¨ |
| | | * @return æµ®å¨å¾çç map |
| | | */ |
| | | public static Map<String, XSSFPictureData> getFloatingPictures(XSSFSheet xssfSheet) { |
| | | Map<String, XSSFPictureData> mapFloatingPictures = new HashMap<>(); |
| | | XSSFDrawing drawingPatriarch = xssfSheet.getDrawingPatriarch(); |
| | | if (drawingPatriarch != null) { |
| | | List<XSSFShape> shapes = drawingPatriarch.getShapes(); |
| | | for (XSSFShape shape : shapes) { |
| | | if (shape instanceof XSSFPicture ) { |
| | | XSSFPicture picture = (XSSFPicture)shape; |
| | | XSSFClientAnchor anchor = (XSSFClientAnchor) picture.getAnchor(); |
| | | XSSFPictureData pictureData = picture.getPictureData(); |
| | | String key = anchor.getRow1() + "-" + anchor.getCol1(); |
| | | mapFloatingPictures.put(key, pictureData); |
| | | } |
| | | } |
| | | } |
| | | return mapFloatingPictures; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç WPS æä»¶ä¸çå¾çæ°æ®ï¼è¿åå¾çä¿¡æ¯ mapã |
| | | * |
| | | * @param stream è¾å
¥æµ |
| | | * @param mapConfig é
ç½®æ å° |
| | | * @return å¾çä¿¡æ¯ç map |
| | | * @throws IOException |
| | | */ |
| | | private static Map<String, XSSFPictureData> processPictures(ByteArrayInputStream stream, Map<String, String> mapConfig) throws IOException { |
| | | Map<String, XSSFPictureData> mapPictures = new HashedMap<>(); |
| | | Workbook workbook = WorkbookFactory.create(stream); |
| | | List<XSSFPictureData> allPictures = (List<XSSFPictureData>) workbook.getAllPictures(); |
| | | for (XSSFPictureData pictureData : allPictures) { |
| | | PackagePartName partName = pictureData.getPackagePart().getPartName(); |
| | | String uri = partName.getURI().toString(); |
| | | if (mapConfig.containsKey(uri)) { |
| | | String strId = mapConfig.get(uri); |
| | | mapPictures.put(strId, pictureData); |
| | | } |
| | | } |
| | | return mapPictures; |
| | | } |
| | | |
| | | /** |
| | | * è·å WPS ææ¡£ä¸çå¾çï¼å
æ¬åµå
¥å¼å¾çåæµ®å¨å¼å¾çã |
| | | * |
| | | * @param data äºè¿å¶æ°æ® |
| | | * @return å¾çä¿¡æ¯ç map |
| | | * @throws IOException |
| | | */ |
| | | public static Map<String, XSSFPictureData> getPictures(byte[] data) { |
| | | try { |
| | | Map<String, String> mapConfig = processZipEntries(new ByteArrayInputStream(data)); |
| | | Map<String, XSSFPictureData> mapPictures = processPictures(new ByteArrayInputStream(data), mapConfig); |
| | | Iterator<Sheet> sheetIterator = WorkbookFactory.create(new ByteArrayInputStream(data)).sheetIterator(); |
| | | while (sheetIterator.hasNext()) { |
| | | mapPictures.putAll(getFloatingPictures((XSSFSheet) sheetIterator.next())); |
| | | } |
| | | return mapPictures; |
| | | } catch (IOException e) { |
| | | return new HashedMap<>(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤ç Zip æä»¶ä¸çæ¡ç®ï¼æ´æ°å¾çé
置信æ¯ã |
| | | * |
| | | * @param stream Zip è¾å
¥æµ |
| | | * @return é
置信æ¯ç map |
| | | * @throws IOException |
| | | */ |
| | | private static Map<String, String> processZipEntries(ByteArrayInputStream stream) throws IOException { |
| | | Map<String, String> mapConfig = new HashedMap<>(); |
| | | ZipInputStream zipInputStream = new ZipInputStream(stream); |
| | | ZipEntry zipEntry; |
| | | while ((zipEntry = zipInputStream.getNextEntry()) != null) { |
| | | try { |
| | | final String fileName = zipEntry.getName(); |
| | | if ("xl/cellimages.xml".equals(fileName)) { |
| | | processCellImages(zipInputStream, mapConfig); |
| | | } else if ("xl/_rels/cellimages.xml.rels".equals(fileName)) { |
| | | return processCellImagesRels(zipInputStream, mapConfig); |
| | | } |
| | | } finally { |
| | | zipInputStream.closeEntry(); |
| | | } |
| | | } |
| | | return new HashedMap<>(); |
| | | } |
| | | |
| | | /** |
| | | * å¤ç Zip æä»¶ä¸ç cellimages.xml æä»¶ï¼æ´æ°å¾çé
置信æ¯ã |
| | | * |
| | | * @param zipInputStream Zip è¾å
¥æµ |
| | | * @param mapConfig é
置信æ¯ç map |
| | | * @throws IOException |
| | | */ |
| | | private static void processCellImages(ZipInputStream zipInputStream, Map<String, String> mapConfig) throws IOException { |
| | | String content = IOUtils.toString(zipInputStream); |
| | | JSONObject jsonObject = XML.toJSONObject(content); |
| | | if (jsonObject != null) { |
| | | JSONObject cellImages = jsonObject.getJSONObject("etc:cellImages"); |
| | | if (cellImages != null) { |
| | | JSONArray cellImageArray = null; |
| | | Object cellImage = cellImages.get("etc:cellImage"); |
| | | if (cellImage != null && cellImage instanceof JSONArray) { |
| | | cellImageArray = (JSONArray) cellImage; |
| | | } else if (cellImage != null && cellImage instanceof JSONObject) { |
| | | JSONObject cellImageObj = (JSONObject) cellImage; |
| | | if (cellImageObj != null) { |
| | | cellImageArray = new JSONArray(); |
| | | cellImageArray.add(cellImageObj); |
| | | } |
| | | } |
| | | if (cellImageArray != null) { |
| | | processImageItems(cellImageArray, mapConfig); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤ç cellImageArray ä¸çå¾çé¡¹ï¼æ´æ°å¾çé
置信æ¯ã |
| | | * |
| | | * @param cellImageArray å¾ç项ç JSONArray |
| | | * @param mapConfig é
置信æ¯ç map |
| | | */ |
| | | private static void processImageItems(JSONArray cellImageArray, Map<String, String> mapConfig) { |
| | | for (int i = 0; i < cellImageArray.size(); i++) { |
| | | JSONObject imageItem = cellImageArray.getJSONObject(i); |
| | | if (imageItem != null) { |
| | | JSONObject pic = imageItem.getJSONObject("xdr:pic"); |
| | | if (pic != null) { |
| | | processPic(pic, mapConfig); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤ç pic ä¸çå¾çä¿¡æ¯ï¼æ´æ°å¾çé
置信æ¯ã |
| | | * |
| | | * @param pic å¾çç JSONObject |
| | | * @param mapConfig é
置信æ¯ç map |
| | | */ |
| | | private static void processPic(JSONObject pic, Map<String, String> mapConfig) { |
| | | JSONObject nvPicPr = pic.getJSONObject("xdr:nvPicPr"); |
| | | if (nvPicPr != null) { |
| | | JSONObject cNvPr = nvPicPr.getJSONObject("xdr:cNvPr"); |
| | | if (cNvPr != null) { |
| | | String name = cNvPr.getStr("name"); |
| | | if (StringUtils.isNotEmpty(name)) { |
| | | String strImageEmbed = updateImageEmbed(pic); |
| | | if (strImageEmbed != null) { |
| | | mapConfig.put(strImageEmbed, name); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·ååµå
¥å¼å¾çç embed ä¿¡æ¯ã |
| | | * |
| | | * @param pic å¾çç JSONObject |
| | | * @return embed ä¿¡æ¯ |
| | | */ |
| | | private static String updateImageEmbed(JSONObject pic) { |
| | | JSONObject blipFill = pic.getJSONObject("xdr:blipFill"); |
| | | if (blipFill != null) { |
| | | JSONObject blip = blipFill.getJSONObject("a:blip"); |
| | | if (blip != null) { |
| | | return blip.getStr("r:embed"); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç Zip æä»¶ä¸ç relationship æ¡ç®ï¼æ´æ°é
置信æ¯ã |
| | | * |
| | | * @param zipInputStream Zip è¾å
¥æµ |
| | | * @param mapConfig é
置信æ¯ç map |
| | | * @return é
置信æ¯ç map |
| | | * @throws IOException |
| | | */ |
| | | private static Map<String, String> processCellImagesRels(ZipInputStream zipInputStream, Map<String, String> mapConfig) throws IOException { |
| | | String content = IOUtils.toString(zipInputStream ); |
| | | JSONObject jsonObject = XML.toJSONObject(content); |
| | | JSONObject relationships = jsonObject.getJSONObject("Relationships"); |
| | | if (relationships != null) { |
| | | JSONArray relationshipArray = null; |
| | | Object relationship = relationships.get("Relationship"); |
| | | |
| | | if (relationship != null && relationship instanceof JSONArray) { |
| | | relationshipArray = (JSONArray) relationship; |
| | | } else if (relationship != null && relationship instanceof JSONObject ) { |
| | | JSONObject relationshipObj = (JSONObject) relationship; |
| | | if (relationshipObj != null) { |
| | | relationshipArray = new JSONArray(); |
| | | relationshipArray.add(relationshipObj); |
| | | } |
| | | } |
| | | if (relationshipArray != null) { |
| | | return processRelationships(relationshipArray, mapConfig); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç relationshipArray ä¸çå
³ç³»é¡¹ï¼æ´æ°é
置信æ¯ã |
| | | * |
| | | * @param relationshipArray å
³ç³»é¡¹ç JSONArray |
| | | * @param mapConfig é
置信æ¯ç map |
| | | * @return é
置信æ¯ç map |
| | | */ |
| | | private static Map<String, String> processRelationships(JSONArray relationshipArray, Map<String, String> mapConfig) { |
| | | Map<String, String> mapRelationships = new HashedMap<>(); |
| | | for (int i = 0; i < relationshipArray.size(); i++) { |
| | | JSONObject relaItem = relationshipArray.getJSONObject(i); |
| | | if (relaItem != null) { |
| | | String id = relaItem.getStr("Id"); |
| | | String value = "/xl/" + relaItem.getStr("Target"); |
| | | if (mapConfig.containsKey(id)) { |
| | | String strImageId = mapConfig.get(id); |
| | | mapRelationships.put(value, strImageId); |
| | | } |
| | | } |
| | | } |
| | | return mapRelationships; |
| | | } |
| | | |
| | | /** |
| | | * @return {@link byte[]} |
| | | * @description |
| | | * @author bianhl |
| | | * @date 2024/4/26 13:52 |
| | | */ |
| | | private static byte[] getFileStream(InputStream inputStream) { |
| | | // å建 ByteArrayOutputStream æ¥æåæµæ°æ® |
| | | try { |
| | | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
| | | // å° inputStream 读åå° byteArrayOutputStream ä¸ |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = inputStream.read(buffer)) != -1) { |
| | | byteArrayOutputStream.write(buffer, 0, length); |
| | | } |
| | | // å° byteArrayOutputStream çå
容è·å为åèæ°ç» |
| | | return byteArrayOutputStream.toByteArray(); |
| | | } catch (IOException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | interface CacheKey { |
| | | } |
| | | public interface RedisKeys { |
| | | public static final String ORDER_CODE = "ORDER_CODE"; |
| | | String IMPORTING_RECORD = "IMPORTING_RECORD"; |
| | | String ORDER_CODE = "ORDER_CODE"; |
| | | } |
| | | /** |
| | | * æä½ç±»åï¼ç¨äºåæ¥å£éªè¯åç» |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("å工信æ¯å¯¼å
¥") |
| | | public class CasesImport { |
| | | |
| | | // @ExcelColumn(name="åºå·",value = "sn") |
| | | private Integer sn; |
| | | |
| | | @ExcelColumn(name="å§å",value = "name",index = 1) |
| | | private String name; |
| | | @ExcelColumn(name="ææºå·",value = "phone",index = 2) |
| | | private String phone; |
| | | |
| | | @ExcelColumn(name="身份è¯å·",value = "idcardNo",index = 3) |
| | | private String idcardNo; |
| | | |
| | | @ExcelColumn(name="ç»ç»åç§°" , value = "companyName" ,index = 4) |
| | | private String companyName; |
| | | |
| | | @ExcelColumn(name="å·¥å·" , value = "code") |
| | | private String code; |
| | | |
| | | @ExcelColumn(name="å²ä½" , value = "code") |
| | | private String positionName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.dto; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("å工信æ¯å¯¼å
¥") |
| | | public class MemberImport { |
| | | @ExcelColumn(name="å·¥å·",value = "code",index = 1) |
| | | private String code; |
| | | @ExcelColumn(name="å§å",value = "name",index = 2) |
| | | private String name; |
| | | @ExcelColumn(name="èä¸ç
§",value = "imgurl",index = 3) |
| | | private String imgurl; |
| | | @ExcelColumn(name="ç级",value = "levelName",index = 4) |
| | | private String levelName; |
| | | @ExcelColumn(name="æ§å«" , value = "sex" ,index = 5) |
| | | private String sex; |
| | | @ExcelColumn(name="å²ä½" , value = "position",index = 6) |
| | | private String position; |
| | | @ExcelColumn(name="ä»ä¸å¹´ä»½(å¹´)" , value = "jobYear",index = 7) |
| | | private String jobYear; |
| | | @ExcelColumn(name="æå¡æåº", value = "zqNames",index = 8) |
| | | private String zqNames; |
| | | @ExcelColumn(name="åä¸åç±»å", value = "typeNames",index = 9) |
| | | private String typeNames; |
| | | @ExcelColumn(name="æ
é¿é¢å", value = "fieldNames",index = 10) |
| | | private String fieldNames; |
| | | @ExcelColumn(name="æå¡ååºæ°(个)", value = "serveNum",index = 11) |
| | | private String serveNum; |
| | | @ExcelColumn(name="è´¹ç¨æ å(å
/å¨)", value = "fee",index = 12) |
| | | private String fee; |
| | | @ExcelColumn(name="èå¸ç®ä»", value = "fee",index = 13) |
| | | private String info; |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="æåºç ï¼ååºï¼") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | @ExcelColumn(name="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼") |
| | | @ApiModelProperty(value = "æ¯å¦åºå®ï¼:0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | @ExcelColumn(name="æ¯å¦åºå® :0=å¦ï¼1=æ¯ï¼") |
| | | private Integer isFixed; |
| | | @ApiModelProperty(value = "æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼", example = "1") |
| | | @ApiModelProperty(value = "æåæä½äººåï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String updateUserName; |
| | | @ApiModelProperty(value = "éä»¶éå", example = "1") |
| | | @TableField(exist = false) |
| | | private List<Multifile> fileList; |
| | | @ApiModelProperty(value = "徿 å
¨è·¯å¾") |
| | | @TableField(exist = false) |
| | | private String iconFull; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.dao.business.dto.CasesImport; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.poi.ss.usermodel.PictureData; |
| | | |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å类信æ¯è¡¨Modelå®ä¹ |
| | | * @author doumee |
| | |
| | | @ApiModelProperty("导å
¥å¤±è´¥è®°å½æ°") |
| | | @ExcelColumn(name="导å
¥å¤±è´¥è®°å½æ°",index=18 ,width=10) |
| | | private Integer errorNum; |
| | | @TableField(exist = false) |
| | | private List<CasesImport> caseList; |
| | | @TableField(exist = false) |
| | | private List<MemberImport> memberList; |
| | | @TableField(exist = false) |
| | | private List<PictureData> pictureDataList; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç±»å0å¾ç 1è§é¢ 2å
¶ä»", example = "1") |
| | | private Integer type; |
| | | |
| | | // @ApiModelProperty(value = "å
³è对象类å 0SHE䏿¥ 1è·ç»æ»ä¸æ¥ 2è·ç»æ»å¤ç 3è·ç»æ»åé
ç©ä¸ä¸»ç®¡ 4è·ç»æ»åé
å¤ç人 5DCAé£é©ä¸æ¥ 6DCAé£é©å¤ç 7DCAå·¥åå¾ç", example = "1") |
| | | // @ExcelExportColumn(name="å
³è对象类å 0SHE䏿¥ 1è·ç»æ»ä¸æ¥ 2è·ç»æ»å¤ç 3è·ç»æ»åé
ç©ä¸ä¸»ç®¡ 4è·ç»æ»åé
å¤ç人 5DCAé£é©ä¸æ¥ 6DCAé£é©å¤ç 7DCAå·¥åå¾ç") |
| | | @ApiModelProperty(value = "å
³è对象类å 0æ¡ä¾å¾ï¼1å䏿è¡å¾", example = "1") |
| | | @ApiModelProperty(value = "å
³è对象类å 0åä¸åç±»åå¤å¾ 1æ¡ä¾", example = "1") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "æä»¶å°å") |
| | |
| | | |
| | | @ApiModelProperty(value = "æä»¶å°å") |
| | | @TableField(exist = false) |
| | | private String fileurlFull; |
| | | private String url; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å
ç½æä»¶å°å") |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.ImportRecord; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return long |
| | | */ |
| | | long count(ImportRecord model); |
| | | ImportRecord importBatch(MultipartFile file, int type ); |
| | | |
| | | void dealImporTask(ImportRecord importRecord); |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Member; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | long count(Member model); |
| | | |
| | | Member findDetailById(Integer id,String queryUserRole); |
| | | |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | @Autowired |
| | | private CategoryMapper categoryMapper; |
| | | |
| | | @Autowired |
| | | private MultifileMapper multifileMapper; |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public Integer create(Category category) { |
| | | // ç±»å:0=æåº;1=åä¸å;2=æ
é¿é¢å;3=讲å¸ç级; |
| | | if(Objects.isNull(category) |
| | | || Objects.isNull(category.getType()) |
| | | || Objects.isNull(category.getName()) |
| | | || (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) ) |
| | | ){ |
| | | || (Constants.equalsInteger(category.getType(),Constants.ZERO)&& StringUtils.isBlank(category.getDetail())) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | category.setCreateUser(loginUserInfo.getId()); |
| | | category.setUpdateTime(new Date()); |
| | | category.setUpdateUser(loginUserInfo.getId()); |
| | | if(!Constants.equalsInteger(category.getType(),Constants.ONE)){ |
| | | category.setIsFixed(Constants.ZERO); |
| | | } |
| | | categoryMapper.insert(category); |
| | | dealBatchMultiFiles(category, category.getFileList(), loginUserInfo,false); |
| | | return category.getId(); |
| | | } |
| | | |
| | | public void dealBatchMultiFiles(Category category, List<Multifile> fileList, LoginUserInfo user,boolean update) { |
| | | Date today = new Date(); |
| | | //æ¸
空åæç |
| | | if(update){ |
| | | multifileMapper.delete(new UpdateWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.ZERO) |
| | | .eq(Multifile::getObjId,category.getId())); |
| | | } |
| | | if(fileList!=null && fileList.size()>0){ |
| | | List<Multifile> multifileList = new ArrayList<>(); |
| | | fileList.stream().forEach(s -> { |
| | | if(StringUtils.isNotBlank(s.getFileurl())){ |
| | | s.setIsdeleted(Constants.ZERO); |
| | | s.setCreator(user.getId()); |
| | | s.setCreateDate(today); |
| | | s.setObjId(category.getId()); |
| | | s.setType(Constants.ZERO); |
| | | s.setObjType(Constants.ZERO); |
| | | multifileList.add(s); |
| | | } |
| | | }); |
| | | if(multifileList.size()>0){ |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | categoryMapper.update(new UpdateWrapper<Category>().lambda().set(Category::getDeleted,Constants.ONE).eq(Category::getId,id)); |
| | | |
| | | // categoryMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | |
| | | || Objects.isNull(category.getId()) |
| | | || Objects.isNull(category.getType()) |
| | | || Objects.isNull(category.getName()) |
| | | || (Constants.equalsInteger(category.getType(),Constants.ONE) && (Objects.isNull(category.getIcon())||Objects.isNull(category.getIsFixed())) ) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | category.setIsFixed(null); |
| | | category.setUpdateUser(loginUserInfo.getId()); |
| | | categoryMapper.updateById(category); |
| | | dealBatchMultiFiles(category, category.getFileList(), loginUserInfo,true); |
| | | } |
| | | @Override |
| | | public void updateStatus(Category category) { |
| | | if(Objects.isNull(category) |
| | | || Objects.isNull(category.getId())){ |
| | | if(Objects.isNull(category) || Objects.isNull(category.getId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(StringUtils.isNotBlank(category.getIcon())){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.CATEGORY_FILES).getCode(); |
| | | category.setIconFull(path + category.getIcon()); |
| | | } |
| | | return category; |
| | |
| | | |
| | | @Override |
| | | public List<Category> findList(Category category) { |
| | | category.setDeleted(Constants.ZERO); |
| | | QueryWrapper<Category> wrapper = new QueryWrapper<>(category); |
| | | return categoryMapper.selectList(wrapper); |
| | | } |
| | |
| | | queryWrapper.orderByAsc(Category::getSortnum); |
| | | PageData<Category> result =PageData.from(categoryMapper.selectJoinPage(page, Category.class,queryWrapper)); |
| | | if(result!=null && result.getRecords()!=null){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.CATEGORY_FILES).getCode(); |
| | | for(Category cate : result.getRecords()){ |
| | | try { |
| | | if(StringUtils.isNotBlank(cate.getIcon())){ |
| | | cate.setIconFull(path + cate.getIcon()); |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | if(Constants.equalsInteger(cate.getType(),Constants.ONE) ){ |
| | | initMultifileList(cate); |
| | | } |
| | | if(StringUtils.isNotBlank(cate.getIcon())){ |
| | | cate.setIconFull(path + cate.getIcon()); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private void initMultifileList(Category cate) { |
| | | String path = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.CATEGORY_FILES).getCode(); |
| | | |
| | | Multifile find = new Multifile(); |
| | | find.setObjId(cate.getId()); |
| | | find.setObjType(Constants.ZERO); |
| | | find.setIsdeleted(Constants.ZERO); |
| | | List<Multifile> fileList= multifileMapper.selectList(new QueryWrapper<>(find)); |
| | | if(fileList!=null){ |
| | | for(Multifile f : fileList){ |
| | | if(StringUtils.isNotBlank(f.getFileurl())){ |
| | | f.setUrl(path+f.getFileurl()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | cate.setFileList(fileList); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .orderByAsc(Category::getSortnum) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode(); |
| | | String categoryFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.CATEGORY_FILES).getCode(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode(); |
| | | for (Category category:categoryList) { |
| | | if(StringUtils.isNotBlank(category.getIcon())){ |
| | | category.setIconFull(path + categoryFile + category.getIcon()); |
| | | category.setIconFull(path + category.getIcon()); |
| | | } |
| | | //åä¸åæè¡æ¦å¾ç |
| | | if(Constants.equalsInteger(type,Constants.ONE)){ |
| | | List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.ONE) |
| | | .eq(Multifile::getObjId,category.getId()) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | String muFile = systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE,Constants.MEMBER_FILES).getCode(); |
| | | multifileList.forEach(m->{ |
| | | m.setFileurlFull(path + muFile + m.getFileurl()); |
| | | }); |
| | | } |
| | | category.setMultifileList(multifileList); |
| | | if(Constants.equalsInteger(category.getType(),Constants.ONE) ){ |
| | | initMultifileList(category); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.dto.CasesImport; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.model.ImportRecord; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.ImportRecordMapper; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.service.business.ImportRecordService; |
| | | 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.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * å类信æ¯è¡¨Serviceå®ç° |
| | |
| | | |
| | | @Autowired |
| | | private ImportRecordMapper importRecordMapper; |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Override |
| | | public Integer create(ImportRecord importRecord) { |
| | | if(StringUtils.isBlank(importRecord.getImgurl())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | importRecord.setDeleted(Constants.ZERO); |
| | | importRecord.setStatus(Constants.ZERO); |
| | | importRecord.setCreateTime(new Date()); |
| | | importRecord.setCreateUser(loginUserInfo.getId()); |
| | | importRecord.setUpdateTime(new Date()); |
| | | importRecord.setUpdateUser(loginUserInfo.getId()); |
| | | importRecordMapper.insert(importRecord); |
| | | return importRecord.getId(); |
| | | } |
| | |
| | | QueryWrapper<ImportRecord> wrapper = new QueryWrapper<>(importRecord); |
| | | return importRecordMapper.selectCount(wrapper); |
| | | } |
| | | @Override |
| | | public ImportRecord importBatch(MultipartFile file,int type ){ |
| | | Boolean importing = (Boolean) redisTemplate.opsForValue().get(Constants.RedisKeys.IMPORTING_RECORD); |
| | | if(importing!=null && importing){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对ä¸èµ·ï¼å·²åå¨å¯¼å
¥ä»»å¡æ£å¨æ§è¡ä¸ï¼è¯·ç¨ååè¯ï¼"); |
| | | } |
| | | redisTemplate.opsForValue().set(Constants.RedisKeys.IMPORTING_RECORD,true,30, TimeUnit.MINUTES); |
| | | try { |
| | | ImportRecord model = new ImportRecord(); |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | model.setDeleted(Constants.ZERO); |
| | | model.setStatus(Constants.ONE);//弿¥å¤çä¸ |
| | | model.setCreateTime(new Date()); |
| | | model.setCreateUser(loginUserInfo.getId()); |
| | | model.setUpdateTime(model.getCreateTime()); |
| | | model.setUpdateUser(loginUserInfo.getId()); |
| | | model.setType(type); |
| | | model.setTitle((type==1?"æ¡ä¾ä¿¡æ¯æ¹é导å
¥":"èå¸ä¿¡æ¯æ¹é导å
¥")+ DateUtil.getPlusTime2(model.getCreateTime())); |
| | | model.setTotalNum(0); |
| | | ExcelImporter ie= new ExcelImporter(file,0,0, CellType.STRING); // ç¡®ä¿åå
æ ¼ç±»å为å符串); |
| | | if(type == 1) { |
| | | model.setCaseList(ie.getDataList(CasesImport.class,null)); |
| | | if(model.getCaseList() ==null || model.getCaseList().size()==0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"导å
¥æä»¶æ¡ä¾ä¿¡æ¯å
容为空ï¼"); |
| | | } |
| | | model.setTotalNum(model.getCaseList().size()); |
| | | }else{ |
| | | model.setMemberList(ie.getDataList(MemberImport.class,null)); |
| | | if(model.getMemberList() ==null || model.getMemberList().size()==0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"导å
¥æä»¶èå¸ä¿¡æ¯å
容为空ï¼"); |
| | | } |
| | | model.setTotalNum(model.getMemberList().size()); |
| | | } |
| | | // model.setPictureDataList(ie); |
| | | importRecordMapper.insert(model); |
| | | return model; |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æä»¶ä¿¡æ¯è¯»å失败ï¼è¯·æ£æ¥æä»¶å
容åéè¯ï¼"); |
| | | }finally { |
| | | redisTemplate.delete(Constants.RedisKeys.IMPORTING_RECORD); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 弿¥æ§è¡æä»¶ä»»å¡ |
| | | * @param importRecord |
| | | */ |
| | | @Override |
| | | @Async |
| | | public void dealImporTask(ImportRecord importRecord){ |
| | | int success = 0; |
| | | if(Constants.equalsInteger(importRecord.getType(),0)){ |
| | | dealUserImportBiz(importRecord); |
| | | }else{ |
| | | dealCaseImportBiz(importRecord); |
| | | } |
| | | importRecord.setStatus(Constants.TWO); |
| | | importRecord.setUpdateTime(new Date()); |
| | | importRecordMapper.updateById(importRecord); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å¤çæ¡ä¾å¯¼å
¥ä»»å¡ |
| | | * @param importRecord |
| | | */ |
| | | |
| | | private int dealCaseImportBiz(ImportRecord importRecord) { |
| | | int success=0; |
| | | String msg =""; |
| | | try { |
| | | for(CasesImport param:importRecord.getCaseList()){ |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | importRecord.setDoneNum(success); |
| | | importRecord.setErrorNum(importRecord.getTotalNum() - success); |
| | | return success; |
| | | } |
| | | |
| | | /** |
| | | * å¤ç人å导å
¥è®°å½ |
| | | * @param importRecord |
| | | */ |
| | | private int dealUserImportBiz(ImportRecord importRecord) { |
| | | int success=0; |
| | | String msg = ""; |
| | | try { |
| | | for(MemberImport param:importRecord.getMemberList()){ |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | importRecord.setDoneNum(success); |
| | | importRecord.setErrorNum(importRecord.getTotalNum() - success); |
| | | importRecord.setDetail(msg); |
| | | |
| | | return success; |
| | | } |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | 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.dao.business.ImportRecordMapper; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.CasesMapper; |
| | | import com.doumee.dao.business.CategoryMapper; |
| | | import com.doumee.dao.business.MultifileMapper; |
| | |
| | | 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.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | QueryWrapper<Member> wrapper = new QueryWrapper<>(member); |
| | | return memberMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | } |