| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | export function businessData (data) { |
| | | return request.post('/business/workbench/businessData', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function shopRankList10 (data) { |
| | | return request.post('/business/workbench/shopRankList10', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function goodsRankList10 (data) { |
| | | return request.post('/business/workbench/goodsRankList10', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <TableLayout> |
| | | <div slot="search-form" class="data"> |
| | | <div class="item-title">æ°æ®çæ¿</div> |
| | | <div class="top-tab"> |
| | | <div class="tab-title">ç»è¥æ°æ®åæ</div> |
| | | <div class="tab-item"> |
| | | <span v-for="(item,index) in tabs" :key="'tab'+index" :class="item.index==tabIndex?'active-tab tab-btn':'tab-btn'" @click="changeTab(item)">{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | <div class="item-title"> </div> |
| | | <div class="data-summary"> |
| | | <div class="data-item"> |
| | | <div>ä¼åæ°é</div> |
| | | <div class="data-num">{{ countData.users }}</div> |
| | | <div class="data-item blue"> |
| | | <div>{{tabName}}éå®é¢</div> |
| | | <div class="data-num">ï¿¥{{ (topData.price ||0).toFixed(2) }}</div> |
| | | </div> |
| | | <div class="parting"></div> |
| | | <div class="data-item"> |
| | | <div>仿¥æ´»è·ç¨æ·</div> |
| | | <div class="data-num">{{ countData.activeUsers }}</div> |
| | | <div class="data-item yellow"> |
| | | <div>{{tabName}}æäº¤è®¢åé</div> |
| | | <div class="data-num">{{ topData.num||0}}</div> |
| | | </div> |
| | | <div class="parting"></div> |
| | | <div class="data-item"> |
| | | <div>è®¢åæ»æ°</div> |
| | | <div class="data-num">{{ countData.orders }}</div> |
| | | <div class="data-item green"> |
| | | <div>{{tabName}}鿬¾éé¢</div> |
| | | <div class="data-num">ï¿¥{{( topData.price1 ||0).toFixed(2) }}</div> |
| | | </div> |
| | | <div class="parting"></div> |
| | | <div class="data-item"> |
| | | <div>è®¢åæ»éé¢</div> |
| | | <div class="data-num">{{ countData.money }}</div> |
| | | <div class="data-item orange"> |
| | | <div>{{tabName}}鿬¾è®¢åé</div> |
| | | <div class="data-num">{{ topData.num1 ||0 }}</div> |
| | | </div> |
| | | <div class="parting"></div> |
| | | <div class="data-item"> |
| | | <div>æ¬æè®¢åæ°</div> |
| | | <div class="data-num">{{ countData.mouthOrders }}</div> |
| | | </div> |
| | | <div class="parting"></div> |
| | | <div class="data-item"> |
| | | <div>æ¬æè®¢åæ»éé¢</div> |
| | | <div class="data-num">{{ countData.mouthMoney }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template v-slot:table-wrap> |
| | | <div class="change-style"> |
| | | <div class="item-title">订åéé¢è¶å¿</div> |
| | | <div style="display: flex;"> |
| | | <el-button type="text" @click="changeCount(7)">7æ¥</el-button> |
| | | <div style="margin: 0 5px;">|</div> |
| | | <el-button type="text" @click="changeCount(30)">30æ¥</el-button> |
| | | <div class="count-left"> |
| | | <div class="item-title">订åéä¸éå®é¢è¶å¿</div> |
| | | <div ref="orderCount" class="bottom" ></div> |
| | | </div> |
| | | <div class="count-right"> |
| | | <div class="item-title">ååç±»éå®é¢å æ¯</div> |
| | | <div ref="cateCount" class="bottom"></div> |
| | | </div> |
| | | </div> |
| | | <div ref="orderChange" class="bottom"> |
| | | |
| | | <div class="change-style"> |
| | | <div class="tab-title" style="display: flex;align-items: center; "> |
| | | <span style="">æååæ</span> |
| | | <div class="tab-item" style="margin-left: 20px;" > |
| | | <el-date-picker style="width: 110px;height: 22px;margin-right: 10px;" v-model="searchForm.topYear" type="year" @change="changeYearMonth" |
| | | clearable value-format="yyyy" format="yyyy'年'" placeholder="年份" ></el-date-picker> |
| | | <el-date-picker style="width: 100px;height: 22px;" v-model="searchForm.topMonth" type="month" @change="changeYearMonth" |
| | | clearable value-format="MM" format="MM'æ'" placeholder="æä»½" ></el-date-picker> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="change-style"> |
| | | <div class="count-left"> |
| | | <div class="item-title" style="display: flex;"> |
| | | <span style="flex: 1">ç»éåIOP10</span> |
| | | <div class="tab-item" style="text-align: right;flex: 1.5; "> |
| | | <span v-for="(item,index) in tabs1" :key="'tab'+index" :class="item.index==tabIndex1?'active-tab tab-btn':'tab-btn'" @click="changeTab1(item)">{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | <div class="bottom1"> |
| | | <el-table :data="dataList1||[]" stripe border inline > |
| | | <el-table-column prop="sortnum" label="æå" align="center"> |
| | | <template slot-scope="scope">{{scope.$index +1}}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="ç»éååç§°" align="center" > </el-table-column> |
| | | <el-table-column prop="num" label="订åé" align="center" > </el-table-column> |
| | | <el-table-column prop="price" label="éå®é¢ï¼å
ï¼" align="center" ></el-table-column> |
| | | <el-table-column prop="num1" label="ä¼åæ°" align="center" ></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | <div class="count-right"> |
| | | <div class="item-title"> |
| | | <div class="item-title" style="display: flex;"> |
| | | <span style="flex: 1">åä¸ååTOP10</span> |
| | | <div class="tab-item" style="text-align: right;flex: 1.5; "> |
| | | <span v-for="(item,index) in tabs2" :key="'tab'+index" :class="item.index==tabIndex2?'active-tab tab-btn':'tab-btn'" @click="changeTab2(item)">{{item.name}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="bottom1"> |
| | | <el-table :data="dataList2||[]" stripe border > |
| | | <el-table-column prop="sortnum" label="æå" align="center"> |
| | | <template slot-scope="scope">{{scope.$index +1}}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="åååç§°" align="center" > </el-table-column> |
| | | <el-table-column prop="num" label="éé" align="center" > </el-table-column> |
| | | <el-table-column prop="price" label="éå®é¢ï¼å
ï¼" align="center" ></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="change-style"> |
| | | <div class="tab-title" style="display: flex;align-items: center; "> |
| | | <span style="">è¥éæ°æ®åæ</span> |
| | | <div class="tab-item" style="margin-left: 20px;" > |
| | | <el-date-picker style="width: 110px;height: 22px;margin-right: 10px;" v-model="searchForm.topYear2" type="year" |
| | | clearable value-format="yyyy" format="yyyy'年'" placeholder="年份" ></el-date-picker> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="change-style"> |
| | | <div class="count-left"> |
| | | <div class="item-title">积ååæ¾ç±»åå æ¯</div> |
| | | <div class="bottom2" style="display: flex"> |
| | | <div ref="integralCount" style="flex: 1"></div> |
| | | <div style="flex: 1;font-size: 14px;font-weight: 500;"> |
| | | <div>累计æ¶èï¼{{10000}}</div> |
| | | <div>ç´¯è®¡ä¼æ éé¢ï¼ï¿¥{{10000 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="count-right"> |
| | | <div class="item-title">伿 å¸åæ¾ç±»åå æ¯</div> |
| | | <div class="bottom2"> |
| | | <div class="bottom2" style="display: flex"> |
| | | <div ref="couponCount" style="flex: 1"></div> |
| | | <div style="flex: 1;font-size: 14px;font-weight: 500;"> |
| | | <div>已使ç¨ä¼æ å¸ï¼{{10000}}</div> |
| | | <div>ç´¯è®¡ä¼æ éé¢ï¼ï¿¥{{10000 }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="change-style" v-if="1==2"> |
| | | <div class="item-title">è¥éæå
¥è´¹ç¨ä¸éå®é¢åæ</div> |
| | | <div ref="feeCount" class="bottom"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import * as echarts from 'echarts'; |
| | | import { findAllList, createCoffeeTask } from '@/api/business/taskRule' |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import * as echarts from 'echarts' |
| | | export default { |
| | | extends: BaseTable, |
| | | components: { |
| | | TableLayout |
| | | }, |
| | | data() { |
| | | data () { |
| | | return { |
| | | countData: { |
| | | users: 1000, |
| | | activeUsers: 1000, |
| | | mouthOrders: 10, |
| | | mouthMoney: 100000, |
| | | orders: 10, |
| | | money: 100000 |
| | | loading1: false, |
| | | loading2: false, |
| | | loading3: false, |
| | | tabs2: [{ index: 0, name: 'æéé' }, { index: 1, name: 'æéå®é¢' }], |
| | | tabs1: [{ index: 0, name: 'æè®¢åé' }, { index: 1, name: 'æéå®é¢' }, { index: 2, name: 'æä¼åæ°' }], |
| | | tabs: [{ index: 0, name: '仿¥' }, { index: 1, name: 'è¿7æ¥' }, { index: 2, name: 'è¿30æ¥' }, { index: 3, name: 'è¿12æ' }], |
| | | tabName: '仿¥', |
| | | tabIndex: 0, |
| | | tabIndex1: 0, |
| | | tabIndex2: 0, |
| | | searchForm: { |
| | | topYear: null, |
| | | topMonth: null, |
| | | topYear2: null |
| | | }, |
| | | orderCorderCount: [10,10,20,10,40,10,30], |
| | | opinionData: ['3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26'], |
| | | myChart: null |
| | | topData: { |
| | | num: 0, |
| | | num1: 0, |
| | | price: 0, |
| | | price1: 0, |
| | | dateStrList: [], |
| | | dataList: [], |
| | | dataList2: [], |
| | | cateList: [], |
| | | numList: [] |
| | | }, |
| | | countData: { |
| | | totalPrice: 1000, |
| | | totalNum: 1000, |
| | | totalRefundPrice: 10000, |
| | | totalRefundNum: 100 |
| | | }, |
| | | dataList1: [], |
| | | dataList2: [], |
| | | myChart0: null, |
| | | myChart1: null |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.myChart = echarts.init(this.$refs.orderChange) |
| | | window.addEventListener('resize', () => { |
| | | this.myChart.resize() |
| | | created () { |
| | | this.config({ |
| | | module: 'å·¥ä½å°æ°æ®ç»è®¡', |
| | | api: '/business/workbench', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.renderOrderChange() |
| | | findAllList({}) |
| | | |
| | | }, |
| | | mounted () { |
| | | this.initTopData() |
| | | this.initShopRankData() |
| | | this.initGoodsRankData() |
| | | }, |
| | | methods: { |
| | | renderOrderChange() { |
| | | this.myChart.setOption({ |
| | | changeYearMonth(){ |
| | | this.initGoodsRankData() |
| | | this.initShopRankData() |
| | | }, |
| | | initShopRankData () { |
| | | this.loading2 = true |
| | | this.api.shopRankList10({ year: this.searchForm.topYear, month: this.searchForm.topMonth ,type:this.tabIndex1}).then(res => { |
| | | res = res || [] |
| | | this.dataList1 = res |
| | | }).finally(() => { |
| | | this.loading2 = false |
| | | }) |
| | | }, |
| | | initGoodsRankData () { |
| | | this.loading3 = true |
| | | this.api.goodsRankList10({ year: this.searchForm.topYear, month: this.searchForm.topMonth ,type:this.tabIndex2}).then(res => { |
| | | res = res || [] |
| | | this.dataList2 = res |
| | | }).finally(() => { |
| | | this.loading3 = false |
| | | }) |
| | | }, |
| | | initTopData () { |
| | | this.loading1 = true |
| | | this.initTopEcharts() |
| | | this.api.businessData({ dateType: this.tabIndex }).then(res => { |
| | | res = res || {} |
| | | res.num = res.num || 0 |
| | | res.num1 = res.num1 || 0 |
| | | res.price = res.price || 0 |
| | | res.price1 = res.price1 || 0 |
| | | res.dateStrList = res.dateStrList || [] |
| | | res.datalist2 = res.datalist2 || [] |
| | | res.dataList = res.dataList || [] |
| | | res.cateList = res.cateList || [] |
| | | this.topData = res |
| | | this.renderEchartOption0() |
| | | this.renderEchartOption2() |
| | | }).finally(() => { |
| | | this.loading1 = false |
| | | }) |
| | | }, |
| | | initTopEcharts () { |
| | | this.myChart0 = echarts.init(this.$refs.orderCount) |
| | | window.addEventListener('resize', () => { |
| | | this.myChart0.resize() |
| | | }) |
| | | this.myChart1 = echarts.init(this.$refs.cateCount) |
| | | window.addEventListener('resize', () => { |
| | | this.myChart1.resize() |
| | | }) |
| | | this.renderEchartOption0() |
| | | this.renderEchartOption2() |
| | | }, |
| | | changeTab (item) { |
| | | if (this.loading1) { |
| | | return |
| | | } |
| | | if (item.index !== this.tabIndex) { |
| | | this.tabName = item.name |
| | | this.tabIndex = item.index |
| | | this.initTopData() |
| | | } |
| | | }, |
| | | changeTab1 (item) { |
| | | if (this.loading2) { |
| | | return |
| | | } |
| | | if (item.index !== this.tabIndex1) { |
| | | this.tabName = item.name |
| | | this.tabIndex1 = item.index |
| | | this.initShopRankData() |
| | | } |
| | | }, |
| | | changeTab2 (item) { |
| | | if (this.loading3) { |
| | | return |
| | | } |
| | | if (item.index !== this.tabIndex2) { |
| | | this.tabName = item.name |
| | | this.tabIndex2 = item.index |
| | | this.initGoodsRankData() |
| | | } |
| | | }, |
| | | renderEchartOption0 () { |
| | | this.myChart0.setOption({ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['订åé', 'éå®é¢(å
)'] |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: this.opinionData |
| | | data: this.topData.dateStrList || [] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [{ |
| | | name: '订å', |
| | | type: 'line', |
| | | stack: 'æ»é', |
| | | data: this.orderCorderCount |
| | | }] |
| | | yAxis: [ |
| | | { |
| | | type: 'value', |
| | | name: '订åé', |
| | | min: 0 |
| | | }, |
| | | { |
| | | type: 'value', |
| | | name: 'éå®é¢(å
)', |
| | | min: 0 |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: '订åé', |
| | | data: this.topData.dataList || [], |
| | | type: 'bar' |
| | | }, |
| | | { |
| | | name: 'éå®é¢(å
)', |
| | | yAxisIndex: 1, |
| | | data: this.topData.dataList2 || [], |
| | | type: 'line' |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | }, |
| | | changeCount(page) { |
| | | if (page == 7) { |
| | | this.orderCorderCount = [10,10,20,10,40,10,30] |
| | | this.opinionData = ['3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26'] |
| | | } else { |
| | | this.orderCorderCount = [11,10,20,10,40,10,30,20,10,20,10,40,10,30,10,10,20,10,40,10,30,10,10,20,10,40,10,30,20,40] |
| | | this.opinionData = ['3.01','3.02','3.03','3.04','3.05','3.06','3.07','3.08','3.09','3.10','3.11','3.12','3.13','3.14','3.15','3.16','3.17','3.18','3.19','3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26', '3.27','3.28','3.28','3.30',] |
| | | } |
| | | // this.orderCorderCount.push(1) |
| | | // this.opinionData.push(1) |
| | | this.renderOrderChange() |
| | | |
| | | renderEchartOption2 () { |
| | | const series = [] |
| | | this.topData.cateList.forEach((item, index) => { |
| | | series.push( { |
| | | name: item.name, |
| | | type: 'bar', |
| | | stack: 'total', |
| | | barWidth: '60%', |
| | | label: { |
| | | // show: true |
| | | }, |
| | | data: item.data||[] |
| | | }) |
| | | }) |
| | | this.myChart1.setOption({ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | } |
| | | }, |
| | | legend: { |
| | | data: this.topData.cateList || [] |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: this.topData.dateStrList || [] |
| | | }, |
| | | yAxis: { type: 'value' } , |
| | | series |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep .el-input--small .el-input__inner{ |
| | | height: 22px; |
| | | line-height: 22px; |
| | | border-radius: 0; |
| | | } |
| | | ::v-deep .el-input--small .el-input__icon{ |
| | | height: 22px; |
| | | line-height: 22px; |
| | | } |
| | | .top-tab{ |
| | | margin-bottom: 30px; |
| | | display: block; |
| | | } |
| | | .tab-title{ |
| | | font-weight: 600; |
| | | font-size: 16px; |
| | | color: #222222; |
| | | line-height: 22px; |
| | | display: inline; |
| | | } |
| | | .tab-item{ |
| | | display: inline; |
| | | margin-left: 50px; |
| | | .active-tab{ |
| | | border: 1px solid #216EEE !important; |
| | | color: #216EEE !important; |
| | | } |
| | | .tab-btn{ |
| | | font-weight: normal; |
| | | cursor: pointer; |
| | | border-radius: 0px; |
| | | margin: 0px 5px; |
| | | font-size: 12px; |
| | | border: 1px solid #999; |
| | | color: #999; |
| | | padding: 1px 5px; |
| | | background-color: #f2f2f2; |
| | | } |
| | | } |
| | | .data { |
| | | padding-bottom: 10px; |
| | | } |
| | | .item-title { |
| | | font-weight: 500; |
| | | |
| | | font-weight: 600; |
| | | font-size: 14px; |
| | | color: #222222; |
| | | margin-left: 20px; |
| | | line-height: 22px; |
| | | } |
| | | .data-summary { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 10px; |
| | | margin-bottom: 20px; |
| | | .green{ |
| | | border-left: 8px solid #12bb8b; |
| | | } |
| | | .yellow{ |
| | | border-left: 8px solid #f6cf46; |
| | | } |
| | | .blue{ |
| | | border-left: 8px solid #216EEE; |
| | | } |
| | | .orange{ |
| | | border-left: 8px solid #ff9e56; |
| | | } |
| | | .data-item { |
| | | flex: 1; |
| | | height: 80px; |
| | |
| | | box-sizing: border-box; |
| | | padding: 15px; |
| | | display: flex; |
| | | font-size: 14px; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | background-color: #f4f7fc; |
| | | color: #666; |
| | | .data-num { |
| | | font-size: 20px; |
| | | font-weight: 700; |
| | | color:aqua |
| | | font-weight: 800; |
| | | color: #333; |
| | | } |
| | | } |
| | | .parting { |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | line-height: 31px; |
| | | } |
| | | .bottom { |
| | | height: 500px; |
| | | } |
| | | </style> |
| | | margin-bottom: 50px; |
| | | .count-left{ |
| | | display: inline-block; |
| | | margin-right: 10px; |
| | | flex: 1; |
| | | .bottom { |
| | | height: 500px; |
| | | width: 100%; |
| | | } |
| | | .bottom2 { |
| | | height: 300px; |
| | | width: 100%; |
| | | } |
| | | .bottom1 { |
| | | height: auto; |
| | | width: 100%; |
| | | } |
| | | } |
| | | .count-right{ |
| | | display: inline-block; |
| | | margin-left: 10px; |
| | | flex: 1; |
| | | .bottom { |
| | | height: 500px; |
| | | width: 100%; |
| | | } |
| | | .bottom2 { |
| | | height: 300px; |
| | | width: 100%; |
| | | } |
| | | .bottom1 { |
| | | height: auto; |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | </style> |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.WithdrawRecord; |
| | | import com.doumee.service.business.IntegralService; |
| | | import com.doumee.service.business.WithdrawRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private WithdrawRecordService withdrawRecordService; |
| | | |
| | | @Autowired |
| | | private IntegralService integralService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:withdrawrecord:update") |
| | | public ApiResponse updateById(@RequestBody WithdrawRecord withdrawRecord) { |
| | | withdrawRecordService.updateById(withdrawRecord); |
| | | withdrawRecordService.updateById(withdrawRecord,integralService); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.dao.business.model.Fund; |
| | | import com.doumee.dao.system.dto.CountDataDTO; |
| | | import com.doumee.dao.system.vo.BusinessDataCountVO; |
| | | import com.doumee.dao.system.vo.CountDataVO; |
| | | import com.doumee.service.business.FundService; |
| | | import com.doumee.service.business.WorkbenchService; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | @Api(tags = "å·¥ä½å°æ°æ®ç»è®¡æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/business/workbench") |
| | | public class WorkbenchController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WorkbenchService workbenchService; |
| | | |
| | | @ApiOperation("ç»è¥æ°æ®åæ") |
| | | @PostMapping("/businessData") |
| | | public ApiResponse<BusinessDataCountVO> businessData(@RequestBody CountDataDTO param) { |
| | | return ApiResponse.success(workbenchService.businessData(param)); |
| | | } |
| | | @ApiOperation("ç»éåTOP10") |
| | | @PostMapping("/shopRankList10") |
| | | public ApiResponse<List<BusinessDataCountVO>> shopRankList10(@RequestBody CountDataDTO param) { |
| | | return ApiResponse.success(workbenchService.shopRankList10(param)); |
| | | } |
| | | @ApiOperation("åä¸ååTOP10") |
| | | @PostMapping("/goodsRankList10") |
| | | public ApiResponse<List<BusinessDataCountVO>> goodsRankList10(@RequestBody CountDataDTO param) { |
| | | return ApiResponse.success(workbenchService.goodsRankList10(param)); |
| | | } |
| | | |
| | | } |
| | |
| | | DONE(3, "交æå®æ", "交æå®æ"), |
| | | CLOSE(4, "å·²å
³é", "å·²å
³é"), |
| | | PART_DONE(5, "é¨ååè´§", "é¨ååè´§"), |
| | | |
| | | |
| | | REFUND(6, "订å鿬¾", "订å鿬¾"), |
| | | ; |
| | | // æååé |
| | | private String name; |
| | |
| | | */ |
| | | public enum IntegralObjType { |
| | | REGISTER(0, "注å积åå¥å±", "注åæåï¼è·å¾${param}积å",0,0), |
| | | INVITENEWUSER(3, "é请好åå¾ç§¯å", "æ¨è好å${param}æåï¼è·å¾${param1}积å",0,0), |
| | | INVITENEWUSER(3, "é请好åå¾ç§¯å", "æ¨è好å${param1}æåï¼è·å¾${param}积å",0,0), |
| | | SYSTEM_RECHARGE(12,"积ååæ¾","å¹³å°å¥å±ï¼è·å¾${param}积å",0,0), |
| | | SYSTEM_DEDUCT(13,"ç§¯åæ£é¤","平尿£åï¼æ¶è${param}积å",0,0), |
| | | MEMBER_ORDER_CANCEL(14,"åæ¶è®¢åéå","交æé款éåï¼è·å¾${param}积å",0,0), |
| | | MEMBER_ORDER_REFUND(28,"订å鿬¾","订å鿬¾ï¼è¿è¿è®¢åæ¶è${param}积å",0,0), |
| | | MEMBER_ORDER(9,"ä¸åæµæ£","æ¶è´¹æµæ£ï¼æ¶è${param}积å",1,0), |
| | | ORDER_DONATE(15,"æ¶è´¹è¿ç§¯å","è´ç©æåï¼è·å¾${param}积å",0,0), |
| | | SHOP_YEAR_SETTLEMENT(18,"积åè¿æ","积åè¿æï¼æ¶è${param}积å",0,0), |
| | | MEMBER_ORDER_REFUND_RETURN(27,"订å鿬¾","订å鿬¾ï¼æ£é¤è®¢åè¿è¿${param}积å",0,0), |
| | | |
| | | |
| | | ORDER_DONE_AMOUNT(16,"订åç»ç®","${param}订åç»ç®æåï¼è·å¾ï¿¥${param1}å
",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | WITHDRAW_APPLY(17,"ä½é¢æç°","ä½é¢æç°å·²æäº¤ï¼æ¶èï¿¥${param}å
",0,1), |
| | | WITHDRAW_APPLY_BACK(19,"æç°éå","ä½é¢æç°å¤±è´¥ï¼è·å¾ï¿¥${param}å
",0,1), |
| | | ORDER_DONE_AMOUNT_BACK(20,"订åç»ç®éå","${param}订åç»ç®éåï¼æ¶èï¿¥${param1}å
",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | ORDER_DONE_AMOUNT(16,"订åç»ç®","${param1}订åç»ç®æåï¼è·å¾ï¿¥${param}",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | WITHDRAW_APPLY(17,"ä½é¢æç°","ä½é¢æç°å·²æäº¤ï¼æ¶èï¿¥${param}",0,1), |
| | | WITHDRAW_APPLY_BACK(19,"æç°éå","ä½é¢æç°å¤±è´¥ï¼è·å¾ï¿¥${param}",0,1), |
| | | // ORDER_DONE_AMOUNT_BACK(20,"订åç»ç®éå","${param1}订åç»ç®éåï¼æ¶èï¿¥${param}å
",0,1),//${param}订åç¼å·ï¼${param1}éé¢ |
| | | SHOP_ORDER_REFUND_CASH(25,"订å鿬¾","${param1}订å鿬¾ï¼æ£é¤ç»ç®éé¢ï¿¥${param}",0,0), |
| | | |
| | | |
| | | SHOP_ORDER(21,"æ¶è´¹è¿ç§¯å","ä¼å${param}交ææåï¼è·å¾${param1}积å",0,0),//${param}æµç§°-ææºå· |
| | | SHOP_ORDER_CANCEL(22,"订ååæ¶éå","订ååæ¶éåï¼éå${param}积å",0,0), |
| | | SHOP_ORDER(21,"æ¶è´¹è¿ç§¯å","ä¼å${param1}交ææåï¼è·å¾${param}积å",0,0),//${param}æµç§°-ææºå· |
| | | // SHOP_ORDER_CANCEL(22,"订ååæ¶éå","订ååæ¶éåï¼éå${param}积å",0,0), |
| | | SHOP_ORDER_REFUND_INTEGRAL(26,"订å鿬¾","订å鿬¾ï¼æ£é¤è®¢åè¿è¿${param}积å",0,0), |
| | | SHOP_SYSTEM_RECHARGE(23,"积ååæ¾","å¹³å°å¥å±ï¼è·å¾${param}积å",0,0), |
| | | SHOP_SYSTEM_DEDUCT(24,"ç§¯åæ£é¤","平尿£åï¼æ¶è${param}积å",0,0), |
| | | |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.Calendar; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.Enumeration; |
| | | import java.util.GregorianCalendar; |
| | | import java.util.Hashtable; |
| | | import java.util.Locale; |
| | | |
| | | import org.apache.commons.lang3.RandomStringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | |
| | | } |
| | | return length; |
| | | } |
| | | public static String minusMonthToDate(LocalDate date, int num) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); |
| | | String month = date.minusMonths(num).format(formatter); |
| | | |
| | | return month; |
| | | } |
| | | /** |
| | | * å¾å°ä¸¤ä¸ªæ¥æä¹é´ç¸å·®çå¤©æ° |
| | | * |
| | |
| | | calo.add(Calendar.DATE, intBetween); |
| | | return calo.getTime(); |
| | | } |
| | | public static List<Date> getDatePeriodByYearAndMonth(int year , int month) { |
| | | List<Date> list = new ArrayList<>(); |
| | | list.add(null); |
| | | list.add(null); |
| | | try { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH, month); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | list.set(0,calendar.getTime()); |
| | | calendar.add(Calendar.MONTH, 1); // å ä¸ä¸ªæ |
| | | calendar.add(Calendar.DAY_OF_MONTH, -1); // ç¶ååä¸å¤©å¾å°è¿ä¸ªææåä¸å¤© |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | list.set(1,calendar.getTime()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | public static List<Date> getDatePeriodByYear(int year) { |
| | | List<Date> list = new ArrayList<>(); |
| | | list.add(null); |
| | | list.add(null); |
| | | try { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.YEAR, year); |
| | | calendar.set(Calendar.MONTH,0); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | list.set(0,calendar.getTime()); |
| | | calendar.add(Calendar.YEAR, 1); // å ä¸ä¸ªæ |
| | | calendar.add(Calendar.DAY_OF_MONTH, -1); // ç¶ååä¸å¤©å¾å°è¿ä¸ªææåä¸å¤© |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | list.set(1,calendar.getTime()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | /** |
| | | * å¾å°å°dateå¢å æå®å¹´æ°åçdate |
| | | * |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | System.out.println(RandomStringUtils.randomNumeric(3)); |
| | | System.out.println(getPlusTime2(getDatePeriodByYearAndMonth(2026,11).get(0))); |
| | | System.out.println(getPlusTime2(getDatePeriodByYearAndMonth(2026,11).get(1))); |
| | | System.out.println(getPlusTime2(getDatePeriodByYear(2026).get(0))); |
| | | System.out.println(getPlusTime2(getDatePeriodByYear(2026).get(1))); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | |
| | | }catch (WxErrorException wxErrorException){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | import com.doumee.dao.web.request.goods.GoodsRequest; |
| | | import com.doumee.dao.web.response.goods.GoodsInfoResponse; |
| | | import com.doumee.dao.web.response.goods.MemberOrderResponse; |
| | | import com.github.yulichang.base.mapper.MPJJoinMapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | public interface GoodsorderMapper extends BaseMapper<Goodsorder> { |
| | | public interface GoodsorderMapper extends MPJJoinMapper<Goodsorder> { |
| | | |
| | | |
| | | @Select(" select g.CODE AS code , g.id as orderId , g.CREATE_DATE as createDate , g.TYPE as orderType , g.STATUS as orderStatus , g.IS_COMMENT as isComment , g.PAY_STATUS as payStatus ," + |
| | |
| | | @ApiModelProperty(value = "鿬¾éé¢", example = "1") |
| | | @ExcelColumn(name="鿬¾éé¢") |
| | | private BigDecimal money; |
| | | |
| | | @ApiModelProperty(value = "æ£é¤å·²è¿ç»éå积åå¼", example = "1") |
| | | @ExcelColumn(name="æ£é¤å·²è¿ç»éå积åå¼") |
| | | private BigDecimal returnShopIntegral; |
| | | |
| | | @ApiModelProperty(value = "æ£é¤ç»éåç»ç®éé¢", example = "1") |
| | | @ExcelColumn(name="æ£é¤ç»éåç»ç®éé¢") |
| | | private BigDecimal returnShopSettlement; |
| | | |
| | | @ApiModelProperty(value = "æ£é¤å·²è¿ç¨æ·ç§¯åå¼", example = "1") |
| | | @ExcelColumn(name="æ£é¤å·²è¿ç¨æ·ç§¯åå¼") |
| | | private BigDecimal returnIntegral; |
| | | |
| | | @ApiModelProperty(value = "鿬¾é
置信æ¯", example = "1") |
| | | @ExcelColumn(name="鿬¾é
置信æ¯") |
| | | private String returnConfig; |
| | | |
| | | @ApiModelProperty(value = "å®é
鿬¾éé¢", example = "1") |
| | | @ExcelColumn(name="å®é
鿬¾éé¢") |
| | | private BigDecimal actMoney; |
| | |
| | | @ApiModelProperty(value = "订åç¼ç ï¼å
³ègoodsorder表ï¼", example = "1") |
| | | @ExcelColumn(name="订åç¼ç ï¼å
³ègoodsorder表ï¼") |
| | | private Integer orderId; |
| | | @ApiModelProperty(value = "ååç¼ç ï¼gooods表ï¼", example = "1") |
| | | @ExcelColumn(name="ååç¼ç ï¼gooods表ï¼") |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "SKUå表å¾") |
| | | @ExcelColumn(name="SKUå表å¾") |
| | |
| | | @ExcelColumn(name="对象ç¼ç ") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "对象类å 0åè±è®¢å ãååãåå¡è®¡å订å 1æ´»å¨ãæ¢åºãèµè®¯ 2æ´»å¨æ¢åºèµè®¯è¯è®º", example = "1") |
| | | @ExcelColumn(name="对象类å 0åè±è®¢å ãååãåå¡è®¡å订å 1æ´»å¨ãæ¢åºãèµè®¯ 2æ´»å¨æ¢åºèµè®¯è¯è®º") |
| | | @ApiModelProperty(value = "对象类å 0åå订å 1ç§¯åæµæ°´ 2äºå¨è¯ä»· 3伿 å¸ 4ç°éæµæ°´", example = "1") |
| | | @ExcelColumn(name="对象类å 0åå订å 1ç§¯åæµæ°´ 2äºå¨è¯ä»· 3伿 å¸ 4ç°éæµæ°´") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "æ¶æ¯ç±»å 0订åéç¥ 1ç³»ç»æ¶æ¯ 2äºå¨æ¶æ¯ 3伿 叿é 4宿¹å®¢æ 5æ´»å¨æ¨è 6æçå
³æ³¨", example = "1") |
| | | @ExcelColumn(name="æ¶æ¯ç±»å 0订åéç¥ 1ç³»ç»æ¶æ¯ 2äºå¨æ¶æ¯ 3伿 叿é 4宿¹å®¢æ 5æ´»å¨æ¨è 6æçå
³æ³¨") |
| | | @ApiModelProperty(value = "æ¶æ¯ç±»å 0æ¶è´¹è
æ¶æ¯ï¼1=ç»éåæ¶æ¯ï¼", example = "1") |
| | | @ExcelColumn(name="æ¶æ¯ç±»å 0æ¶è´¹è
æ¶æ¯ï¼1=ç»éåæ¶æ¯ï¼") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0æªè¯» 1已读", example = "1") |
| | |
| | | @TableField(exist = false) |
| | | private Integer shopId; |
| | | |
| | | @ApiModelProperty(value = "æ¥è¯¢ç±»åï¼0=ç³»ç»æ¶æ¯ï¼1=ç¤¾åºæ¶æ¯ï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer queryType; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.system.dto; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("ç»éåè´¦æ·æç»å¯¹è±¡") |
| | | public class CountDataDTO { |
| | | |
| | | @ApiModelProperty(value = "æå", example = "1") |
| | | private Integer year; |
| | | |
| | | @ApiModelProperty(value = "ç»è®¡æ°é(è®¢åæ°ãééãæ¶è积åé)") |
| | | private Integer month; |
| | | @ApiModelProperty(value = "ç»è®¡æ°é(è®¢åæ°ãééãæ¶è积åé)") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "æ¶é´ç±»å 0ä»å¤© 1è¿ä¸æ¥ 2è¿30天 3ä¸å¹´") |
| | | private int dateType; |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | private Date startTime; |
| | | @ApiModelProperty(value = "æªæ¢æ¶é´") |
| | | private Date endTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.system.vo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("ç»è¥æ°æ®åæç»è®¡è§£é") |
| | | public class BusinessDataCountVO { |
| | | @ApiModelProperty(value = "ç»è®¡æ°é(è®¢åæ°ãééãæ¶è积åé)") |
| | | private Long num; |
| | | @ApiModelProperty(value = "ç»è®¡æ°é2 (ä¼åæ°ï¼") |
| | | private Long num1; |
| | | @ApiModelProperty(value = "éå®é¢ï¼ä¼æ éé¢") |
| | | private BigDecimal price; |
| | | @ApiModelProperty(value = "éå®é¢ï¼ä¿æäº¤æéé¢éé¢") |
| | | private BigDecimal price1; |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦åç§°") |
| | | private String name; |
| | | @ApiModelProperty(value = "ç»è®¡åè¡¨æ°æ®") |
| | | private List<Long> dataList; |
| | | @ApiModelProperty(value = "横轴") |
| | | private List<String> dateStrList; |
| | | @ApiModelProperty(value = "ç»è®¡åè¡¨æ°æ®2") |
| | | private List<BigDecimal> dataList2; |
| | | @ApiModelProperty(value = "ç»è®¡åè¡¨æ°æ®åç±»2") |
| | | private List<CountDataVO> cateList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.system.vo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("ç»éåè´¦æ·æç»å¯¹è±¡") |
| | | public class CountDataVO { |
| | | |
| | | @ApiModelProperty(value = "æå", example = "1") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "ç»è®¡æ°é(è®¢åæ°ãééãæ¶è积åé)") |
| | | private Long num; |
| | | @ApiModelProperty(value = "ç»è®¡æ°é2 (ä¼åæ°ï¼") |
| | | private Long num2; |
| | | @ApiModelProperty(value = "éå®é¢ï¼ä¼æ éé¢") |
| | | private BigDecimal price; |
| | | @ApiModelProperty(value = "éå®é¢ï¼ä¿æäº¤æéé¢éé¢") |
| | | private BigDecimal price1; |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦åç§°") |
| | | private String name; |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦æ¶é´åç§°") |
| | | private String dateStr; |
| | | @ApiModelProperty(value = "éå®é¢éå") |
| | | private BigDecimal[] data; |
| | | } |
| | |
| | | @ApiModelProperty(value = "对象ç¼ç ", example = "1") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "对象类å 0åè±è®¢å ãååãåå¡è®¡å订å 1æ´»å¨ãæ¢åºãèµè®¯ 2æ´»å¨æ¢åºèµè®¯è¯è®º", example = "1") |
| | | @ApiModelProperty(value = "对象类å 0åå订å 1ç§¯åæµæ°´ 2äºå¨è¯ä»· 3伿 å¸ 4ç°éæµæ°´", example = "1") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "æ¶æ¯ç±»å 0订åéç¥ 1ç³»ç»æ¶æ¯ 2äºå¨æ¶æ¯ 3伿 叿é 4宿¹å®¢æ 5æ´»å¨æ¨è 6æçå
³æ³¨", example = "1") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.web.request; |
| | | |
| | | import com.doumee.dao.business.model.MemberCoupon; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/3/23 9:50 |
| | | */ |
| | | @Data |
| | | @ApiModel("åé伿 å¸éç¥è¯·æ±ç±»") |
| | | public class CouponNoticeRequest{ |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¼æ å¸ä¿¡æ¯") |
| | | private MemberCoupon memberCoupon; |
| | | |
| | | @ApiModelProperty(value = "伿 叿°é") |
| | | private Integer num; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ¶æ¯ç±»å 0æ¶å
¥ 1æ¯åº") |
| | | private Integer dealType; |
| | | |
| | | @ApiModelProperty(value = "æ¶æ¯åæ°") |
| | | private String param1; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModel("å¾®ä¿¡ææææºå·è¯·æ±ç±»") |
| | | public class WxPhoneRequest implements Serializable { |
| | | |
| | | @NotEmpty(message = "encryptedData ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "encryptedData") |
| | | private String encryptedData; |
| | | |
| | | @NotEmpty(message = "iv ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "iv") |
| | | private String iv; |
| | | |
| | | @NotEmpty(message = "sessionKey ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "sessionKey") |
| | | private String sessionKey; |
| | | // @NotEmpty(message = "encryptedData ä¸è½ä¸ºç©º") |
| | | // @ApiModelProperty(value = "encryptedData") |
| | | // private String encryptedData; |
| | | // |
| | | // @NotEmpty(message = "iv ä¸è½ä¸ºç©º") |
| | | // @ApiModelProperty(value = "iv") |
| | | // private String iv; |
| | | // |
| | | // @NotEmpty(message = "sessionKey ä¸è½ä¸ºç©º") |
| | | // @ApiModelProperty(value = "sessionKey") |
| | | // private String sessionKey; |
| | | |
| | | @NotEmpty(message = "openid ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "openid") |
| | | private String openid; |
| | | |
| | | @NotEmpty(message = "code ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "code") |
| | | private String code; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é请ç ") |
| | | private String recId; |
| | | |
| | |
| | | @ApiModelProperty(value = "å¾
æ¶è´§æ°é") |
| | | private Long waitReceiveNum; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å卿ªè¯»ï¼0=æ ï¼1=åå¨") |
| | | private Integer unRead; |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.admin.response.AftersaleListResponse; |
| | | import com.doumee.dao.business.model.Aftersale; |
| | | import com.doumee.dao.web.request.AfterSaleApplyRequest; |
| | | import com.doumee.dao.web.request.goods.AftersaleCancelRequest; |
| | | import com.doumee.dao.web.request.goods.AftersaleCreateRequest; |
| | | import com.doumee.dao.web.request.goods.AftersalePostRequest; |
| | |
| | | void memberPost(AftersalePostRequest aftersale); |
| | | |
| | | void autoDone(); |
| | | |
| | | void afterSaleApply(AfterSaleApplyRequest afterSaleApplyRequest, Integer userId); |
| | | } |
| | |
| | | */ |
| | | List<LabelsResponse> getGoodsLabels(Integer parentId); |
| | | |
| | | List<LabelsResponse> getGoodsLabelsByType(Integer type); |
| | | List<LabelsResponse> getGoodsLabelsByType(Integer type,Integer parentId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.dao.web.dto.NoticeCardDTO; |
| | | import com.doumee.dao.web.request.CouponNoticeRequest; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | PageData<NoticeCardDTO> findNoticeCardDTOPage(PageWrap<Notice> pageWrap); |
| | | |
| | | /** |
| | | * 积åå卿¶æ¯ç±»å |
| | | * @param integralObjType 积ååå¨ç±»å |
| | | * @param memberId ç¨æ·ä¸»é®/åæ·ä¸»é® |
| | | * @param integral åå¨ç§¯å/ç°éå¼ |
| | | * @param objId å
³èå¯¹è±¡ä¸»é® - ç§¯åæµæ°´åå¨è®°å½ä¸»é® |
| | | * @param param1 param2 |
| | | */ |
| | | void saveMemberIntegralNotice(Constants.IntegralObjType integralObjType, Integer type, |
| | | Integer memberId, |
| | | BigDecimal integral, |
| | | Integer objId, String param1); |
| | | |
| | | |
| | | /** |
| | | * 伿 叿¶æ¯ |
| | | * @param memberId |
| | | * @param couponList |
| | | */ |
| | | void couponNotice(Integer memberId,List<CouponNoticeRequest> couponList); |
| | | |
| | | |
| | | /** |
| | | * è®¢åæ¯ä»æå åéæ¶æ¯ |
| | | * @param shopId |
| | | * @param objId |
| | | * @param receiveType |
| | | */ |
| | | void orderPayNotice(Integer shopId, Integer objId,Integer receiveType); |
| | | |
| | | /** |
| | | * 订ååæ¶æ¶æ¯ |
| | | * @param shopId |
| | | * @param objId |
| | | * @param orderNo |
| | | */ |
| | | void orderCancelNotice(Integer shopId, Integer objId,String orderNo); |
| | | |
| | | |
| | | /** |
| | | * 积åè¿ææ¶æ¯ |
| | | * @param memberId |
| | | * @param integral |
| | | * @param expireDateNum |
| | | */ |
| | | void expireNotice(Integer memberId, BigDecimal integral,Integer expireDateNum); |
| | | |
| | | /** |
| | | * è¯è®ºç«å
ä¿¡ |
| | | * @param memberId |
| | | * @param objId |
| | | * @param memberName |
| | | */ |
| | | void commonNotice(Integer memberId, Integer objId,String memberName ); |
| | | } |
| | |
| | | * |
| | | * @param withdrawRecord å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(WithdrawRecord withdrawRecord); |
| | | void updateById(WithdrawRecord withdrawRecord, IntegralService integralService); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Fund; |
| | | import com.doumee.dao.system.dto.CountDataDTO; |
| | | import com.doumee.dao.system.vo.BusinessDataCountVO; |
| | | import com.doumee.dao.system.vo.CountDataVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èµéæç»ä¿¡æ¯è¡¨Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | public interface WorkbenchService { |
| | | |
| | | BusinessDataCountVO businessData(CountDataDTO param); |
| | | |
| | | List<BusinessDataCountVO> shopRankList10(CountDataDTO param); |
| | | List<BusinessDataCountVO> goodsRankList10(CountDataDTO param); |
| | | } |
| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.wx.WxMiniUtilService; |
| | | import com.doumee.dao.admin.response.AftersaleListResponse; |
| | | import com.doumee.dao.business.AftersaleMapper; |
| | | import com.doumee.dao.business.FundMapper; |
| | | import com.doumee.dao.business.GoodsorderDetailMapper; |
| | | import com.doumee.dao.business.GoodsorderMapper; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.join.AftersaleJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.MultiFileDTO; |
| | | import com.doumee.dao.web.request.AfterSaleApplyRequest; |
| | | import com.doumee.dao.web.request.DealIntegralRequest; |
| | | import com.doumee.dao.web.request.goods.AftersaleCancelRequest; |
| | | import com.doumee.dao.web.request.goods.AftersaleCreateRequest; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ååå®åä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | @Autowired |
| | | private GoodsorderMapper goodsorderMapper; |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private GoodsorderDetailMapper goodsorderDetailMapper; |
| | | @Autowired |
| | | private AftersaleJoinMapper aftersaleJoinMapper; |
| | |
| | | @Autowired |
| | | @Lazy |
| | | private IntegralService integralService; |
| | | |
| | | @Autowired |
| | | private MemberCouponJoinMapper memberCouponJoinMapper; |
| | | |
| | | @Autowired |
| | | private FundMapper fundMapper; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void afterSaleApply(AfterSaleApplyRequest afterSaleApplyRequest, Integer userId){ |
| | | if(Objects.isNull(afterSaleApplyRequest) |
| | | || Objects.isNull(afterSaleApplyRequest.getOrderId()) |
| | | || Objects.isNull(afterSaleApplyRequest.getReturnUseIntegralStatus()) |
| | | || Objects.isNull(afterSaleApplyRequest.getReturnUseCouponStatus()) |
| | | || Objects.isNull(afterSaleApplyRequest.getReturnShopSettlementStatus()) |
| | | || Objects.isNull(afterSaleApplyRequest.getReturnShopIntegralStatus()) |
| | | || Objects.isNull(afterSaleApplyRequest.getReturnIntegralStatus()) |
| | | || Objects.isNull(afterSaleApplyRequest.getMoney()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | Goodsorder goodsorder = goodsorderMapper.selectById(afterSaleApplyRequest.getOrderId()); |
| | | if(Objects.isNull(goodsorder)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.WAIT_RECEIVE.getKey()) |
| | | || Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.DONE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订åç¶æå·²æµè½¬ï¼æ æ³è¿è¡è¯¥æä½ï¼"); |
| | | } |
| | | Aftersale aftersale = new Aftersale(); |
| | | aftersale.setCreateDate(new Date()); |
| | | aftersale.setIsdeleted(Constants.ZERO); |
| | | aftersale.setOrderId(goodsorder.getId()); |
| | | aftersale.setType(Constants.ZERO); |
| | | aftersale.setContent(afterSaleApplyRequest.getRemark()); |
| | | aftersale.setStatus(Constants.AftersaleStatus.DONE.getKey()); |
| | | aftersale.setInfo(afterSaleApplyRequest.getRemark()); |
| | | aftersale.setMoney(afterSaleApplyRequest.getMoney()); |
| | | aftersale.setCoupon(goodsorder.getCouponPrice()); |
| | | aftersale.setReturnShopIntegral(BigDecimal.ZERO); |
| | | aftersale.setReturnIntegral(BigDecimal.ZERO); |
| | | aftersale.setReturnShopSettlement(BigDecimal.ZERO); |
| | | aftersale.setCode(getNextInCode()); |
| | | |
| | | //订åéåè¿åç»ç»éåç积å |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getReturnCustomerIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //ç»éååå¨å©ä½ç§¯å |
| | | if(Objects.nonNull(shop)&&shop.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //å¼å¯äºæ£é¤è¿è¿ç»éå积å |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopIntegralStatus(),Constants.ONE)){ |
| | | //è®°å½æ£é¤ç»éå积åå¼ |
| | | aftersale.setReturnShopIntegral(shop.getIntegral().compareTo(goodsorder.getReturnCustomerIntegral())>Constants.ZERO |
| | | ?goodsorder.getReturnCustomerIntegral():shop.getIntegral()); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(goodsorder.getDistributionShopId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_REFUND_INTEGRAL); |
| | | integralService.dealShopIntegral(dealIntegralRequest); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订åéå ç»éåç»ç®ä½é¢ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getShopSettlement().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //ç»éååå¨å©ä½ç§¯å |
| | | if(Objects.nonNull(shop)&&shop.getAmount().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //å¼å¯äºæ£é¤è¿è¿ç»éå积å |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopSettlementStatus(),Constants.ONE)){ |
| | | //è®°å½æ£é¤ç»éå积åå¼ |
| | | aftersale.setReturnShopSettlement(shop.getAmount().compareTo(goodsorder.getShopSettlement())>Constants.ZERO |
| | | ?goodsorder.getShopSettlement():shop.getAmount()); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(goodsorder.getDistributionShopId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_REFUND_CASH); |
| | | integralService.dealShopAmount(dealIntegralRequest); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订åéå è¿è¿ç»å®¢æ·ç积å |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())&&goodsorder.getReturnMemberIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | //客æ·åå¨å©ä½ç§¯å |
| | | if(Objects.nonNull(member)&&member.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //å¼å¯äºæ£é¤è¿è¿å®¢æ·ç§¯å |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnIntegralStatus(),Constants.ONE)){ |
| | | //è®°å½æ£é¤ç»éå积åå¼ |
| | | aftersale.setReturnIntegral(member.getIntegral().compareTo(goodsorder.getReturnCustomerIntegral())>Constants.ZERO |
| | | ?goodsorder.getReturnCustomerIntegral():member.getIntegral()); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(member.getId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_REFUND_RETURN); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订å鿬¾ è¿è¿å®¢æ·ä½¿ç¨ç积å |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnIntegralStatus(),Constants.ONE) |
| | | && goodsorder.getUseIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | dealIntegralRequest.setMemberId(goodsorder.getMemberId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_REFUND); |
| | | dealIntegralRequest.setParam1(goodsorder.getCode().toString()); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | |
| | | //订å鿬¾ éå客æ·ä½¿ç¨ç伿 å¸ |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnUseCouponStatus(),Constants.ONE) |
| | | && Objects.nonNull(goodsorder.getCouponId())){ |
| | | memberCouponJoinMapper.update(new UpdateWrapper<MemberCoupon>().lambda() |
| | | .set(MemberCoupon::getStatus, Constants.ZERO) |
| | | .eq(MemberCoupon::getId, goodsorder.getCouponId()) |
| | | ); |
| | | } |
| | | |
| | | |
| | | if(afterSaleApplyRequest.getMoney().compareTo(BigDecimal.ZERO)>Constants.ZERO |
| | | && afterSaleApplyRequest.getMoney().compareTo(goodsorder.getPrice())<=Constants.ZERO){ |
| | | //订å鿬¾ |
| | | String refundCode = WxMiniUtilService.wxRefund(goodsorder.getCode().toString(), goodsorder.getPrice(), afterSaleApplyRequest.getMoney()); |
| | | Fund fund = new Fund(); |
| | | fund.setOrderCode(refundCode); |
| | | fund.setCreator(userId); |
| | | fund.setCreateDate(new Date()); |
| | | fund.setIsdeleted(Constants.ZERO); |
| | | fund.setRemark(userId.toString()); |
| | | fund.setMemberId(goodsorder.getCreator()); |
| | | fund.setTitle("订å鿬¾"); |
| | | fund.setContent(afterSaleApplyRequest.getRemark()); |
| | | fund.setObjId(goodsorder.getId()); |
| | | fund.setObjType(Constants.ONE); |
| | | fund.setType(Constants.ZERO); |
| | | fund.setNum(goodsorder.getPrice()); |
| | | fundMapper.insert(fund); |
| | | aftersale.setDrawbackNo(refundCode); |
| | | aftersale.setDrawbackDate(new Date()); |
| | | aftersale.setDrawbackInfo(afterSaleApplyRequest.getRemark()); |
| | | aftersale.setDrawbackNo(refundCode); |
| | | |
| | | } |
| | | aftersaleMapper.insert(aftersale); |
| | | |
| | | goodsorderMapper.update(null,new UpdateWrapper<Goodsorder>().lambda() |
| | | .set(Goodsorder::getStatus, Constants.OrderStatus.REFUND.getKey()) |
| | | .eq(Goodsorder::getId, goodsorder.getId()) |
| | | ); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | QueryWrapper<Banner> wrapper = new QueryWrapper<>(banner); |
| | | wrapper.lambda().orderByDesc(Banner::getSortnum); |
| | | List<Banner> banners = bannerMapper.selectList(wrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() + systemDictDataBiz.queryByCode(Constants.OSS, Constants.BANNER_FILE).getCode(); |
| | | List<BannerDTO> collect = banners.stream().map(s -> { |
| | | BannerDTO dto = new BannerDTO(); |
| | | BeanUtils.copyProperties(s, dto); |
| | | dto.setImgurl(path + s.getImgurl()); |
| | | if (Constants.equalsInteger(dto.getType(),Constants.ZERO)){ |
| | | dto.setContent(null); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.IntegralService; |
| | | import com.doumee.service.business.NoticeService; |
| | | import com.doumee.service.system.SystemDictDataService; |
| | | import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; |
| | |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private CouponMapper couponMapper; |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | @Autowired |
| | | private NoticeMapper noticeMapper; |
| | | @Autowired |
| | | private MemberCouponJoinMapper memberCouponJoinMapper; |
| | | @Autowired |
| | |
| | | |
| | | /****************************************ç§»å¨ç«¯æ¥å£å¼å§********************************************************************/ |
| | | |
| | | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public PayResponse orderPay(OrderPayRequest orderPayRequest){ |
| | | Member member = memberMapper.selectById(orderPayRequest.getMemberId()); |
| | | //æ¥è¯¢æ¶è´§å°å |
| | | Addr addr = addrMapper.selectById(orderPayRequest.getAddressId()); |
| | | if(Objects.isNull(addr)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°æ¶è´§å°åä¿¡æ¯ï¼"); |
| | | } |
| | | Areas area = areasService.findById(addr.getAreaId(), Constants.TWO); |
| | | if(Objects.isNull(area)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æ¶è´§å°ååºåä¿¡æ¯åçååï¼è¯·æ´æ°åä¸åï¼"); |
| | | } |
| | | Goodsorder goodsorder = new Goodsorder(); |
| | | goodsorder.setCreator(orderPayRequest.getMemberId()); |
| | | goodsorder.setIntegral(BigDecimal.ZERO); |
| | | goodsorder.setCreateDate(new Date()); |
| | | goodsorder.setIsdeleted(Constants.ZERO); |
| | | goodsorder.setMemberInfo(orderPayRequest.getRemark()); |
| | | goodsorder.setAddrId(addr.getId()); |
| | | goodsorder.setLinkaddr(area.getProvinceName()+area.getCityName() + area.getName() + addr.getAddr()); |
| | | goodsorder.setLinkphone(addr.getPhone()); |
| | | goodsorder.setLinkname(addr.getName()); |
| | | goodsorder.setMemberId(member.getId()); |
| | | goodsorder.setType(orderPayRequest.getOrderType()); |
| | | //åæ®ç¼å· èªå¢ |
| | | goodsorder.setCode(getNextInCode()); |
| | | //计ç®è®¢åæ»éé¢ |
| | | BigDecimal sumPrice = BigDecimal.ZERO; |
| | | //åå¨è®°å½æç» |
| | | List<PayDetailRequest> payDetailRequestList = orderPayRequest.getPayDetailRequestList(); |
| | | if(Objects.isNull(payDetailRequestList)||payDetailRequestList.size()==Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æ æç»æ°æ®,è¯·æ£æ¥éæ©æ°æ®ï¼"); |
| | | } |
| | | List<GoodsorderDetail> goodsOrderDetailList = new ArrayList<>(); |
| | | for (PayDetailRequest payDetailRequest:payDetailRequestList) { |
| | | //æ¥è¯¢åå |
| | | GoodsSku goodsSku = goodsSkuMapper.selectById(payDetailRequest.getGoodsSkuId()); |
| | | if(Objects.isNull(goodsSku)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ååSKUä¿¡æ¯ï¼"); |
| | | } |
| | | Goods goods = goodsMapper.selectById(goodsSku.getGoodsId()); |
| | | if(Objects.isNull(goods)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ååä¿¡æ¯ï¼"); |
| | | } |
| | | if(goods.getStatus().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨ååå·²å 餿已䏿¶ï¼æ æ³ä¸å"); |
| | | } |
| | | if(goodsSku.getStock().compareTo(new BigDecimal(Constants.formatIntegerNum(payDetailRequest.getGoodsNum())))<Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"åå¨åååºåä¸è¶³ï¼æ æ³ä¸åï¼"); |
| | | } |
| | | //åååºåæ£é¤ |
| | | goodsSku.setStock(goodsSku.getStock().subtract(new BigDecimal(Constants.formatIntegerNum(payDetailRequest.getGoodsNum())))); |
| | | goodsSkuMapper.updateById(goodsSku); |
| | | GoodsorderDetail goodsOrderDetail = new GoodsorderDetail(); |
| | | goodsOrderDetail.setCreator(member.getId()); |
| | | goodsOrderDetail.setCreateDate(new Date()); |
| | | goodsOrderDetail.setImgurl(StringUtils.isBlank(goodsSku.getImgurl())?goods.getImgurl():goodsSku.getImgurl()); |
| | | goodsOrderDetail.setName(goods.getName()); |
| | | goodsOrderDetail.setGoodsSkuId(goodsSku.getId().toString()); |
| | | goodsOrderDetail.setSkuName(goodsSku.getName()); |
| | | goodsOrderDetail.setPrice(goodsSku.getPrice()); |
| | | goodsOrderDetail.setGoodsNum(payDetailRequest.getGoodsNum()); |
| | | goodsOrderDetailList.add(goodsOrderDetail); |
| | | sumPrice = sumPrice.add(goodsSku.getPrice().multiply(new BigDecimal(payDetailRequest.getGoodsNum()))); |
| | | //è´ç©è½¦æ¯ä» å é¤è´ç©è½¦åå |
| | | if(orderPayRequest.getIsShopChart().equals(Constants.ONE)){ |
| | | shopcartMapper.deleteById(payDetailRequest.getShopCartId()); |
| | | } |
| | | } |
| | | |
| | | //è®¢åæ¯ä»ç°ééé¢ |
| | | goodsorder.setPrice((sumPrice.subtract(orderPayRequest.getDeductionBalance()))); |
| | | MemberCoupon memberCoupon = new MemberCoupon(); |
| | | if(!Objects.isNull(orderPayRequest.getCouponId())){ |
| | | memberCoupon = memberCouponMapper.selectById(orderPayRequest.getCouponId()); |
| | | if(Objects.isNull(memberCoupon)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä¼æ å¸ä¿¡æ¯ï¼"); |
| | | } |
| | | if(sumPrice.compareTo(memberCoupon.getLimitPrice())<Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"订åéé¢å°äºä¼æ 叿»éé¢ï¼æ æ³ä½¿ç¨ï¼"); |
| | | } |
| | | if(memberCoupon.getStatus().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"伿 å¸å·²ä½¿ç¨ï¼"); |
| | | } |
| | | sumPrice = sumPrice.subtract(memberCoupon.getPrice()); |
| | | goodsorder.setCouponId(orderPayRequest.getCouponId()); |
| | | goodsorder.setCouponPrice(memberCoupon.getPrice()); |
| | | } |
| | | |
| | | goodsorder.setCode(getNextInCode()); |
| | | if(!Objects.isNull(memberCoupon)){ |
| | | memberCoupon.setStatus(Constants.ONE); |
| | | memberCouponMapper.updateById(memberCoupon); |
| | | } |
| | | //åè±åå订å åç¬å¤ç æ£åç§¯å æ·»å 积ååå¨è®°å½ |
| | | if(orderPayRequest.getOrderType().equals(Constants.ONE)){ |
| | | if(member.getIntegral().compareTo(sumPrice)<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "åè±ä¸è¶³,æ æ³å
æ¢ï¼"); |
| | | } |
| | | goodsorder.setStatus(Constants.OrderStatus.PAY_DONE.getKey()); |
| | | goodsorder.setPayStatus(Constants.ZERO); |
| | | goodsorder.setPayDate(new Date()); |
| | | goodsorderMapper.insert(goodsorder); |
| | | //æ´æ°ç¨æ·ç§¯å |
| | | memberMapper.subtractIntegral(member.getId(),sumPrice); |
| | | PayResponse payResponse = new PayResponse(); |
| | | payResponse.setOrderId(goodsorder.getId()); |
| | | return payResponse; |
| | | } |
| | | goodsorder.setIntegral(orderPayRequest.getDeductionBalance()); |
| | | goodsorderMapper.insert(goodsorder); |
| | | //æ°æ®åå¨ |
| | | BigDecimal total = Constants.formatBigdecimal(goodsorder.getPrice()).add(Constants.formatBigdecimal(goodsorder.getIntegral())).add(Constants.formatBigdecimal(goodsorder.getCouponPrice())); |
| | | BigDecimal rate =Constants.formatBigdecimal(goodsorder.getCouponPrice()).divide(total,4,BigDecimal.ROUND_HALF_UP); |
| | | BigDecimal totalWxMoney = new BigDecimal(0); |
| | | BigDecimal totalIntegral = new BigDecimal(0); |
| | | for (int i =0;i< goodsOrderDetailList.size();i++) { |
| | | GoodsorderDetail goodsOrderDetail= goodsOrderDetailList.get(i); |
| | | goodsOrderDetail.setOrderId(goodsorder.getId()); |
| | | BigDecimal wxMoney ; |
| | | BigDecimal integral; |
| | | if(i!=0 && i == goodsOrderDetailList.size() -1){ |
| | | //å¤çå 为åèäºå
¥é æçå¯éé颿失 |
| | | wxMoney = Constants.formatBigdecimal(goodsorder.getPrice()).subtract(totalWxMoney); |
| | | integral = Constants.formatBigdecimal(goodsorder.getIntegral()).subtract(totalIntegral);; |
| | | }else{ |
| | | //å½åæç»å®é
ä»·æ ¼ |
| | | BigDecimal detialTotal = Constants.formatBigdecimal(goodsOrderDetail.getPrice()).multiply(new BigDecimal(Constants.formatIntegerNum(goodsOrderDetail.getGoodsNum()))); |
| | | //æç®ä¼æ å¸åæ¯ä»ä»·æ ¼ï¼å
å«ç°éåä½é¢é¨åï¼ |
| | | BigDecimal actDetialTotal = detialTotal.subtract(detialTotal.multiply(rate)); |
| | | //æç°éåç§¯åæ¯ä»æ¯ä¾ï¼æç®æ¯ä¸ªæç»ç°éåç§¯åæ¯ä»çæ°é |
| | | BigDecimal rate1 = detialTotal .divide(total,4,BigDecimal.ROUND_HALF_UP); |
| | | //å¯éç°ééé¢ |
| | | wxMoney = Constants.formatBigdecimal(goodsorder.getPrice()).multiply(rate1); |
| | | //å©ä¸çæ¯ä½é¢æµæ£ |
| | | integral =actDetialTotal.subtract(wxMoney); |
| | | totalWxMoney = totalWxMoney.add(wxMoney);//累计 |
| | | totalIntegral= totalIntegral.add(integral);//累计 |
| | | } |
| | | goodsOrderDetail.setMoney(wxMoney); |
| | | goodsOrderDetail.setIntegral(integral); |
| | | goodsorderDetailMapper.insert(goodsOrderDetail); |
| | | } |
| | | //å¦ææµæ£éé¢å¤§äº 0 åè¿è¡ä½é¢ä¸å¡å¤ç |
| | | if(orderPayRequest.getDeductionBalance().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //æµæ£éé¢å°äºä¼åå©ä½ä½é¢ |
| | | if(orderPayRequest.getDeductionBalance().compareTo(member.getIntegral())<=Constants.ZERO){ |
| | | //æ´æ°ä½é¢ä¿¡æ¯ æ·»å 积ååå¨è®°å½ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(orderPayRequest.getDeductionBalance()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(member.getId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | //åé微信å°ç¨åºè®¢é
æ¶æ¯ |
| | | SendWxMessage.integralChangeNotice(member,orderPayRequest.getDeductionBalance()); |
| | | //ä½é¢å
¨é¨æµæ£ |
| | | if(goodsorder.getPrice().compareTo(BigDecimal.ZERO)==Constants.ZERO){ |
| | | goodsorder.setStatus(Constants.OrderStatus.PAY_DONE.getKey()); |
| | | goodsorder.setPayStatus(Constants.ONE); |
| | | goodsorder.setPayDate(new Date()); |
| | | goodsorderMapper.updateById(goodsorder); |
| | | PayResponse payResponse = new PayResponse(); |
| | | payResponse.setOrderId(goodsorder.getId()); |
| | | return payResponse; |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ä½é¢ä¸è¶³ï¼æ æ³è¿è¡æ¯ä»ï¼å½åå©ä½ä½é¢ï¼ã"+member.getIntegral()+"ãï¼"); |
| | | } |
| | | } |
| | | if(goodsorder.getPrice().compareTo(orderPayRequest.getTitlePrice())!=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ååä»·æ ¼åçååï¼è¯·å·æ°åéæ°æ¯ä»ï¼"); |
| | | } |
| | | return this.wxPay(goodsorder,member); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public PayResponse orderPay(ShopOrderPayRequest orderPayRequest,MemberCouponServiceImpl memberCouponService){ |
| | |
| | | dealIntegralRequest.setMemberId(member.getId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | |
| | |
| | | PayResponse payResponse = new PayResponse(); |
| | | payResponse.setOrderId(goodsorder.getId()); |
| | | payResponse.setPayType(Constants.ONE); |
| | | //åééç¥ |
| | | if(Objects.nonNull(goodsorder.getPickUpShopId())){ |
| | | //åéç«å
ä¿¡ - ç»éå |
| | | noticeService.orderPayNotice(goodsorder.getPickUpShopId(),goodsorder.getId(),goodsorder.getReceiveType()); |
| | | } |
| | | |
| | | |
| | | return payResponse; |
| | | } |
| | | |
| | |
| | | dealIntegralRequest.setMemberId(goodsorder.getMemberId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_CANCEL); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_CANCEL); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | //订åä¿¡æ¯åæ¶ |
| | |
| | | |
| | | SendWxMessage.orderCancel(goodsorder,memberMapper.selectById(goodsorder.getMemberId()),goodsName); |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢ä¼æ å¸ä¿¡æ¯è®°å½ |
| | | if(!Objects.isNull(goodsorder.getCouponId())){ |
| | | MemberCoupon memberCoupon = memberCouponMapper.selectById(goodsorder.getCouponId()); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.WAIT_PAY.getKey()) |
| | | || Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.PAY_DONE.getKey()) |
| | | || Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.WAIT_RECEIVE.getKey()) )){ |
| | | || Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.PAY_DONE.getKey()) )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订ååæ¶å¤±è´¥ï¼è®¢åç¶æå·²æµè½¬ï¼"); |
| | | } |
| | | if(Constants.formatBigdecimal(goodsorder.getPrice()).compareTo(BigDecimal.ZERO)>Constants.ZERO |
| | |
| | | fund.setNum(goodsorder.getPrice()); |
| | | fundMapper.insert(fund); |
| | | } |
| | | if(goodsorder.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //订åå·²æ¯ä»ç¶æ ï¼ ä½¿ç¨äºç§¯å ä¸ç§¯å使ç¨å¤§äº0 |
| | | if(goodsorder.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO |
| | | &&Constants.equalsInteger(goodsorder.getStatus(),Constants.OrderStatus.PAY_DONE.getKey())){ |
| | | //æ´æ°ä½é¢ä¿¡æ¯ æ·»å 积ååå¨è®°å½ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(goodsorder.getIntegral()); |
| | |
| | | dealIntegralRequest.setMemberId(goodsorder.getMemberId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_CANCEL); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.MEMBER_ORDER_CANCEL); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | //订åä¿¡æ¯åæ¶ |
| | |
| | | } |
| | | } |
| | | |
| | | //SendWxMessage.orderCancel(goodsorder,memberMapper.selectById(goodsorder.getMemberId()),goodsName); |
| | | // ç¨æ·ä¸»å¨åæ¶ åéç»éåç«å
æ¶æ¯ |
| | | if(Objects.nonNull(goodsorder.getPickUpShopId())&&StringUtils.isBlank(cancelInfo)){ |
| | | noticeService.orderCancelNotice(goodsorder.getPickUpShopId(),goodsorder.getId(),goodsorder.getCode().toString()); |
| | | } |
| | | |
| | | //æ¥è¯¢ä¼æ å¸ä¿¡æ¯è®°å½ |
| | | if(!Objects.isNull(goodsorder.getCouponId())){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public BigDecimal getDeductAmount(List<PayDetailRequest> requestList){ |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | |
| | | String couponNames = ""; |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(shareCouponRewardList)){ |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | | List<CouponNoticeRequest> requestList = new ArrayList<>(); |
| | | for (JSONObject jsonObject:shareCouponRewardList) { |
| | | Integer couponId = jsonObject.getInteger("couponId"); |
| | | Integer num = jsonObject.getInteger("num"); |
| | |
| | | } |
| | | couponIds = couponIds + (StringUtils.isBlank(couponIds)? ",":"" )+ couponId ; |
| | | couponNames = couponNames + (StringUtils.isBlank(couponNames)? ",":"" )+ coupon.getName() ; |
| | | |
| | | |
| | | CouponNoticeRequest couponNoticeRequest = new CouponNoticeRequest(); |
| | | couponNoticeRequest.setMemberCoupon(memberCoupon); |
| | | couponNoticeRequest.setNum(num); |
| | | requestList.add(couponNoticeRequest); |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberCouponList)){ |
| | | memberCouponJoinMapper.insert(memberCouponList); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(requestList)){ |
| | | //åéç«å
ä¿¡ |
| | | noticeService.couponNotice(inviteMember.getId(),requestList); |
| | | } |
| | | } |
| | | inviteRecordMapper.update(new UpdateWrapper<InviteRecord>().lambda() |
| | |
| | | dealIntegralRequest.setMemberId(goodsorder.getDistributionShopId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.ORDER_DONATE); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER); |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | if(Objects.nonNull(member)){ |
| | | dealIntegralRequest.setParam1(member.getNickname()); |
| | | } |
| | | integralService.dealShopIntegral(dealIntegralRequest); |
| | | } |
| | | } |
| | |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.ORDER_DONE_AMOUNT); |
| | | dealIntegralRequest.setParam1(goodsorder.getCode().toString()); |
| | | integralService.dealShopAmount(dealIntegralRequest); |
| | | } |
| | | } |
| | |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | )); |
| | | myPageResponse.setAfterOrders(aftersaleMapper.selectCount(new QueryWrapper<Aftersale>() |
| | | .apply(" ID in ( select g.id from goodsorder g where g.MEMBER_ID = '"+memberId+"' ) ") |
| | | .notIn("STATUS",Constants.AftersaleStatus.DONE,Constants.AftersaleStatus.SHOP_REFUSE,Constants.AftersaleStatus.CANCEL) |
| | | .notIn("STATUS",Constants.AftersaleStatus.DONE.getKey(),Constants.AftersaleStatus.SHOP_REFUSE.getKey(),Constants.AftersaleStatus.CANCEL.getKey()) |
| | | )); |
| | | |
| | | |
| | |
| | | .eq(Collect::getMemberId,member.getId()) |
| | | ) |
| | | ); |
| | | homeInfoResponse.setUnRead( |
| | | noticeMapper.selectCount(new QueryWrapper<Notice>().lambda() |
| | | .eq(Notice::getIsdeleted,Constants.ZERO) |
| | | .eq(Notice::getMemberId,member.getId()) |
| | | .eq(Notice::getStatus,Constants.ZERO) |
| | | )>=Constants.ZERO?Constants.ZERO:Constants.ONE |
| | | ); |
| | | |
| | | return homeInfoResponse; |
| | | } |
| | |
| | | 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.doumee.service.business.NoticeService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | |
| | | @Transactional(rollbackFor = {Exception.class, BusinessException.class}) |
| | | @Override |
| | |
| | | }else{ |
| | | memberMapper.subtractIntegral(member.getId(),dealIntegralRequest.getIntegralNum()); |
| | | } |
| | | |
| | | //ç«å
ä¿¡ |
| | | noticeService.saveMemberIntegralNotice( |
| | | dealIntegralRequest.getIntegralObjType(),Constants.ZERO,member.getId(),dealIntegralRequest.getIntegralNum(), |
| | | integral.getId(), dealIntegralRequest.getParam1() |
| | | ); |
| | | |
| | | |
| | | return integral.getId(); |
| | | } |
| | | |
| | |
| | | }else{ |
| | | shopMapper.subtractIntegral(shop.getId(),dealIntegralRequest.getIntegralNum()); |
| | | } |
| | | |
| | | //ç«å
ä¿¡ |
| | | noticeService.saveMemberIntegralNotice( |
| | | dealIntegralRequest.getIntegralObjType(),Constants.ZERO,shop.getId(),dealIntegralRequest.getIntegralNum(), |
| | | integral.getId(), dealIntegralRequest.getParam1() |
| | | ); |
| | | |
| | | |
| | | return integral.getId(); |
| | | } |
| | | |
| | |
| | | BigDecimal num = param.getNum(); |
| | | if(param.getType() == 1 &&Constants.formatBigdecimal(model.getIntegral()).compareTo(param.getNum())<0){ |
| | | //妿æ¯åå°ï¼å¤æç¨æ·ä½é¢æ¯å¦æ»¡è¶³ |
| | | num = num.multiply(new BigDecimal(-1));//åå° |
| | | // num = num.multiply(new BigDecimal(-1));//åå° |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"ç¨æ·è´¦æ·ä½é¢ä¸è¶³ï¼"); |
| | | } |
| | | //è´¦æ·ä½é¢ |
| | | memberMapper.update(null,new UpdateWrapper<Member>().lambda() |
| | | .eq(Member::getId,model.getId()) |
| | | .set(Member::getEditDate,date) |
| | | .set(Member::getEditor,user.getId()) |
| | | .setSql(param.getType() == 0,"total_integral = ifnull(total_integral,0)+" + num)//累计å¢å |
| | | .setSql(param.getType() == 0,"integral = ifnull(integral,0)+" + param.getNum()) |
| | | .setSql(param.getType() == 1,"integral = ifnull(integral,0)-" + param.getNum())); |
| | | |
| | | integralObjType = param.getType()==0?Constants.IntegralObjType.SYSTEM_RECHARGE:Constants.IntegralObjType.SYSTEM_DEDUCT; |
| | | integral.setTotalNum(param.getType() == 0? Constants.formatBigdecimal(model.getIntegral()).add(param.getNum()):Constants.formatBigdecimal(model.getIntegral()).subtract(param.getNum())); |
| | | integral.setUserType(Constants.ZERO); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(num); |
| | | dealIntegralRequest.setDealType(param.getType()); |
| | | dealIntegralRequest.setMemberId(model.getId()); |
| | | dealIntegralRequest.setObjId(null); |
| | | dealIntegralRequest.setOrderCode(null); |
| | | dealIntegralRequest.setIntegralObjType(integralObjType); |
| | | this.dealIntegral(dealIntegralRequest); |
| | | |
| | | |
| | | //è´¦æ·ä½é¢ |
| | | // memberMapper.update(null,new UpdateWrapper<Member>().lambda() |
| | | // .eq(Member::getId,model.getId()) |
| | | // .set(Member::getEditDate,date) |
| | | // .set(Member::getEditor,user.getId()) |
| | | // .setSql(param.getType() == 0,"total_integral = ifnull(total_integral,0)+" + num)//累计å¢å |
| | | // .setSql(param.getType() == 0,"integral = ifnull(integral,0)+" + param.getNum()) |
| | | // .setSql(param.getType() == 1,"integral = ifnull(integral,0)-" + param.getNum())); |
| | | // |
| | | // integralObjType = param.getType()==0?Constants.IntegralObjType.SYSTEM_RECHARGE:Constants.IntegralObjType.SYSTEM_DEDUCT; |
| | | // integral.setTotalNum(param.getType() == 0? Constants.formatBigdecimal(model.getIntegral()).add(param.getNum()):Constants.formatBigdecimal(model.getIntegral()).subtract(param.getNum())); |
| | | // integral.setUserType(Constants.ZERO); |
| | | }else{//ç»éåè´¦æ· |
| | | Shop model = shopMapper.selectById(param.getMemberId()); |
| | | if(model == null ||Constants.equalsObject(model.getIsdeleted(),Constants.ONE)){ |
| | |
| | | BigDecimal num = param.getNum(); |
| | | if(param.getType() == 1 &&Constants.formatBigdecimal(model.getIntegral()).compareTo(param.getNum())<0){ |
| | | //妿æ¯åå°ï¼å¤æç¨æ·ä½é¢æ¯å¦æ»¡è¶³ |
| | | num = num.multiply(new BigDecimal(-1));//åå° |
| | | // num = num.multiply(new BigDecimal(-1));//åå° |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"ç»éåè´¦æ·ç§¯åä½é¢ä¸è¶³ï¼"); |
| | | } |
| | | //è´¦æ·ä½é¢ |
| | | shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | .eq(Shop::getId,model.getId()) |
| | | .set(Shop::getEditDate,date) |
| | | .set(Shop::getEditor,user.getId()) |
| | | .setSql(param.getType() == 0,"total_integral = ifnull(total_integral,0)+" + num)//累计å¢å |
| | | .setSql(param.getType() == 0,"integral = ifnull(integral,0)+" + param.getNum()) |
| | | .setSql(param.getType() == 1,"integral = ifnull(integral,0)-" + param.getNum())); |
| | | integralObjType = param.getType()==0?Constants.IntegralObjType.SHOP_SYSTEM_RECHARGE:Constants.IntegralObjType.SHOP_SYSTEM_DEDUCT; |
| | | integral.setTotalNum(param.getType() == 0? Constants.formatBigdecimal(model.getIntegral()).add(param.getNum()):Constants.formatBigdecimal(model.getIntegral()).subtract(param.getNum())); |
| | | integral.setUserType(Constants.ONE); |
| | | // shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | // .eq(Shop::getId,model.getId()) |
| | | // .set(Shop::getEditDate,date) |
| | | // .set(Shop::getEditor,user.getId()) |
| | | // .setSql(param.getType() == 0,"total_integral = ifnull(total_integral,0)+" + num)//累计å¢å |
| | | // .setSql(param.getType() == 0,"integral = ifnull(integral,0)+" + param.getNum()) |
| | | // .setSql(param.getType() == 1,"integral = ifnull(integral,0)-" + param.getNum())); |
| | | // integralObjType = param.getType()==0?Constants.IntegralObjType.SHOP_SYSTEM_RECHARGE:Constants.IntegralObjType.SHOP_SYSTEM_DEDUCT; |
| | | // integral.setTotalNum(param.getType() == 0? Constants.formatBigdecimal(model.getIntegral()).add(param.getNum()):Constants.formatBigdecimal(model.getIntegral()).subtract(param.getNum())); |
| | | // integral.setUserType(Constants.ONE); |
| | | |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(num); |
| | | dealIntegralRequest.setDealType(param.getType()); |
| | | dealIntegralRequest.setMemberId(model.getId()); |
| | | dealIntegralRequest.setObjId(null); |
| | | dealIntegralRequest.setOrderCode(null); |
| | | dealIntegralRequest.setIntegralObjType(integralObjType); |
| | | this.dealShopIntegral(dealIntegralRequest); |
| | | |
| | | |
| | | } |
| | | integral.setCreateDate(new Date()); |
| | | integral.setCreator(user.getId()); |
| | | integral.setIsdeleted(Constants.ZERO); |
| | | integral.setNum(param.getNum()); |
| | | integral.setTitle(integralObjType.getName()); |
| | | integral.setContent(integralObjType.getNoteinfo().replace("${param}",integral.getNum().toString())); |
| | | integral.setMemberId(param.getMemberId()); |
| | | integral.setObjId(param.getMemberId()); |
| | | integral.setObjType(integralObjType.getKey()); |
| | | integral.setType(param.getType()); |
| | | integral.setRemark(param.getRemark()); |
| | | integral.setOrderCode(null); |
| | | integralMapper.insert(integral); |
| | | // integral.setCreateDate(new Date()); |
| | | // integral.setCreator(user.getId()); |
| | | // integral.setIsdeleted(Constants.ZERO); |
| | | // integral.setNum(param.getNum()); |
| | | // integral.setTitle(integralObjType.getName()); |
| | | // integral.setContent(integralObjType.getNoteinfo().replace("${param}",integral.getNum().toString())); |
| | | // integral.setMemberId(param.getMemberId()); |
| | | // integral.setObjId(param.getMemberId()); |
| | | // integral.setObjType(integralObjType.getKey()); |
| | | // integral.setType(param.getType()); |
| | | // integral.setRemark(param.getRemark()); |
| | | // integral.setOrderCode(null); |
| | | // integralMapper.insert(integral); |
| | | } |
| | | @Override |
| | | public IntegralDataResponse getIntegralData(IntegralRecordDTO model){ |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<LabelsResponse> getGoodsLabelsByType(Integer type) { |
| | | public List<LabelsResponse> getGoodsLabelsByType(Integer type,Integer parentId) { |
| | | LambdaQueryWrapper<Labels> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Labels::getStatus,Constants.ZERO); |
| | | wrapper.eq(Labels::getStatus,Constants.ONE); |
| | | wrapper.eq(Labels::getIsdeleted,Constants.ZERO); |
| | | wrapper.eq(Objects.nonNull(parentId),Labels::getParentId,parentId); |
| | | wrapper.eq(Labels::getType,type); |
| | | wrapper.orderByAsc(Labels::getSortnum,Labels::getCreateDate); |
| | | List<Labels> labels = labelsMapper.selectList(wrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS,Constants.LABELS_IMG).getCode(); |
| | | List<LabelsResponse> collect = labels.stream().map(s -> { |
| | | LabelsResponse labelsResponse = new LabelsResponse(); |
| | | BeanUtils.copyProperties(s, labelsResponse); |
| | | if(StringUtils.isNotBlank(s.getImgurl())){ |
| | | labelsResponse.setImgUrl(path + s.getImgurl()); |
| | | } |
| | | return labelsResponse; |
| | | }).collect(Collectors.toList()); |
| | | return collect; |
| | |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getOpenId, openId) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .last(" limit 1")); |
| | | //å建token |
| | | JwtPayLoad payLoad = new JwtPayLoad(Constants.MEMBER_PREFIX+member.getId()); |
| | | String token = JwtTokenUtil.generateToken(payLoad); |
| | | AccountResponse accountResponse = new AccountResponse(); |
| | | accountResponse.setSessionKey(session.getSessionKey()); |
| | | if(Objects.nonNull(member)){ |
| | | memberMapper.updateById(member); |
| | | member.setImgFullUrl(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl()); |
| | | //å建token |
| | | JwtPayLoad payLoad = new JwtPayLoad(Constants.MEMBER_PREFIX+member.getId()); |
| | | String token = JwtTokenUtil.generateToken(payLoad); |
| | | accountResponse.setToken(token); |
| | | accountResponse.setMember(member); |
| | | }else{ |
| | |
| | | @Override |
| | | public AccountResponse wxPhone(WxPhoneRequest wxPhoneRequest){ |
| | | try { |
| | | WxMaPhoneNumberInfo userPhoneInfo = WxMiniConfig.wxMaService.getUserService().getPhoneNoInfo( |
| | | wxPhoneRequest.getSessionKey(), wxPhoneRequest.getEncryptedData(), wxPhoneRequest.getIv()); |
| | | //è·åææºå· |
| | | String phone= userPhoneInfo.getPurePhoneNumber(); |
| | | WxMaPhoneNumberInfo userPhoneInfo = WxMiniConfig.wxMaService.getUserService().getPhoneNumber(wxPhoneRequest.getCode()); |
| | | String phone = userPhoneInfo.getPhoneNumber(); |
| | | if(Objects.isNull(phone)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªè·åå°ææºå·"); |
| | | } |
| | |
| | | member.setRecId(Constants.getInviteCode(wxPhoneRequest.getRecId())); |
| | | } |
| | | member.setOpenId(wxPhoneRequest.getOpenid()); |
| | | member.setIntegral(BigDecimal.ZERO); |
| | | } |
| | | member.setPhone(phone); |
| | | member.setEditDate(new Date()); |
| | |
| | | platformConfigDTO.getShareIntegralReward():BigDecimal.ZERO); |
| | | inviteRecord.setFirstOrderStatus(Constants.ZERO); |
| | | inviteRecordMapper.insert(inviteRecord); |
| | | //èµ éé请积å |
| | | //å¼å¯é请注åé积å |
| | | if(Constants.equalsInteger(platformConfigDTO.getShareIntegralRewardStatus(),Constants.ZERO)){ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(platformConfigDTO.getShareIntegralReward()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | dealIntegralRequest.setMemberId(member.getRecId()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.INVITENEWUSER); |
| | | dealIntegralRequest.setParam1(member.getNickname()); |
| | | integralService.dealIntegral(dealIntegralRequest); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | import com.doumee.dao.business.NoticeMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | | import com.doumee.dao.business.join.NoticeJoinMapper; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.NoticeCardDTO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.web.request.CouponNoticeRequest; |
| | | import com.doumee.service.business.NoticeService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | @Override |
| | | public PageData<NoticeCardDTO> findNoticeCardDTOPage(PageWrap<Notice> pageWrap) { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo)SecurityUtils.getSubject().getPrincipal(); |
| | | IPage<Notice> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | LambdaQueryWrapper<Notice> queryWrapper = new LambdaQueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.eq(Notice::getType,pageWrap.getModel().getType()) |
| | | .eq(Notice::getObjMemberId,loginUserInfo.getMemberId()); |
| | | |
| | | Notice notice = pageWrap.getModel(); |
| | | |
| | | queryWrapper.ne(Objects.nonNull(notice.getQueryType())&&Constants.equalsInteger(notice.getQueryType(),Constants.ZERO), |
| | | Notice::getObjType,Constants.TWO) |
| | | .eq(Objects.nonNull(notice.getQueryType())&&Constants.equalsInteger(notice.getQueryType(),Constants.ONE), |
| | | Notice::getObjType,Constants.TWO) |
| | | .eq(Notice::getMemberId,notice.getMemberId()) |
| | | .orderByAsc(Notice::getStatus) |
| | | .orderByDesc(Notice::getId) |
| | | ; |
| | | IPage<Notice> noticeIPage = noticeMapper.selectPage(page, queryWrapper); |
| | | |
| | | List<NoticeCardDTO> noticeCardDTOs = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(noticeIPage.getRecords())){ |
| | | return PageData.from(new Page<>()); |
| | | noticeCardDTOs = noticeIPage.getRecords().stream().map(s -> { |
| | | NoticeCardDTO noticeCardDTO = new NoticeCardDTO(); |
| | | BeanUtils.copyProperties(s, noticeCardDTO); |
| | | return noticeCardDTO; |
| | | |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | List<NoticeCardDTO> noticeCardDTOs = noticeIPage.getRecords().stream().map(s -> { |
| | | NoticeCardDTO noticeCardDTO = new NoticeCardDTO(); |
| | | BeanUtils.copyProperties(s, noticeCardDTO); |
| | | return noticeCardDTO; |
| | | |
| | | }).collect(Collectors.toList()); |
| | | |
| | | PageData<NoticeCardDTO> pageData = new PageData<>(); |
| | | pageData.setPage(pageWrap.getPage()); |
| | | pageData.setCapacity(pageWrap.getCapacity()); |
| | |
| | | return pageData; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param type 0æ¶è´¹è
ï¼1=ç»éåï¼ |
| | | * @param objType 0åå订å 1ç§¯åæµæ°´ 2äºå¨è¯ä»· 3伿 å¸ |
| | | * |
| | | */ |
| | | |
| | | public void saveNoticeInfo(Integer type,Integer objType,Integer memberId |
| | | ,String title,String content,Integer objId){ |
| | | Notice notice = new Notice(); |
| | | notice.setCreateDate(new Date()); |
| | | notice.setIsdeleted(Constants.ZERO); |
| | | notice.setTitle(title); |
| | | notice.setContent(content); |
| | | notice.setType(type); |
| | | notice.setObjType(objType); |
| | | notice.setObjId(objId); |
| | | notice.setMemberId(memberId); |
| | | notice.setStatus(Constants.ZERO); |
| | | noticeMapper.insert(notice); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 积åå卿¶æ¯ç±»å |
| | | * @param integralObjType 积ååå¨ç±»å |
| | | * @param memberId ç¨æ·ä¸»é®/åæ·ä¸»é® |
| | | * @param integral åå¨ç§¯å/ç°éå¼ |
| | | * @param objId å
³èå¯¹è±¡ä¸»é® - ç§¯åæµæ°´åå¨è®°å½ä¸»é® |
| | | * @param param1 param2 |
| | | */ |
| | | @Override |
| | | public void saveMemberIntegralNotice(Constants.IntegralObjType integralObjType,Integer type, |
| | | Integer memberId, |
| | | BigDecimal integral, |
| | | Integer objId,String param1){ |
| | | String title = integralObjType.getName(); |
| | | String info = integralObjType.getNoteinfo(); |
| | | info = info.replace("${param}",integral.toString()).replace("${param1}",param1); |
| | | this.saveNoticeInfo( |
| | | type, |
| | | Constants.ONE, |
| | | memberId, |
| | | title, |
| | | info, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 忾伿 å¸ ç«å
ä¿¡ |
| | | * @param memberId |
| | | * @param couponList |
| | | */ |
| | | @Override |
| | | public void couponNotice(Integer memberId,List<CouponNoticeRequest> couponList){ |
| | | String noticeInfo = "æåæ¨è·å¾${param}"; |
| | | //æåæ¨è·å¾ 满50å10æµæ£å¸ |
| | | String replaceInfo = ""; |
| | | //æ´ç伿 å¸å
容 |
| | | for (CouponNoticeRequest c:couponList) { |
| | | MemberCoupon mc = c.getMemberCoupon(); |
| | | String info = Constants.equalsInteger(mc.getCouponType(),Constants.ZERO)? |
| | | "满"+mc.getLimitPrice()+"å
å"+mc.getPrice()+"å
æµæ£å¸*"+c.getNum(): |
| | | "满"+mc.getLimitPrice()+"å
享"+mc.getPrice()+"æå¸"; |
| | | replaceInfo = replaceInfo + (StringUtils.isBlank(replaceInfo)? |
| | | info:","+info); |
| | | } |
| | | noticeInfo.replace("${param}",replaceInfo); |
| | | |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.ONE, |
| | | memberId, |
| | | "è·å¾ç³»ç»åæ¾ç伿 å¸", |
| | | noticeInfo, |
| | | null |
| | | ); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 积åè¿æ ç«å
æ¶æ¯ |
| | | * @param memberId |
| | | * @param integral |
| | | * @param expireDateNum |
| | | */ |
| | | @Override |
| | | public void expireNotice(Integer memberId, BigDecimal integral,Integer expireDateNum){ |
| | | //æ¨æ1000积å30天åè¿æï¼è¯·å°½å¿«ä½¿ç¨ |
| | | String noticeInfo = "æ¨æ${param}积åå³å°è¿æï¼è¯·å°½å¿«ä½¿ç¨"; |
| | | if(integral.compareTo(BigDecimal.ZERO)<=Constants.ZERO){ |
| | | return; |
| | | } |
| | | noticeInfo.replace("${param}",integral.toString()); |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.ONE, |
| | | memberId, |
| | | "æ¨ç积åå°å¨"+expireDateNum+"天忏
空ï¼è¯·å°½å¿«ä½¿ç¨", |
| | | noticeInfo, |
| | | null |
| | | ); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è¯è®ºæ¶æ¯ ç«å
ä¿¡ |
| | | * @param memberId |
| | | * @param objId |
| | | * @param memberName |
| | | */ |
| | | @Override |
| | | public void commonNotice(Integer memberId, Integer objId,String memberName ){ |
| | | //æ¨æ1000积å30天åè¿æï¼è¯·å°½å¿«ä½¿ç¨ |
| | | String noticeInfo = "${param}åå¤äºæ¨çè¯è®º"; |
| | | noticeInfo.replace("${param}",memberName); |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.TWO, |
| | | memberId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * è®¢åæ¯ä»æå åéæ¶æ¯ |
| | | * @param shopId |
| | | * @param objId |
| | | * @param receiveType |
| | | */ |
| | | @Override |
| | | public void orderPayNotice(Integer shopId, Integer objId,Integer receiveType){ |
| | | if(Constants.equalsInteger(receiveType,Constants.ZERO)){ |
| | | return; |
| | | } |
| | | //æ¨ææ°çãåè´§æ¹å¼ã订åå¾
å¤ç |
| | | String noticeInfo = "æ¨ææ°ç${param}订åå¾
å¤ç"; |
| | | noticeInfo.replace("${param}",Constants.equalsInteger(receiveType,Constants.ZERO)?"ç©æµåè´§":"é¨åºèªæ"); |
| | | this.saveNoticeInfo( |
| | | Constants.ONE, |
| | | Constants.ZERO, |
| | | shopId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 订ååæ¶ åéç«å
ä¿¡ |
| | | * @param shopId |
| | | * @param objId |
| | | * @param orderNo |
| | | */ |
| | | @Override |
| | | public void orderCancelNotice(Integer shopId, Integer objId,String orderNo){ |
| | | // æ¨ç订å{订åå·}ï¼å·²ç±å®¢æ·æå¨åæ¶ï¼è¯·ç¥æ |
| | | String noticeInfo = " æ¨ç订å${param}ï¼å·²ç±å®¢æ·æå¨åæ¶ï¼è¯·ç¥æ"; |
| | | noticeInfo.replace("${param}",orderNo); |
| | | this.saveNoticeInfo( |
| | | Constants.ONE, |
| | | Constants.ZERO, |
| | | shopId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private WithdrawRecordMapper withdrawRecordMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private ShopMapper shopMapper; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void updateById(WithdrawRecord withdrawRecord) { |
| | | public void updateById(WithdrawRecord withdrawRecord, IntegralService integralService) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsObject(withdrawRecord.getStatus(),Constants.ONE) |
| | | && !Constants.equalsObject(withdrawRecord.getStatus(),Constants.TWO)){ |
| | |
| | | model.setPayBank(withdrawRecord.getPayBank()); |
| | | withdrawRecordMapper.updateById(model); |
| | | dealBatchMultiFiles(model,withdrawRecord.getPayFileList()); |
| | | |
| | | //å®¡æ¹æªéè¿ éåæç°éé¢ |
| | | if (Constants.equalsObject(model.getStatus(), Constants.TWO)) { |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.WITHDRAW_APPLY_BACK); |
| | | dealIntegralRequest.setIntegralNum(model.getAmount()); |
| | | dealIntegralRequest.setObjId(withdrawRecord.getId()); |
| | | dealIntegralRequest.setOrderCode(withdrawRecord.getCode().toString()); |
| | | dealIntegralRequest.setMemberId(model.getMemberId()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | integralService.dealShopAmount(dealIntegralRequest); |
| | | } |
| | | } |
| | | |
| | | public void dealBatchMultiFiles(WithdrawRecord model, List<Multifile> fileList ) { |
| | | //æ¸
空åæç |
| | | if(fileList!=null && fileList.size()>0){ |
| | |
| | | return; |
| | | } |
| | | for (WithdrawRecord withdrawRecord: withdrawRecords) { |
| | | this.updateById(withdrawRecord); |
| | | // this.updateById(withdrawRecord); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.rocketmq5.NormalMsgProducer; |
| | | 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.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.dto.CountDataDTO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.system.vo.BusinessDataCountVO; |
| | | import com.doumee.dao.system.vo.CountDataVO; |
| | | import com.doumee.dao.web.dto.CollectDTO; |
| | | import com.doumee.dao.web.dto.MemberDTO; |
| | | import com.doumee.dao.web.dto.MultiFileDTO; |
| | | import com.doumee.dao.web.dto.OrgDTO; |
| | | import com.doumee.dao.web.dto.activity.*; |
| | | import com.doumee.dao.web.dto.shop.ShopSimpleDTO; |
| | | import com.doumee.dao.web.request.ActivityPageListRequest; |
| | | import com.doumee.service.business.*; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ´»å¨ãèµè®¯ãæ¢åºä¿¡æ¯è¡¨Serviceå®ç° |
| | | * |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | @Service |
| | | public class WorkbenchServiceImpl implements WorkbenchService { |
| | | @Autowired |
| | | private GoodsorderMapper goodsorderMapper; |
| | | @Autowired |
| | | private GoodsorderDetailMapper goodsorderDetailMapper; |
| | | @Override |
| | | public List<BusinessDataCountVO> shopRankList10(CountDataDTO param) { |
| | | Date startDate = null,endDate = null; |
| | | if(param.getYear()!=null && param.getMonth()!=null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | }else if(param.getYear()!=null && param.getMonth()==null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear()); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | } |
| | | //ç»è®¡è®¢åééåéå®é¢éå |
| | | List<BusinessDataCountVO> list1 = goodsorderMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<Goodsorder>() |
| | | .selectAs(Shop::getName,BusinessDataCountVO::getName) |
| | | .select("(select count(distinct(t.member_id)) )",BusinessDataCountVO::getNum1) |
| | | .select("(select count(t.id) )",BusinessDataCountVO::getNum) |
| | | .select("(select sum(t.total_price) )",BusinessDataCountVO::getPrice) |
| | | .leftJoin(Shop.class,Shop::getId,Goodsorder::getDistributionShopId) |
| | | .ge(startDate!=null,Goodsorder::getCreateDate,startDate) |
| | | .ne(endDate!=null,Goodsorder::getCreateDate,endDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(Goodsorder::getDistributionShopId) |
| | | .orderByDesc(Constants.equalsInteger(param.getType() ,0),"sum(t.total_price) ") |
| | | .orderByDesc(Constants.equalsInteger(param.getType() ,1),"count(t.id) ") |
| | | .orderByDesc(Constants.equalsInteger(param.getType() ,2),"count(distinct(t.member_id))") |
| | | .last("limit 10")) ; |
| | | return list1; |
| | | |
| | | } |
| | | @Override |
| | | public List<BusinessDataCountVO> goodsRankList10(CountDataDTO param) { |
| | | Date startDate = null,endDate = null; |
| | | if(param.getYear()!=null && param.getMonth()!=null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYearAndMonth(param.getYear(),param.getMonth()-1); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | }else if(param.getYear()!=null && param.getMonth()==null){ |
| | | List<Date> dList = DateUtil.getDatePeriodByYear(param.getYear()); |
| | | startDate = dList.get(0); |
| | | endDate = dList.get(1); |
| | | } |
| | | //ç»è®¡è®¢åééåéå®é¢éå |
| | | List<BusinessDataCountVO> list1 = goodsorderDetailMapper.selectJoinList(BusinessDataCountVO.class,new MPJLambdaWrapper<GoodsorderDetail>() |
| | | .selectAs(Goods::getName,BusinessDataCountVO::getName) |
| | | .select("(select sum(t.goods_num) )",BusinessDataCountVO::getNum) |
| | | .select("(select sum(ifnull(t.price,0) * ifnull(t.goods_num,0)))",BusinessDataCountVO::getPrice) |
| | | .leftJoin(Goodsorder.class,Goodsorder::getId,GoodsorderDetail::getOrderId) |
| | | .leftJoin(Goods.class,Goods::getId,GoodsorderDetail::getGoodsId) |
| | | .ge(startDate!=null,Goodsorder::getCreateDate,startDate) |
| | | .ne(endDate!=null,Goodsorder::getCreateDate,endDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(GoodsorderDetail::getGoodsId) |
| | | .orderByDesc(Constants.equalsInteger(param.getType() ,1),"sum(ifnull(t.price,0) * ifnull(t.goods_num,0)) ") |
| | | .orderByDesc(Constants.equalsInteger(param.getType() ,0),"sum(t.goods_num) ") |
| | | .last("limit 10")) ; |
| | | return list1; |
| | | } |
| | | @Override |
| | | public BusinessDataCountVO businessData(CountDataDTO param) { |
| | | BusinessDataCountVO data = new BusinessDataCountVO(); |
| | | int dataType = param.getDateType();//0仿¥ 1è¿ä¸æ¥ 2è¿30æ¥ 3è¿1å¹´ |
| | | String name = "HOUR(t.CREATE_DATE)"; |
| | | List<String> dateList = new ArrayList<>(); |
| | | Date date = Utils.Date.getEnd(new Date());//仿¥ 23:59:59 |
| | | Date startDate = DateUtil.addDaysToDate(date,-1); |
| | | switch (dataType) { |
| | | case 1: { |
| | | name = "DATE_FORMAT(t.CREATE_DATE, '%Y-%m-%d')"; |
| | | for(int i=1;i<=7;i++){ |
| | | dateList.add(DateUtil.getShortTime(DateUtil.addDaysToDate(date,i-7))); |
| | | } |
| | | startDate = DateUtil.addDaysToDate(date,-7); |
| | | break; |
| | | } case 2: { |
| | | name = "DATE_FORMAT(t.CREATE_DATE, '%Y-%m-%d')"; |
| | | for(int i=1;i<=30;i++){ |
| | | dateList.add(DateUtil.getShortTime(DateUtil.addDaysToDate(date,i-30))); |
| | | } |
| | | startDate = DateUtil.addDaysToDate(date,-30); |
| | | break; |
| | | } case 3: { |
| | | LocalDate now = LocalDate.now(); |
| | | startDate = DateUtil.increaseYear(date,-1); |
| | | name = "DATE_FORMAT(t.CREATE_DATE, '%Y-%m')"; |
| | | for(int i=1;i<=12;i++){ |
| | | dateList.add(DateUtil.minusMonthToDate(now,12-i)); |
| | | } |
| | | break; |
| | | } default:{ |
| | | for(int i=0;i<=23;i++){ |
| | | dateList.add(i+""); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | data.setDateStrList(dateList); |
| | | //订åéé |
| | | CountDataVO r = goodsorderMapper.selectJoinOne(CountDataVO.class,new MPJLambdaWrapper<Goodsorder>() |
| | | .select("(select count(t.id) )",CountDataVO::getNum) |
| | | .select("(select sum(t.total_Price) )",CountDataVO::getPrice) |
| | | .ge(Goodsorder::getCreateDate,startDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) ); |
| | | if (r != null) { |
| | | data.setNum(Constants.formatLongNum(r.getNum()));//订åé |
| | | data.setPrice(Constants.formatBigdecimal(r.getPrice()));//订åéé¢ |
| | | } |
| | | //鿬¾ç»è®¡ |
| | | CountDataVO r1 = goodsorderMapper.selectJoinOne(CountDataVO.class,new MPJLambdaWrapper<Goodsorder>() |
| | | .select("(select count(t.id) )",CountDataVO::getNum) |
| | | .select("(select sum(t.refund_money) )",CountDataVO::getPrice) |
| | | .ge(Goodsorder::getRefundTime,startDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.REFUND.getKey()) ); |
| | | |
| | | |
| | | if (r1 != null) { |
| | | data.setNum1(Constants.formatLongNum(r1.getNum()));//鿬¾åé |
| | | data.setPrice1(Constants.formatBigdecimal(r1.getPrice()));//鿬¾éé¢ |
| | | } |
| | | |
| | | //ç»è®¡è®¢åééåéå®é¢éå |
| | | List<CountDataVO> list1 = goodsorderMapper.selectJoinList(CountDataVO.class,new MPJLambdaWrapper<Goodsorder>() |
| | | .select("(select "+name+")",CountDataVO::getDateStr) |
| | | .select("(select count(t.id) )",CountDataVO::getNum) |
| | | .select("(select sum(t.total_price) )",CountDataVO::getPrice) |
| | | .ge(Goodsorder::getCreateDate,startDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(name) ); |
| | | |
| | | List<Long> datalist1 = new ArrayList<>(); |
| | | List<BigDecimal> datalistPrice = new ArrayList<>(); |
| | | for(String str : dateList){ |
| | | long tnum =0; |
| | | BigDecimal tprice = new BigDecimal(0); |
| | | if(list1!=null){ |
| | | for(CountDataVO p : list1){ |
| | | if(StringUtils.equals(p.getDateStr(),str)){ |
| | | tnum =(Constants.formatLongNum(p.getNum())); |
| | | tprice = (Constants.formatBigdecimal(p.getPrice())); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | datalist1.add( tnum ); |
| | | datalistPrice.add(tprice); |
| | | } |
| | | data.setDataList(datalist1 ); |
| | | data.setDataList2(datalistPrice ); |
| | | |
| | | String name1 =name.replace("t.","t3."); |
| | | //ç»è®¡åç±»ååæ°æ®éå |
| | | List<CountDataVO> list2 = goodsorderDetailMapper.selectJoinList(CountDataVO.class,new MPJLambdaWrapper<GoodsorderDetail>() |
| | | .select("(select "+name1+")",CountDataVO::getDateStr) |
| | | .selectAs(Labels::getName,CountDataVO::getName) |
| | | .select("(select sum(ifnull(t.price,0) * ifnull(t.goods_num,0)) )",CountDataVO::getPrice) |
| | | .leftJoin(Goods.class,Goods::getId,GoodsorderDetail::getGoodsId) |
| | | .leftJoin(Labels.class,Labels::getId,Goods::getCategoryId) |
| | | .leftJoin(Goodsorder.class,Goodsorder::getId,GoodsorderDetail::getOrderId) |
| | | .ge(Goodsorder::getCreateDate,startDate) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey(),Constants.OrderStatus.REFUND.getKey()) |
| | | .groupBy(name1+",t1.category_id")); |
| | | |
| | | List<CountDataVO> cateList = getCateListFromDataList(list2); |
| | | if(list2!=null &&list2.size()>0 && cateList!=null && cateList.size()>0){ |
| | | BigDecimal[] temp = new BigDecimal[dateList.size()]; |
| | | for(CountDataVO cate : cateList){ |
| | | for(int i=0;i<dateList.size();i++){ |
| | | temp[i] = new BigDecimal(0); |
| | | for(CountDataVO model : list2){ |
| | | if(StringUtils.equals(model.getDateStr(),dateList.get(i)) && StringUtils.equals(model.getName(),cate.getName())){ |
| | | temp[i] = Constants.formatBigdecimal(model.getPrice()); |
| | | } |
| | | } |
| | | } |
| | | cate.setData(temp); |
| | | } |
| | | } |
| | | data.setCateList(cateList); |
| | | return data; |
| | | } |
| | | |
| | | private List<CountDataVO> getCateListFromDataList(List<CountDataVO> list2) { |
| | | List<CountDataVO> list = new ArrayList<>(); |
| | | for(CountDataVO model :list2){ |
| | | boolean isnew = true; |
| | | for(CountDataVO str :list){ |
| | | if(StringUtils.equals(str.getName(),model.getName())){ |
| | | isnew = false; |
| | | } |
| | | |
| | | } |
| | | if(isnew ){ |
| | | list.add(model); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(memberService.wxLogin(code)); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "ç»å®ææºå·", notes = "å°ç¨åºç«¯") |
| | | @PostMapping("/wxPhone") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true) |
| | | }) |
| | | public ApiResponse<AccountResponse> wxPhone(@Valid @RequestBody WxPhoneRequest wxPhoneRequest) { |
| | | return ApiResponse.success(memberService.wxPhone(wxPhoneRequest)); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | @Api(tags = "æ ç¾ä¿¡æ¯è¡¨ä¸å¡") |
| | | @Trace(exclude = true) |
| | | //@RestController |
| | | @RestController |
| | | @RequestMapping("/web/labels") |
| | | @Slf4j |
| | | public class LabelsApi extends ApiController{ |
| | |
| | | @ApiOperation(value = "è·åå类信æ¯", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/getGoodsLabelsByType") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type", value = "ç±»å0åååç±» 1åååç 2åå®¶æ ç¾ 3å¿«é 4éè´§é项 5æ¢è´§é项 6鿬¾é项 7åæ¶è®¢åé项 8åå¡ç¾ç§åç±» 9å¨ è¯¢åç±» 10æ´»å¨èµäºåç±» 11达人æ¢åºåç±»", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "parentId", value = "ç¶çº§ä¸»é®", required = false), |
| | | }) |
| | | public ApiResponse<List<LabelsResponse>> getGoodsLabelsByType(Integer type){ |
| | | return ApiResponse.success(labelsService.getGoodsLabelsByType(type)); |
| | | public ApiResponse<List<LabelsResponse>> getGoodsLabelsByType(@RequestParam Integer type,Integer parentId){ |
| | | return ApiResponse.success(labelsService.getGoodsLabelsByType(type,parentId)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.dao.web.dto.NoticeCardDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Api(tags = "æ¶æ¯éç¥ä¿¡ä¸å¡") |
| | | @Trace(exclude = true) |
| | | @LoginRequired |
| | | //@RestController |
| | | @RestController |
| | | @RequestMapping("/web/notice") |
| | | @Slf4j |
| | | public class NoticeApi extends ApiController{ |
| | |
| | | * @param pageWrap |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "æ¥è¯¢ç¨æ·éç¥", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/findNoticeCardDTOPage") |
| | | public ApiResponse<PageData<NoticeCardDTO>> findNoticeCardDTOPage(@RequestBody PageWrap<Notice> pageWrap){ |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "æ¥è¯¢ç¨æ·éç¥", notes = "å°ç¨åºç«¯") |
| | | @PostMapping("/findNoticeCardDTOPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<PageData<NoticeCardDTO>> findNoticeCardDTOPage(@RequestBody PageWrap<Notice> pageWrap){ |
| | | pageWrap.getModel().setMemberId(this.getMemberId()); |
| | | return ApiResponse.success(noticeService.findNoticeCardDTOPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | goodsOrder.setExchangeCode(Constants.equalsInteger(goodsOrder.getReceiveType(),Constants.ZERO)?null:Constants.getRandomNumber()); |
| | | goodsOrder.setPayMethod(Constants.ZERO); |
| | | goodsorderService.updateById(goodsOrder); |
| | | if(Objects.nonNull(goodsOrder.getPickUpShopId())){ |
| | | //åéç«å
ä¿¡ - ç»éå |
| | | noticeService.orderPayNotice(goodsOrder.getPickUpShopId(),goodsOrder.getId(),goodsOrder.getReceiveType()); |
| | | } |
| | | Fund fund = new Fund(); |
| | | fund.setOrderCode(goodsOrder.getPayOrderId()); |
| | | fund.setCreator(goodsOrder.getMemberId()); |