This commit is contained in:
zhaohengkun 2024-10-29 11:35:05 +08:00
parent dc6551a581
commit bafcf724f1
22 changed files with 1104 additions and 919 deletions

View File

@ -36,6 +36,17 @@ export function getTradingPageApi(query) {
})
}
// 油站端 - 财务报表 -交易对账-交易明细 表格数据
export function transactionList(query) {
return request({
url: 'business/allOrderInfo/transactionList',
method: 'get',
params: query
})
}
export function getInstituionListApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByInstituion',
@ -107,6 +118,15 @@ export function getTissueByDataApi(query) {
})
}
// 油站端- 交易明细-统计数据
export function orderStatistics(query) {
return request({
url: 'business/allOrderInfo/orderStatistics',
method: 'get',
params: query
})
}
export function exportExcelTradingApi(data) {

View File

@ -1,7 +1,7 @@
<!-- 收银台订单-->
<template>
<div class="container">
<div class="new-top" >
<div class="new-top">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="">
<el-input style="width: 215px;" v-model="queryParams.orderNo" placeholder="请输入订单号"></el-input>
@ -10,7 +10,7 @@
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="请选择订单类型"
placeholder="请选择订单类型"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
@ -30,18 +30,18 @@
</el-form-item>
<el-form-item label="" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="请选择支付方式"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="请选择支付方式"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="status">
<el-select
v-model="queryParams.status"
@ -102,18 +102,18 @@
placeholder="交易结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right; margin-right: 0px ">
<el-form-item style="float: right; margin-right: 0px ">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" >导出</el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
</div>
<div class="wit_box" >
<div class="wit_box">
<div class="box-gang">
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start" >
<div class="size-bole">{{ wechat}}/{{ wechats}}</div>
<el-tooltip class="item" effect="dark" placement="top-start">
<div class="size-bole">{{ map.s1 || 0 }}/{{ map.s2 || 0 }}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
@ -121,8 +121,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">{{ orderStatistics.alipay?orderStatistics.alipay:0 }}/0</div>
<el-tooltip class="item" effect="dark" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">{{ map.s3 || 0 }}/{{ map.s4 || 0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -131,28 +131,19 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#F44522;" >{{ orderStatistics.balance?orderStatistics.balance:0 }}/0</div>
<el-tooltip class="item" effect="dark" placement="top-start">
<div class="size-bole" style="color:#F44522;">{{ map.s5 || 0 }}/{{ map.s6 || 0 }}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #F44522"></div>
<div class="nei">云闪付收款/笔数</div>
<div class="nei">银联二维码/笔数</div>
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#FF7E00;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #FF7E00"></div>
<div class="nei">pos机收款/笔数</div>
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#0D2ED8;">{{ orderStatistics.cash?orderStatistics.cash:0 }}/0</div>
<div class="size-bole" style="color:#0D2ED8;">{{ map.s7 || 0 }}/{{ map.s8 || 0 }}</div>
</el-tooltip>
@ -162,8 +153,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#790DD8;">{{orderStatistics.cashcount?orderStatistics.cashcount:0}}/0</div>
<el-tooltip class="item" effect="dark" placement="top-start">
<div class="size-bole" style="color:#790DD8;">{{ map.s9 || 0 }}/{{ map.s10 || 0 }} </div>
</el-tooltip>
<div class="size-hui">
@ -172,8 +163,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#D80D54;">999999/999999999999</div>
<el-tooltip class="item" effect="dark" placement="top-start">
<div class="size-bole" style="color:#D80D54;">{{ map.s11 || 0 }}/{{ map.s12 || 0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -188,7 +179,7 @@
border
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"></el-table-column>
<el-table-column prop="payChannel" align="center" label="订单类型">
<template slot-scope="scope">
<span v-if="scope.row.payChannel=='cashier'">收银台</span>
@ -200,27 +191,30 @@
</el-table-column>
<el-table-column prop="type" align="center" label="订单分类">
<template slot-scope="scope">
<span v-if="scope.row.type=='1'">油品</span>
<span v-else-if="scope.row.type=='2'">商品</span>
<span v-else-if="scope.row.type=='3'">储值卡</span>
<span v-else-if="scope.row.type=='4'">积分</span>
<span v-else-if="scope.row.type=='5'">囤油卡</span>
<span v-else-if="scope.row.type=='6'">油品加商品(收银台订单)</span>
<span v-if="scope.row.type=='1'">油品订单</span>
<span v-else-if="scope.row.type=='2'">商品订单</span>
<span v-else-if="scope.row.type=='3'">储值卡订单</span>
<span v-else-if="scope.row.type=='4'">积分商城订单</span>
<span v-else-if="scope.row.type=='5'">囤油卡订单</span>
<span v-else-if="scope.row.type=='6'">收银台订单</span>
<span v-else-if="scope.row.type=='7'">挂账订单</span>
<span v-else="">其他</span>
<span v-else-if="scope.row.type=='8'">POS订单</span>
<span v-else>其他</span>
</template>
</el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额(元)">
</el-table-column>
<el-table-column prop="discountAmount" align="center" label="优惠金额(元)"></el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额(元)"></el-table-column>
<el-table-column prop="payMoney" align="center" label="会员付款金额(元)"></el-table-column>
<el-table-column prop="payMoney" align="center" label="归还金额(元)">
<template slot-scope="scope">
<span v-if="scope.row.type=='3'">{{scope.row.goodsMoney + scope.row.payMoney}}</span>
<span v-else>{{scope.row.goodsMoney}}</span>
<span v-if="scope.row.type == 7">{{ scope.row.goodsMoney}}</span>
<span v-else> -- </span>
</template>
</el-table-column>
<el-table-column prop="payMoney" align="center" label="优惠金额(元)"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额(元)"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="会员付款金额(元)"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="挂账/归还金额(元)"> </el-table-column>
<el-table-column prop="userName" align="center" label="付款用户" > </el-table-column>
<el-table-column prop="userName" align="center" label="付款用户"></el-table-column>
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<span v-if="scope.row.payType=='CASH'">现金</span>
@ -231,18 +225,18 @@
</el-table-column>
<el-table-column prop="status" align="center" label="订单状态">
<template slot-scope="scope">
<div v-if="scope.row.status == 'unpaid'" style="color: #F44522">未支付</div>
<div v-else-if="scope.row.status == 'paid'" style="color: #0DC291">已支付</div>
<div v-if="scope.row.status == 'unpaid'" style="color: #F44522">未支付</div>
<div v-else-if="scope.row.status == 'paid'" style="color: #0DC291">已支付</div>
<div v-else-if="scope.row.status == 'refund'" style="color: #F44522">已退款</div>
<div v-else style="color: #F44522">支付失败</div>
</template>
</el-table-column>
<el-table-column prop="mchntCd" align="center" label="支付渠道"> </el-table-column>
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="createBy" align="center" label="关联员工"> </el-table-column>
<el-table-column prop="merchantName" align="center" label="支付渠道"></el-table-column>
<el-table-column prop="mchntCd" align="center" label="商户号"></el-table-column>
<el-table-column prop="createBy" align="center" label="关联员工"></el-table-column>
<el-table-column prop="createTime" align="center" label="订单创建时间" width="220"> </el-table-column>
<el-table-column prop="updateTime" align="center" label="订单完成时间" width="220"> </el-table-column>
<el-table-column prop="createTime" align="center" label="订单创建时间" width="220"></el-table-column>
<el-table-column prop="updateTime" align="center" label="订单完成时间" width="220"></el-table-column>
</el-table>
</div>
<pagination
@ -257,42 +251,42 @@
title="订单信息"
:visible.sync="dialogVisible">
<el-descriptions :title="'订单号:'+ordersInfo.orderNo">
<el-descriptions-item label="门店">{{ordersInfo.storeName}}</el-descriptions-item>
<el-descriptions-item label="收银员">{{ordersInfo.createBy}}</el-descriptions-item>
<el-descriptions-item label="支付渠道">{{ordersInfo.payChannel}}</el-descriptions-item>
<el-descriptions-item label="商户号">{{ordersInfo.mchntCd}}</el-descriptions-item>
<el-descriptions-item label="费率">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="订单来源">{{ordersInfo.type}}</el-descriptions-item>
<el-descriptions-item label="所属模块">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{ordersInfo.payType}}</el-descriptions-item>
<el-descriptions-item label="付款用户">{{ordersInfo.userName}}</el-descriptions-item>
<el-descriptions-item label="支付状态">{{ordersInfo.status}}</el-descriptions-item>
<el-descriptions-item label="备注">{{ordersInfo.content}}</el-descriptions-item>
<el-descriptions-item label="门店">{{ ordersInfo.storeName }}</el-descriptions-item>
<el-descriptions-item label="收银员">{{ ordersInfo.createBy }}</el-descriptions-item>
<el-descriptions-item label="支付渠道">{{ ordersInfo.payChannel }}</el-descriptions-item>
<el-descriptions-item label="商户号">{{ ordersInfo.mchntCd }}</el-descriptions-item>
<el-descriptions-item label="费率">{{ ordersInfo.amount }}</el-descriptions-item>
<el-descriptions-item label="订单来源">{{ ordersInfo.type }}</el-descriptions-item>
<el-descriptions-item label="所属模块">{{ ordersInfo.amount }}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{ ordersInfo.payType }}</el-descriptions-item>
<el-descriptions-item label="付款用户">{{ ordersInfo.userName }}</el-descriptions-item>
<el-descriptions-item label="支付状态">{{ ordersInfo.status }}</el-descriptions-item>
<el-descriptions-item label="备注">{{ ordersInfo.content }}</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="金额详情" :column="3" border>
<el-descriptions-item>
<template slot="label">
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
{{ ordersInfo.goodsMoney ? ordersInfo.goodsMoney : "--" }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
{{ ordersInfo.payMoney ? ordersInfo.payMoney : "--" }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
{{ ordersInfo.refMoney ? ordersInfo.refMoney : "--" }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
{{ ordersInfo.payMoney ? ordersInfo.payMoney : "--" }}
</el-descriptions-item>
</el-descriptions>
@ -304,312 +298,317 @@
<script>
import {
exportExcelTradingApi, getmyDataApi,
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi
exportExcelTradingApi,
orderStatistics,
transactionList
} from "@/api/allOrder";
export default {
name: "reconciliation-trading",
data(){
return{
wechat:999999999999999,
wechats:999999999999999,
radio1:"油号选错",
loading:false,
dialogVisible:false,
//
staffList:[],
ordersInfo:{},
//
dateRange: [],
beginTime:"",
endTime:"",
//
isSysDate:false,
//
orderList:[],
deptList:[],
export default {
name: "reconciliation-trading",
data() {
return {
map:{},
radio1: "油号选错",
loading: false,
dialogVisible: false,
//
staffList: [],
ordersInfo: {},
//
dateRange: [],
beginTime: "",
endTime: "",
//
isSysDate: false,
//
orderList: [],
deptList: [],
//
queryParams: {
page: 1,
pageSize: 10,
beginTime:"",
endTime:"",
orderNo:"",
status:"",
payType:"",
payChannel:"",
deptType:"3",
storeId:"",
deptId:"",
},
orderStatistics:{
CASH:"0",
WECHAT:"0",
ALIPAY:"0",
balance:"0",
CASHCount:"0",
WECHATCount:"0",
ALIPAYCount:"0",
balanceCount:"0",
refBalance:"0",
refBalanceCount:"0",
},
total:0,
//
queryParams: {
page: 1,
pageSize: 10,
beginTime: "",
endTime: "",
orderNo: "",
status: "",
payType: "",
payChannel: "",
deptType: "3",
storeId: "",
deptId: "",
},
orderStatistics: {
CASH: "0",
WECHAT: "0",
ALIPAY: "0",
balance: "0",
CASHCount: "0",
WECHATCount: "0",
ALIPAYCount: "0",
balanceCount: "0",
refBalance: "0",
refBalanceCount: "0",
},
total: 0,
}
},
async created() {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.dateRange = [start, new Date()];
this.beginTime = start
this.endTime = new Date()
this.isSysDate = true
await this.getDeptList();
// this.getList();
},
methods: {
async getDeptList() {
this.getList()
},
exportExcelCashier() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res => {
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob, '交易明细统计.xLsx')
})
},
async created() {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.dateRange = [start,new Date()];
this.beginTime = start
this.endTime = new Date()
this.isSysDate = true
await this.getDeptList();
// this.getList();
//
async getOrderStatistics() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
orderStatistics(this.addDateRange(this.queryParams, dateRange)).then(res => {
this.map = res.data
})
},
methods:{
async getDeptList() {
// getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
// this.deptList = response.data.records;
// })
await getmyDataApi(this.addDateRange(this.queryParams)).then( response => {
this.queryParams.deptId = response.data.deptId;
this.getList()
})
},
exportExcelCashier() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'交易明细统计.xLsx')
})
},
//
async getOrderStatistics() {
// await this.getDeptList()
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getTissueByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
//
async getList(val){
// await this.getDeptList()
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getTradingPageApi(this.addDateRange(this.queryParams,dateRange)).then( response => {
//
async getList(val) {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
transactionList(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
// this.getDeptList()
this.getOrderStatistics()
this.getOrderStatistics()
})
},
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
},
//
handleQuery() {
this.queryParams.page = 1;
this.getDeptList()
})
},
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
},
//
handleQuery() {
this.queryParams.page = 1;
this.getDeptList()
// this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.queryParams = {
page: 1,
pageSize: 10,
deptType:"3",
}
this.beginTime = ""
this.endTime = ""
this.getDeptList()
// this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.queryParams = {
page: 1,
pageSize: 10,
deptType: "3",
}
this.beginTime = ""
this.endTime = ""
this.getDeptList()
this.handleQuery();
},
}
this.handleQuery();
},
}
}
</script>
<style scoped lang="scss">
.container{
.container {
background: #f4f5f9;
box-sizing: border-box;
padding-bottom: 8px;
//height: 87.5vh;
}
.app-top{
width: 100%;
height: 60px;
box-sizing: border-box;
padding: 10px;
}
.clearfix{
width: 100%;
.app-top {
width: 100%;
}
.box-card{
width: 100%;
margin-bottom: 15px;
}
.box-gang{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.box{
//box-sizing: border-box;
padding: 5px;
//background: #f9f9f9;
padding-left: 20px;
height: 60px;
box-sizing: border-box;
padding: 10px;
}
width: 211px;
height: 60px;
background:#fff;
border-radius: 10px;
border: 1px solid #FF9655;
.clearfix {
width: 100%;
}
.size-hui{
display: flex;
align-items: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 13px;
color: #888888;
text-align: left;
font-style: normal;
text-transform: none;
}
.nei {
color: #333333;
width: 150px;
}
.box-card {
width: 100%;
margin-bottom: 15px;
}
.box-gang {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.box {
//box-sizing: border-box;
padding: 5px;
//background: #f9f9f9;
padding-left: 20px;
width: 211px;
height: 60px;
background: #fff;
border-radius: 10px;
border: 1px solid #FF9655;
}
.size-hui {
display: flex;
align-items: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 13px;
color: #888888;
text-align: left;
font-style: normal;
text-transform: none;
.nei {
color: #333333;
width: 150px;
}
.dian{
width: 6px;
height: 6px;
}
.dian {
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 5px;
}
margin-right: 5px;
}
.el-form--inline .el-form-item {
margin-bottom: 15px;
margin-right: 21px;
}
.icon-img{
.el-form--inline .el-form-item {
margin-bottom: 15px;
margin-right: 21px;
}
//margin-left: 110px;
width: 100%;
height: 20px;
margin-right: 5px;
img{
float: right;
//width: 100%;
width: 20px;
.icon-img {
height: 100%;
}
}
.f-button{
width: 100%;
float: right ;
text-align: right;
}
.size-bole{
//font-weight: bold;
//margin-left: 110px;
width: 100%;
height: 20px;
margin-right: 5px;
//width: 53px;
height: 31px;
//font-family: YouSheBiaoTiHei;
font-size: 24px;
color: #0DC291;
font-weight: 600;
font-size: 24px;
//line-height: 0px;
text-align: left;
font-style: normal;
text-transform: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.wgang{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
img {
float: right;
//width: 100%;
width: 20px;
height: 100%;
}
.table-box{
width: 100%;
height: 58vh;
overflow: auto;
}
.pagination-box{
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
}
.top-app-sou{
width: 20%;
}
.tk{
text-align: center;
color: grey;
margin: 10px 0;
}
.new-top{
width: 98%;
background: #FFFFFF;
margin: 15px auto;
height: 115px;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
margin-bottom: 5px;
}
.wit_box{
width: 98%;
background: #FFFFFF;
margin: 5px auto;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
height: 74vh;
}
}
.f-button {
width: 100%;
float: right;
text-align: right;
}
.size-bole {
//font-weight: bold;
//width: 53px;
height: 31px;
//font-family: YouSheBiaoTiHei;
font-size: 24px;
color: #0DC291;
font-weight: 600;
font-size: 24px;
//line-height: 0px;
text-align: left;
font-style: normal;
text-transform: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.wgang {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
.table-box {
width: 100%;
height: 58vh;
overflow: auto;
}
.pagination-box {
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
}
.top-app-sou {
width: 20%;
}
.tk {
text-align: center;
color: grey;
margin: 10px 0;
}
.new-top {
width: 98%;
background: #FFFFFF;
margin: 15px auto;
height: 115px;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
margin-bottom: 5px;
}
.wit_box {
width: 98%;
background: #FFFFFF;
margin: 5px auto;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
height: 74vh;
}
</style>

View File

@ -58,6 +58,18 @@ public class CardCouponUserController extends BaseController {
return getSuccessResult(this.cardCouponUserService.getById(id));
}
/**
* 通过主键查询 单条数据 并关联查询优惠券名称
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("/selectOneCardName")
public ResponseObject selectOneCardName(@RequestParam("id") Serializable id) {
return getSuccessResult(this.cardCouponUserService.selectOneCardName(Integer.parseInt(id.toString())));
}
/**
* 新增数据
*

View File

@ -48,5 +48,10 @@ public interface CardCouponUserMapper extends BaseMapper<CardCouponUser> {
List<Map<String, Object>> selectUserCardVerification(@Param("str") String str);
CardCouponUser selectByOrderId(String orderNo);
CardCouponUserVo selectOneCardName(Integer id);
}

View File

@ -2,23 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper">
<select id="selectAllList" resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponVO">
SELECT
cc.*,
main.id AS dataId,
main.mt_user_id AS mtUserId
FROM
card_coupon_user main
INNER JOIN card_coupon cc ON main.card_coupon_id = cc.id
WHERE
main.store_id = #{storeId}
AND main.mt_user_id = #{userId}
AND main.`status` = '0'
AND cc.`type` != '2'
AND main.start_time &lt;= #{nowDate} AND main.end_time &gt;= #{nowDate}
SELECT cc.*,
main.id AS dataId,
main.mt_user_id AS mtUserId
FROM card_coupon_user main
INNER JOIN card_coupon cc ON main.card_coupon_id = cc.id
WHERE main.store_id = #{storeId}
AND main.mt_user_id = #{userId}
AND main.`status` = '0'
AND cc.`type` != '2'
AND main.start_time &lt;= #{nowDate}
AND main.end_time &gt;= #{nowDate}
</select>
<select id="queryPage" resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo">
SELECT ccu.*,cc.`name` couponName,cc.type,cc.use_condition FROM card_coupon_user ccu
LEFT JOIN card_coupon cc ON ccu.card_coupon_id = cc.id
LEFT JOIN card_coupon cc ON ccu.card_coupon_id = cc.id
<where>
ccu.mt_user_id = #{entity.mtUserId}
<if test="entity.storeId != null and entity.storeId != ''">
@ -30,50 +28,57 @@
</where>
</select>
<select id="selectCouponCount" resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUniVo">
SELECT
card_coupon_id id,
count(1) count
SELECT card_coupon_id id,
count(1) count
FROM card_coupon_user
WHERE store_id = #{storeId} AND mt_user_id = #{userId}
WHERE store_id = #{storeId}
AND mt_user_id = #{userId}
group by card_coupon_id
</select>
<select id="selectCardCouponUserList"
resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser">
select * from card_coupon_user
<where>
<if test="params.mtUserId != null and params.mtUserId != ''">
and mt_user_id = #{params.mtUserId}
</if>
<if test="params.cardCouponId != null and params.cardCouponId != ''">
and card_coupon_id = #{params.cardCouponId}
</if>
<if test="params.createTimeStart != null">
and create_time &gt;= #{params.createTimeStart}
</if>
<if test="params.createTimeEnd != null">
and create_time &lt;= #{params.createTimeEnd}
</if>
</where>
select * from card_coupon_user
<where>
<if test="params.mtUserId != null and params.mtUserId != ''">
and mt_user_id = #{params.mtUserId}
</if>
<if test="params.cardCouponId != null and params.cardCouponId != ''">
and card_coupon_id = #{params.cardCouponId}
</if>
<if test="params.createTimeStart != null">
and create_time &gt;= #{params.createTimeStart}
</if>
<if test="params.createTimeEnd != null">
and create_time &lt;= #{params.createTimeEnd}
</if>
</where>
</select>
<select id="selectUserCardVerification" resultType="map">
SELECT
userCard.id as id ,
mtUser.NAME as mobile ,
userCard.verification_code as ticketCode ,
card.name as exchangeName,
card.exchange_content as exchangeContent
FROM
( SELECT * FROM card_coupon_user WHERE mobile = #{str} OR verification_code = #{str} ) userCard
INNER JOIN card_coupon card ON userCard.card_coupon_id = card.id
LEFT JOIN mt_user mtUser ON mtUser.id = userCard.mt_user_id
WHERE
card.type IN ( 2, 5 )
AND userCard.STATUS = 0
AND userCard.start_time &lt;= NOW() AND userCard.end_time &gt;= NOW()
<select id="selectUserCardVerification" resultType="map">
SELECT userCard.id as id,
mtUser.NAME as mobile,
userCard.verification_code as ticketCode,
card.name as exchangeName,
card.exchange_content as exchangeContent
FROM (SELECT * FROM card_coupon_user WHERE mobile = #{str} OR verification_code = #{str}) userCard
INNER JOIN card_coupon card ON userCard.card_coupon_id = card.id
LEFT JOIN mt_user mtUser ON mtUser.id = userCard.mt_user_id
WHERE card.type IN (2, 5)
AND userCard.STATUS = 0
AND userCard.start_time &lt;= NOW()
AND userCard.end_time &gt;= NOW()
</select>
<select id="selectByOrderId"
resultType="com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser">
select * from card_coupon_user where order_id = #{orderId}
select *
from card_coupon_user
where order_id = #{orderId}
</select>
<select id="selectOneCardName"
resultType="com.fuint.business.marketingActivity.cardCoupon.vo.CardCouponUserVo">
select cu.*, cc.name as couponName
from card_coupon_user cu
JOIN card_coupon cc on cu.card_coupon_id = cc.id
where cu.id = #{id}
</select>

View File

@ -21,6 +21,10 @@ import java.util.Map;
public interface CardCouponUserService extends IService<CardCouponUser> {
CardCouponUserVo selectOneCardName(Integer id);
List<CardCouponUser> selectByMap(Map<String,Object> map);
/**

View File

@ -36,6 +36,12 @@ public class CardCouponUserServiceImpl extends ServiceImpl<CardCouponUserMapper,
@Autowired
private CardCouponUserMapper cardCouponUserMapper;
@Override
public CardCouponUserVo selectOneCardName(Integer id) {
CardCouponUserVo cardCouponUserVo = super.baseMapper.selectOneCardName(id);
return cardCouponUserVo;
}
@Override
public List<CardCouponUser> selectByMap(Map<String, Object> map) {
return baseMapper.selectByMap(map);

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.dto.AllOrderInfoRes;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.CashierOrder;
@ -99,6 +100,21 @@ public class AllOrderInfoController extends BaseController {
}
/**
* 退款
* @param map
* @return
*/
@PostMapping("/cashierRefund")
public ResponseObject cashierRefund(@RequestBody Map<String,String> map){
try {
return getSuccessResult(allOrderInfoService.cashierRefund(map));
} catch (Exception e) {
e.printStackTrace();
}
return getFailureResult(500,"退款失败");
}
/**
* 退款
* @param map
@ -109,6 +125,8 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(allOrderInfoService.refund(map));
}
@GetMapping("/getOrderInfo")
public ResponseObject getOrderInfo(String orderNo, String type) {
return getSuccessResult(allOrderInfoService.getOrderInfo(orderNo,type));
@ -128,6 +146,21 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(list);
}
/**
*
* 油站端 - 财务报表 -交易对账-交易明细 表格数据
*/
@GetMapping("/transactionList")
public ResponseObject transactionList(AllOrderInfoRes allOrderInfoRes,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<AllOrderInfoVo> list = allOrderInfoService.transactionList(page, allOrderInfoRes);
return getSuccessResult(list);
}
/**
* 导出订单
* @param response
@ -147,6 +180,13 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(list);
}
// 油站端- 交易明细-统计数据
@GetMapping("/orderStatistics")
public ResponseObject getTradingData(AllOrderInfoRes allOrderInfoRes){
Map<String, Object> map = allOrderInfoService.orderStatistics(allOrderInfoRes);
return getSuccessResult(map);
}
/**
* 机构流水分析
*/

View File

@ -0,0 +1,11 @@
package com.fuint.business.order.dto;
import com.fuint.business.order.entity.AllOrderInfo;
import lombok.Data;
/**
* 油站端 - 封装请求参数实体
*/
@Data
public class AllOrderInfoRes extends AllOrderInfo {
}

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
import java.util.List;
@ -47,6 +48,10 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
* 店铺id
*/
private Integer storeId;
/**
* 找零金额
*/
private Double seekZero;
/**
* 原价
*/
@ -104,6 +109,10 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
*支付通道
*/
private String paymentChannel;
/**
* 退款金额
*/
private Double refMoney;
/**
*商户id
*/

View File

@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
@ -98,7 +99,7 @@ public class CashierOrder extends BaseEntity implements Serializable {
/**
* 找零金额
*/
private Double seekZero;
private BigDecimal seekZero;
/**
* 订单状态已支付未支付支付失败
*/

View File

@ -7,6 +7,7 @@ import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrde
import com.fuint.business.marketingActivity.cardValueRule.dto.CardValueOrdersDTO;
import com.fuint.business.marketingActivity.cardValueRule.vo.CardValueOrdersVo;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.dto.AllOrderInfoRes;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.HandoverRecord;
@ -107,4 +108,7 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
Double getCountMemberBalance(@Param("storeId") Integer storeId,@Param("endTime") String endTime);
AllOrderInfoVo selectByOrderNo(String orderNo);
IPage<AllOrderInfoVo> transactionList(Page page,@Param("obj") AllOrderInfoRes allOrderInfoRes);
Map<String, Object> orderStatistics(@Param("obj") AllOrderInfoRes allOrderInfoRes);
}

View File

@ -542,7 +542,7 @@
SELECT mt_user.*
FROM mt_user_balance
LEFT JOIN mt_user ON mt_user_balance.mt_user_id = mt_user.id
WHERE mt_user_balance.store_id IN
WHERE mt_user_balance.store_id IN
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
@ -559,7 +559,7 @@
SELECT mt_user.*
FROM mt_user_balance
LEFT JOIN mt_user ON mt_user_balance.mt_user_id = mt_user.id
WHERE mt_user_balance.store_id IN
WHERE mt_user_balance.store_id IN
<foreach collection="order.storeIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
@ -605,16 +605,16 @@
s.name AS storeName,
SUM(COALESCE(a.pay_money, 0)) AS payMoney,
count(*) count,
sum( CASE WHEN a.pay_type = 'WECHAT' THEN a.pay_money ELSE 0 END ) wechatMoney,
sum( CASE WHEN a.pay_type = 'CASH' THEN a.pay_money ELSE 0 END ) cashMoney,
sum( CASE WHEN a.pay_type = 'WECHAT' THEN a.pay_money ELSE 0 END ) wechatMoney,
sum( CASE WHEN a.pay_type = 'CASH' THEN a.pay_money ELSE 0 END ) cashMoney,
sum( CASE WHEN a.pay_type = 'balance' THEN a.pay_money ELSE 0 END ) balanceMoney,
sum( CASE WHEN a.pay_type = 'ALIPAY' THEN a.pay_money ELSE 0 END ) alipayMoney,
sum( CASE WHEN a.STATUS = 'refund' THEN a.pay_money ELSE 0 END ) refMoney,
count( CASE WHEN a.STATUS = 'refund' THEN 1 ELSE NULL END ) refCount
sum( CASE WHEN a.pay_type = 'ALIPAY' THEN a.pay_money ELSE 0 END ) alipayMoney,
sum( CASE WHEN a.STATUS = 'refund' THEN a.pay_money ELSE 0 END ) refMoney,
count( CASE WHEN a.STATUS = 'refund' THEN 1 ELSE NULL END ) refCount
from mt_store s
LEFT JOIN all_order_info a on s.id=a.store_id
LEFT JOIN sys_dept d on d.dept_id = s.contract_dept_id
from mt_store s
LEFT JOIN all_order_info a on s.id=a.store_id
LEFT JOIN sys_dept d on d.dept_id = s.contract_dept_id
where
<if test="order.storeIds != null">
s.id in
@ -622,18 +622,22 @@
#{item}
</foreach>
</if>
and s.if_delete = '0'
and s.if_delete = '0'
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d'))
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &gt;=
date_format(#{order.params.beginTime},'%y%m%d'))
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d') )
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &lt;=
date_format(#{order.params.endTime},'%y%m%d') )
</if>
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d'))
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &gt;=
date_format(#{order.params.beginTime},'%y%m%d'))
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d') )
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &lt;=
date_format(#{order.params.endTime},'%y%m%d') )
</if>
GROUP BY s.id
ORDER BY payMoney DESC
@ -727,18 +731,22 @@
#{item}
</foreach>
</if>
and s.if_delete = '0'
and s.if_delete = '0'
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d'))
and (a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &gt;=
date_format(#{order.params.beginTime},'%y%m%d'))
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d') )
and ( a.create_time IS NULL OR date_format(a.create_time,'%y%m%d') &lt;=
date_format(#{order.params.endTime},'%y%m%d') )
</if>
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d'))
and (s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &gt;=
date_format(#{order.params.beginTime},'%y%m%d'))
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d') )
and ( s.create_time IS NULL OR date_format(s.create_time,'%y%m%d') &lt;=
date_format(#{order.params.endTime},'%y%m%d') )
</if>
</select>
@ -802,7 +810,7 @@
<where>
a.status = "paid"
<if test="allOrderInfo.storeId != null">
and a.store_id = #{allOrderInfo.storeId}
and a.store_id = #{allOrderInfo.storeId}
</if>
<if test="allOrderInfo.userId != null">
and a.user_id = #{allOrderInfo.userId}
@ -810,23 +818,23 @@
<if test="allOrderInfo.startTime != null">
and a.pay_time between #{allOrderInfo.startTime} and #{allOrderInfo.endTime}
</if>
<if test="allOrderInfo.content != null and allOrderInfo.content != ''">
and a.content like concat('%',#{allOrderInfo.content},'%')
</if>
<if test="allOrderInfo.content != null and allOrderInfo.content != ''">
and a.content like concat('%',#{allOrderInfo.content},'%')
</if>
</where>
</select>
<select id="getOneByOrderId" resultType="com.fuint.business.order.vo.AllOrderActivityVo">
SELECT info.*,
oil.oil_num as shengshu,
oil.oils as oils
oil.oils as oils
FROM all_order_info info
Left JOIN oil_order oil ON info.order_no = oil.order_no
where info.id = #{orderId}
</select>
<select id="getAllOrderInfoCountByStoreId" resultType="java.lang.String">
select count(DISTINCT store_id ) FROM all_order_info
select count(DISTINCT store_id ) FROM all_order_info
where
<if test="order.storeIds != null">
store_id in
@ -835,53 +843,61 @@
</foreach>
</if>
<if test="order.params.beginTime != null and order.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d')
and date_format(create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d')
</if>
<if test="order.params.endTime != null and order.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
and date_format(create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')
</if>
</select>
<select id="getCountMemberBalance" resultType="java.lang.Double">
SELECT
SUM(CASE WHEN content like '%充值%' THEN pay_money ELSE 0 END) -
SUM(CASE WHEN content like '%订单%' and type = '3' THEN pay_money ELSE 0 END) AS net_pay_money
FROM
all_order_info
WHERE
store_id = #{storeId}
AND pay_time &lt; #{endTime};
SELECT SUM(CASE WHEN content like '%充值%' THEN pay_money ELSE 0 END) -
SUM(CASE WHEN content like '%订单%' and type = '3' THEN pay_money ELSE 0 END) AS net_pay_money
FROM all_order_info
WHERE store_id = #{storeId}
AND pay_time &lt; #{endTime};
</select>
<select id="selectByOrderNo" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select * from all_order_info where order_no = #{orderNo}
select *
from all_order_info
where order_no = #{orderNo}
</select>
<select id="transactionList" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
SELECT
ai.*,
mu.NAME AS userName,
mc.merchant_name as merchantName
FROM
all_order_info ai
LEFT JOIN mt_user mu ON ai.user_id = mu.id
LEFT JOIN merchant_config mc on mc.id = ai.m_id
<where>
<if test="obj.storeId != null and obj.storeId != ''">
ai.store_id = #{obj.storeId}
</if>
</where>
ORDER BY ai.create_time DESC
</select>
<select id="orderStatistics" resultType="java.util.Map">
SELECT
SUM( CASE WHEN ai.pay_type = 'WECHAT' THEN ai.pay_money ELSE 0 END ) AS s1,-- 微信实付
SUM( CASE WHEN ai.pay_type = 'WECHAT' THEN 1 ELSE 0 END ) AS s2,-- 微信订单笔数
SUM( CASE WHEN ai.pay_type = 'ALIPAY' THEN ai.pay_money ELSE 0 END ) AS s3,-- 支付宝实收
SUM( CASE WHEN ai.pay_type = 'ALIPAY' THEN 1 ELSE 0 END ) AS s4,-- 支付宝订单笔数
SUM( CASE WHEN ai.pay_type = 'UNIONPAY' THEN ai.pay_money ELSE 0 END ) AS s5,-- 银联实收
SUM( CASE WHEN ai.pay_type = 'UNIONPAY' THEN 1 ELSE 0 END ) AS s6,-- 银联订单笔数
SUM( CASE WHEN ai.pay_type = 'CASH' THEN ai.pay_money ELSE 0 END ) AS s7,-- 现金实收
SUM( CASE WHEN ai.pay_type = 'CASH' THEN 1 ELSE 0 END ) AS s8,-- 订单笔数
SUM( CASE WHEN mu.id IS NOT NULL THEN ai.pay_money ELSE 0 END ) AS s9,-- 会员实收
SUM( CASE WHEN mu.id IS NOT NULL THEN 1 ELSE 0 END ) AS s10,-- 会员订单笔数
SUM( CASE WHEN ai.pay_type = 'after_pay' THEN ai.pay_money ELSE 0 END ) AS s11,-- 挂账实收
SUM( CASE WHEN ai.pay_type = 'after_pay' THEN 1 ELSE 0 END ) AS s12 -- 挂账订单笔数
FROM
all_order_info ai
LEFT JOIN mt_user mu ON ai.user_id = mu.id
LEFT JOIN merchant_config mc ON mc.id = ai.m_id
</select>
<!-- <where>-->
<!-- store_id = #{order.storeId}-->
<!-- <if test="order.params.beginTime != null and order.params.beginTime != ''">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
<!-- and date_format(create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d')-->
<!-- </if>-->
<!-- <if test="order.params.endTime != null and order.params.endTime != ''">&lt;!&ndash; 结束时间检索 &ndash;&gt;-->
<!-- and date_format(create_time,'%y%m%d') &lt;= date_format(#{order.params.endTime},'%y%m%d')-->
<!-- </if>-->
<!-- </where>-->
<!-- SUM(CASE WHEN transaction_type = 'sale' THEN amount ELSE 0 END) AS total_sales-->
<!-- COUNT(CASE WHEN pay_type = 'WECHAT' THEN 0 END) AS wechat, &#45;&#45; 微信-->
<!-- WHERE-->
<!-- DATE(pay_time) = CURDATE();-->
<!-- <if test="startTime != null ">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
<!-- and date_format(pay_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')-->
<!-- </if>-->
<!-- <if test="endTime != null ">&lt;!&ndash; 结束时间检索 &ndash;&gt;-->
<!-- and date_format(pay_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')-->
<!-- </if>-->
<!-- <if test="startTime1 != null and startTime1 != ''">-->
<!-- AND pay_time >= #{startTime1} &#45;&#45; 开始时间检索-->
<!-- </if>-->
<!-- <if test="endTime1 != null and endTime1 != ''">-->
<!-- AND pay_time &lt;= #{endTime} &#45;&#45; 结束时间检索-->
<!-- </if>-->
</mapper>

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.dto.AllOrderInfoRes;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.HandoverRecord;
@ -18,6 +19,9 @@ import java.util.Map;
@Transactional
public interface AllOrderInfoService {
Map<String, Object> orderStatistics(AllOrderInfoRes allOrderInfoRes);
/**
* 分页查询全部订单信息
* @param allOrderInfo
@ -79,6 +83,7 @@ public interface AllOrderInfoService {
AllOrderInfoVo getTradingData(AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getTradingPage(Page page, AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> transactionList(Page page, AllOrderInfoRes allOrderInfoRes);
IPage<SysDeptVo> runningWaterByInstituion(Page page, AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> runningWaterByInstituion2(Page page, AllOrderInfoDto allOrderInfo);
@ -196,4 +201,6 @@ AllOrderActivityVo getOneByOrderId(Integer orderId);
* @return
*/
HomeDataShowVo getDataCount(String startTime, String endTime);
Object cashierRefund(Map<String, String> map) throws Exception;
}

View File

@ -26,6 +26,7 @@ import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapp
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.dto.AllOrderInfoRes;
import com.fuint.business.order.entity.*;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.mapper.OilOrderMapper;
@ -96,6 +97,11 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
OilNumberMapper oilNumberMapper;
@Override
public Map<String, Object> orderStatistics(AllOrderInfoRes allOrderInfoRes) {
return allOrderInfoMapper.orderStatistics(allOrderInfoRes);
}
@Override
public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) {
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo);
@ -381,7 +387,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
@Resource
CashierOrderService cashierOrderService;
@Resource
LJGoodsService ljGoodsService;
@Resource
LJOrderService ljOrderService;
@ -403,6 +408,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
@Resource
private CardCouponUserMapper cardCouponUserMapper;
// 此接口 只针对 消费订单进行退款 (不包含充值订单)
@Override
@Transactional
public int refund(Map<String, String> map) {
@ -475,7 +481,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
AllOrderInfoVo allOrderInfoVo = allOrderInfoMapper.selectByOrderNo(map.get("orderNo"));
CardCouponUser cardCouponUser = cardCouponUserMapper.selectByOrderId(String.valueOf(allOrderInfoVo.getId()));
// 如果有优惠券信息 再做退回优惠券操作
if (ObjectUtil.isNotEmpty(cardCouponUser)){
if (ObjectUtil.isNotEmpty(cardCouponUser)) {
cardCouponUser.setStatus("0");
cardCouponUserMapper.updateById(cardCouponUser);
}
@ -540,6 +546,51 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return 0;
}
// 此接口是专门为 收银台订单退款使用 不是通用
@Transactional(rollbackFor = Exception.class)
public Object cashierRefund(Map<String, String> map) throws Exception {
AccountInfo now = TokenUtil.getNowAccountInfo();
// 参数
String orderNo = map.get("orderNo");
// 1.根据 orderNo 查询 总订单表 收银台表 进行退款
AllOrderInfo allOrder = selectAllOrderInfoByOrderNo(orderNo);
// 3.如果支付类型 支付宝 微信 银联 则调用第三方支付接口 进行退款
if (allOrder.getPayType().equals("WECHAT") || allOrder.getPayType().equals("UNIONPAY") || allOrder.getPayType().equals("ALIPAY")) {
int totalAmt = (int) ((allOrder.getPayMoney() - allOrder.getSeekZero()) * 100);
map.put("totalAmt", String.valueOf(totalAmt));
map.put("orderNo", allOrder.getOrderNo());
map.put("payType", allOrder.getPayType());
map.put("refundAmt", String.valueOf(totalAmt));
map.putAll(getMerchantConfig(allOrder));
Map<String, String> refund = fyPayService.refund(map);
} else {
throw new RuntimeException("其它类型支付正在维护中!");
}
allOrder.setRefMoney(allOrder.getGoodsMoney());
allOrder.setRefBy(String.valueOf(now.getId()));
allOrder.setStatus("refund");
allOrder.setRefOrderNo(map.get("refundOrderNo"));
baseMapper.updateById(allOrder);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
cashierOrder.setStatus("refund");
cashierOrderService.updateById(cashierOrder);
// 2.根据 用户优惠券id 把优惠券还原状态
// 4.如果是 囤油卡 车队卡 储值卡 则进行另外处理
return 1;
}
private static String formatBigDecimal(BigDecimal value) {
DecimalFormat decimalFormat = new DecimalFormat("0.00");
return decimalFormat.format(value);
@ -817,6 +868,16 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return pageList;
}
@Override
public IPage<AllOrderInfoVo> transactionList(Page page, AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
IPage<AllOrderInfoVo> allOrderInfoVoIPage = super.baseMapper.transactionList(page, allOrderInfoRes);
return allOrderInfoVoIPage;
}
@Override
public void tradingExportExcel(HttpServletResponse response, AllOrderInfoDto order) {
@ -1858,7 +1919,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
mtUserVo.setName("会员充值占比");
mtUserVo.setType(3);
double value = 0.0;
if (sum>0){
if (sum > 0) {
value = Double.parseDouble(getFormattedResult(((double) mtUser / sum) * 100));
}
mtUserVo.setValue(value);
@ -1868,7 +1929,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
productVo.setName("商品交易占比");
productVo.setType(3);
double value1 = 0.0;
if (sum>0){
if (sum > 0) {
value1 = Double.parseDouble(getFormattedResult(((double) product / sum) * 100));
}
productVo.setValue(value1);
@ -1878,7 +1939,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
oilRechargeVo.setName("油品交易占比");
oilRechargeVo.setType(3);
double value2 = 0.0;
if (sum>0){
if (sum > 0) {
value2 = Double.parseDouble(getFormattedResult(((double) oilRecharge / sum) * 100));
}
oilRechargeVo.setValue(value2);
@ -1888,7 +1949,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
pointMallVo.setName("积分商城交易占比");
pointMallVo.setType(3);
double value3 = 0.0;
if (sum>0){
if (sum > 0) {
value3 = Double.parseDouble(getFormattedResult((double) pointMall / sum * 100));
}
pointMallVo.setValue(value3);

View File

@ -433,7 +433,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 商品实付金额
Double goodsActualPay = Double.valueOf(map.get("goodsActualPay"));
// 找零金额
Double seekZero = Double.valueOf(map.get("seekZero"));
BigDecimal seekZero = new BigDecimal(map.get("seekZero"));
// 油枪id
String oilGunId = map.get("oilGunId");
// 活动营销优惠金额
@ -1120,7 +1120,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilOrderAmount(oilAmount);
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setSeekZero(0.0);
cashierOrder.setSeekZero(BigDecimal.valueOf(0.0));
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status,0.0);
@ -1190,7 +1190,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilOrderAmount(oilAmount);
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrder.setSeekZero(0.0);
cashierOrder.setSeekZero(BigDecimal.valueOf(0.0));
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount, oilAmount, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
@ -1306,7 +1306,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilOrderAmount(oilAmount);
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(order.getId());
cashierOrder.setSeekZero(0.0);
cashierOrder.setSeekZero(BigDecimal.valueOf(0.0));
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid",0.0);

View File

@ -22,7 +22,7 @@ public class AllOrderInfoVo extends AllOrderInfo {
private String cashMoney;
private String balanceMoney;
private String alipayMoney;
private String refMoney;
private Double refMoney;
// 交易笔数
private String strokeCount;
// 笔单价

View File

@ -1,9 +1,10 @@
# \u57FA\u672C\u914D\u7F6E
server.port=8080
env.profile=dev
env.properties.path=C:/Users/qq244432/Desktop/project/oil-station/fuintBackend/configure/
#env.properties.path=F:/work/oilSystem/fuintBackend/configure/
#env.properties.path=D:/oil/new-oil/oilSystem/fuintBackend/configure/
env.properties.path=D:/code/bulidmap/oil-station/fuintBackend/configure
#env.properties.path=D:/code/bulidmap/oil-station/fuintBackend/configure
#env.properties.path=D:/work/oilSystem/fuintBackend/configure/
#env.properties.path=/www/wwwroot/shenlanshuke/oilAdmin/
@ -28,6 +29,9 @@ mybatis-plus.mapper-locations = classpath*:/mapper/*Mapper.xml,classpath*:com/fu
mybatis-plus.configuration.intercepts=com.example.MyInterceptor
# \u9ED8\u8BA4\u65F6\u95F4\u683C\u5F0F
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
# 配置mybatisplus 日志输出
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
logging.level.com.baomidou.mybatisplus=DEBUG
#logging.level.com.fuint.business.*.mapper:DEBUG
#logging.level.org.springframework.web:DEBUG

View File

@ -8,6 +8,17 @@ export function refundApi(data) {
data: data
})
}
// 退款 新的收银台专用
export function cashierRefund(data) {
return request({
url: '/business/allOrderInfo/cashierRefund',
method: 'post',
data: data
})
}
export function getOrderInfoApi(data) {
return request({
url: '/business/allOrderInfo/getOrderInfo',

View File

@ -8,6 +8,14 @@ export function getCouponList(query) {
params: query
})
}
// 根据 userCouponID 查询 当前用户的卡券 以及 卡券名称
export function selectOneCardName(id) {
return request({
url: 'cardCouponUser/selectOneCardName',
method: 'get',
params:id
})
}
// 查询卡券信息
export function getCouponInfo(id) {

View File

@ -1291,6 +1291,9 @@ export default {
this.payType = "ALIPAY"
this.loading = false;
this.restVipUser();
},
//
queryPayStatus() {
@ -1378,14 +1381,21 @@ export default {
this.$modal.msgError("请输入正确的金额");
return;
}
//
this.payForm.seekZero = this.getChangeShould
}
if (!this.payForm.authCode && ((+this.oilActualPay) + (+this.goodsActualPay)) > 0) {
this.$modal.msgError("请先扫码");
return;
}
//
if (this.payForm.payType == "CASH"){
//
this.payForm.seekZero = this.getChangeShould
}
else {
this.payForm.seekZero = 0
}
this.loading = true;
let _this = this;