Merge remote-tracking branch 'origin/master'
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/business/inviteRecord/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function exportExcel (data) { |
| | | return request.post('/business/inviteRecord/exportExcel', data, { |
| | | trim: true, |
| | | download: true |
| | | }) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="100%" |
| | | :visible.sync="visible" |
| | | > |
| | | <TableLayout > |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="10px" style="display: block;" > |
| | | <el-form-item label="" prop="name" style="display: inline-block;margin-right: 30px;width: 180px"> |
| | | <el-input v-model="searchForm.name" placeholder="åååç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="id" style="display: inline-block;margin-right: 30px;;width: 180px"> |
| | | <el-input v-model="searchForm.id" placeholder="ååID" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="categoryId" style="display: inline-block;margin-right: 30px;"> |
| | | <!-- 0æ£å¸¸ 1ç¦ç¨ --> |
| | | <el-select |
| | | v-model="searchForm.categoryId" |
| | | style="width: 120px" |
| | | placeholder="æå±åç±»" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in labels" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="brandId" style="display: inline-block;margin-right: 30px;"> |
| | | <!-- 0æ£å¸¸ 1ç¦ç¨ --> |
| | | <el-select |
| | | v-model="searchForm.brandId" |
| | | style="width: 120px" |
| | | placeholder="æå±åç" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in brands" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="status" style="display: inline-block;margin-right: 30px;"> |
| | | <!-- 0æ£å¸¸ 1ç¦ç¨ --> |
| | | <el-select |
| | | v-model="searchForm.status" |
| | | style="width: 120px" |
| | | @change="search" |
| | | clearable |
| | | placeholder="ä¸ä¸æ¶ç¶æ" |
| | | > |
| | | <el-option :key="0" :value="0" label="䏿¶"></el-option> |
| | | <el-option :key="1" :value="1" label="䏿¶"></el-option> |
| | | </el-select> |
| | | </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" > |
| | | <li><el-button type="primary" icon="el-icon-plus" @click="setPriceBatch" >æ¹éå®ä»·</el-button></li> |
| | | </ul>--> |
| | | <div :style="'display: flex;height:'+tabelHeight+'px;'"> |
| | | <el-table |
| | | :height="tabelHeight" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <!-- |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | --> |
| | | <el-table-column prop="imgurl" label="ååä¿¡æ¯" min-width="80px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image style="width: 50px;height: 50px;" v-if="row.imgurl && row.imgurl!=''" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="ååID" min-width="120px" ></el-table-column> |
| | | <el-table-column prop="name" label="åååç§°" min-width="180px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="categoryName" label="æå±åç±»" min-width="120px"></el-table-column> |
| | | <el-table-column prop="brandName" label="æå±åç" min-width="120px"></el-table-column> |
| | | <el-table-column prop="stockNum" label="å©ä½åºåé" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="ä¸ä¸æ¶ç¶æ" min-width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.status ==1" class="red">已䏿¶</span> |
| | | <span v-else class="green">已䏿¶</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="price" label="å±ç¤ºä»·æ ¼" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="skuPrice" label="éå®ä»·(å
)" fixed="right" min-width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <span class="orange">{{ row.skuPrice }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="shopPrice" label="ä¾è´§ä»·(å
)" align="center" min-width="100px" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-if="scope.row.isPriceSelected" v-model="scope.row.shopPrice" |
| | | @focus="focusEvent(scope.row,scope.$index,scope.column)" |
| | | @blur="blurEvent(scope.row,scope.$index,scope.column)" v-focus></el-input> |
| | | <p style="cursor: pointer" class="blue" title="ç¹å»ç¼è¾" @click="cellClick(scope.row, scope.column)" v-else>{{scope.row.shopPrice || 'æªè®¾ç½®' }}</p> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column |
| | | label="æä½" |
| | | min-width="160" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" v-permissions="['business:goods:update']" @click="setPrice(row)">è®¾ç½®ä»·æ ¼</el-button> |
| | | </template> |
| | | </el-table-column>--> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </div> |
| | | </template> |
| | | </TableLayout> |
| | | <template v-slot:footer> |
| | | <el-button @click="visible=false">è¿å</el-button> |
| | | </template> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { findAll as labelList } from '@/api/business/labels' |
| | | import { setGoodsPrice } from '@/api/business/shop' |
| | | export default { |
| | | name: 'OperaShopGoodsWindow', |
| | | extends: BaseTable, |
| | | components: { GlobalWindow, TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | title: '', |
| | | price: null, |
| | | visible: false, |
| | | tabelHeight: null, |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | name: '', |
| | | shopId: null, |
| | | categoryId: '', |
| | | brandId: '', |
| | | // ç±»å 0å¹³å°åå 1åè±åå 2åå¡è®¡ååå |
| | | type: '0', // å¹³å°åå |
| | | status: '', |
| | | labels: '' |
| | | }, |
| | | labels: [], |
| | | brands: [] |
| | | } |
| | | }, |
| | | mounted () { |
| | | window.addEventListener('resize', this.handleResize) |
| | | }, |
| | | beforeDestroy () { |
| | | window.removeEventListener('resize', this.handleResize) |
| | | }, |
| | | created: function () { |
| | | this.config({ |
| | | module: 'ååä¿¡æ¯è¡¨', |
| | | api: '/business/goods', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.handleResize() |
| | | labelList({ |
| | | type: 0 // åååç±» |
| | | }).then(res => { |
| | | this.labels = res |
| | | }) |
| | | labelList({ |
| | | type: 1 // åååç |
| | | }) |
| | | .then(res => { |
| | | this.brands = res |
| | | }) |
| | | }, |
| | | directives: { |
| | | focus: { |
| | | inserted: function (el) { |
| | | el.querySelector('input').focus() |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | setPrice (row) { |
| | | if (row.skuPrice == null) { |
| | | this.$tip.warning('请å
设置ååéå®ä»·ï¼') |
| | | return |
| | | } |
| | | console.log(row) |
| | | }, |
| | | setPriceBatch () { |
| | | }, |
| | | handleResize () { |
| | | this.tabelHeight = window.innerHeight - 400 |
| | | }, |
| | | open (title, info) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.searchForm.shopId = info.id |
| | | this.search() |
| | | this.handleResize() |
| | | }, |
| | | handlePageChange: function (pageIndex) { |
| | | this.__checkApi() |
| | | this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex |
| | | this.isWorking.search = true |
| | | this.api.fetchList({ |
| | | page: this.tableData.pagination.pageIndex, |
| | | capacity: this.tableData.pagination.pageSize, |
| | | model: this.searchForm, |
| | | sorts: this.tableData.sorts |
| | | }) |
| | | .then(data => { |
| | | (data.records || []).forEach((item) => { |
| | | item.isPriceSelected = false |
| | | }) |
| | | this.tableData.list = data.records || [] |
| | | this.tableData.pagination.total = data.total |
| | | console.log(this.tableData.list) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.search = false |
| | | }) |
| | | }, |
| | | cellClick (row, column) { |
| | | row.isPriceSelected = !row.isPriceSelected |
| | | }, |
| | | focusEvent (row, index, column) { |
| | | row.oldShopsPrice = row.shopPrice |
| | | }, |
| | | blurEvent (row, curIndex, column) { |
| | | if ( !this.skuPrice || this.skuPrice <= row.shopPrice) { |
| | | this.$tip.error('ä¾è´§ä»·ä¸è½ä½äºéå®ä»·') |
| | | row.isPriceSelected = !row.isPriceSelected |
| | | row.shopPrice = row.oldShopsPrice// ä»·æ ¼è¿å |
| | | return |
| | | } |
| | | if (row.shopPrice == row.oldShopsPrice) { |
| | | row.isPriceSelected = !row.isPriceSelected |
| | | return |
| | | } |
| | | setGoodsPrice({ |
| | | id: this.searchForm.shopId, |
| | | goodsId: row.id, |
| | | goodsPrice: row.shopPrice |
| | | }).then(res => { |
| | | row.oldShopsPrice = row.shopPrice |
| | | this.$tip.success('ä¿®æ¹æå') |
| | | this.$emit('success') |
| | | }).catch(e => { |
| | | row.shopPrice = row.oldShopsPrice// ä»·æ ¼è¿å |
| | | }).finally(() => { |
| | | row.isPriceSelected = !row.isPriceSelected |
| | | }) |
| | | }, |
| | | handleClick (val) { |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .table-pagination{ |
| | | position: fixed !important; |
| | | bottom: 50px; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:inviterecord:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="é请人信æ¯" prop="recName" > |
| | | <el-input v-model="searchForm.recName" placeholder="请é请人æµç§°/å§å/ææºå· " clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="被é请人信æ¯" prop="memberName" > |
| | | <el-input v-model="searchForm.memberName" placeholder="被é请人æµç§°/å§å/ææºå· " clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="宿鶿®µ" prop="firstOrderStatus"> |
| | | <el-select v-model="searchForm.firstOrderStatus" placeholder="è¯·éæ©å®æé¶æ®µ" clearable @change="search" > |
| | | <el-option :value="0" label="已注å"></el-option> |
| | | <el-option :value="1" label="宿é¦å"></el-option> |
| | | </el-select> |
| | | </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:inviterecord:exportExcel']"> |
| | | <li> <el-button type="primary" :loading="isWorking.export" v-permissions="['business:inviterecord:exportExcel']" @click="exportExcel">导åº</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="openid" label="被é请人微信ID" min-width="200px"></el-table-column> |
| | | <el-table-column prop="memberName" label="被é请人(æµç§°/å§å/ææº)" min-width="200px"></el-table-column> |
| | | <el-table-column prop="recName" label="é请人(æµç§°/å§å/ææº)" min-width="200px"></el-table-column> |
| | | <el-table-column prop="firstOrderStatus" label="宿鶿®µ" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.firstOrderStatus ===1" class="green">宿é¦å</span> |
| | | <span v-else class="orange">已注å</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="rewardIntegral" label="积åå¥å±" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span class="orange">{{ row.rewardIntegral || ''}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="couponNames" label="伿 å¸å¥å±" min-width="150px"></el-table-column> |
| | | <el-table-column prop="firstFinishDate" label="é¦å宿æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column prop="createDate" label="æ³¨åæ¶é´" min-width="150px"></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | export default { |
| | | name: 'inviteRecord', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | recName: '', |
| | | memberName: '', |
| | | firstOrderStatus: '' |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'æ¨èè®°å½è¡¨', |
| | | api: '/business/inviteRecord', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <TableLayout :permissions="['business:goods:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <!-- <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="å
¨é¨åå" name="first"></el-tab-pane> |
| | | <el-tab-pane label="å·²å®ç½åå" name="second"></el-tab-pane> |
| | | <el-tab-pane label="åæ¶ç«åå" name="third"></el-tab-pane> |
| | | </el-tabs>--> |
| | | <el-form-item label="åååç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åååç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | |
| | | <el-select |
| | | v-model="searchForm.status" |
| | | placeholder="è¯·éæ©ä¸æ¶ç¶æ" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option :key="0" :value="0" label="䏿¶"></el-option> |
| | | <el-option :key="1" :value="1" label="䏿¶"></el-option> |
| | |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:goods:create', 'business:goods:delete']"> |
| | | <ul class="toolbar" > |
| | | <li><el-button type="primary" icon="el-icon-plus" @click="$refs.operaGoodsWindow.open('æ°å»ºåå', null, 0)" v-permissions="['business:goods:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-edit" @click="issued(0)">䏿¶</el-button></li> |
| | | <li><el-button type="danger" icon="el-icon-edit" @click="issued(1)">䏿¶</el-button></li> |
| | | <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>æç¤ºï¼ãä¾è´§ä»·è®¾ç½®ãåªç»è®¡å¯ç¨ç¶æçä¾éåè®¾ç½®æ°æ®</p></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | |
| | | <el-table-column prop="skuPrice" label="éå®ä»·(å
)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="shopPrice" label="ä¾è´§ä»·è®¾ç½®" min-width="100px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <div @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.pricedShopNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div> |
| | | <div title="é对å¯ç¨ä¾éåä»·æ ¼è®¾ç½®ç»è®¡" @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.pricedShopNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="stockNum" label="å©ä½åºåé" min-width="100px"></el-table-column> |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | min-width="250" |
| | | min-width="160" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" v-if="row.status == 1" @click="$refs.operaGoodsWindow.open('ç¼è¾åå', row, 0)" v-permissions="['business:goods:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="goPriceSet(row)">ä¾è´§ä»·</el-button> |
| | | <el-button type="text" v-permissions="['business:goods:update']" @click="goPriceSet(row)">ä¾è´§ä»·</el-button> |
| | | <el-button type="text" style="color: red;" @click="deleteById(row)" v-permissions="['business:goods:delete']">å é¤</el-button> |
| | | <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('åå详æ
', row, 0)">æ¥ç详æ
</el-button>--> |
| | | </template> |
| | |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | creator: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | remark: '', |
| | | imgurl: '', |
| | | name: '', |
| | | info: '', |
| | | categoryId: '', |
| | | brandId: '', |
| | | price: '', |
| | | salenum: '', |
| | | content: '', |
| | | sortnum: '', |
| | | looknum: '', |
| | | // ç±»å 0å¹³å°åå 1åè±åå 2åå¡è®¡ååå |
| | | type: '0', // å¹³å°åå |
| | | status: '', |
| | | isrec: '', |
| | | styleImg: '', |
| | | labels: '' |
| | | }, |
| | | labels: [], |
| | | serials: [], |
| | | brands: [] |
| | | brands: [], |
| | | serials: [] |
| | | } |
| | | }, |
| | | provide () { |
| | |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:shop:create', 'business:shop:delete']"> |
| | | <ul class="toolbar" > |
| | | <li><el-button type="primary" @click="$refs.operaShopWindow.open('æ°å»ºç»éå')" icon="el-icon-plus" v-permissions="['business:shop:create']">æ°å»º</el-button></li> |
| | | <!-- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:shop:delete']">å é¤</el-button></li> --> |
| | | <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>æç¤ºï¼ãä¾è´§ä»·è®¾ç½®ãåªç»è®¡ä¸æ¶ç¶æçååä»·æ ¼è®¾ç½®æ°æ®</p></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | |
| | | {{ row.saleType == 1?'èªä¸»éè´':'å¹³å°éºè´§'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="shopPrice" label="ä¾è´§ä»·è®¾ç½®" min-width="100px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <div title="é坹䏿¶ååä»·æ ¼è®¾ç½®ç»è®¡" @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.pricedGoodsNum||0}}</span> / <span class="green"> {{row.goodsNum||0}}</span> </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" align="center" min-width="140px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" align="center" min-width="100px" fixed="right"> |
| | | <template slot-scope="{row}"> |
| | |
| | | <el-table-column |
| | | v-if="containPermissions(['business:shop:update', 'business:shop:delete'])" |
| | | label="æä½" |
| | | min-width="200" |
| | | min-width="280" |
| | | fixed="right" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaShopWindow.open('ç¼è¾ç»éå', row)" icon="el-icon-edit" v-permissions="['business:shop:update']">ç¼è¾</el-button> |
| | | <el-button type="text" v-permissions="['business:shop:update']" icon="el-icon-edit" @click="goPriceSet(row)">ä¾è´§ä»·</el-button> |
| | | <el-button type="text" @click="resetPwd(row)" icon="el-icon-edit" v-permissions="['business:shop:update']">éç½®å¯ç </el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:shop:delete']">å é¤</el-button> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <OperaShopWindow ref="operaShopWindow" @success="handlePageChange"/> |
| | | <OperaShopInfoWindow ref="OperaShopInfoWindow" /> |
| | | <ResetPwdShopWindow ref="resetPwdWindow"/> |
| | | <OperaGoodsShopWindow ref="OperaGoodsShopWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaShopWindow from '@/components/business/OperaShopWindow' |
| | | import OperaShopInfoWindow from '@/components/business/OperaShopInfoWindow' |
| | | import OperaGoodsShopWindow from '@/components/business/OperaGoodsShopWindow' |
| | | import { resetPwd, updateIsRecById } from '@/api/business/shop' |
| | | import ResetPwdShopWindow from '@/components/business/ResetPwdShopWindow' |
| | | export default { |
| | | name: 'Shop', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow }, |
| | | components: { TableLayout, Pagination, OperaShopWindow, OperaShopInfoWindow, ResetPwdShopWindow,OperaGoodsShopWindow }, |
| | | data () { |
| | | return { |
| | | |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | goPriceSet(row){ |
| | | this.$refs.OperaGoodsShopWindow.open('设置ä¾è´§ä»· - '+row.name, row ) |
| | | }, |
| | | resetPwd (row) { |
| | | this.$dialog.messageWaring('确认é置该ç»éåã' + row.name + 'ãçç»å½å¯ç åï¼') |
| | | .then(() => { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.InviteRecord; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.service.business.InviteRecordService; |
| | | 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.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | /** |
| | | * ç¨æ·é请记å½Controllerå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-01-20 15:51:22 |
| | | */ |
| | | @Api(tags = "tableNameæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/business/inviteRecord") |
| | | public class InviteRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InviteRecordService inviteRecordService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:inviterecord:create") |
| | | public ApiResponse create(@RequestBody InviteRecord inviteRecord) { |
| | | return ApiResponse.success(inviteRecordService.create(inviteRecord)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:inviterecord:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | inviteRecordService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:inviterecord:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | inviteRecordService.deleteByIdInBatch(this.getIdList(ids)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:inviterecord:update") |
| | | public ApiResponse updateById(@RequestBody InviteRecord inviteRecord) { |
| | | inviteRecordService.updateById(inviteRecord); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:inviterecord:query") |
| | | public ApiResponse<PageData<InviteRecord>> findPage (@RequestBody PageWrap<InviteRecord> pageWrap) { |
| | | return ApiResponse.success(inviteRecordService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:inviterecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<InviteRecord> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InviteRecord.class).export(inviteRecordService.findPage(pageWrap).getRecords(), "ä¼åé请记å½è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:inviterecord:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(inviteRecordService.findById(id)); |
| | | } |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Long pricedShopNum; |
| | | |
| | | @ApiModelProperty(value = "shopId" ) |
| | | @TableField(exist = false) |
| | | private Integer shopId; |
| | | @ApiModelProperty(value = "åå®¶ä¾è´§ä»·" ) |
| | | @TableField(exist = false) |
| | | private BigDecimal shopPrice; |
| | | |
| | | } |
| | |
| | | private Integer creator; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="äº¤ææ¶é´" ,index =1,width = 10) |
| | | @ExcelColumn(name="æ³¨åæ¶é´" ,index =8,width = 10 ,dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å®æé¦åï¼0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="宿æç«¯" ,index =4,width = 10,valueMapping = "0=已注å;1=宿é¦å;") |
| | | private Integer firstOrderStatus; |
| | | |
| | | @ApiModelProperty(value = "宿é¦åæ¶é´") |
| | | @ExcelColumn(name="宿é¦åæ¶é´" ,index =7,width = 10 ,dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date firstFinishDate; |
| | | |
| | | @ApiModelProperty(value = "é请å¥å±ç§¯å") |
| | | @ExcelColumn(name="å¥å±é请人积å" ,index =5,width = 10 ) |
| | | private BigDecimal rewardIntegral; |
| | | |
| | | @ApiModelProperty(value = "éè¯·å®æé¦åå¥å±ä¼æ å¸ä¸»é® å¤ä¸ªä»¥,åå²") |
| | | private String couponIds; |
| | | |
| | | @ApiModelProperty(value = "éè¯·å®æé¦åå¥å±ä¼æ å¸åç§° å¤ä¸ªä»¥,åå²") |
| | | @ExcelColumn(name="å¥å±éè¯·äººä¼æ å¸" ,index =6,width = 10 ) |
| | | private String couponNames; |
| | | |
| | | @ApiModelProperty(value = "被é请人头å") |
| | |
| | | |
| | | @ApiModelProperty(value = "被é请人åç§°") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="被éè¯·äººï¼æµç§°/å§å/ææºå·ï¼" ,index =2,width = 20) |
| | | private String memberName; |
| | | |
| | | @ApiModelProperty(value = "被é请人åç§°") |
| | | @TableField(exist = false) |
| | | private String memberNickname; |
| | | @ApiModelProperty(value = "被éè¯·äººææºå·") |
| | | @TableField(exist = false) |
| | | private String memberPhone; |
| | | @ApiModelProperty(value = "é请人æµç§°") |
| | | @TableField(exist = false) |
| | | private String recNickname; |
| | | @ApiModelProperty(value = "éè¯·äººææºå·") |
| | | @TableField(exist = false) |
| | | private String recPhone; |
| | | @ApiModelProperty(value = "被é请人åç§°") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="éè¯·äººï¼æµç§°/å§å/ææºå·ï¼" ,index =3,width = 20) |
| | | private String recName; |
| | | @ApiModelProperty(value = "被é请人åç§°") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="被é请人openid" ,index =1,width = 15) |
| | | private String openid; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ååç¼ç ") |
| | | @TableField(exist = false) |
| | | private Integer goodsId; |
| | | @ApiModelProperty(value = "å·²è®¾ç½®ä»·æ ¼äº§åæ°é") |
| | | @TableField(exist = false) |
| | | private Long pricedGoodsNum; |
| | | @ApiModelProperty(value = "ååæ»é") |
| | | @TableField(exist = false) |
| | | private Long goodsNum; |
| | | |
| | | @ApiModelProperty(value = "伿 å¸ï¼ä¼æ å¸ä½¿ç¨æ»æ°(å¼ )") |
| | | @TableField(exist = false) |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Integral; |
| | | import com.doumee.dao.web.dto.IntegralDTO; |
| | | import com.doumee.dao.web.dto.IntegralRecordDTO; |
| | | import com.doumee.dao.web.request.DealIntegralRequest; |
| | | import com.doumee.dao.web.response.IntegralDataResponse; |
| | | import com.doumee.dao.business.model.InviteRecord; |
| | | import com.doumee.dao.web.response.InviteInfoResponse; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | InviteInfoResponse getInviteInfo(Integer memberId); |
| | | |
| | | String createShareImg(Integer memberId) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(InviteRecord model); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(InviteRecord model); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(InviteRecord model); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param model å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<InviteRecord> model); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return model |
| | | */ |
| | | InviteRecord findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return InviteRecord |
| | | */ |
| | | InviteRecord findOne(InviteRecord model); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return List<InviteRecord> |
| | | */ |
| | | List<InviteRecord> findList(InviteRecord model); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<InviteRecord> |
| | | */ |
| | | PageData<InviteRecord> findPage(PageWrap<InviteRecord> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(InviteRecord model); |
| | | |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | Activity activity = new Activity(); |
| | | activity.setIsdeleted(Constants.ZERO); |
| | | activity.setIsdeleted(Constants.ONE); |
| | | activity.setId(id); |
| | | activityMapper.updateById(activity); |
| | | } |
| | |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.bouncycastle.jcajce.provider.asymmetric.GOST; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Autowired |
| | | private GoodsMapper goodsMapper; |
| | | @Autowired |
| | | private ShopGoodsRelationMapper shopGoodsRelationMapper; |
| | | |
| | | |
| | | |
| | |
| | | goods.setEditor(user.getId()); |
| | | goods.setId(id); |
| | | goodsMapper.updateById(goods); |
| | | //å é¤ä¾è´§ä»· |
| | | shopGoodsRelationMapper.delete(new UpdateWrapper<ShopGoodsRelation>().lambda().eq(ShopGoodsRelation::getGoodsId,id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void updateStatusById(List<Goods> list) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | |
| | | |
| | | if(list == null || list.size()==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for(Goods model:list){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)){ |
| | | idList.add(model.getId() ); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Constants.formatIntegerNum(list.get(0).getStatus()) == Constants.ONE){ |
| | | //å¦ææ¯æ¹é䏿¶ |
| | | goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | .set(Goods::getEditDate,new Date() ) |
| | | .set(Goods::getEditor,user.getId()) |
| | | .set(Goods::getStatus,Constants.ONE ) |
| | | .in(Goods::getId,idList)); |
| | | return; |
| | | } |
| | | long shopNum = shopMapper.selectCount(new QueryWrapper<Shop>().lambda() |
| | | .eq(Shop::getIsdeleted,Constants.ZERO) |
| | | .eq(Shop::getStatus,Constants.ZERO)); |
| | | MPJLambdaWrapper<Goods> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Goods.class); |
| | | queryWrapper.innerJoin(GoodsSku.class,GoodsSku::getGoodsId,Goods::getId); |
| | | queryWrapper.select("(select count(s.id) from shop_goods_relation s " + |
| | | "left join shop g on s.SHOP_ID =g.id " + |
| | | "where g.status=0 and s.ISDELETED=0 and s.GOODS_ID=t.id) as pricedShopNum "); |
| | | queryWrapper.eq(GoodsSku::getIsdeleted,Constants.ZERO); |
| | | queryWrapper.eq(Goods::getId,model.getId()); |
| | | List<Goods> query= goodsAdminJoinMapper.selectJoinList(Goods.class,queryWrapper); |
| | | if(query==null||query.size()<=0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), model.getName()+":ååæªé
ç½®SKUï¼æ æ³ä¸æ¶"); |
| | | queryWrapper.in(Goods::getId,idList); |
| | | List<Goods> goodsList= goodsAdminJoinMapper.selectJoinList(Goods.class,queryWrapper); |
| | | if(goodsList==null || goodsList.size() == 0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ååä¿¡æ¯æ¥è¯¢æ æ "); |
| | | } |
| | | //æ¥è¯¢å
¨é¨skuä¿¡æ¯ |
| | | List<GoodsSku> goodsSkuList=goodsSkuMapper.selectList(new QueryWrapper<GoodsSku>().lambda() |
| | | .eq(GoodsSku::getIsdeleted,Constants.ZERO) |
| | | .in(GoodsSku::getGoodsId,idList) ); |
| | | if(goodsSkuList==null || goodsSkuList.size() == 0){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ååå°æªè®¾ç½®é¶å®ä»·ï¼è¯·å
è®¾ç½®ä»·æ ¼ï¼ "); |
| | | } |
| | | for(Goods param: list){ |
| | | Goods goods = getGoodsFromListById(param.getId(),goodsList,goodsSkuList); |
| | | if(goods ==null ){ |
| | | continue; |
| | | } |
| | | //妿æ¯ä¸æ¶ |
| | | goods.setGoodsSkuList(goodsSkuList); |
| | | if(goods.getSkuPrice() == null || goods.getSkuPrice().compareTo(new BigDecimal(0)) <=0){ |
| | | //é»è®¤skuä¿¡æ¯ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":ååååå°æªè®¾ç½®é¶å®ä»·ï¼æ æ³ä¸æ¶"); |
| | | } |
| | | if(Constants.formatLongNum(goods.getPricedShopNum()) <= shopNum){ |
| | | //é»è®¤skuä¿¡æ¯ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), goods.getName()+":ææªè®¾ç½®ä¾è´§ä»·çç»éåï¼æ æ³ä¸æ¶"); |
| | | } |
| | | } |
| | | Goods update=new Goods(); |
| | | update.setEditor(user.getId()); |
| | | update.setEditDate(new Date()); |
| | | update.setStatus(model.getStatus()); |
| | | update.setId(model.getId()); |
| | | goodsMapper.updateById(model); |
| | | goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | .set(Goods::getEditDate,new Date() ) |
| | | .set(Goods::getEditor,user.getId()) |
| | | .set(Goods::getStatus,Constants.ZERO ) |
| | | .in(Goods::getId,idList)); |
| | | } |
| | | |
| | | private Goods getGoodsFromListById(Integer id, List<Goods> goodsList, List<GoodsSku> skuList) { |
| | | for(Goods model: goodsList){ |
| | | if(Constants.equalsObject(model.getIdList(),id)){ |
| | | for(GoodsSku sku :skuList){ |
| | | if(Constants.equalsInteger(sku.getGoodsId(),id)){ |
| | | model.setSkuPrice(sku.getPrice()); |
| | | } |
| | | } |
| | | return model; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | queryWrapper.leftJoin(Labels.class,Labels::getId,Goods::getParentCategoryId); |
| | | //åºåé |
| | | queryWrapper.select("(select sum(STOCK) from goods_sku where ISDELETED=0 and GOODS_ID=t.id) as stockNum "); |
| | | queryWrapper.select("(select count(id) from shop_goods_relation s where s.ISDELETED=0 and s.GOODS_ID=t.id) as pricedShopNum "); |
| | | if(pageWrap.getModel().getShopId() !=null){ |
| | | queryWrapper.select("(select s.price from shop_goods_relation s where s.ISDELETED=0 and s.GOODS_ID=t.id and s.shop_id="+pageWrap.getModel().getShopId()+" limit 1) as shopPrice");//åå®¶ä¾è´§ä»· |
| | | }else{ |
| | | queryWrapper.select("(select count(s.id) from shop_goods_relation s left join shop g on s.SHOP_ID =g.id where g.status=0 and s.ISDELETED=0 and s.GOODS_ID=t.id) as pricedShopNum "); |
| | | } |
| | | //å®é
éé |
| | | queryWrapper.select("(select sum(gd.GOODS_NUM) from goodsorder_detail gd" + |
| | | " inner join goods_sku gs on gs.id=gd.GOODS_SKU_ID" + |
| | |
| | | queryWrapper.eq(pageWrap.getModel().getBrandId() != null, Goods::getBrandId, pageWrap.getModel().getBrandId()); |
| | | queryWrapper.eq(pageWrap.getModel().getStatus() != null, Goods::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.in(pageWrap.getModel().getIdList() != null && pageWrap.getModel().getIdList().size()>0, Goods::getId, pageWrap.getModel().getIdList()); |
| | | if(pageWrap.getModel().getShopId() !=null){ |
| | | queryWrapper.orderByAsc("shopPrice"); |
| | | } |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | IPage<Goods> result = goodsAdminJoinMapper.selectJoinPage(page, Goods.class, queryWrapper); |
| | | initResult(result.getRecords()); |
| | | initResult(result.getRecords(),pageWrap.getModel().getShopId()==null); |
| | | return PageData.from(result); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | private void initResult(List<Goods> list) { |
| | | private void initResult(List<Goods> list,boolean shopId) { |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | long shopNum = shopMapper.selectCount(new QueryWrapper<Shop>().lambda() |
| | | .eq(Shop::getIsdeleted,Constants.ZERO)); |
| | | long shopNum = 0; |
| | | if(shopId){//ä¸é对åå®¶æç´¢çè¯ï¼ |
| | | shopNum = shopMapper.selectCount(new QueryWrapper<Shop>().lambda() |
| | | .eq(Shop::getIsdeleted,Constants.ZERO) |
| | | .eq(Shop::getStatus,Constants.ZERO)); |
| | | } |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_FILE).getCode(); |
| | | for (Goods goods : list) { |
| | |
| | | import com.doumee.service.business.InviteRecordService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.http.util.TextUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Integer create(InviteRecord inviteRecord) { |
| | | inviteRecordMapper.insert(inviteRecord); |
| | | return inviteRecord.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | inviteRecordMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(InviteRecord inviteRecord) { |
| | | UpdateWrapper<InviteRecord> deleteWrapper = new UpdateWrapper<>(inviteRecord); |
| | | inviteRecordMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | inviteRecordMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(InviteRecord inviteRecord) { |
| | | inviteRecordMapper.updateById(inviteRecord); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<InviteRecord> inviteRecords) { |
| | | if (CollectionUtils.isEmpty(inviteRecords)) { |
| | | return; |
| | | } |
| | | for (InviteRecord inviteRecord: inviteRecords) { |
| | | this.updateById(inviteRecord); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public InviteRecord findById(Integer id) { |
| | | return inviteRecordMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public InviteRecord findOne(InviteRecord inviteRecord) { |
| | | QueryWrapper<InviteRecord> wrapper = new QueryWrapper<>(inviteRecord).last("limit 1"); |
| | | return inviteRecordMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<InviteRecord> findList(InviteRecord inviteRecord) { |
| | | QueryWrapper<InviteRecord> wrapper = new QueryWrapper<>(inviteRecord); |
| | | return inviteRecordMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<InviteRecord> findPage(PageWrap<InviteRecord> pageWrap) { |
| | | IPage<InviteRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<InviteRecord> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.selectAll(InviteRecord.class ) |
| | | .select("t1.name",InviteRecord::getRecName) |
| | | .select("t1.nickname",InviteRecord::getRecNickname) |
| | | .select("t1.phone",InviteRecord::getRecPhone) |
| | | .select("t2.name",InviteRecord::getMemberName) |
| | | .select("t2.nickname",InviteRecord::getMemberNickname) |
| | | .select("t2.open_id",InviteRecord::getOpenid) |
| | | .select("t2.phone",InviteRecord::getMemberPhone) |
| | | .leftJoin(Member.class,Member::getId,InviteRecord::getInviteId) |
| | | .leftJoin(Member.class,Member::getId,InviteRecord::getMemberId) ; |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | queryWrapper.eq(pageWrap.getModel().getId() != null,InviteRecord::getId, pageWrap.getModel().getId()); |
| | | queryWrapper.eq(pageWrap.getModel().getCreator() != null,InviteRecord::getCreator, pageWrap.getModel().getCreator()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.ge(InviteRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.le(InviteRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | queryWrapper.eq(pageWrap.getModel().getEditor() != null,InviteRecord::getEditor, pageWrap.getModel().getEditor()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.ge(InviteRecord::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.le(InviteRecord::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | queryWrapper.and(StringUtils.isNotBlank(pageWrap.getModel().getRecName()),w->{ |
| | | w.like("t1.name",pageWrap.getModel().getRecName()).or() |
| | | .like("t1.phone",pageWrap.getModel().getRecName()).or() |
| | | .like("t1.nickname",pageWrap.getModel().getRecName()); |
| | | }); |
| | | queryWrapper.and(StringUtils.isNotBlank(pageWrap.getModel().getMemberName()),w->{ |
| | | w.like("t2.name",pageWrap.getModel().getMemberName()).or() |
| | | .like("t2.phone",pageWrap.getModel().getMemberName()).or() |
| | | .like("t2.nickname",pageWrap.getModel().getMemberName()); |
| | | }); |
| | | queryWrapper.eq(pageWrap.getModel().getIsdeleted() != null,InviteRecord::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | queryWrapper.eq(pageWrap.getModel().getRemark() != null,InviteRecord::getRemark, pageWrap.getModel().getRemark()); |
| | | queryWrapper.eq(pageWrap.getModel().getInviteId() != null,InviteRecord::getInviteId, pageWrap.getModel().getInviteId()); |
| | | queryWrapper.eq(pageWrap.getModel().getMemberId() != null,InviteRecord::getMemberId, pageWrap.getModel().getMemberId()); |
| | | queryWrapper.eq(pageWrap.getModel().getPhone() != null,InviteRecord::getPhone, pageWrap.getModel().getPhone()); |
| | | queryWrapper.eq(pageWrap.getModel().getFirstOrderStatus() != null,InviteRecord::getFirstOrderStatus, pageWrap.getModel().getFirstOrderStatus()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.ge(InviteRecord::getFirstFinishDate, Utils.Date.getStart(pageWrap.getModel().getFirstFinishDate())); |
| | | queryWrapper.le(InviteRecord::getFirstFinishDate, Utils.Date.getEnd(pageWrap.getModel().getFirstFinishDate())); |
| | | } |
| | | queryWrapper.eq(pageWrap.getModel().getRewardIntegral() != null,InviteRecord::getRewardIntegral, pageWrap.getModel().getRewardIntegral()); |
| | | |
| | | queryWrapper.orderByDesc(InviteRecord::getCreateDate); |
| | | IPage<InviteRecord> result =inviteRecordMapper.selectPage(page, queryWrapper); |
| | | if(result!=null && result.getRecords()!=null){ |
| | | for(InviteRecord model : result.getRecords()){ |
| | | model.setMemberName(StringUtils.defaultString(model.getMemberNickname(),"")+" / " |
| | | +StringUtils.defaultString(model.getMemberName(),"-")+" / " |
| | | +StringUtils.defaultString(model.getMemberPhone(),"-")); |
| | | model.setRecName(StringUtils.defaultString(model.getRecNickname(),"")+" / " |
| | | +StringUtils.defaultString(model.getRecName(),"-")+" / " |
| | | +StringUtils.defaultString(model.getRecPhone(),"-")); |
| | | } |
| | | } |
| | | return PageData.from(result); |
| | | } |
| | | |
| | | @Override |
| | | public long count(InviteRecord inviteRecord) { |
| | | QueryWrapper<InviteRecord> wrapper = new QueryWrapper<>(inviteRecord); |
| | | return inviteRecordMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | shop.setEditDate(new Date()); |
| | | shop.setIsdeleted(Constants.ONE); |
| | | shopMapper.updateById(shop); |
| | | shopGoodsRelationMapper.delete(new UpdateWrapper<ShopGoodsRelation>().lambda().eq(ShopGoodsRelation::getShopId,id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | queryWrapper.selectAll(Shop.class); |
| | | if(pageWrap.getModel().getGoodsId()!=null){ |
| | | //æ¥è¯¢æååçä¾è´§ä»· |
| | | queryWrapper.select("(select s.price from shop_goods_relation s where s.ISDELETED=0 and s.shop_id = t.id and s.GOODS_ID="+pageWrap.getModel().getGoodsId()+") as goodsPrice "); |
| | | queryWrapper.select("(select s.price from shop_goods_relation s where s.ISDELETED=0 and s.shop_id = t.id and s.GOODS_ID="+pageWrap.getModel().getGoodsId()+" limit 1) as goodsPrice "); |
| | | } |
| | | queryWrapper.select("(select count(s.id) from shop_goods_relation s left join goods g on s.goods_id =g.id where g.status=0 and s.ISDELETED=0 and s.shop_id=t.id) as pricedGoodsNum "); |
| | | queryWrapper.selectAs(Labels::getName,Shop::getBigAreaName); |
| | | queryWrapper.selectAs(Member::getNickname,Shop::getNickName); |
| | | queryWrapper.selectAs(Member::getImgurl,Shop::getMemberImgurl); |
| | |
| | | IPage<Shop> result = shopJoinMapper.selectJoinPage(page, Shop.class, queryWrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | long goodsNum = goodsMapper.selectCount(new QueryWrapper<Goods>().lambda() |
| | | .eq(Goods::getIsdeleted,Constants.ZERO) |
| | | .eq(Goods::getStatus,Constants.ZERO)); |
| | | for(Shop model:result.getRecords()){ |
| | | model.setImgFullUrl(path); |
| | | model.setAreas( AreasServiceImpl.getAddressByAreaId(model.getAreaId())); |
| | | model.setGoodsNum(goodsNum); |
| | | if(model.getLatitude()!=null && model.getLongitude()!=null){ |
| | | model.setLocationInfo(model.getLatitude().doubleValue()+","+model.getLongitude().doubleValue()); |
| | | } |
| | |
| | | } |
| | | return saleReportResponse; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |