Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
| | |
| | | "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", |
| | | "dev": true |
| | | }, |
| | | "dayjs": { |
| | | "version": "1.11.13", |
| | | "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", |
| | | "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" |
| | | }, |
| | | "de-indent": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", |
| | |
| | | "@wangeditor/editor-for-vue": "^1.0.2", |
| | | "axios": "^0.21.1", |
| | | "core-js": "^3.6.5", |
| | | "dayjs": "^1.11.13", |
| | | "echarts": "^5.4.2", |
| | | "ele-calendar": "^2.0.0", |
| | | "element-ui": "^2.15.13", |
| | |
| | | trim: true |
| | | }) |
| | | } |
| | | export function comboUpdatePost(data) { |
| | | return request.post('/business/discount/updStatus', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | export function comboDelPost(id) { |
| | | return request.get(`/business/discount/delete/${id}`) |
| | | } |
| | | export function comboListPost(data) { |
| | | return request.post('/business/discount/page', data, { |
| | | trim: true |
| | |
| | | download: true |
| | | }) |
| | | } |
| | | |
| | | export function comboSalePage(data) { |
| | | return request.post('/business/discountMember/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function comboSaleEx(data) { |
| | | return request.post('/business/discountMember/exportExcel', data, { |
| | | trim: true, |
| | | download: true |
| | | }) |
| | | } |
| | | export function comboSaleAdjust(data) { |
| | | return request.post('/business/discountMember/adjust', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function comboSaleCancel(data) { |
| | | return request.post('/business/discountMember/cancel', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function comboSalerDetailPost(id) { |
| | | return request.get('/business/discountMember/' + id) |
| | | } |
| | | export function discountLogLog(data) { |
| | | return request.post('/business/discountLog/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | |
| | | <script> |
| | | import Pagination from '@/components/common/Pagination' |
| | | import Pagination from '@/components/common/Paginations' |
| | | import QueryForm from '@/components/common/QueryForm' |
| | | export default { |
| | | name: 'BasePageTemp', |
| | |
| | | this.filters = {} |
| | | this.pagination.pageSize = 10 |
| | | this.pagination.page = 1 |
| | | console.log('-----'); |
| | | |
| | | this.getList() |
| | | }, |
| | | handleSizeChange(capacity) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="table-pagination"> |
| | | <el-pagination |
| | | :current-page="pagination.page" |
| | | :page-sizes="pagination.pageSizes||[10, 20, 30, 40]" |
| | | :page-size="pagination.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="pagination.total" |
| | | @size-change="sizeChange" |
| | | @current-change="currentChange" |
| | | background> |
| | | </el-pagination> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'Pagination', |
| | | props: { |
| | | pagination: { |
| | | type: Object, |
| | | default: function () { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | } |
| | | }, |
| | | methods: { |
| | | sizeChange (value) { |
| | | this.$emit('size-change', value) |
| | | }, |
| | | currentChange (value) { |
| | | this.$emit('current-change', value) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaRepairDealWindow from '@/components/business/OperaRepairDealWindow' |
| | | import RepairDetailWindow from '@/components/business/RepairDetailWindow' |
| | | import { formatDateTime } from '@/utils/util' |
| | | import dayjs from 'dayjs' |
| | | import { getFileList } from '@/api/business/bikeRepair' |
| | | export default { |
| | | name: 'BikeRepair', |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | // this.searchForm.startDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 00:00:00' |
| | | this.searchForm.startDate = dayjs().format('YYYY-MM-DD') + ' 00:00:00' |
| | | this.searchForm.endDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59' |
| | | this.search() |
| | | }, |
| | | methods: { |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { formatDateTime } from '@/utils/util' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | name: 'MemberRides', |
| | | extends: BaseTable, |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | // this.searchForm.startDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 00:00:00' |
| | | // this.searchForm.endDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 23:59:59' |
| | | this.searchForm.startDate = dayjs().format('YYYY-MM-DD') + ' 00:00:00' |
| | | this.searchForm.endDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59' |
| | | this.search() |
| | | }, |
| | | methods: { |
| | |
| | | import GoodsOrderDetail from '@/components/business/goodsOrderDetail' |
| | | import BackGoodsorderWindow from '@/components/business/backGoodsorderWindow' |
| | | import { getDetail, getGoodsorderCanBanlanceDTO, closerGoodsorder } from '@/api/business/goodsorder' |
| | | import { formatDateTime } from '@/utils/util' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | name: 'Goodsorder', |
| | | extends: BaseTable, |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | // this.searchForm.startDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 00:00:00' |
| | | this.searchForm.startDate = dayjs().format('YYYY-MM-DD') + ' 00:00:00' |
| | | this.searchForm.endDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59' |
| | | this.search() |
| | | }, |
| | | methods: { |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { formatDateTime } from '@/utils/util' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | name: 'MemberRides', |
| | | extends: BaseTable, |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.searchForm.startDate = dayjs().format('YYYY-MM-DD') + ' 00:00:00' |
| | | this.searchForm.endDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59' |
| | | // this.searchForm.startDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 00:00:00' |
| | | // this.searchForm.endDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 23:59:59' |
| | | this.search() |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import { fetchList } from '@/api/business/onlinePayStatistics' |
| | | import { formatDateTime } from '@/utils/util' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | name: 'PricingParam', |
| | | extends: BaseTable, |
| | |
| | | } |
| | | }, |
| | | created () { |
| | | // this.searchForm.startDate = formatDateTime(new Date(), 'yyyy-MM-dd') + ' 00:00:00' |
| | | this.searchForm.startDate = dayjs().format('YYYY-MM-DD') + ' 00:00:00' |
| | | this.searchForm.endDate = dayjs().format('YYYY-MM-DD') + ' 23:59:59' |
| | | this.search() |
| | | }, |
| | | methods: { |
| | |
| | | <span class="title">{{ detail.name }}</span> |
| | | <span class="status">{{ detail.status == '0' ? 'å·²å¯ç¨' : 'ç¦ç¨' }}</span> |
| | | </div> |
| | | <div class="placeholder9 mt10">æ¯æ¥éå®ééï¼{{ detail.saleDayLimit }}</div> |
| | | <div class="placeholder9 mt10">æ¯æ¥éå®ééï¼{{ detail.saleDayLimit || 'ä¸éé¢' }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <div class="item"> |
| | | <div class="key">æ»åæ¾æ°é</div> |
| | | <div class="value">{{ detail.saleLimit || 'ä¸éé¢' }}</div> |
| | | <div class="value">{{ detail.saleLimit || '-' }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="key">å·²é宿°é</div> |
| | |
| | | <div class="item"> |
| | | <div class="key">å©ä½æ°é</div> |
| | | <div v-if="detail.saleLimit" class="value">{{ detail.saleLimit - detail.saleNum }}</div> |
| | | <div v-else class="value">ä¸éé¢</div> |
| | | <div v-else class="value">-</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="createTime_wrap"> |
| | | <span class="item">å建æ¶é´ï¼{{ detail.createDate }}</span> |
| | | <span class="item">å建人ï¼{{ detail.creator }}</span> |
| | | <span class="item">å建人ï¼{{ detail.creatorName }}</span> |
| | | <span class="item">æåæ´æ°æ¶é´ï¼{{ detail.editDate }}</span> |
| | | <span class="item">æ´æ°äººï¼{{ detail.editor }}</span> |
| | | <span class="item">æ´æ°äººï¼{{ detail.editorName }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="separate" /> |
| | |
| | | <div class="line"> |
| | | <div class="key">å¥é¤ç®ä»ï¼</div> |
| | | <div class="value"> |
| | | <div>{{ detail.desc }}</div> |
| | | <div>{{ detail.descs }}</div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <div class="line"> |
| | | <div class="key">ä½¿ç¨æ¶é´ï¼</div> |
| | | <div class="value" v-if="detail.useType == 0">{{ detail.useStartDate }} è³ {{ detail.useEndDate }}</div> |
| | | <div class="value" v-if="detail.useType == 1">è´ä¹°å{{ detail.useDays }}天å
ææ</div> |
| | | <div class="value" v-if="detail.useType == 2">èª{{ detail.useStartDate }} å {{ detail.useDays }}天å
ææ</div> |
| | | <div class="value" v-if="detail.useType == 0">{{ detail.useStartDate }} è³ {{ detail.useEndDate }}å
ææ</div> |
| | | <div class="value" v-if="detail.useType == 1">è´ä¹°åç«å³çæï¼æææ{{ detail.useDays }}天</div> |
| | | <div class="value" v-if="detail.useType == 2">èª{{ detail.useStartDate }}èµ·{{ detail.useDays }}天å
ææ</div> |
| | | </div> |
| | | <div class="line"> |
| | | <div class="key">éç¨èå´ï¼</div> |
| | | <div class="value">{{ detail.useWorkday == 1 && '工使¥' }} {{ detail.useWorkday && detail.useHoliday && '|' }} {{ detail.useHoliday == 1 && 'è忥' }}</div> |
| | | <div class="value">{{ detail.useWorkday == 1 ? '工使¥' : ''}} {{ detail.useWorkday && detail.useHoliday ? '|' : '' }} {{ detail.useHoliday == 1 ? 'è忥' : '' }}</div> |
| | | </div> |
| | | <div class="line"> |
| | | <div class="key">éç¨é¡¹ç®ï¼</div> |
| | | <div class="value">{{ detail.isbike == 1 && 'èªè¡è½¦' }} {{ detail.isbike && detail.iselecbike && '|' }} {{ detail.iselecbike == 1 && 'çµå¨è½¦' }}</div> |
| | | <div class="value">{{ detail.isbike == 1 ? 'èªè¡è½¦' : '' }} {{ detail.isbike && detail.iselecbike ? '|' : '' }} {{ detail.iselecbike == 1 ? 'çµå¨è½¦' :'' }}</div> |
| | | |
| | | </div> |
| | | <div class="line"> |
| | | <div class="key">æ»éé¢ï¼</div> |
| | | <div class="value">{{ detail.saleLimit || 'ä¸éå¶' }}</div> |
| | | <div class="value">{{ detail.saleLimit || 'ä¸éé¢' }}</div> |
| | | </div> |
| | | <div class="line"> |
| | | <div class="key">æ¯æ¥éé¢ï¼</div> |
| | |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="æ»éé¢"> |
| | | <el-input class="w400" v-model="param.saleLimit" oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 12)" |
| | | <el-input class="w400" v-model="param.saleLimit" oninput="value=value.replace(/^(-1+)|[^\d]+/g, '').slice(0, 12)" |
| | | placeholder="请è¾å
¥æ»å宿°é" v-trim /> |
| | | <div class="placeholder9">请è¾å
¥æ»å宿°éï¼éé大äºè¯¥æ°éåï¼ä¸åæ¯æéå®ï¼ä¸ºç©ºè¡¨ç¤ºä¸éå¶</div> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥éé¢"> |
| | | <el-input class="w400" v-model="param.saleDayLimit" |
| | | oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 12)" placeholder="请è¾å
¥åæ¥å宿°é" v-trim /> |
| | | oninput="value=value.replace(/^(-1+)|[^\d]+/g, '').slice(0, 12)" placeholder="请è¾å
¥åæ¥å宿°é" v-trim /> |
| | | <div class="placeholder9">请è¾å
¥æ¥å宿°éï¼å½æ¥éé大äºè¯¥æ°éåï¼ä¸åæ¯æéå®ï¼ä¸ºç©ºè¡¨ç¤ºä¸éå¶</div> |
| | | </el-form-item> |
| | | |
| | |
| | | comboDetailPost(id).then(res => { |
| | | this.param = res |
| | | this.$set(this.param, 'saleDate', [res.startDate, res.endDate]) |
| | | if (res.useStartDate && res.useEndDate) { |
| | | if (res.useStartDate && res.useEndDate && res.type != 0) { |
| | | this.$set(this.param, 'useDate', [res.useStartDate, res.useEndDate]) |
| | | } |
| | | this.$set(this.param, id, type == 'copy' ? null : this.param.id) |
| | | this.$set(this.param, 'id', type == 'copy' ? null : this.param.id) |
| | | }) |
| | | }, |
| | | } |
| | |
| | | <template> |
| | | <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking"> |
| | | <div class="title">æ¯ä»æç»</div> |
| | | <el-table :data="list" stripe border> |
| | | <el-table-column prop="id" label="订åç¼å·" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column prop="onlineorderId" label="交æåå·" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column prop="refundType" label="交æç±»å" width="100px" align="center"> |
| | | <GlobalWindow :title="title" width="1100px" :visible.sync="visible" :confirm-working="isWorking"> |
| | | <div class="title">订åä¿¡æ¯</div> |
| | | <div class="info_warp"> |
| | | <div class="item"> |
| | | <div class="la">订åç¼å·ï¼</div> |
| | | <div class="val">{{ info.id }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">订åç¶æï¼</div> |
| | | <div class="val">{{ info.status == 1 ? 'å·²æ¯ä»' : 'æªæ¯ä»' }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">ä¸åæ¶é´ï¼</div> |
| | | <div class="val">{{ info.createDate }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">æ¯ä»æ¶é´ï¼</div> |
| | | <div class="val">{{ info.payDate }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">订åéé¢ï¼</div> |
| | | <div class="val">{{ info.money }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">æ¯ä»æ¹å¼ï¼</div> |
| | | <div class="val">{{ info.payWay == 0 ? '微信' : 'æ¯ä»å®' }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">æ¯ä»åå·ï¼</div> |
| | | <div class="val">{{ info.onlineOrderid }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">宿æ¶é´ï¼</div> |
| | | <div class="val">{{ info.payDate }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">夿³¨ï¼</div> |
| | | <div class="val">{{ info.closeInfo }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="title">ä¹°å®¶ä¿¡æ¯</div> |
| | | <div class="info_warp"> |
| | | <div class="item"> |
| | | <div class="la">å¢ç§°ï¼</div> |
| | | <div class="val">{{ form.member.name }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">ææºå·ï¼</div> |
| | | <div class="val">{{ form.member.phone }}</div> |
| | | </div> |
| | | <div class="item"> |
| | | <div class="la">openIdï¼</div> |
| | | <div class="val">{{ form.member.openid }}</div> |
| | | </div> |
| | | </div> |
| | | <div class="title">ååä¿¡æ¯</div> |
| | | <el-table :data="[goods]" stripe border> |
| | | <el-table-column prop="name" min-width="100px" label="å¥é¤å¡" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column prop="refundType" label="æææ" min-width="160px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | {{ typeToStr(row.refundType) }} |
| | | {{ row.useStartDate }} è³ {{ row.useEndDate }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="money" label="交æéé¢(å
)" width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="payWay" label="æ¸ é" width="100px" align="center"> |
| | | <el-table-column label="æ°é" width="80px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.payWay==0? '微信' : 'æ¯ä»å®' }} |
| | | <span>1</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="payDate" label="äº¤ææ¶é´" width="150px" align="center"></el-table-column> |
| | | |
| | | <el-table-column prop="price" label="ä»·æ ¼" width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="payWay" label="ç¶æ" width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | {{ info.status == 1 ? 'å·²æ¯ä»' : 'æªæ¯ä»' }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="title">éªè¡è®°å½</div> |
| | | <el-table |
| | | :data="memberRidesList" |
| | | stripe |
| | | border |
| | | > |
| | | <el-table-column prop="openid" label="ç¨æ·" width="250px" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column prop="bikeCode" label="车è¾ç¼å·" width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="bikeType" label="车类å" width="200px" align="center"></el-table-column> |
| | | <el-table-column prop="rideTime" label="ååºæ¶é¿(å)" width="200px" align="center"></el-table-column> |
| | | <el-table-column prop="duration" label="计费æ¶é¿(å)" width="200px" align="center"></el-table-column> |
| | | <el-table-column prop="bikeType" label="车类å" width="150px" align="center"></el-table-column> |
| | | <el-table-column prop="rentDate" label="ååºæ¶é´" width="150px" align="center"></el-table-column> |
| | | <el-table-column prop="backDate" label="è¿è½¦æ¶é´" width="150px" align="center"></el-table-column> |
| | | <el-table-column prop="closeStatus" fixed="right" label="ç»ç®ç¶æ" width="100px" align="center"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.closeStatus == 0 ? 'æªç»ç®' : 'å·²ç»ç®' }} |
| | | <div v-if="form.refundList && form.refundList.length > 0" class="title">鿬¾ä¿¡æ¯</div> |
| | | <el-table v-if="form.refundList && form.refundList.length > 0" :data="form.refundList" stripe border> |
| | | <el-table-column prop="createDate" label="鿬¾æ¶é´" min-width="180px" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column prop="money" label="鿬¾éé¢" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column label="ç¶æ" min-width="100px" align="center"> |
| | | <template v-slot="{row}"> |
| | | <span v-if="row.status == 0">é¢é款</span> |
| | | <span v-if="row.status == 1">鿬¾å¤±è´¥</span> |
| | | <span v-if="row.status == 2">鿬¾å®æ</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="reason" label="鿬¾å¤æ³¨" min-width="100px" align="center"></el-table-column> |
| | | <el-table-column prop="creatorName" label="æä½äºº" min-width="100px" align="center"></el-table-column> |
| | | </el-table> |
| | | <div slot="footer"> |
| | | <el-button @click="visible=false">è¿å</el-button> |
| | |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | goodsorderId: '' |
| | | member: {} |
| | | }, |
| | | info: {}, |
| | | goods: {}, |
| | | list: [], |
| | | memberRidesList: [], |
| | | // 0ç»ç®é款 1强å¶ç»ç®é款 2ç»ç®å鿬¾ [99: èætype æ¯ä»æ¼é] |
| | |
| | | this.title = title |
| | | this.visible = true |
| | | // æ°å»º |
| | | console.log('target', target) |
| | | |
| | | this.form = target |
| | | this.info = target.goodsOrder |
| | | this.goods = target.discountMember |
| | | this.$nextTick(() => { |
| | | this.list = target.payOrderDTOList |
| | | this.memberRidesList = target.memberRidesList |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style scoped lang="scss"> |
| | | .info_warp { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | font-size: 14px; |
| | | |
| | | .item { |
| | | display: flex; |
| | | width: 33.3%; |
| | | margin-bottom: 6px; |
| | | |
| | | .val { |
| | | color: #666666; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .title { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | |
| | | comboReDetailPost({ orderId: id }).then(res => { |
| | | if (res) { |
| | | this.form = res |
| | | this.form.backType = 0 |
| | | // this.form.backType = 0 |
| | | this.$set(this.form, 'backType', 0) |
| | | this.form.orderId = id |
| | | } |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow title="å¥é¤å¡è¯¦æ
" :visible.sync="isShowModal" width="1000px" @close="close" @confirm="close"> |
| | | <div> |
| | | <div class="modal_title">å¥é¤åç§°ï¼{{ detail.name }}</div> |
| | | <div class="place"> |
| | | <span>å¥é¤å·ï¼{{ detail.code }}</span> |
| | | <span v-if="detail.useType == 1">æææï¼{{ detail.useStartDate }}è³{{ detail.useEndDate }}</span> |
| | | <span v-if="detail.useType == 0">æææï¼{{ detail.useStartDate }}è³{{ detail.useEndDate }}</span> |
| | | <span v-if="detail.useType == 2">æææï¼{{ detail.useStartDate }}è³{{ detail.useEndDate }}</span> |
| | | </div> |
| | | <div class="df_ac"> |
| | | <el-tabs style="flex: 1;" v-model="activeTab" @tab-click="handleClick"> |
| | | <el-tab-pane label="å¥é¤ä½¿ç¨æç»" name="0" /> |
| | | <el-tab-pane label="å¥é¤æä½è®°å½" name="2" /> |
| | | </el-tabs> |
| | | <div style="border-bottom: 2px solid #e5e7ec; margin-top: 1px;">{{ activeTab == 0 ? 'ä½¿ç¨æ
åµ' : 'æä½æ
åµ' }}ï¼{{ pagination.total }}次</div> |
| | | </div> |
| | | <el-table v-if="activeTab == 0" v-loading="loading" :data="list" stripe border> |
| | | <el-table-column prop="createDate" align="center" label="ä½¿ç¨æ¶é´" min-width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="goodsorderId" align="center" label="å
³è订å" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="" align="center" label="éªè½¦æ¶é¿" min-width="80" show-overflow-tooltip> |
| | | <template v-slot="{ row }"> |
| | | {{ row.rideTime }}åé |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="ridePrice" align="center" label="æµæ£éé¢" min-width="100" show-overflow-tooltip /> |
| | | </el-table> |
| | | <el-table v-if="activeTab == 2" v-loading="loading" :data="list" stripe border> |
| | | <el-table-column prop="createDate" align="center" label="æä½æ¶é´" min-width="120" show-overflow-tooltip /> |
| | | <el-table-column prop="info" align="center" label="æä½ç±»å" min-width="100" show-overflow-tooltip> |
| | | <template v-slot="{ row }"> |
| | | <span v-if="row.type == 0">ç¨æ·éªè¡ä½¿ç¨</span> |
| | | <span v-if="row.type == 1">å¥é¤ä½åº</span> |
| | | <span v-if="row.type == 2">å¥é¤è°æ´</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="editInfo" align="center" label="æä½å¤æ³¨" min-width="200" show-overflow-tooltip /> |
| | | <el-table-column prop="creatorName" align="center" label="æä½äºº" min-width="80" show-overflow-tooltip /> |
| | | </el-table> |
| | | <div class="table_btns"> |
| | | <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> |
| | | </div> |
| | | </div> |
| | | </GlobalWindow> |
| | | </template> |
| | | <script> |
| | | import { comboSalerDetailPost, discountLogLog } from '@/api/business/combo.js' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import BasePageTemp from '@/components/base/BasePageTemp' |
| | | export default { |
| | | name: 'ComboDetail', |
| | | extends: BasePageTemp, |
| | | components: { |
| | | GlobalWindow |
| | | }, |
| | | data() { |
| | | return { |
| | | isShowModal: false, |
| | | activeTab: '0', |
| | | detail: {}, |
| | | pagination: { |
| | | page: 1, |
| | | rows: 10 |
| | | }, |
| | | totalCount: 0, |
| | | list: [], |
| | | loading: false |
| | | } |
| | | }, |
| | | created() { |
| | | // this.detail = this.$route.query |
| | | // this.comboDetail() |
| | | }, |
| | | methods: { |
| | | getDetail(row) { |
| | | comboSalerDetailPost(row.id).then(res => { |
| | | this.detail = res |
| | | this.activeTab = '0' |
| | | this.getList() |
| | | }, () => { |
| | | |
| | | }) |
| | | }, |
| | | handleClick(val) { |
| | | this.getList() |
| | | }, |
| | | getList(page) { |
| | | const { pagination, activeTab, detail } = this |
| | | this.loading = true |
| | | if (page) { pagination.page = page } |
| | | discountLogLog({ |
| | | model: { |
| | | type: activeTab, |
| | | discountMemberId: detail.id |
| | | }, |
| | | capacity: pagination.pageSize, |
| | | page: pagination.page, |
| | | }).then(res => { |
| | | this.loading = false |
| | | this.list = res.records || [] |
| | | this.pagination.total = res.total || 0 |
| | | }, () => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | close() { |
| | | this.isShowModal = false |
| | | this.$emit('close') |
| | | }, |
| | | currentPageChange(val) { |
| | | this.pagination.page = val |
| | | this.comboDetail() |
| | | }, |
| | | pageSizeChange(val) { |
| | | this.pagination.rows = val |
| | | this.comboDetail() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .modal_title { |
| | | font-size: 18px; |
| | | font-weight: 500; |
| | | margin-bottom: 6px; |
| | | } |
| | | |
| | | .place { |
| | | color: #999999; |
| | | font-size: 13px; |
| | | display: flex; |
| | | margin-bottom: 8px; |
| | | |
| | | span { |
| | | margin-right: 60px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <div> |
| | | <span v-if="row.status == 0" @click="handleEdit(row, 'copy')" class="primaryColor pointer">å¤å¶</span> |
| | | <span v-if="row.status == 1" @click="handleEdit(row)" class="primaryColor pointer mr10">ç¼è¾</span> |
| | | <span v-if="row.status == 1" @click="handleDetail(row)" class="red pointer">å é¤</span> |
| | | <span v-if="row.status == 1" @click="handleDel(row)" class="red pointer">å é¤</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Edit from './components/Edit' |
| | | import ComboDetail from './components/ComboDetail.vue' |
| | | import { comboListPost, comboEditPost } from '@/api/business/combo.js' |
| | | import { comboListPost, comboUpdatePost, comboDelPost } from '@/api/business/combo.js' |
| | | import { Message } from 'element-ui' |
| | | export default { |
| | | extends: BasePageTemp, |
| | |
| | | }) |
| | | }, |
| | | changeStatus(row) { |
| | | comboEditPost({ ...row }).then(res => { |
| | | comboUpdatePost({ ...row }).then(res => { |
| | | if (res.code == 200) { |
| | | return Message.success('æ´æ°æå') |
| | | } |
| | | }) |
| | | }, |
| | | handleDel(row) { |
| | | this.$confirm('æ¨ç¡®è®¤è¦å é¤å½åå¥é¤åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | comboDelPost(row.id).then(res => { |
| | | if (res) { |
| | | Message.success('å 餿å') |
| | | this.getList() |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | handleEdit(row, type = 'edit') { |
| | | this.isShowEdit = true |
| | | this.$nextTick(() => { |
| | |
| | | <el-button type="primary" @click="handleEx()">导åº</el-button> |
| | | </div> |
| | | <el-table v-loading="loading" :data="list" stripe border> |
| | | <el-table-column prop="code" align="center" label="订åç¼å·" min-width="180" show-overflow-tooltip> |
| | | <el-table-column prop="code" align="center" label="订åç¼å·" min-width="200" show-overflow-tooltip> |
| | | <template scope="{row}"> |
| | | <span @click="handleDetail(row.id)" class="primaryColor pointer">{{ row.code }}</span> |
| | | </template> |
| | |
| | | <el-table-column prop="money" align="center" label="å计(å
)" min-width="80" show-overflow-tooltip /> |
| | | <el-table-column prop="money" align="center" label="å®ä»(å
)" min-width="80" show-overflow-tooltip /> |
| | | <el-table-column prop="refundMoney" align="center" label="å·²ééé¢(å
)" min-width="100" show-overflow-tooltip /> |
| | | <el-table-column prop="memberId" align="center" label="ç¨æ·ä¿¡æ¯" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="openid" align="center" label="ç¨æ·ä¿¡æ¯" min-width="200" show-overflow-tooltip /> |
| | | <el-table-column prop="payWay" align="center" label="æ¯ä»æ¹å¼" min-width="80" show-overflow-tooltip> |
| | | <template v-slot="{ row }"> |
| | | <span v-if="row.payWay == 0">微信æ¯ä»</span> |
| | |
| | | <span>å°ç¨åºç«¯</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="payWay" align="center" label="订åç¶æ" min-width="80" show-overflow-tooltip> |
| | | <template v-slot="{ row }"> |
| | | <span v-if="row.status == 0">æªæ¯ä»</span> |
| | | <span v-if="row.status == 1">å·²æ¯ä»</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="refundUserName" align="center" label="æä½äºº" min-width="80" show-overflow-tooltip /> |
| | | <el-table-column prop="createDate" align="center" label="å建æ¶é´" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column label="æä½" fixed="right" align="center" min-width="80" show-overflow-tooltip> |
| | | <el-table-column prop="createDate" align="center" label="å建æ¶é´" min-width="160" show-overflow-tooltip /> |
| | | <el-table-column label="æä½" fixed="right" align="center" min-width="120" show-overflow-tooltip> |
| | | <template v-slot="{ row }"> |
| | | <span @click="handleDetail(row.id)" class="primaryColor pointer">æ¥ç详æ
</span> |
| | | <span v-if="row.status == 1 && (row.refundMoney < row.money)" @click="handRefund(row.id)" class="primaryColor pointer ml10">鿬¾</span> |
| | | <span v-if="row.status == 1 && (row.refundMoney < row.money)" @click="handRefund(row.id)" |
| | | class="primaryColor pointer ml10">鿬¾</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | comboListOrderEx, |
| | | comboOrderDetailPost |
| | | } from '@/api/business/combo.js' |
| | | import dayjs from 'dayjs' |
| | | export default { |
| | | extends: BasePageTemp, |
| | | components: { |
| | |
| | | label: '订åç¼å·', |
| | | }, |
| | | { |
| | | filed: 'name', |
| | | filed: 'discountName', |
| | | type: 'input', |
| | | label: 'å¥é¤å¡', |
| | | placeholder: '请è¾å
¥å¡åç§°', |
| | | }, |
| | | { |
| | | filed: 'pay', |
| | | filed: 'payWay', |
| | | type: 'select', |
| | | label: 'æ¯ä»æ¹å¼', |
| | | options: [] |
| | | options: [ |
| | | { label: '微信', value: 0 }, |
| | | { label: 'æ¯ä»å®', value: 1 }, |
| | | ] |
| | | }, |
| | | { |
| | | filed: 'status', |
| | | filed: 'payStatus', |
| | | type: 'select', |
| | | label: '订åç¶æ', |
| | | options: [ |
| | |
| | | ] |
| | | }, |
| | | { |
| | | filed: 'time', |
| | | type: 'date', |
| | | filed: 'selDate', |
| | | type: 'daterange', |
| | | label: 'æ¯ä»æ¶é´', |
| | | }, |
| | | { |
| | | filed: 'username', |
| | | filed: 'openid', |
| | | type: 'input', |
| | | label: 'ç¨æ·ä¿¡æ¯', |
| | | }, |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | let date = dayjs().format('YYYY-MM-DD') |
| | | this.$set(this.filters, 'selDate', [date, date]) |
| | | this.getList() |
| | | // this.initData() |
| | | }, |
| | |
| | | handleDetail(id) { |
| | | comboOrderDetailPost({id}) |
| | | .then(res => { |
| | | if (res) { |
| | | this.$refs.OrderDetailRef.open('订å详æ
', res) |
| | | } |
| | | |
| | | }) |
| | | .catch(err => { |
| | | this.$tip.apiFailed(err) |
| | | }) |
| | | }, |
| | | handleEx() { |
| | | const { pagination, filters } = this |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | this.loading = true |
| | | if (filters.selDate && filters.selDate.length > 0) { |
| | | filters.startDate = filters.selDate[0] + ' 00:00:00' |
| | | filters.endDate = filters.selDate[1] + ' 00:00:00' |
| | | } else { |
| | | filters.startDate = null |
| | | filters.endDate = null |
| | | } |
| | | comboListOrderEx({ |
| | | page: 1, |
| | | capacity: 1000000, |
| | | model: this.filters |
| | | model: { |
| | | ...filters, |
| | | type: 1 |
| | | }, |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | |
| | | getList(page) { |
| | | const { pagination, filters } = this |
| | | this.loading = true |
| | | if (filters.selDate && filters.selDate.length > 0) { |
| | | filters.startDate = filters.selDate[0] + ' 00:00:00' |
| | | filters.endDate = filters.selDate[1] + ' 00:00:00' |
| | | } else { |
| | | filters.startDate = null |
| | | filters.endDate = null |
| | | } |
| | | if (page) { pagination.page = page } |
| | | comboOrderPost({ |
| | | model: { |
| | |
| | | <template> |
| | | <div class="main_app"> |
| | | <Breadcrumb /> |
| | | <QueryForm v-model="querys" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clearQueryForm"> |
| | | <template #btns> |
| | | <el-button v-if="meta.indexOf('MealsUseDetailExport') > -1" type="primary" |
| | | @click="comboRecordExport">导åº</el-button> |
| | | </template> |
| | | <template #indate> |
| | | <el-date-picker v-model="querys.indate" type="datetimerange" range-separator="è³" start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" class="w400" |
| | | :picker-options="pickerOptions" /> |
| | | </template> |
| | | <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clearQueryForm"> |
| | | </QueryForm> |
| | | <div class="table_btns"> |
| | | <el-button v-preventReClick plain type="primary" @click="handleEx">导åº</el-button> |
| | | <el-button v-preventReClick plain type="danger" @click="openModal('zuofei')">ä½åº</el-button> |
| | | <el-button v-preventReClick plain @click="openModal('tiaozheng')">å¥é¤è°æ´</el-button> |
| | | <el-button plain type="primary" @click="handleEx">导åº</el-button> |
| | | <el-button plain type="danger" @click="openModal('zuofei')">ä½åº</el-button> |
| | | <el-button plain @click="openModal('tiaozheng')">å¥é¤è°æ´</el-button> |
| | | </div> |
| | | <el-table v-loading="loading" :data="list" stripe border @selection-change="handleSelectionChange"> |
| | | <el-table-column fixed="left" align="center" type="selection" :selectable="handleDisable" width="55" /> |
| | | <el-table-column align="center" label="å¥é¤ç¥¨å·" width="300" show-overflow-tooltip> |
| | | <el-table-column align="center" label="å¥é¤ç¥¨å·" min-width="160" show-overflow-tooltip> |
| | | <template v-slot="scope"> |
| | | <span class="primaryColor pointer" @click="comboDetail(scope.row)">{{ |
| | | scope.row.id |
| | | scope.row.code |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="å¥é¤ç±»å" width="120"> |
| | | <el-table-column align="center" label="å¥é¤ç±»å" min-width="80"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.mealsType === '0'">é¨ç¥¨æ¬¡å¡</span> |
| | | <span v-if="scope.row.mealsType === '1'">é¨ç¥¨æéå¡</span> |
| | | <span v-if="scope.row.mealsType === '2'">é¢å®æ¬¡å¡</span> |
| | | <span v-if="scope.row.mealsType === '3'">课ç¨é¢çº¦æ¬¡å¡</span> |
| | | <span v-if="scope.row.mealsType === '4'">è¯¾ç¨æéå¡</span> |
| | | <span v-if="scope.row.type == '0'">æéå¡</span> |
| | | <span v-if="scope.row.type == '1'">次å¡</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="å¥é¤åç§°" show-overflow-tooltip width="160" prop="mealsName" /> |
| | | <el-table-column align="center" label="ç¨æ·ä¿¡æ¯" min-width="240" prop="memberInfo" show-overflow-tooltip /> |
| | | <el-table-column align="center" label="ä½¿ç¨æ¬¡æ°" width="80" prop="useCount"> |
| | | <el-table-column align="center" label="å¥é¤åç§°" show-overflow-tooltip min-width="100" prop="name" /> |
| | | <el-table-column align="center" label="ç¨æ·ä¿¡æ¯" min-width="100" prop="openid" show-overflow-tooltip /> |
| | | <el-table-column align="center" label="ä½¿ç¨æ¬¡æ°" min-width="80" prop="useTimes"> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æææ¥æ" min-width="200" prop="remainCount"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.mealsType === '1'">-</span> |
| | | <span v-else>{{ scope.row.useCount }}</span> |
| | | <span>{{ scope.row.useStartDate }}è³{{ scope.row.useEndDate }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æææ¥æ" width="80" prop="remainCount"> |
| | | <el-table-column align="center" label="å¥é¤ç¶æ" min-width="80"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.mealsType === '1'">-</span> |
| | | <span v-else>{{ scope.row.remainCount }}</span> |
| | | <span v-if="scope.row.status == '0'" class="text_success">æ£å¸¸</span> |
| | | <span v-if="scope.row.status == '1'" class="text_warning">ä½åº</span> |
| | | <span v-if="scope.row.status == '2'" class="text-danger">å¾
æ¯ä»</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" align="center" label="å¥é¤ç¶æ" width="80"> |
| | | <template v-slot="scope"> |
| | | <span v-if="scope.row.status === '0'" class="text_success">æ£å¸¸</span> |
| | | <span v-if="scope.row.status === '1'" class="text_warning">å»ç»</span> |
| | | <span v-if="scope.row.status === '2'" class="text-danger">ä½åº</span> |
| | | <span v-if="scope.row.status === '3'" class="text-danger">失æ</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="æææ¥æ" width="120" prop="validTime" /> |
| | | <el-table-column align="center" label="æä½" fixed="right" width="150"> |
| | | <el-table-column align="center" label="æä½" fixed="right" min-width="150"> |
| | | <template v-slot="scope"> |
| | | <template> |
| | | <el-button v-if=" |
| | | meta.indexOf('MealsMemberPartRefund') > -1 && |
| | | (scope.row.status == '0' || scope.row.status == '1') |
| | | " type="text" @click="rowClickRefund(scope.row)">鿬¾</el-button> |
| | | <el-button v-if="scope.row.status == '0'" type="text" |
| | | @click="getServiceChargePriceBtn('2', scope.row.id)">å»ç»</el-button> |
| | | <el-button v-if="scope.row.status == '0'" type="text" @click="openCan(scope.row)">ä½åº</el-button> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-dialog title="å¥é¤è°æ´" :visible.sync="isShowAdjust" width="500px"> |
| | | <div class="adjust_modal"> |
| | | <div style="margin-top: -30px; margin-bottom: 10px;"> |
| | | <el-radio v-model="adjustData.aa" label="1">å·²éå½å2æ¡æ°æ®</el-radio> |
| | | <el-radio v-model="adjustData.flag" label="0">å·²é{{ selList.length }}æ¡æ°æ®</el-radio> |
| | | </div> |
| | | <div style="margin-bottom: 16px;"> |
| | | <el-radio v-model="adjustData.aa" label="1">å·²éç°æç鿡件ä¸å
¨é¨ç11æ¡æ°æ®</el-radio> |
| | | <el-radio v-model="adjustData.flag" label="1">éç°æç鿡件ä¸å
¨é¨ç{{ pagination.total }}æ¡æ°æ®</el-radio> |
| | | </div> |
| | | <div class="df_ac mb5"> |
| | | <span class="key">æææå¢å ï¼</span> |
| | | <el-input v-model="adjustData.addTime" oninput="value=value.replace(/[^\d]/g,'')" class="flex1 mr10" /> |
| | | <el-input v-model="adjustData.addNum" oninput="value=value.replace(/[^\d]/g,'')" class="flex1 mr10" /> |
| | | <span>天</span> |
| | | </div> |
| | | <div class="df_ac mb20"> |
| | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowAdjust = false">åæ¶</el-button> |
| | | <el-button v-preventReClick type="primary" :loading="subLoading" @click="handleModelEnter">ç¡®å®</el-button> |
| | | <el-button type="primary" :loading="subLoading" @click="handleModelEnter">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="å¥é¤ä½åº" :visible.sync="isShowCan" width="500px"> |
| | | <div class="adjust_modal" style="margin-top: -30px;"> |
| | | <div class="red" style="font-size: 16px;">ç¡®å®ä½åºéä¸å¥é¤åï¼ä½åºåï¼å¥é¤ä¸å¯ä½¿ç¨</div> |
| | | <div class="df_ac mt10"> |
| | | <el-input type="textarea" v-model="remarkCan" placeholder="请æè¦æ±è¾å
¥å¤æ³¨è¯´æï¼éå¿
å¡«" /> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowCan = false">åæ¶</el-button> |
| | | <el-button type="primary" :loading="subLoading" @click="handleCan">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <Refund v-if="isShowRefund" ref="RefundRef" @close="isShowRefund = false" @success="refundSuccess" /> |
| | | <Detail v-if="isShowDetail" ref="detailRef" /> |
| | | <orderDialog ref="child" @orderSuccess="getList()" /> |
| | | <Detail ref="DetailRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { pickerOptions } from './components/config' |
| | | import BasePageTemp from '@/components/base/BasePageTemp' |
| | | import Breadcrumb from '@/layouts/Breadcrumb' |
| | | // import Detail from '../comboDetail' |
| | | // import Refund from './refund.vue' |
| | | import Detail from './components/SaleDetail.vue' |
| | | import { Message } from 'element-ui' |
| | | import { |
| | | comboSalePage, |
| | | comboSaleEx, |
| | | comboSaleCancel, |
| | | comboSaleAdjust, |
| | | } from '@/api/business/combo.js' |
| | | export default { |
| | | name: 'SalesRecord', |
| | | extends: BasePageTemp, |
| | | components: { Breadcrumb }, |
| | | components: { Breadcrumb, Detail }, |
| | | data() { |
| | | return { |
| | | exportLoading: false, |
| | |
| | | isShowRefund: false, |
| | | queryFormConfig: { |
| | | formItems: [{ |
| | | filed: 'id', |
| | | filed: 'code', |
| | | type: 'input', |
| | | label: 'å¥é¤ç¥¨å·', |
| | | placeholder: '请è¾å
¥å¥é¤å·', |
| | | clearable: true |
| | | }, { |
| | | filed: 'mealsName', |
| | | filed: 'name', |
| | | type: 'input', |
| | | label: 'å¥é¤åç§°', |
| | | placeholder: '请è¾å
¥å¥é¤åç§°', |
| | | clearable: true |
| | | }, { |
| | | filed: 'memberSearchValue', |
| | | filed: 'openid', |
| | | type: 'input', |
| | | label: 'ç¨æ·ä¿¡æ¯', |
| | | clearable: true |
| | |
| | | clearable: true, |
| | | options: [ |
| | | { value: '0', label: 'æ£å¸¸' }, |
| | | { value: '1', label: 'å»ç»' }, |
| | | { value: '2', label: 'ä½åº' }, |
| | | { value: '3', label: '失æ' }] |
| | | { value: '1', label: 'ä½åº' }, |
| | | // { value: '2', label: 'å¾
æ¯ä»' } |
| | | ] |
| | | }], |
| | | online: true |
| | | }, |
| | | pickerOptions, |
| | | querys: { |
| | | id: '', |
| | | mealsName: '', |
| | |
| | | |
| | | saleRecordList: [], |
| | | saleRecordTotal: 0, |
| | | selectSalesList: [], |
| | | selList: [], |
| | | saleRecordLoading: false, |
| | | subLoading: false, |
| | | |
| | | isShowModal: false, |
| | | isShowCan: false, |
| | | ModalTitle: '', |
| | | ModalText: '', |
| | | ModelRemark: '', |
| | | remarkCan: '', |
| | | // â¬ï¸adjustè°æ´ç¸å
³ |
| | | isShowAdjust: false, |
| | | isShowCan: false, |
| | | canList: [], |
| | | adjustData: { |
| | | flag: 0, |
| | | addNum: '', |
| | | addTime: '' |
| | | }, |
| | |
| | | }, |
| | | created() { |
| | | // this.meta = this.$route.meta.buttons || [] |
| | | // this.getList(1) |
| | | this.getList(1) |
| | | }, |
| | | methods: { |
| | | rowClickRefund(row) { |
| | |
| | | this.isShowRefund = false |
| | | this.getList() |
| | | }, |
| | | getServiceChargePriceBtn(type, mealsMemberId) { |
| | | this.serviceChargeId = mealsMemberId |
| | | getServiceChargePrice({ |
| | | param: { |
| | | type, |
| | | mealsMemberId |
| | | } |
| | | }).then((res) => { |
| | | if (res.errorCode === '000000') { |
| | | this.serviceChargePrice = res.record.price |
| | | this.openModal('dongjie') |
| | | } |
| | | handleEx() { |
| | | const { pagination, filters } = this |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | this.loading = true |
| | | comboSaleEx({ |
| | | page: 1, |
| | | capacity: 1000000, |
| | | model: filters |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | handleEx() { |
| | | const { querys } = this |
| | | this.exportLoading = true |
| | | recordExport({ |
| | | param: { |
| | | ...querys |
| | | } |
| | | }).then((res) => { |
| | | this.exportLoading = false |
| | | if (res.errorCode === '000000') { |
| | | const a = document.createElement('a') // å建ä¸ä¸ªaæ ç¾å
ç´ |
| | | a.style.display = 'none' // 设置å
ç´ ä¸å¯è§ |
| | | a.href = res.record.showUrl // 设置ä¸è½½å°å |
| | | document.body.appendChild(a) // å å
¥ |
| | | a.click() // 触åç¹å»,ä¸è½½ |
| | | document.body.removeChild(a) // |
| | | this.$message.success('å¯¼åºæå') |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.exportLoading = false |
| | | }) |
| | | openCan(row) { |
| | | this.isShowCan = true |
| | | this.canList = [row] |
| | | }, |
| | | handleDisable(row, index) { |
| | | if (row.status === '2') { |
| | | return false |
| | | } else { |
| | | handleDisable(row) { |
| | | // return row.status == 0 |
| | | return true |
| | | } |
| | | }, |
| | | // æ¥è¯¢è¡¨æ ¼æ°æ® |
| | | getList(page) { |
| | | const { querys, pagination } = this |
| | | if (page) { |
| | | pagination.page = page |
| | | this.pagination.page = Number(page) |
| | | } |
| | | if (querys.indate && querys.indate.length > 0) { |
| | | querys.startTime = querys.indate[0] |
| | | querys.endTime = querys.indate[1] |
| | | } else { |
| | | querys.startTime = null |
| | | querys.endTime = null |
| | | } |
| | | pagination.firstQueryTime = parseTime(new Date()) |
| | | this.saleRecordLoading = true |
| | | comboSalesRecordPost({ |
| | | pagination, param: { |
| | | ...querys, |
| | | venueId: sessionStorage.getItem('venueId') |
| | | } |
| | | const { pagination, filters } = this |
| | | this.loading = true |
| | | if (page) { pagination.page = page } |
| | | comboSalePage({ |
| | | model: { |
| | | ...filters |
| | | }, |
| | | capacity: pagination.pageSize, |
| | | page: pagination.page, |
| | | }).then(res => { |
| | | this.saleRecordLoading = false |
| | | if (res.errorCode === '000000') { |
| | | this.saleRecordLoading = false |
| | | this.saleRecordTotal = res.totalCount |
| | | this.saleRecordList = res.recordList |
| | | if (res.totalCount && res.recordList.length === 0 && pagination.page > 1) { |
| | | this.getList(Math.ceil(res.totalCount / pagination.rows)) |
| | | } |
| | | } |
| | | }).catch(() => { |
| | | this.saleRecordLoading = false |
| | | this.loading = false |
| | | this.list = res.records || [] |
| | | this.pagination.total = res.total || 0 |
| | | }, () => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | clearQueryForm() { |
| | | // eslint-disable-next-line no-unused-vars |
| | | this.querys = {} |
| | | this.filters = {} |
| | | this.getList(1) |
| | | }, |
| | | // æå¼modal å»ç» è§£å» ä½åº |
| | | openModal(type) { |
| | | const { selectSalesList } = this |
| | | const { selList } = this |
| | | this.ModelRemark = '' |
| | | this.adjustData.addNum = '' |
| | | this.adjustData.addTime = '' |
| | | switch (type) { |
| | | case 'dongjie': |
| | | this.ModalTitle = 'å¥é¤å»ç»' |
| | | this.ModalText = 'ç¡®å®å»ç»éä¸å¥é¤åï¼å»ç»åï¼å¥é¤å°æ æ³ä½¿ç¨' |
| | | break |
| | | case 'jiedong': |
| | | this.ModalTitle = 'å¥é¤è§£å»' |
| | | this.ModalText = 'ç¡®å®è§£å»éä¸å¥é¤åï¼è§£å»åï¼å¥é¤å¯ç«å³çæä½¿ç¨' |
| | | break |
| | | case 'zuofei': |
| | | this.ModalTitle = 'å¥é¤ä½åº' |
| | | this.ModalText = 'ç¡®å®ä½åºéä¸å¥é¤åï¼ä½åºåï¼å¥é¤ä¸å¯ä½¿ç¨' |
| | |
| | | default: |
| | | break |
| | | } |
| | | if (selectSalesList.length === 0 && type !== 'dongjie') { |
| | | return this.$message.warning(`请å
éæ©è¦${this.ModalTitle.slice(2)}çå¥é¤`) |
| | | if (selList.length === 0 && type == 'zuofei') { |
| | | return Message.warning(`请å
éæ©è¦${this.ModalTitle.slice(2)}çå¥é¤`) |
| | | } |
| | | if (this.ModalTitle === 'å¥é¤è°æ´') { |
| | | this.isShowAdjust = true |
| | | this.adjustData = { |
| | | flag: '0' |
| | | } |
| | | } else { |
| | | this.isShowModal = true |
| | | this.isShowCan = true |
| | | } |
| | | }, |
| | | // ç¡®å® å»ç» è§£å» ä½åº |
| | | handleModelEnter() { |
| | | // if (!this.ModelRemark) { |
| | | // this.$message.warning('æä½å¤æ³¨å¿
å¡«') |
| | | // return |
| | | // } |
| | | switch (this.ModalTitle) { |
| | | case 'å¥é¤å»ç»': |
| | | this.Freeze() |
| | | break |
| | | case 'å¥é¤è§£å»': |
| | | this.Unfreeze() |
| | | break |
| | | case 'å¥é¤ä½åº': |
| | | this.cancellation() |
| | | break |
| | |
| | | break |
| | | } |
| | | }, |
| | | // å»ç» |
| | | Freeze() { |
| | | const that = this |
| | | const data = { |
| | | type: '1', |
| | | handleRemake: this.ModelRemark, |
| | | isCreateOrder: '1', |
| | | id: this.serviceChargeId |
| | | } |
| | | this.subLoading = true |
| | | handleComboSalesPost({ param: { ...data } }).then(res => { |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | if (res.errorCode === '000000') { |
| | | const obj = res.record |
| | | if (obj && obj.price) { |
| | | obj.goodsInfos = obj.serviceChargeOrderInfo |
| | | obj.allPrice = obj.price |
| | | this.$refs.child.continuePay(obj, 'handlingFees') |
| | | } else { |
| | | this.$message.success('å»ç»æå') |
| | | this.getList() |
| | | } |
| | | // |
| | | } else if (res.errorCode === '200001') { |
| | | this.$confirm('å卿ªå¤ç订å, æ¯å¦è·³è½¬?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning', |
| | | callback: () => { }, |
| | | beforeClose: (action, ctx, close) => { |
| | | if (action !== 'confirm') { |
| | | close() |
| | | return |
| | | } |
| | | ctx.confirmButtonLoading = true |
| | | that.$router.push({ name: 'HandlingFees' }) |
| | | } |
| | | }).finally(() => { |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è§£å» |
| | | async Unfreeze() { |
| | | const data = { |
| | | type: '2', |
| | | handleRemake: this.ModelRemark, |
| | | id: this.selectSalesList.map(i => i.id).join(',') |
| | | } |
| | | this.subLoading = true |
| | | const res = await handleComboSalesPost({ param: { ...data } }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | if (res && res.errorCode === '000000') { |
| | | this.$message.success('è§£å»æå') |
| | | this.getList() |
| | | } |
| | | }, |
| | | // è°æ´ |
| | | async handleAdjust() { |
| | | if (!this.adjustData.addNum && !this.adjustData.addTime) { |
| | | return this.$message.warning('请è¾å
¥è¦è°æ´çæææå¤©æ°æè
ä½é次æ°') |
| | | return Message.warning('请è¾å
¥è¦è°æ´çæææå¤©æ°æè
ä½é次æ°') |
| | | } |
| | | const data = { |
| | | type: '3', |
| | | handleRemake: this.ModelRemark, |
| | | addNum: this.adjustData.addNum || 0, |
| | | addTime: this.adjustData.addTime || 0, |
| | | id: this.selectSalesList.map(i => i.id).join(',') |
| | | info: this.ModelRemark, |
| | | addDays: this.adjustData.addNum || 0, |
| | | choseIdList: this.adjustData.flag == 0 ? this.selList.map(i => i.id) : [], |
| | | ...this.filters |
| | | } |
| | | |
| | | this.subLoading = true |
| | | const res = await handleComboSalesPost({ param: { ...data } }).catch(() => { |
| | | const res = await comboSaleAdjust({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | if (res && res.errorCode === '000000') { |
| | | this.$message.success('å¥é¤è°æ´æå') |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('å¥é¤è°æ´æå') |
| | | this.getList() |
| | | this.isShowAdjust = false |
| | | } |
| | |
| | | // ä½åº |
| | | async cancellation() { |
| | | const data = { |
| | | type: '4', |
| | | handleRemake: this.ModelRemark, |
| | | id: this.selectSalesList.map(i => i.id).join(',') |
| | | handleRemake: this.remarkCan, |
| | | choseIdList: this.selList.map(i => i.id) |
| | | } |
| | | this.subLoading = true |
| | | const res = await handleComboSalesPost({ param: { ...data } }).catch(() => { |
| | | const res = await comboSaleCancel({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowModal = false |
| | | if (res && res.errorCode === '000000') { |
| | | this.$message.success('ä½åºæå') |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('ä½åºæå') |
| | | this.getList() |
| | | } |
| | | }, |
| | | async handleCan() { |
| | | const data = { |
| | | handleRemake: this.remarkCan, |
| | | choseIdList: this.canList.map(i => i.id) |
| | | } |
| | | this.subLoading = true |
| | | const res = await comboSaleCancel({ ...data }).catch(() => { |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | }) |
| | | this.subLoading = false |
| | | this.isShowCan = false |
| | | if (res) { |
| | | Message.success('ä½åºæå') |
| | | this.getList() |
| | | } |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.selectSalesList = val |
| | | this.selList = val |
| | | }, |
| | | comboDetail(item) { |
| | | this.isShowDetail = true |
| | | this.$nextTick(() => { |
| | | this.$refs.detailRef.isShowModal = true |
| | | this.$refs.detailRef.comboDetail(item) |
| | | this.$refs.DetailRef.isShowModal = true |
| | | this.$refs.DetailRef.getDetail(item) |
| | | }) |
| | | |
| | | // this.$router.push({ |
| | | // name: 'comboDetail', |
| | | // query: item |
| | | // }) |
| | | }, |
| | | pageSizeChange(val) { |
| | | this.pagination.rows = val |
| | |
| | | text-align: right; |
| | | } |
| | | } |
| | | .el-dialog__body{ |
| | | |
| | | } |
| | | .el-dialog__body {} |
| | | |
| | | .text_warning { |
| | | color: #e89e42; |
| | | } |
| | |
| | | */ |
| | | public class TestHex { |
| | | |
| | | @Test |
| | | public void testHex() throws Exception { |
| | | try (BufferedReader reader = reader("target/test-classes/JT808.txt")) { |
| | | reader.lines().filter(hex -> !hex.isEmpty()).forEach(hex -> BeanTest.selfCheck(hex)); |
| | | } |
| | | } |
| | | // @Test |
| | | // public void testHex() throws Exception { |
| | | // try (BufferedReader reader = reader("target/test-classes/JT808.txt")) { |
| | | // reader.lines().filter(hex -> !hex.isEmpty()).forEach(hex -> BeanTest.selfCheck(hex)); |
| | | // } |
| | | // } |
| | | |
| | | @Test |
| | | public void testSubpackage() throws Exception { |
| | | try (BufferedReader reader = reader("target/test-classes/JT1078.txt")) { |
| | | reader.lines().filter(hex -> !hex.isEmpty()).forEach(hex -> { |
| | | JTMessage message = BeanTest.coder.decode(Unpooled.wrappedBuffer(ByteBufUtil.decodeHexDump(hex))); |
| | | if (message != null) |
| | | System.out.println(BeanTest.gson.toJson(message)); |
| | | }); |
| | | } |
| | | } |
| | | // @Test |
| | | // public void testSubpackage() throws Exception { |
| | | // try (BufferedReader reader = reader("target/test-classes/JT1078.txt")) { |
| | | // reader.lines().filter(hex -> !hex.isEmpty()).forEach(hex -> { |
| | | // JTMessage message = BeanTest.coder.decode(Unpooled.wrappedBuffer(ByteBufUtil.decodeHexDump(hex))); |
| | | // if (message != null) |
| | | // System.out.println(BeanTest.gson.toJson(message)); |
| | | // }); |
| | | // } |
| | | // } |
| | | |
| | | public static BufferedReader reader(String path) throws FileNotFoundException { |
| | | return new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8)); |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹ç¶æ") |
| | | @PostMapping("/updStatus") |
| | | @RequiresPermissions("business:discount:update") |
| | | public ApiResponse updStatus(@RequestBody Discount discount) { |
| | | discountService.updStatus(discount); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:discount:query") |
| | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:discountmember:query") |
| | | public ApiResponse findById(@PathVariable String id) { |
| | | public ApiResponse<DiscountMember> findById(@PathVariable String id) { |
| | | return ApiResponse.success(discountMemberService.getDetail(id)); |
| | | } |
| | | |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | |
| | | public ApiResponse<PageData<Goodsorder>> findPage (@RequestBody PageWrap<Goodsorder> pageWrap) { |
| | | return ApiResponse.success(goodsorderService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("线ä¸äº¤ææ±æ»æ°æ®æ¥å£") |
| | | @PostMapping("/getTotalData") |
| | | @RequiresPermissions("business:goodsorder:query") |
| | |
| | | for (Goodsorder goodsorder:goodsorders) { |
| | | DiscountGoodsorderExportVO discountGoodsorderExportVO = new DiscountGoodsorderExportVO(); |
| | | BeanUtils.copyProperties(goodsorder,discountGoodsorderExportVO); |
| | | discountGoodsorderExportVO.setPayMoney(discountGoodsorderExportVO.getPayMoney()); |
| | | discountGoodsorderExportVO.setPayMoney(discountGoodsorderExportVO.getMoney()); |
| | | discountGoodsorderExportVO.setOrigin(Constants.ZERO); |
| | | discountGoodsorderExportVOList.add(discountGoodsorderExportVO); |
| | | } |
| | | ExcelExporter.build(DiscountGoodsorderExportVO.class).exportWithFirstAndEnd(discountGoodsorderExportVOList, "订åå表_"+System.currentTimeMillis(),"订åå表_"+ DateUtil.getPlusTime2(DateUtil.getCurrentDate()),null, response); |
| | |
| | | @PostMapping("/backGoodsorder") |
| | | @RequiresPermissions("business:goodsorder:query") |
| | | public ApiResponse backGoodsorder(@RequestBody GoodsorderBackDTO goodsorderBackDTO){ |
| | | if(Objects.nonNull(goodsorderBackDTO) && Objects.isNull(goodsorderBackDTO.getBackType())){ |
| | | goodsorderBackDTO.setBackType(Constants.ONE); |
| | | } |
| | | goodsorderService.backGoodsorder(goodsorderBackDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 宿¶å
³é è¶
æ¶æªæ¯ä»ç订å |
| | | * 30 ç§å·æ°ä¸æ¬¡ |
| | | * @throws Exception |
| | | */ |
| | | @Scheduled(cron = "0/15 * * * * ? ") |
| | | public void autCancel() throws Exception { |
| | | log.info("=====================å¼å§å®æ¶å·æ°å
³éè¶
æ¶æªæ¯ä»ç订å======================="); |
| | | goodsorderService.autCancel(); |
| | | log.info("=====================ç»æå®æ¶å·æ°å
³éè¶
æ¶æªæ¯ä»ç订å======================="); |
| | | } |
| | | |
| | | /** |
| | | * ç«ç¹è½¦è¾æ»¡æ¶çé¢è¦ |
| | | * @throws Exception |
| | | */ |
| | |
| | | public void updateById(SystemDictData systemDictData) { |
| | | SystemDictData queryDto = new SystemDictData(); |
| | | queryDto.setDictId(systemDictData.getDictId()); |
| | | queryDto.setCode(systemDictData.getCode()); |
| | | queryDto.setLabel(systemDictData.getLabel()); |
| | | queryDto.setDeleted(Constants.ZERO); |
| | | SystemDictData dictData = systemDictDataService.findOne(queryDto); |
| | | if (dictData != null && !dictData.getId().equals(systemDictData.getId())) { |
| | |
| | | |
| | | PLATFORM_REFUND(3,"å¹³å°é款", "å¹³å°é款"), |
| | | |
| | | DISCOUNT(4,"å¹³å°å¥é¤", "å¹³å°å¥é¤") |
| | | DISCOUNT(4,"å¥é¤è´ä¹°", "å¥é¤è´ä¹°") |
| | | |
| | | ; |
| | | String name; |
| | |
| | | public static final String LEASE_NOTICE_URL = "LEASE_NOTICE_URL"; |
| | | //æ¼é |
| | | public static final String RENT_DEPOSIT = "RENT_DEPOSIT"; |
| | | //çµè½¦ä¸´åèªå¨å
³éæ¶é¿ï¼åéï¼ |
| | | public static final String PAUSE_AUTO_CLOSE_TIME = "PAUSE_AUTO_CLOSE_TIME"; |
| | | |
| | | //温馨æç¤º |
| | | public static final String TIPS = "TIPS"; |
| | | //温馨æç¤º |
| | |
| | | return dt1; |
| | | } |
| | | |
| | | |
| | | |
| | | public static Date StringToDateFormat(String DATE,String format) { |
| | | if(StringUtils.isBlank(DATE)){ |
| | | return null; |
| | | } |
| | | DateFormat df = new SimpleDateFormat(format); |
| | | Date dt1 = null; |
| | | try { |
| | | dt1 = df.parse(DATE); |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | return dt1; |
| | | } |
| | | |
| | | |
| | | public static String getXDaysAfter(Date date, Integer days){ |
| | | Timestamp currentTimestamp = new Timestamp(date.getTime()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(currentTimestamp); |
| | | calendar.add(Calendar.DAY_OF_YEAR, days-1); // å¨å½åæ¶é´åºç¡ä¸æ·»å æå®çå¤©æ° |
| | | calendar.add(Calendar.DAY_OF_YEAR, days); // å¨å½åæ¶é´åºç¡ä¸æ·»å æå®çå¤©æ° |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
| | | return formatter.format(calendar.getTime()); |
| | | } |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | System.out.println(DateUtil.getBetweenDays("2025-02-13","2025-02-15")); |
| | | System.out.println(DateUtil.getCurrDate()); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | |
| | | Map<String, TemplateData> m = new HashMap<>(4); |
| | | m.put("character_string1", new TemplateData(bikeCode)); |
| | | //è§£éæ¶é´ |
| | | m.put("date3", new TemplateData(DateUtil.getDate(startTime,"yyyy-MM-dd HH:mm"))); |
| | | m.put("date3", new TemplateData(DateUtil.getFomartDate(startTime,"yyyy/MM/dd HH:mm"))); |
| | | //ä¸éæ¶é´ |
| | | m.put("date4", new TemplateData(DateUtil.getDate(endTime,"yyyy-MM-dd HH:mm"))); |
| | | m.put("date4", new TemplateData(DateUtil.getFomartDate(endTime,"yyyy/MM/dd HH:mm"))); |
| | | //温馨æé |
| | | m.put("thing5", new TemplateData("临æ¶é车已è¶
è¿æå¤§æ¶é¿ï¼å·²èªå¨è¿è½¦")); |
| | | wxMsgVo.setPage(goodsOrderUrl + goodsOrderId); |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @ExcelColumn(name="ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | |
| | | @ApiModelProperty(value = "æ¯æ¥åä»·", example = "1") |
| | | private BigDecimal dayPrice; |
| | | |
| | | @ApiModelProperty(value = "å°ç¨åºæ¥è¯¢ä½¿ç¨", hidden = true) |
| | | @TableField(exist = false) |
| | | private Integer minShow; |
| | | |
| | | @ApiModelProperty(value = "å建人åç§°") |
| | | @TableField(exist = false) |
| | | private String creatorName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æåç¼è¾äºº") |
| | | @TableField(exist = false) |
| | | private String editorName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å¾çå
¨è·¯å¾", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @ExcelColumn(name="ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | private String creator; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "æ¯ä»æ¹å¼ 0微信 1æ¯ä»å®") |
| | | @ExcelColumn(name="æ¯ä»æ¹å¼",index = 7 ,width = 10,valueMapping = "0=微信ï¼1=æ¯ä»å®ï¼",align = HorizontalAlignment.CENTER) |
| | | @ExcelColumn(name="æ¯ä»æ¹å¼",index = 7 ,width = 10,valueMapping = "0=微信;1=æ¯ä»å®;",align = HorizontalAlignment.CENTER) |
| | | private Integer payWay; |
| | | |
| | | @ApiModelProperty(value = "è®¢åæ¥æº") |
| | | @ExcelColumn(name="è®¢åæ¥æº",index = 8 ,width = 10,valueMapping = "0=å°ç¨åºç«¯ï¼",align = HorizontalAlignment.CENTER) |
| | | @ExcelColumn(name="è®¢åæ¥æº",index = 8 ,width = 10,valueMapping = "0=å°ç¨åºç«¯;",align = HorizontalAlignment.CENTER) |
| | | private Integer origin; |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "订å主é®") |
| | | private String goodsOrderId; |
| | | |
| | | @ApiModelProperty(value = "éªè¡ç¶æï¼-1=æªéªè¡ï¼0=请æ±å¼éä¸ ;1=éªè¡ä¸; 2=å·²è¿è½¦; 3=å¼é失败ï¼") |
| | | @ApiModelProperty(value = "éªè¡ç¶æï¼-1=æªéªè¡ï¼0=请æ±å¼éä¸ ;1=éªè¡ä¸; 2=å·²è¿è½¦; 3=å¼é失败ï¼4=临æ¶é车ï¼") |
| | | private Integer rideStatus; |
| | | |
| | | @ApiModelProperty(value = "å°ç¨åºæ¯å¦åæ¢æå¡ 0å¦ 1æ¯") |
| | |
| | | @ApiModel("éªè¡è®°å½ç¶æä¿¡æ¯è¿åç±»") |
| | | public class MemberRidesDetailResponse { |
| | | |
| | | |
| | | @ApiModelProperty(value = "éªè¡è®°å½ä¸»é®") |
| | | private String id; |
| | | |
| | |
| | | @ApiModelProperty(value = "éªè¡è®°å½ä¸»é®") |
| | | private String rideId; |
| | | |
| | | @ApiModelProperty(value = "车è¾ç±»å") |
| | | private String bikeTypeName; |
| | | |
| | | @ApiModelProperty(value = "å¥é¤å¡ä¿¡æ¯") |
| | | private DiscountMember discountMember; |
| | | |
| | |
| | | |
| | | void autoCancelRefunOrder(); |
| | | |
| | | DiscountMember getUseDiscount(String memberId, Integer driveTime); |
| | | DiscountMember getUseDiscount(String memberId, Integer driveTime,Integer type); |
| | | |
| | | void autCancel(); |
| | | } |
| | |
| | | low = Double.parseDouble(collect.get(Constants.LOW_BIKE_VOLTAGE).getCode()); |
| | | }catch (Exception e){ |
| | | } |
| | | if(pageWrap.getModel().getType() == Constants.ONE){ |
| | | if(pageWrap.getModel().getLowVoltage() == Constants.ONE){ |
| | | //ä½çµé |
| | | queryWrapper.lt(Bikes::getVoltage,low); |
| | | }else{ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DiscountLogMapper; |
| | | import com.doumee.dao.business.model.DiscountLog; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.DiscountLogService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨Serviceå®ç° |
| | |
| | | @Override |
| | | public PageData<DiscountLog> findPage(PageWrap<DiscountLog> pageWrap) { |
| | | IPage<DiscountLog> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<DiscountLog> queryWrapper = new QueryWrapper<>(); |
| | | MPJLambdaWrapper<DiscountLog> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountLog::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(DiscountLog::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountLog::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(DiscountLog::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getInfo() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getInfo, pageWrap.getModel().getInfo()); |
| | | } |
| | | if (pageWrap.getModel().getDiscountMemberId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getDiscountMemberId, pageWrap.getModel().getDiscountMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getRideTime() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getRideTime, pageWrap.getModel().getRideTime()); |
| | | } |
| | | if (pageWrap.getModel().getRidePrice() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getRidePrice, pageWrap.getModel().getRidePrice()); |
| | | } |
| | | if (pageWrap.getModel().getEditInfo() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditInfo, pageWrap.getModel().getEditInfo()); |
| | | } |
| | | if (pageWrap.getModel().getEditDays() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditDays, pageWrap.getModel().getEditDays()); |
| | | } |
| | | if (pageWrap.getModel().getGoodsorderId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getGoodsorderId, pageWrap.getModel().getGoodsorderId()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | DiscountLog model = pageWrap.getModel(); |
| | | queryWrapper.selectAll(DiscountLog.class) |
| | | .selectAs(SystemUser::getRealname,DiscountLog::getCreatorName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,DiscountLog::getCreator) |
| | | .eq(DiscountLog::getIsdeleted, Constants.ZERO) |
| | | .eq(Objects.nonNull(model.getType()),DiscountLog::getType,model.getType()) |
| | | .eq(StringUtils.isNotBlank(model.getDiscountMemberId()),DiscountLog::getDiscountMemberId,model.getDiscountMemberId()); |
| | | PageData<DiscountLog> pageData = PageData.from(discountLogMapper.selectJoinPage(page, DiscountLog.class,queryWrapper)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(pageData.getRecords())){ |
| | | for (DiscountLog discountLog:pageData.getRecords()) { |
| | | if(Constants.equalsInteger(discountLog.getType(),Constants.ZERO)&&Objects.nonNull(discountLog.getRidePrice())){ |
| | | discountLog.setRidePrice( |
| | | Constants.translateMoney(discountLog.getRidePrice()) |
| | | ); |
| | | } |
| | | } |
| | | return PageData.from(discountLogMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | return pageData; |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(Objects.isNull(discountMember)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | List<DiscountLog> discountLogList = discountLogMapper.selectJoinList(DiscountLog.class,new MPJLambdaWrapper<DiscountLog>() |
| | | .selectAll(DiscountLog.class) |
| | | .selectAs(SystemUser::getRealname,DiscountLog::getCreatorName) |
| | | .eq(DiscountLog::getDiscountMemberId,discountMember.getId()) |
| | | .eq(DiscountLog::getIsdeleted,Constants.ZERO) |
| | | .orderByDesc(DiscountLog::getId) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(discountLogList)){ |
| | | discountMember.setDiscountLogList(discountLogList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList())); |
| | | discountMember.setOptLogList(discountLogList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList())); |
| | | discountMember.setUseTimes(discountMember.getDiscountLogList().size()); |
| | | } |
| | | // List<DiscountLog> discountLogList = discountLogMapper.selectJoinList(DiscountLog.class,new MPJLambdaWrapper<DiscountLog>() |
| | | // .selectAll(DiscountLog.class) |
| | | // .selectAs(SystemUser::getRealname,DiscountLog::getCreatorName) |
| | | // .leftJoin(SystemUser.class,SystemUser::getId,DiscountLog::getCreator) |
| | | // .eq(DiscountLog::getDiscountMemberId,discountMember.getId()) |
| | | // .eq(DiscountLog::getIsdeleted,Constants.ZERO) |
| | | // .orderByDesc(DiscountLog::getId) |
| | | // ); |
| | | // discountMember.setUseTimes(discountMember.getDiscountLogList().size()); |
| | | // if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(discountLogList)){ |
| | | // discountMember.setDiscountLogList(discountLogList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList())); |
| | | // discountMember.setOptLogList(discountLogList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList())); |
| | | // |
| | | // } |
| | | return discountMember; |
| | | } |
| | | |
| | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | DiscountMember model = pageWrap.getModel(); |
| | | queryWrapper.selectAll(DiscountMember.class) |
| | | .selectAs(Member::getOpenid,DiscountMember::getOpenid) |
| | | .select(" ( select count(1) from discount_log d where d.discount_member_id = t.id and d.type = 0 ) ",DiscountMember::getUseTimes) |
| | | .leftJoin(Member.class,Member::getId,DiscountMember::getMemberId) |
| | | .like(StringUtils.isNotBlank(model.getCode()),DiscountMember::getCode,model.getCode()) |
| | | .like(StringUtils.isNotBlank(model.getName()),DiscountMember::getName,model.getName()) |
| | | .like(StringUtils.isNotBlank(model.getOpenid()),Member::getOpenid,model.getOpenid()) |
| | | .eq(Objects.nonNull(model.getStatus()),DiscountMember::getStatus,model.getStatus()) |
| | | .orderByDesc(DiscountMember::getId); |
| | | .ne(DiscountMember::getStatus,Constants.TWO) |
| | | .orderByDesc(DiscountMember::getCode); |
| | | return PageData.from(discountMemberJoinMapper.selectJoinPage(page, DiscountMember.class,queryWrapper)); |
| | | } |
| | | |
| | |
| | | .orderByDesc(DiscountMember::getId); |
| | | List<DiscountMember> list = discountMemberJoinMapper.selectJoinList(DiscountMember.class,queryWrapper); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªæ¥è¯¢å°å¯æ¥åºçå¥é¤å¡ä¿¡æ¯"); |
| | | return; |
| | | } |
| | | for (DiscountMember discountMember:list) { |
| | | if(!Constants.equalsInteger(discountMember.getStatus(),Constants.ZERO)){ |
| | | continue; |
| | | } |
| | | discountMemberMapper.update(null,new UpdateWrapper<DiscountMember>().lambda() |
| | | .set(DiscountMember::getStatus,Constants.ONE) |
| | | .eq(DiscountMember::getId,discountMember.getId()) |
| | |
| | | discountLog.setGoodsorderId(discountMember.getGoodsorderId()); |
| | | discountLogMapper.insert(discountLog); |
| | | } |
| | | //鿬¾æä½ |
| | | } |
| | | |
| | | |
| | |
| | | discountLog.setDiscountMemberId(discountMember.getId()); |
| | | discountLog.setType(Constants.TWO); |
| | | discountLog.setGoodsorderId(discountMember.getGoodsorderId()); |
| | | discountLog.setEditInfo(model.getInfo()); |
| | | discountLog.setInfo(model.getInfo()); |
| | | discountLog.setEditDays(model.getAddDays()); |
| | | discountLog.setEditInfo("å°æææå¢å "+model.getAddDays()+"天, è°æ´åæææè³"+useEndDate); |
| | | discountLogMapper.insert(discountLog); |
| | | |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | discount.setIsdeleted(Constants.ZERO); |
| | | discount.setCreateDate(new Date()); |
| | | discount.setCreator(userInfo.getId()); |
| | | discount.setEditDate(new Date()); |
| | | discount.setEditor(userInfo.getId()); |
| | | if(Constants.equalsInteger(discount.getUseType(),Constants.ZERO)){ |
| | | discount.setUseDays((int) (DateUtil.getBetweenDays(DateUtil.dateToString(discount.getUseStartDate(),"yyyy-MM-dd"),DateUtil.dateToString(discount.getUseEndDate(),"yyyy-MM-dd")))); |
| | | } |
| | |
| | | ( discount.getUseStartDate().getTime()>discount.getUseEndDate().getTime()) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ä½¿ç¨æ¶æ®µä¿¡æ¯é误"); |
| | | } |
| | | |
| | | //æå®æ¥æçæ |
| | | if(Constants.equalsInteger(discount.getUseType(),Constants.TWO) && |
| | | ( discount.getUseStartDate().getTime()<discount.getStartDate().getTime() || |
| | | discount.getUseStartDate().getTime() > discount.getEndDate().getTime() |
| | | ) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ä½¿ç¨æ¶æ®µä¿¡æ¯é误"); |
| | | } |
| | | if(Objects.isNull(discount.getSaleDayLimit())){ |
| | | discount.setSaleDayLimit(Constants.ZERO); |
| | | } |
| | | if(Objects.isNull(discount.getSaleLimit())){ |
| | | discount.setSaleLimit(Constants.ZERO); |
| | | } |
| | | if(Constants.equalsInteger(discount.getUseType(),Constants.TWO)){ |
| | | discount.setUseEndDate( DateUtil.StringToDateFormat(DateUtil.getXDaysAfter(discount.getUseStartDate(),discount.getUseDays()),"yyyy-MM-dd")); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void updateById(Discount discount) { |
| | | LoginUserInfo userInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(discount) |
| | | || StringUtils.isBlank(discount.getId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Discount model = discountMapper.selectById(discount.getId()); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªç¦ç¨æ æ³è¿è¡ä¿®æ¹"); |
| | | } |
| | | this.vaildReq(discount); |
| | | discount.setEditDate(new Date()); |
| | | discount.setEditor(userInfo.getId()); |
| | | if(Constants.equalsInteger(discount.getUseType(),Constants.ZERO)){ |
| | | discount.setUseDays((int) (DateUtil.getBetweenDays(DateUtil.dateToString(discount.getUseStartDate(),"yyyy-MM-dd"),DateUtil.dateToString(discount.getUseEndDate(),"yyyy-MM-dd")))); |
| | | } |
| | | discountMapper.updateById(discount); |
| | | } |
| | | |
| | |
| | | public Discount findById(String id) { |
| | | Discount discount = discountJoinMapper.selectOne(new MPJLambdaWrapper<Discount>() |
| | | .selectAll(Discount.class) |
| | | .select(" s1.realname ",Discount::getCreatorName) |
| | | .select(" s2.realname ",Discount::getEditorName) |
| | | .select(" (select count(1) from goodsorder g where g.obj_type = 0 and g.obj_id = t.id and g.pay_status = 1 ) ",Discount::getSaleNum) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Discount::getCreator) |
| | | .leftJoin(" system_user s1 on s1.id = t.creator") |
| | | .leftJoin(" system_user s2 on s2.id = t.editor") |
| | | .eq(Discount::getId,id) |
| | | ); |
| | | if(Objects.isNull(discount)){ |
| | |
| | | .eq(Objects.nonNull(modele.getBikeOrElec()) && Constants.equalsInteger(modele.getBikeOrElec(),Constants.ONE),Discount::getIsbike, Constants.ONE) |
| | | .eq(Objects.nonNull(modele.getBikeOrElec()) && Constants.equalsInteger(modele.getBikeOrElec(),Constants.TWO),Discount::getIselecbike, Constants.ONE) |
| | | .eq(Discount::getIsdeleted, Constants.ZERO) |
| | | .eq( pageWrap.getModel().getStatus() !=null,BikeRepair::getStatus,pageWrap.getModel().getStatus()); |
| | | .eq( pageWrap.getModel().getStatus() !=null,BikeRepair::getStatus,pageWrap.getModel().getStatus()) |
| | | .apply( Objects.nonNull(modele.getMinShow())," now() BETWEEN t.start_date and ( t.end_date + INTERVAL '1 day' ) ") |
| | | ; |
| | | queryWrapper.orderByDesc(Discount::getCreateDate); |
| | | PageData<Discount> pageData = PageData.from(discountJoinMapper.selectJoinPage(page, Discount.class,queryWrapper)); |
| | | for (Discount discount:pageData.getRecords()) { |
| | |
| | | @Override |
| | | public void dealPrice(Discount discount){ |
| | | if(Objects.isNull(discount) |
| | | || Objects.isNull(discount.getUseEndDate()) |
| | | || Objects.isNull(discount.getUseStartDate()) |
| | | || Objects.isNull(discount.getUseDays()) |
| | | || Objects.isNull(discount.getPrice()) |
| | | || discount.getPrice().compareTo(BigDecimal.ZERO)==0 |
| | | ){ |
| | |
| | | MPJLambdaWrapper<Goodsorder> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Goodsorder.class); |
| | | queryWrapper.selectAs(Member::getOpenid, Goodsorder::getOpenid); |
| | | queryWrapper.selectAs(DiscountMember::getName, Goodsorder::getDiscountName); |
| | | queryWrapper.leftJoin(Member.class, Member::getId ,Goodsorder::getMemberId); |
| | | queryWrapper.select("(select r.name from discount_member r where r.isdeleted=0 and r.goodsorder_id=t.id limit 1) as discountName"); |
| | | queryWrapper.leftJoin(DiscountMember.class, DiscountMember::getGoodsorderId ,Goodsorder::getId); |
| | | // queryWrapper.select("(select r.name from discount_member r where r.isdeleted=0 and r.goodsorder_id=t.id limit 1) as discountName"); |
| | | queryWrapper.select("(select max(r.done_date) from refund r where r.obj_id=t.id and r.status in(0,2)) as refund_date"); |
| | | queryWrapper.select("(select sum(r.money) from refund r where r.obj_id=t.id and r.status in(0,2)) as refund_money"); |
| | | //æ¶é´æ®µçé |
| | |
| | | queryWrapper.like(model.getCode() !=null,Goodsorder::getCode,model.getCode()); |
| | | queryWrapper.like(model.getId() !=null,Goodsorder::getId,model.getId()); |
| | | queryWrapper.eq(model.getStatus() !=null,Goodsorder::getStatus,model.getStatus()); |
| | | queryWrapper.eq(model.getPayWay() !=null,Goodsorder::getPayWay,model.getPayWay()); |
| | | queryWrapper.like(model.getOnlineOrderid() !=null,Goodsorder::getOnlineOrderid,model.getOnlineOrderid()); |
| | | queryWrapper.like(model.getOpenid() !=null,Member::getOpenid,model.getOpenid()); |
| | | queryWrapper.eq(Goodsorder::getIsdeleted,Constants.ZERO); |
| | | //妿æ¯éªè¡è®¢ååªæ¾ç¤ºæ¯ä»æåç |
| | | queryWrapper.eq(Constants.equalsInteger(model.getType(),Constants.ZERO),Goodsorder::getPayStatus,Constants.ONE); |
| | | queryWrapper.in(Constants.equalsInteger(model.getType(),Constants.ONE),Goodsorder::getStatus,Constants.ONE,Constants.ZERO); |
| | | |
| | | return queryWrapper; |
| | | } |
| | |
| | | if(Objects.nonNull(pageWrap.getModel().getCloseStatus()) && pageWrap.getModel().getCloseStatus().equals(Constants.ONE)){ |
| | | queryWrapper.eq(Goodsorder::getStatus,Constants.GOODSORDER_STATUS.CLOSE.getKey()); |
| | | } |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDiscountName()),Goodsorder::getDiscountName,pageWrap.getModel().getDiscountName()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDiscountName()),DiscountMember::getName,pageWrap.getModel().getDiscountName()); |
| | | IPage<Goodsorder> goodsorderIPage = goodsorderJoinMapper.selectJoinPage(page, Goodsorder.class, queryWrapper); |
| | | if (!CollectionUtils.isEmpty(goodsorderIPage.getRecords())){ |
| | | goodsorderIPage.getRecords().forEach(s->{ |
| | |
| | | discountMapper.selectList(new QueryWrapper<Discount>().lambda() |
| | | .eq(Discount::getIsdeleted,Constants.ZERO) |
| | | .eq(Discount::getStatus,Constants.ZERO) |
| | | .apply(" now() BETWEEN start_date and ( end_date + INTERVAL '1 day' ) ") |
| | | .orderByDesc(Discount::getId) |
| | | .last(" limit 3 ") |
| | | ) |
| | |
| | | memberRidesResponse.setVoltageStatus(this.getVoltageStatus(bikes)); |
| | | } |
| | | //æ¥è¯¢å½åçéªè¡å¥é¤ |
| | | memberRidesResponse.setDiscountMember(this.getUseDiscount(memberId,Constants.ZERO)); |
| | | memberRidesResponse.setDiscountMember(this.getUseDiscount(memberId,Constants.ZERO,memberRides.getType())); |
| | | homeResponse.setMemberRidesResponse(memberRidesResponse); |
| | | } |
| | | } |
| | |
| | | if(Constants.equalsInteger(goodsorder.getType(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | goodsorder.setMoney(Constants.translateMoney(goodsorder.getMoney())); |
| | | goodsorderDetailVO.setGoodsOrder(goodsorder); |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | if(Objects.nonNull(member)){ |
| | |
| | | .eq(Refund::getObjId,goodsorder.getId()) |
| | | .orderByDesc(Refund::getId) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(refunds)){ |
| | | for (Refund refund:refunds) { |
| | | if(Objects.nonNull(refund.getMoney())){ |
| | | refund.setMoney(Constants.translateMoney(refund.getMoney())); |
| | | } |
| | | } |
| | | } |
| | | goodsorderDetailVO.setRefundList(refunds); |
| | | |
| | | return goodsorderDetailVO; |
| | |
| | | freeTime = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME, Constants.FREE_RENT_TIME).getCode()); |
| | | }catch (Exception e){ |
| | | } |
| | | closeMoney = getCloseMoneyByRides(memberRides,freeTime,true,goodsorder.getMoney(),goodsorder.getMemberId()).getAmount(); |
| | | closeMoney = getCloseMoneyByRides(memberRides,freeTime,true,goodsorder.getMoney(),goodsorder.getMemberId(),true).getAmount(); |
| | | //å®é
ç»ç®ä»·æ ¼ï¼è®°å½å¨æé«è½¦åè®°å½ä¸ |
| | | // memberRides.get(0).setActualPrice(closeMoney); |
| | | } |
| | |
| | | transactionsMapper.insert(transactions); |
| | | } |
| | | |
| | | private RidesDetailResponse getCloseMoneyByRides(List<MemberRides> memberRides,int freeTime,boolean isClose,BigDecimal yjMoney,String memberId) { |
| | | private RidesDetailResponse getCloseMoneyByRides(List<MemberRides> memberRides,int freeTime,boolean isClose,BigDecimal yjMoney,String memberId,Boolean unOver) { |
| | | RidesDetailResponse ridesDetailResponse = new RidesDetailResponse(); |
| | | ridesDetailResponse.setHaveDisCount(Constants.ZERO); |
| | | BigDecimal closeMoney = new BigDecimal(0.00); |
| | |
| | | topRides.setActualPrice(closeMoney); |
| | | } |
| | | //æ¥è¯¢æ¯å¦åå¨å¥é¤ä¿¡æ¯ |
| | | DiscountMember discountMember = this.getUseDiscount(memberId,durationSum); |
| | | DiscountMember discountMember = this.getUseDiscount(memberId,durationSum,Objects.nonNull(topRides)?topRides.getType():null); |
| | | //è®¡ç®æµæ£éé¢ |
| | | if(Objects.nonNull(discountMember) && discountMember.getSurplusTime() > Constants.ZERO && Objects.nonNull(topRides)){ |
| | | //unOver æ¯å¦æªç»ç® æªç»ç®çè®¢åæ ¹æ®å½åå¥é¤æ¥è¯¢ å·²ç»ç®çè®¢åæ ¹æ®å·²çæçæ°æ®è¿è¡æ¥è¯¢ |
| | | if(Objects.nonNull(discountMember) && Objects.nonNull(topRides) && unOver){ |
| | | //å卿µæ£è®°å½ |
| | | DiscountLog discountLog = new DiscountLog(); |
| | | discountLog.setIsdeleted(Constants.ZERO); |
| | |
| | | discountLog.setEditInfo("éªè¡æµæ£"); |
| | | discountLog.setGoodsorderId(topRides.getOrdreId()); |
| | | //妿éªè¡æ¶é´å°äºçäºå©ä½æ¶é´ åç´æ¥æ·»å éªè¡å¡ä½¿ç¨æ°æ® ä¿®æ£å®é
æ¯ä»éé¢ |
| | | if(discountMember.getSurplusTime() >= durationSum){ |
| | | if(Constants.equalsInteger(discountMember.getLimitType(),Constants.ZERO) || discountMember.getSurplusTime() >= durationSum){ |
| | | discountLog.setRideTime(durationSum); |
| | | discountLog.setRidePrice(closeMoney); |
| | | topRides.setActualPrice(BigDecimal.ZERO); |
| | |
| | | }else{ |
| | | int baseTime =Constants.formatIntegerNum(topRides.getBaseTime()); |
| | | BigDecimal closeDisCountMoney = Constants.formatDecimalNum(topRides.getBasePrice()); |
| | | //妿æ¯ä¸å£ä»·æ¹å¼ï¼ä»·æ ¼ç´æ¥ä¸ºä¸å£ä»·baseMoney,妿䏿¯è®¡ç®æ£å¸¸ä»·æ ¼ |
| | | //åå»ä¼æ æ¶é¿å©ä½æ¶é¿ |
| | | Integer durationDisCountSum = durationSum - discountMember.getSurplusTime(); |
| | | discountLog.setRideTime(discountMember.getSurplusTime()); |
| | | discountLog.setRideTime(durationDisCountSum<=Constants.ZERO?discountMember.getSurplusTime():Constants.ZERO); |
| | | //妿æ¯ä¸å£ä»·æ¹å¼ï¼ä»·æ ¼ç´æ¥ä¸ºä¸å£ä»·baseMoney,妿䏿¯è®¡ç®æ£å¸¸ä»·æ ¼ |
| | | if(baseTime != -1){//䏿¯ä¸å£ä»· |
| | | if(durationDisCountSum > baseTime && Constants.formatIntegerNum(topRides.getUnitTime())>0){ |
| | | //妿è¶
åºäºèµ·æ¥ä»·æ ¼ï¼è®¡ç®è¶
åºä»·æ ¼ |
| | |
| | | //计ç®éé¢ç´¯è®¡è¶
åºé¨é¨ä»·æ ¼ï¼è¶
åºæ¶é´åä½*è¶
åºå使¶é´ä»·æ ¼ï¼ |
| | | closeDisCountMoney = closeDisCountMoney.add(unit.multiply(Constants.formatDecimalNum(topRides.getUnitPrice()))); |
| | | } |
| | | discountLog.setRidePrice(closeMoney.subtract(closeDisCountMoney)); |
| | | discountLog.setRidePrice(durationDisCountSum<=Constants.ZERO?closeMoney.subtract(closeDisCountMoney):BigDecimal.ZERO); |
| | | }else{ |
| | | discountLog.setRidePrice(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | if(isClose&&discountLog.getRideTime()>Constants.ZERO){ |
| | | discountLogMapper.insert(discountLog); |
| | | ridesDetailResponse.setHaveDisCount(Constants.ONE); |
| | | } |
| | | ridesDetailResponse.setHaveDisCount(discountLog.getRideTime()>Constants.ZERO?Constants.ONE:Constants.ZERO); |
| | | ridesDetailResponse.setDisCountMoney(discountLog.getRidePrice()); |
| | | }else if(Objects.nonNull(discountMember) && Objects.nonNull(topRides) |
| | | && !unOver ){ |
| | | //å·²è¿è½¦åæ¥è¯¢æ¯å¦æ å¥é¤å¡ä½¿ç¨è®°å½ |
| | | List<DiscountLog> discountLogList = discountLogMapper.selectList(new QueryWrapper<DiscountLog>().lambda().eq(DiscountLog::getGoodsorderId,topRides.getOrdreId()).eq(DiscountLog::getType,Constants.ZERO) |
| | | .eq(DiscountLog::getIsdeleted,Constants.ZERO)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(discountLogList)){ |
| | | ridesDetailResponse.setHaveDisCount(Constants.ONE); |
| | | ridesDetailResponse.setDisCountMoney(discountLogList.stream().map(i->i.getRidePrice()).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | } |
| | | //å¦æè®¢åä»·æ ¼å°é¡¶äºï¼å订å ä»·æ ¼ |
| | | if(Constants.compareBigdecimal(closeMoney, yjMoney) ==1){ |
| | |
| | | LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.isNull(goodsorderBackDTO) |
| | | || StringUtils.isBlank(goodsorderBackDTO.getOrderId()) |
| | | || StringUtils.isBlank(goodsorderBackDTO.getReason()) |
| | | || Objects.isNull(goodsorderBackDTO.getBackType()) |
| | | || Objects.isNull(goodsorderBackDTO.getMoney())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | .selectAs(BaseParam::getSortnum,MemberRides::getSortnum) |
| | | .leftJoin(BaseParam.class,BaseParam::getId,MemberRides::getParamId) |
| | | .eq(MemberRides::getOrdreId,id) |
| | | .in(MemberRides::getStatus,Constants.MEMBER_RIDES_STATUS.RIDES_RUNNING.getKey(),Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey()) |
| | | .in(MemberRides::getStatus,Constants.MEMBER_RIDES_STATUS.RIDES_RUNNING.getKey() |
| | | ,Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey(),Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING.getKey()) |
| | | .orderByDesc(MemberRides::getCreateDate)); |
| | | if (!CollectionUtils.isEmpty(memberRides)){ |
| | | //é¢è®¡ç»ç®ä»·æ ¼åè®¡ç®æ¶é¿ |
| | |
| | | return memberRidesResponse; |
| | | }).collect(Collectors.toList()); |
| | | //累计åé¢ç®ç»ç®éé¢ |
| | | RidesDetailResponse ridesDetailResponse = getCloseMoneyByRides(memberRides,freeTime,false,goodsorder.getMoney(),goodsorder.getMemberId()); |
| | | RidesDetailResponse ridesDetailResponse = getCloseMoneyByRides(memberRides,freeTime,false,goodsorder.getMoney(),goodsorder.getMemberId(), |
| | | Constants.equalsInteger(goodsorder.getStatus(),Constants.GOODSORDER_STATUS.CLOSE.getKey())?false:true); |
| | | if(Constants.formatIntegerNum(goodsorder.getStatus())!= Constants.goodsorderStatus.pay){ |
| | | //妿éå·²æ¯ä»ä½æªç»ç®ï¼ä½¿ç¨è®¢åéé¢ |
| | | ridesDetailResponse.setAmount(goodsorder.getCloseMoney()); |
| | |
| | | discountMember.setMemberId(memberId); |
| | | discountMember.setStatus(Constants.TWO); |
| | | discountMember.setGoodsorderId(goodsorderId); |
| | | if(!Constants.equalsInteger(discountMember.getUseType(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(discountMember.getUseType(),Constants.ONE)){ |
| | | discountMember.setUseStartDate(DateUtil.StringToDateFormat(DateUtil.getCurrDate(),"yyyy-MM-dd")); |
| | | } |
| | | discountMember.setUseEndDate( DateUtil.StringToDateFormat(DateUtil.getXDaysAfter(discountMember.getUseStartDate(),discountMember.getUseDays()-1),"yyyy-MM-dd")); |
| | | } |
| | | discountMemberMapper.insert(discountMember); |
| | | |
| | | Goodsorder goodsorder = new Goodsorder(); |
| | | goodsorder.setId(goodsorderId); |
| | | goodsorder.setCreateDate(new Date()); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å¥é¤ä¿¡æ¯"); |
| | | } |
| | | if(!(Constants.equalsInteger(discount.getIsdeleted(),Constants.ZERO) |
| | | ||Constants.equalsInteger(discount.getStatus(),Constants.ZERO))){ |
| | | && Constants.equalsInteger(discount.getStatus(),Constants.ZERO))){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å¥é¤å·²ä¸æ¶ï¼æ æ³è¿è¡è´ä¹°ï¼è¯·å·æ°æ¥ç"); |
| | | } |
| | | if(!(discount.getStartDate().getTime() < System.currentTimeMillis() |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å¥é¤å¼æ¾æ¶é´æªå°,æ æ³è¿è¡è´ä¹°"); |
| | | } |
| | | //éªè¯æ¯å¦è¶
è¿ä»æ¥å¯å®åæ°é |
| | | if(Objects.nonNull(discount.getSaleDayLimit())){ |
| | | if(Objects.nonNull(discount.getSaleDayLimit())&&discount.getSaleDayLimit()>Constants.ZERO){ |
| | | if(goodsorderMapper.selectCount(new QueryWrapper<Goodsorder>().lambda() |
| | | .eq(Goodsorder::getType,Constants.ONE) |
| | | .eq(Goodsorder::getObjId,discount.getId()) |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å¥é¤ä»æ¥åè¡éå·²å®ç½ï¼è¯·ææ¥æ¥çï¼"); |
| | | } |
| | | } |
| | | if(Objects.nonNull(discount.getSaleLimit())){ |
| | | if(Objects.nonNull(discount.getSaleLimit())&&discount.getSaleLimit()>Constants.ZERO){ |
| | | if(goodsorderMapper.selectCount(new QueryWrapper<Goodsorder>().lambda() |
| | | .eq(Goodsorder::getType,Constants.ONE) |
| | | .eq(Goodsorder::getObjId,discount.getId()) |
| | | .in(Goodsorder::getStatus,Constants.ZERO,Constants.ONE) |
| | | .apply(" EXTRACT(YEAR FROM create_date) = EXTRACT(YEAR FROM CURRENT_DATE) ") |
| | | )>=discount.getSaleDayLimit()){ |
| | | )>=discount.getSaleLimit()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å¥é¤åè¡éå·²å®ç½ï¼"); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | private Object getWxPayResponse(Goodsorder goodsorder,String openid){ |
| | | //è°èµ·æ¯ä» |
| | | Object response = null; |
| | | //è°èµ·æ¯ä» |
| | | PrepayRequest request = new PrepayRequest(); |
| | | request.setAttach("createGoodsOrder"); |
| | | request.setDescription(Constants.equalsInteger(goodsorder.getType(),Constants.ZERO)?"森æå
¬åèªè¡è½¦éªè¡æ¼éæ¯ä»":"森æå
¬åèªè¡è½¦è´ä¹°éªè¡å¥é¤æ¯ä»"); |
| | |
| | | Goodsorder goodsorder = this.goodsorderMapper.selectOne(new QueryWrapper<Goodsorder>() |
| | | .eq("member_id",memberId) |
| | | .eq("status",Constants.goodsorderStatus.pay) |
| | | .eq("type",Constants.ZERO) |
| | | .last(" limit 1 ")); |
| | | if(Objects.isNull(goodsorder)){ |
| | | throw new BusinessException(ResponseStatus.NO_UNCLOSEED_ORDER.getCode(),"æ éªè¡è®¢åè®°å½"); |
| | |
| | | * @param memberId |
| | | */ |
| | | @Override |
| | | public DiscountMember getUseDiscount(String memberId,Integer driveTime){ |
| | | public DiscountMember getUseDiscount(String memberId,Integer driveTime,Integer type){ |
| | | if(Objects.isNull(type)){ |
| | | return null; |
| | | } |
| | | String today = DateUtil.getToday(); |
| | | //夿ä»å¤©æ¯å¦ä¸ºè忥 |
| | | Holidays holidays = new Holidays(); |
| | |
| | | "and d.isdeleted = 0 and d.type = 0 and EXTRACT(DAY FROM d.create_date) = EXTRACT(DAY FROM CURRENT_DATE) ) " , DiscountMember::getUseTime)//æ¥è¯¢ä»æ¥å·²ä½¿ç¨æ¶é´ |
| | | .eq(DiscountMember::getStatus,Constants.ZERO) |
| | | .eq(DiscountMember::getMemberId,memberId) |
| | | .le(DiscountMember::getUseStartDate, Utils.Date.getStart(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .ge(DiscountMember::getUseEndDate, Utils.Date.getEnd(DateUtil.stringToDate(today,"yyyy-MM-dd"))) |
| | | .apply(" t.use_start_date <= '"+today+"' and t.use_end_date >= '"+today+"' ") |
| | | |
| | | .eq(Constants.equalsInteger(holiday,Constants.ZERO),DiscountMember::getUseWorkday,Constants.ONE) |
| | | .eq(Constants.equalsInteger(holiday,Constants.ONE),DiscountMember::getUseHoliday,Constants.ONE) |
| | | |
| | | .eq(Constants.equalsInteger(type,Constants.ZERO),DiscountMember::getIsbike,Constants.ONE) |
| | | .eq(Constants.equalsInteger(type,Constants.ONE),DiscountMember::getIselecbike,Constants.ONE) |
| | | .orderByDesc(DiscountMember::getLimitType) |
| | | .orderByDesc(DiscountMember::getLimitTime) |
| | | ); |
| | |
| | | if(list.size()>Constants.ZERO){ |
| | | //d1å¨ååååº åä¹éåº |
| | | list.sort((d1,d2)-> Integer.compare(d2.getSurplusTime(),d1.getSurplusTime())); |
| | | } |
| | | return list.get(Constants.ZERO); |
| | | } |
| | | }else{ |
| | | //æ æ æéçå¥é¤ ä¼å
æ¥è¯¢å©ä½æ¶é¿å¤§äºéªè¡æ¶é¿çä¿¡æ¯(åæ¶é´æå°çå¥é¤) åæ¥è¯¢å°äºéªè¡æ¶é¿çå¥é¤ |
| | | List<DiscountMember> list = discountMemberList.stream().filter(i->i.getSurplusTime()>=driveTime).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(list)){ |
| | | if(list.size()>Constants.ZERO){ |
| | | //d1å¨ååååº åä¹éåº |
| | | list.sort((d1,d2)-> Integer.compare(d2.getSurplusTime(),d1.getSurplusTime())); |
| | | } |
| | | list.sort((d1,d2)-> Integer.compare(d1.getSurplusTime(),d2.getSurplusTime())); |
| | | return list.get(Constants.ZERO); |
| | | } |
| | | |
| | | } |
| | | list = discountMemberList.stream().filter(i->i.getSurplusTime()<driveTime).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(list)){ |
| | | if(list.size()>Constants.ZERO){ |
| | | list.sort((d1,d2)-> Integer.compare(d1.getSurplusTime(),d2.getSurplusTime())); |
| | | list.sort((d1,d2)-> Integer.compare(d2.getSurplusTime(),d1.getSurplusTime())); |
| | | } |
| | | return list.get(Constants.ZERO); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void autCancel(){ |
| | | goodsorderMapper.update(null,new UpdateWrapper<Goodsorder>().lambda() |
| | | .set(Goodsorder::getStatus,Constants.GOODSORDER_STATUS.CANCEL.getKey()) |
| | |
| | | } |
| | | }else{ |
| | | //妿æ¯çµè½¦ï¼è¯·æ±web端æ¥å£å
³é车è¾ä¿¡æ¯ |
| | | bike = sendCloseElecBikeRequest(memberRides.getBikeCode(),Constants.ONE); |
| | | bike = sendCloseElecBikeRequest(model.getOrdreId(),memberRides.getBikeCode()); |
| | | } |
| | | logInfo = bike!=null?bike.getForceBackInfo():null; |
| | | Integer freeRentTime = Integer.valueOf(collect.get(Constants.FREE_RENT_TIME).getCode()); |
| | |
| | | /** |
| | | * 妿æ¯çµè½¦ï¼è¯·æ±web端æ¥å£å
³é车è¾ä¿¡æ¯ |
| | | */ |
| | | private Bikes sendCloseElecBikeRequest(String bikeCode,int type) { |
| | | private Bikes sendCloseElecBikeRequest(String goodOrderId,String bikeCode) { |
| | | Bikes bike = bikesMapper.selectOne(new QueryWrapper<Bikes>().lambda() |
| | | .eq(Bikes::getType,Constants.ONE) |
| | | .eq(Bikes::getIsdeleted,Constants.ZERO) |
| | |
| | | //请æ±å°å |
| | | String url = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ELEC_BIKE_CONTRIL_API_URL).getCode(); |
| | | JSONObject param = new JSONObject(); |
| | | param.put("clientId",StringTools.leftTrip(bike.getDeviceSn(),'0')); |
| | | param.put("type",type);//0å¼é 1å
³é |
| | | param.put("id", goodOrderId); |
| | | String res = HttpsUtil.postJsonString(url,param.toJSONString()); |
| | | JSONObject json = JSONObject.parseObject(res); |
| | | if(json.get("code").equals("200")){ |
| | |
| | | }else{ |
| | | bike.setForceBackInfo("强å¶è¿è½¦å
³é车é失败,æªç»å®æ§å¶å¨snï¼"); |
| | | } |
| | | bikesMapper.updateById(bike); |
| | | return bike; |
| | | } |
| | | // private Bikes sendCloseElecBikeRequest(String bikeCode,int type) { |
| | | // Bikes bike = bikesMapper.selectOne(new QueryWrapper<Bikes>().lambda() |
| | | // .eq(Bikes::getType,Constants.ONE) |
| | | // .eq(Bikes::getIsdeleted,Constants.ZERO) |
| | | // .eq(Bikes::getCode,bikeCode) |
| | | // ); |
| | | // if(bike == null){ |
| | | // return null; |
| | | // } |
| | | // bike.setForceBackInfo("强å¶è¿è½¦å
³é车é失败ï¼"); |
| | | // if(StringUtils.isNotBlank(bike.getDeviceSn())){ |
| | | // try { |
| | | // //请æ±å°å |
| | | // String url = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ELEC_BIKE_CONTRIL_API_URL).getCode(); |
| | | // JSONObject param = new JSONObject(); |
| | | // param.put("clientId",StringTools.leftTrip(bike.getDeviceSn(),'0')); |
| | | // param.put("type",type);//0å¼é 1å
³é |
| | | // String res = HttpsUtil.postJsonString(url,param.toJSONString()); |
| | | // JSONObject json = JSONObject.parseObject(res); |
| | | // if(json.get("code").equals("200")){ |
| | | // //åèµ·æä»¤æå |
| | | // bike.setForceBackInfo("强å¶è¿è½¦å
³é车éæåï¼"); |
| | | // }else{ |
| | | // bike.setForceBackInfo("强å¶è¿è½¦å
³é车é失败ï¼"+json.get("msg")); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // }else{ |
| | | // bike.setForceBackInfo("强å¶è¿è½¦å
³é车é失败,æªç»å®æ§å¶å¨snï¼"); |
| | | // } |
| | | // bikesMapper.updateById(bike); |
| | | // return bike; |
| | | // } |
| | | |
| | | public static void main(String[] args) { |
| | | String url = "http://localhost:10025/jtt808/device/8500"; |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å½å车è¾ç±»åæ æ³ç§èµï¼è¯·è系管çåï¼"); |
| | | } |
| | | memberRidesResponse.setBikeCode(bike.getCode()); |
| | | memberRidesResponse.setBikeTypeName(baseParam.getName()); |
| | | memberRidesResponse.setBikeType(baseParam.getName()); |
| | | MemberRides memberRides = new MemberRides(); |
| | | this.dealMemberRidesData(baseParam.getId(),memberRides); |
| | | memberRidesResponse.setBasePrice(memberRides.getBasePrice()); |
| | |
| | | memberRidesResponse.getUnitPrice() |
| | | ,memberRidesResponse.getUnitTime())); |
| | | //æ¥è¯¢å½åçéªè¡å¥é¤ |
| | | memberRidesResponse.setDiscountMember(goodsorderService.getUseDiscount(memberId,Constants.ZERO)); |
| | | memberRidesResponse.setDiscountMember(goodsorderService.getUseDiscount(memberId,Constants.ZERO,bikeType)); |
| | | return memberRidesResponse; |
| | | } |
| | | |
| | |
| | | //è´ä¹°å¥é¤ å¤çå
容 |
| | | DiscountMember discountMember = discountMemberMapper.selectById(transactions.getObjId()); |
| | | if(Objects.nonNull(discountMember)){ |
| | | transactions.setContent(discountMember.getName() +" æææ" + DateUtil.dateToString(discountMember.getUseStartDate(),"yyyy-MM-dd") +"-"+DateUtil.dateToString(discountMember.getUseEndDate(),"yyyy-MM-dd")); |
| | | transactions.setContent(discountMember.getName() +" | æææ" + DateUtil.dateToString(discountMember.getUseStartDate(),"yyyy-MM-dd") +" è³ "+DateUtil.dateToString(discountMember.getUseEndDate(),"yyyy-MM-dd")); |
| | | } |
| | | }else if(Constants.equalsInteger(transactions.getType(),Constants.TRANSACTIONS_TYPE.PLATFORM_REFUND.getKey())){ |
| | | DiscountMember discountMember = discountMemberMapper.selectOne( |
| | | new QueryWrapper<DiscountMember>().lambda().eq(DiscountMember::getGoodsorderId, transactions.getOrderId()).last("limit 1")); |
| | | if(Objects.nonNull(discountMember)){ |
| | | transactions.setContent(discountMember.getName() +" æææ" + DateUtil.dateToString(discountMember.getUseStartDate(),"yyyy-MM-dd") +"-"+DateUtil.dateToString(discountMember.getUseEndDate(),"yyyy-MM-dd")); |
| | | transactions.setContent(discountMember.getName() +" | æææ" + DateUtil.dateToString(discountMember.getUseStartDate(),"yyyy-MM-dd") +" è³ "+DateUtil.dateToString(discountMember.getUseEndDate(),"yyyy-MM-dd")); |
| | | } |
| | | } |
| | | } |
| | |
| | | apiV3Key: iF3kC8pL8dZ9iU3hN5fX9zI6eF4xQ6fT |
| | | serialNumer: 368B835A194384FD583B83B77977B84127D2F655 |
| | | mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | notifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxPayNotify |
| | | refundNotifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxRefundNotify |
| | | # notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify |
| | | keyPath: D://apiclient_cert.p12 |
| | | privateCertPath: D://apiclient_cert.pem |
| | | privateKeyPath: D://apiclient_key.pem |
| | | # notifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxPayNotify |
| | | # refundNotifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxRefundNotify |
| | | notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify |
| | | refundNotifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxRefundNotify |
| | | keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 |
| | | privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem |
| | | privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem |
| | | #æå¡å-------------end--- |
| | | existsSub: 1 |
| | | appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 |
| | |
| | | public ApiResponse<PageData<Discount>> discountPage (@RequestBody PageWrap<Discount> pageWrap) { |
| | | Discount discount = new Discount(); |
| | | discount.setStatus(Constants.ZERO); |
| | | discount.setMinShow(Constants.ZERO); |
| | | pageWrap.setModel(discount); |
| | | return ApiResponse.success(discountService.findPage(pageWrap)); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse openElecBike(@RequestBody OpenElecBikeRequest param) { |
| | | public ApiResponse<MemberRidesDetailResponse> openElecBike(@RequestBody OpenElecBikeRequest param) { |
| | | param.setMemberId(getMemberId()); |
| | | jtt808Service.openLock(param); |
| | | return ApiResponse.success( null); |
| | | return ApiResponse.success(jtt808Service.openLock(param)); |
| | | } |
| | | |
| | | @LoginRequired |
| | |
| | | return ApiResponse.success( null); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "强å¶è¿è½¦", notes = "强å¶è¿è½¦") |
| | | @PostMapping("/forceBack") |
| | | public ApiResponse forceBack(@RequestBody Goodsorder goodsorder) { |
| | | jtt808Service.forceBack(goodsorder.getId()); |
| | | return ApiResponse.success( null); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private MemberRidesJoinMapper memberRidesJoinMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private PricingParamMapper pricingParamMapper; |
| | | |
| | |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * æå¨è¿è½¦ |
| | | * @param param |
| | | */ |
| | | @Transactional(rollbackFor = {BusinessException.class}) |
| | | public void backElecBike(BackElecBikeRequest param) { |
| | | Member member = memberMapper.selectById(param.getMemberId()); |
| | |
| | | gparam.setStatus(Constants.goodsorderStatus.pay); |
| | | gparam.setType(Constants.ZERO); |
| | | Goodsorder goodsorder = goodsorderService.findOne(gparam); |
| | | this.backBike(goodsorder); |
| | | } |
| | | |
| | | /** |
| | | * èªå¨è¿è½¦ |
| | | * @param id |
| | | */ |
| | | @Transactional |
| | | public void forceBack(String id){ |
| | | Goodsorder goodsorder = goodsorderService.findById(id); |
| | | this.backBike(goodsorder); |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = {BusinessException.class}) |
| | | public void backBike(Goodsorder goodsorder){ |
| | | if(Objects.isNull(goodsorder)){ |
| | | throw new BusinessException(ResponseStatus.NO_UNCLOSEED_ORDER.getCode(),"æ éªè¡è®¢åè®°å½"); |
| | | } |
| | |
| | | if(Constants.equalsInteger(rides.getStatus(),Constants.MEMBER_RIDES_STATUS.RIDES_RUNNING.getKey()) |
| | | &&Constants.equalsInteger(rides.getType(),Constants.ONE)){ |
| | | //妿æ¯çµè½¦å¹¶ä¸æ¯éªè¡ä¸ è¿è¡å
³éå¤ç |
| | | // Bikes bike = getElecBikeByCode(rides.getBikeCode()); |
| | | // //æ¥è¯¢å车ç«ç¹ä¿¡æ¯ |
| | | // if(bike.getSiteId() ==null){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对ä¸èµ·ï¼è¯·æè¦æ±åå¾å车ç¹å车ï¼"); |
| | | // } |
| | | // lockBikes(bike.getDeviceSn(),Constants.ZERO);//åèµ·å
³éæä»¤è¯·æ± |
| | | Bikes bike = getElecBikeByCode(rides.getBikeCode()); |
| | | //æ¥è¯¢å车ç«ç¹ä¿¡æ¯ |
| | | if(bike.getSiteId() ==null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对ä¸èµ·ï¼è¯·æè¦æ±åå¾å车ç¹å车ï¼"); |
| | | } |
| | | lockBikes(bike.getDeviceSn(),Constants.ZERO);//åèµ·å
³éæä»¤è¯·æ± |
| | | backIds.add(rides.getId()); |
| | | rides.setStatus(Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey());//å·²è¿è½¦ |
| | | // rides.setBackSiteId(bike.getSiteId());//è¿è½¦ç«ç¹ |
| | | rides.setBackSiteId(bike.getSiteId());//è¿è½¦ç«ç¹ |
| | | |
| | | rides.setBackDate(new Date()); |
| | | Integer freeRentTime = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME, Constants.FREE_RENT_TIME).getCode()); |
| | |
| | | APIResult<T0201_0500> data = result.block(); |
| | | if(!data.isSuccess()){ |
| | | //妿å¼é失败ï¼åè¿åå¼å¸¸ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼"+(type ==0?"车è¾å¼é":"车è¾å
³é")+"失败ï¼è¯·ç¨åéè¯ï¼æè
èç³»ååºç®¡ç人åï¼"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼"+(type ==0?"车è¾å
³é":"车è¾å¼é")+"失败ï¼è¯·ç¨åéè¯ï¼æè
èç³»ååºç®¡ç人åï¼"); |
| | | } |
| | | } |
| | | |
| | |
| | | Goodsorder gparam = new Goodsorder(); |
| | | gparam.setMemberId(param.getMemberId()); |
| | | gparam.setStatus(Constants.goodsorderStatus.pay); |
| | | gparam.setType(Constants.ZERO); |
| | | Goodsorder goodsorder = goodsorderService.findOne(gparam); |
| | | if(Objects.isNull(goodsorder)){ |
| | | throw new BusinessException(ResponseStatus.NO_UNCLOSEED_ORDER.getCode(),"对ä¸èµ·ï¼æªæ¥è¯¢å°æ¨å½åæéªè¡ä¸è®¢åè®°å½"); |
| | |
| | | if(memberRides ==null || memberRides.getBikeCode() == null){ |
| | | throw new BusinessException(ResponseStatus.NO_UNCLOSEED_ORDER.getCode(),"对ä¸èµ·ï¼æªæ¥è¯¢å°æ¨å½åæéªè¡ä¸è®°å½"); |
| | | } |
| | | // Bikes bike = getElecBikeByCode(memberRides.getBikeCode()); |
| | | // //æ¥è¯¢å车ä½ç½®æ¯å¦ç¬¦åå车ä½ç½®è§è |
| | | // checkPausePostionBiz(bike); |
| | | Bikes bike = getElecBikeByCode(memberRides.getBikeCode()); |
| | | //æ¥è¯¢å车ä½ç½®æ¯å¦ç¬¦åå车ä½ç½®è§è |
| | | checkPausePostionBiz(bike); |
| | | memberRides.setPauseDate(new Date()); |
| | | memberRides.setEditDate(memberRides.getBackDate()); |
| | | memberRides.setStatus(Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING.getKey()); |
| | |
| | | //å¦æè½¦è¾ç±»åæ¯ç©º |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), " è¯¥è½¦åææ¶ä¸è½å车æä½å¦ï¼è¯·æ´æ¢å
¶ä»è½¦åéè¯ï¼"); |
| | | } |
| | | cacheOpenLock.put(bike.getCode(), 1); |
| | | cacheOpenLock.put(openElecBikeRequest.getCode(), 1); |
| | | try { |
| | | //夿å½åæ¯å¦å·²æ¯ä»æ¼é |
| | | Goodsorder goodsorder = goodsorderService.findOneByWrapper(new QueryWrapper<Goodsorder>() |
| | |
| | | //æ ¹æ®è½¦åæ¥è¯¢è®¡ä»·æ¹æ¡ |
| | | isValidePricingType(bike,memberRides) ; |
| | | MemberRidesDetailResponse memberRidesDetailResponse = new MemberRidesDetailResponse(); |
| | | // this.lockBikes(bike.getDeviceSn(),1); |
| | | this.lockBikes(bike.getDeviceSn(),1); |
| | | //åå¨éªè¡è®°å½ |
| | | memberRides.setId(Constants.getUUID()); |
| | | memberRides.setIsdeleted(Constants.ZERO); |
| | |
| | | memberRidesJoinMapper.insert(memberRides); |
| | | BeanUtils.copyProperties(memberRides, memberRidesDetailResponse); |
| | | return memberRidesDetailResponse; |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "å¼é失败ï¼è¯·è系管çå"); |
| | | }catch (BusinessException biz){ |
| | | throw biz; |
| | | }catch (Exception biz){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR); |
| | | }finally { |
| | | cacheOpenLock.remove(bike.getCode()); |
| | | cacheOpenLock.remove(openElecBikeRequest.getCode()); |
| | | } |
| | | } |
| | | |
| | |
| | | Goodsorder gparam = new Goodsorder(); |
| | | gparam.setMemberId(param.getMemberId()); |
| | | gparam.setStatus(Constants.goodsorderStatus.pay); |
| | | gparam.setType(Constants.ZERO); |
| | | Goodsorder goodsorder = goodsorderService.findOne(gparam); |
| | | if(Objects.isNull(goodsorder)){ |
| | | throw new BusinessException(ResponseStatus.NO_UNCLOSEED_ORDER.getCode(),"对ä¸èµ·ï¼æªæ¥è¯¢å°æ¨å½åæéªè¡ä¸è®¢åè®°å½"); |
| | |
| | | .eq(MemberRides::getIsdeleted,Constants.ZERO) |
| | | .eq(MemberRides::getType,Constants.ONE) |
| | | .eq(MemberRides::getStatus,Constants.MEMBER_RIDES_STATUS.RIDES_PAUSING.getKey()) |
| | | .apply(" NOW() >= t.create_date + INTERVAL '2 hours' ") |
| | | .apply(" NOW() >= (t.create_date + INTERVAL '"+systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME,Constants.PAUSE_AUTO_CLOSE_TIME).getCode()+" min') ") |
| | | ); |
| | | |
| | | ; |
| | | for (MemberRides timeOutRides:memberRidesList) { |
| | | Goodsorder goodsorder = goodsorderService.findById(timeOutRides.getOrdreId()); |
| | | //æ¥è¯¢éªè¡è®°å½ |
| | |
| | | rides.setStatus(Constants.MEMBER_RIDES_STATUS.BACK_CYCLING.getKey());//å·²è¿è½¦ |
| | | rides.setBackSiteId(bike.getSiteId());//è¿è½¦ç«ç¹ |
| | | rides.setBackDate(new Date()); |
| | | Integer freeRentTime = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.MINI_PROGRAMME, Constants.FREE_RENT_TIME).getCode()); |
| | | Integer rideTime = DateUtil.betweenMin(rides.getRentDate(), rides.getBackDate()); |
| | | //计ç®éªè¡è®¡è´¹æ¶é¿ |
| | | rides.setDuration( rideTime > freeRentTime ? rideTime : 0 ); |
| | | rides.setEditDate(rides.getBackDate()); |
| | | memberRidesJoinMapper.updateById(rides);//æ´æ°éªè¡ç¶æä¸ºå·²è¿è½¦ |
| | | } |
| | |
| | | //åéå°ç¨åºéç¥ |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | if(Objects.nonNull(member)&&StringUtils.isNotBlank(member.getOpenid())){ |
| | | sendWxMessage.bookingsCancel(member.getOpenid(),goodsorder.getId(), WxMiniConfig.wxMaService.getAccessToken(),timeOutRides.getBikeCode(),goodsorder.getPayDate(),goodsorder.getEndDate()); |
| | | sendWxMessage.bookingsCancel(member.getOpenid(),goodsorder.getId(), |
| | | WxMiniConfig.wxMaService.getAccessToken(), |
| | | timeOutRides.getBikeCode(),goodsorder.getPayDate(),goodsorder.getEditDate()); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |