This commit is contained in:
ds 2024-11-08 15:23:02 +08:00
parent c889354454
commit c4e1999cbb
12 changed files with 496 additions and 185 deletions

View File

@ -9,6 +9,14 @@ export function getOrderListApi(query) {
})
}
export function getOrderInfoById(id) {
return request({
url: '/business/allOrderInfo/'+id,
method: 'get',
})
}
// 分页查询所有的订单信息
export function getSumPayMoneyApi(query) {
return request({

View File

@ -6,6 +6,7 @@
<el-form-item label="">
<el-input style="width: 215px;" v-model="queryParams.orderNo" placeholder="请输入订单号"></el-input>
</el-form-item>
<el-form-item label="" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
@ -15,29 +16,42 @@
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
<el-option label="平台" value="PC"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="payChannel">
<el-form-item label="" prop="type">
<el-select
v-model="queryParams.payChannel"
v-model="queryParams.type"
clearable
placeholder="请选择订单分类"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
<el-option label="油品" value="1"/>
<el-option label="商品" value="2"/>
<el-option label="储值卡" value="3"/>
<el-option label="积分" value="4"/>
<el-option label="囤油卡" value="5"/>
<el-option label="收银台订单" value="6"/>
<el-option label="挂账订单" value="7"/>
<el-option label="pos" value="8"/>
</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-option label="微信" value="WECHAT"/>
<el-option label="银联二维码" value="UNIONPAY"/>
<el-option label="现金" value="CASH"/>
<el-option label="小程序码" value="APPLET_CODE"/>
<el-option label="储值卡" value="card_value"/>
<el-option label="囤油卡" value="fule_card"/>
<el-option label="车队卡" value="car_card_value"/>
<el-option label="挂账" value="after_pay"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="status">
@ -51,55 +65,43 @@
<el-option label="已退款" value="refund"/>
</el-select>
</el-form-item>
<el-form-item label="" style="margin-right:22px" prop="status">
<el-select
v-model="queryParams.status"
clearable
placeholder="请选择员工"
>
<el-option label="已支付" value="paid"/>
<el-option label="未支付" value="unpaid"/>
<el-option label="已退款" value="refund"/>
<el-form-item label="" style="margin-right:22px" prop="staffId">
<el-select v-model="queryParams.staffId" placeholder="请选择关联员工" clearable>
<el-option
v-for="dicts in this.staffList"
:key="dicts.acctId"
:label="dicts.accountName"
:value="dicts.acctId"
/>
</el-select>
</el-form-item>
<el-form-item label="" style="margin-right: 0px" prop="status">
<el-select
v-model="queryParams.status"
clearable
placeholder="请输入付款用户"
>
<el-option label="已支付" value="paid"/>
<el-option label="未支付" value="unpaid"/>
<el-option label="已退款" value="refund"/>
</el-select>
<el-input v-model="queryParams.userMobile" placeholder="请输入付款手机号"></el-input>
</el-form-item>
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 140px"
type="date"
placeholder="交易开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 140px"
type="date"
placeholder="交易结束日期">
v-model="queryParams.dataRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<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" @click="exportExcelCashier" >导出</el-button>
</el-form-item>
</el-form>
</div>
<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">{{ orderStatistics.wechat?orderStatistics.wechat:0 }}/0</div>
<el-tooltip class="item" effect="dark" content="退款金额(元)/笔数" placement="top-start">
<div class="size-bole">{{ orderStatistics.refBalance || 0 }} / {{ orderStatistics.refBalanceCount || 0 }}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
@ -107,8 +109,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" content="油品订单退款金额(元)/笔数" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">{{ orderStatistics.oilOrder || 0 }} / {{ orderStatistics.oilOrderCount || 0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -117,8 +119,8 @@
</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" content="便利店订单退款金额(元)/笔数" placement="top-start">
<div class="size-bole" style="color:#F44522;" >{{ orderStatistics.convenienceStore || 0 }} / {{ orderStatistics.convenienceStoreCount || 0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -127,8 +129,8 @@
</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 class="item" effect="dark" content="积分商城订单退款金额(元)/笔数" placement="top-start">
<div class="size-bole" style="color:#FF7E00;" >{{orderStatistics.integral || 0}} / {{ orderStatistics.integral || 0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -144,63 +146,37 @@
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="payChannel" align="center" label="订单类型">
<el-table-column prop="payChannel" align="center" label="订单类型"></el-table-column>
<el-table-column prop="type" align="center" label="订单分类"></el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额(元)">
<template slot-scope="scope">
<span v-if="scope.row.payChannel=='cashier'">收银台</span>
<span v-else-if="scope.row.payChannel=='POS'">POS机</span>
<span v-else-if="scope.row.payChannel=='PC'">平台</span>
<span v-else-if="scope.row.payChannel=='applet'">小程序</span>
<span v-else>其他</span>
<span v-if="scope.row.type=='3'">{{ scope.row.goodsMoney + scope.row.payMoney }}</span>
<span v-else>{{ scope.row.goodsMoney }}</span>
</template>
</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-else-if="scope.row.type=='7'">挂账订单</span>
<span v-else="">其他</span>
</template>
</el-table-column>
<el-table-column prop="goodsMoney" 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>
</template>
</el-table-column>
<el-table-column prop="refMoney" align="center" label="退款金额">
<template slot-scope="scope">
<span v-if="scope.row.status == 'refund'">{{scope.row.payMoney}}</span>
<span type="danger" 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="refMoney" align="center" label="退款金额(元)"></el-table-column>
<!-- <el-table-column prop="payAmount" 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>
<span v-else-if="scope.row.payType=='WECHAT'">微信</span>
<span v-else-if="scope.row.payType=='ALIPAY'">支付宝</span>
<span v-else="">余额</span>
</template>
</el-table-column>
<el-table-column prop="userMobile" align="center" label="用户手机号" width="140" ></el-table-column>
<el-table-column prop="payType" align="center" label="支付方式"></el-table-column>
<el-table-column prop="status" align="center" label="订单状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status == 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
<span v-if="scope.row.status == '已退款'" style="color: #fa8b1d">退款成功</span>
</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="updateTime" align="center" label="退款时间" width="220"> </el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="getOrdersInfo(scope.row)"
>详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
@ -215,56 +191,53 @@
<el-dialog
center
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>
<el-descriptions-item label="订单号">{{ordersInfo.orderNo}}</el-descriptions-item>
<el-descriptions-item label="用户手机号">{{ordersInfo.userMobile}}</el-descriptions-item>
<el-descriptions-item label="订单创建时间">{{ordersInfo.createTime}}</el-descriptions-item>
<el-descriptions-item label="订单类型">{{ordersInfo.type}}</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.updateTime}}</el-descriptions-item>
<el-descriptions-item label="关联员工">{{ordersInfo.createBy}}</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="备注">-->
<!-- <el-tag size="small">学校</el-tag>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
<el-descriptions class="margin-top" title="金额详情" :column="3" border>
<div class="d-s" style="margin-top: 15px">
<div class="gang"></div>
<div style="font-weight: bold; font-size: 14px;">金额详情</div>
</div>
<div style="margin-top: 15px;">
<el-descriptions :column="4" direction="vertical" border>
<el-descriptions-item>
<template slot="label">
订单金额
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
优惠金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
</div>
@ -272,10 +245,10 @@
<script>
import {
exportExcelTradingApi, getmyDataApi,
getRunningWaterByTissueApi,
exportExcelBackOrderMsgsApi, getmyDataApi,
getTissueByDataApi,
getTradingPageApi
getTradingOnsPageApi,
getStaffByStorId
} from "@/api/allOrder";
export default {
@ -302,15 +275,19 @@ export default {
queryParams: {
page: 1,
pageSize: 10,
beginTime:"",
endTime:"",
orderNo:"",
status:"",
payType:"",
payChannel:"",
deptType:"3",
storeId:"",
deptId:"",
beginTime: "",
endTime: "",
orderNo: "",
status: "",
payType: "",
payChannel: "",
deptType: "3",
storeId: "",
deptId: "",
userName: "",
userMobile:"",
staffId: "",
dataRange: [],
},
orderStatistics:{
CASH:"0",
@ -338,11 +315,19 @@ export default {
this.endTime = new Date()
this.isSysDate = true
await this.getDeptList();
this.getStaffByStorId();
this.getOrderStatistics();
// this.getList();
this.getList();
},
methods:{
async getStaffByStorId() {
getStaffByStorId().then(response => {
this.staffList = response.data;
})
},
async getDeptList() {
// getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
// this.deptList = response.data.records;
@ -359,43 +344,28 @@ export default {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
exportExcelTradingApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
exportExcelBackOrderMsgsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'交易明细统计.xLsx')
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=>{
getTissueByDataApi(this.queryParams).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) {
getTradingOnsPageApi(this.queryParams).then(response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
// this.getDeptList()
this.getOrderStatistics()
})
},
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
@ -404,8 +374,7 @@ export default {
handleQuery() {
this.queryParams.page = 1;
this.getDeptList()
// this.getList();
this.getOrderStatistics();
},
//
resetQuery() {
@ -536,7 +505,7 @@ export default {
}
.table-box{
width: 100%;
height: 58vh;
height: 54vh;
overflow: auto;
}
.pagination-box{
@ -555,23 +524,35 @@ export default {
margin: 10px 0;
}
.new-top{
width: 98%;
width: 99%;
background: #FFFFFF;
margin: 15px auto;
height: 115px;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
border-radius: 8px;
margin-bottom: 5px;
}
.wit_box{
width: 98%;
width: 99%;
background: #FFFFFF;
margin: 5px auto;
box-sizing: border-box;
padding: 15px;
border-radius: 4px;
height: 74vh;
border-radius: 8px;
height: 73vh;
}
.d-s {
display: flex;
align-items: center;
}
.gang {
width: 2px;
height: 18px;
background: #FF9655;
margin-right: 5px;
}
</style>

View File

@ -290,7 +290,7 @@
<el-button
size="mini"
type="text"
@click="getOrdersInfo(scope.row)"
@click="getOrdersInfo(scope.row.id)"
>详情</el-button>
</template>
</el-table-column>
@ -304,50 +304,57 @@
@pagination="getDeptList"
/>
</div>
<el-dialog
center
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>
<el-descriptions-item label="订单号">{{ordersInfo.orderNo}}</el-descriptions-item>
<el-descriptions-item label="用户手机号">{{ordersInfo.userMobile}}</el-descriptions-item>
<el-descriptions-item label="订单创建时间">{{ordersInfo.createTime}}</el-descriptions-item>
<el-descriptions-item label="订单类型">{{ordersInfo.type}}</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.updateTime}}</el-descriptions-item>
<el-descriptions-item label="关联员工">{{ordersInfo.createBy}}</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>
<div class="d-s" style="margin-top: 15px">
<div class="gang"></div>
<div style="font-weight: bold; font-size: 14px;">金额详情</div>
</div>
<div style="margin-top: 15px;">
<el-descriptions :column="4" direction="vertical" border>
<el-descriptions-item>
<template slot="label">
订单金额
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
优惠金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
</el-descriptions>
</div>
</el-dialog>
</div>
@ -355,7 +362,7 @@
<script>
import {
exportExcelHandoverOrderApi, getmyDataApi,findOrderStatistics,
exportExcelHandoverOrderApi, getmyDataApi,findOrderStatistics,getOrderInfoById,
transactionList,
getDicts,
getStaffByStorId
@ -483,12 +490,15 @@ export default {
})
},
getOrdersInfo(data) {
getOrdersInfo(id) {
this.dialogVisible = true;
this.ordersInfo = data
console.log(id);
getOrderInfoById(id).then(res => {
this.ordersInfo = res.data
console.log(this.ordersInfo);
});
},
//
handleQuery() {
this.queryParams.page = 1;
@ -667,4 +677,16 @@ export default {
height: 73vh;
}
.d-s {
display: flex;
align-items: center;
}
.gang {
width: 2px;
height: 18px;
background: #FF9655;
margin-right: 5px;
}
</style>

View File

@ -47,6 +47,21 @@ public class AllOrderInfoController extends BaseController {
IPage<AllOrderInfoVo> list = allOrderInfoService.getPageList(page, allOrderInfo);
return getSuccessResult(list);
}
@GetMapping("/findOrderStatistics")
public ResponseObject findOrderStatistics(AllOrderInfoRes allOrderInfoRes){
Map<String, Object> map = allOrderInfoService.findOrderStatistics(allOrderInfoRes);
return getSuccessResult(map);
}
@PostMapping("/exportExcelHandoverOrder")
public void exportExcelHandoverOrder(HttpServletResponse response, @RequestBody AllOrderInfoRes allOrderInfoRes) {
allOrderInfoService.exportExcelHandoverOrder(response, allOrderInfoRes);
}
@GetMapping("/{id}")
public ResponseObject getOrderInfoById(@PathVariable("id") Integer id) {
return getSuccessResult(allOrderInfoService.getOrderInfoById(id));
}
@GetMapping("getPageListByPos")
public ResponseObject getPageListByPos(AllOrderInfo allOrderInfo,

View File

@ -127,6 +127,8 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String userMobile;
@TableField(exist = false)
private String[] dataRange;
}

View File

@ -116,5 +116,7 @@ public class AllOrderInfoRes implements Serializable {
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String userMobile;
@TableField(exist = false)
private String[] dataRange;
}

View File

@ -29,6 +29,10 @@ import java.util.Map;
public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
IPage<AllOrderInfoVo> getPageList(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfo allOrderInfo);
Map<String, Object> findOrderStatistics(@Param("allOrderInfo") AllOrderInfoRes allOrderInfoRes,@Param("beginTime") String startTime, @Param("endTime") String endTime);
List getAllOrderInfo(@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
AllOrderInfoVo getOrderInfoById(Integer id);
IPage<AllOrderInfoVo> getFenxiByDaili(@Param("page") Page page, @Param("order") AllOrderInfo allOrderInfo);
IPage<AllOrderInfoVo> getFenxiByDailiType(@Param("page") Page page, @Param("order") AllOrderInfo allOrderInfo);
List<allorderVOo> getFenxiByDaili2(@Param("allOrderInfo") AllOrderInfo allOrderInfo);

View File

@ -202,6 +202,182 @@
order by aoi.create_time desc
</select>
<select id="findOrderStatistics" resultType="java.util.Map">
SELECT
IFNULL(SUM(IF(aoi.pay_type = 'WECHAT', aoi.pay_money, 0)), 0) as wechat, -- 微信
IFNULL(SUM(IF(aoi.pay_type = 'WECHAT', 1, 0)), 0) as wechatCount, -- 笔数
IFNULL(SUM(IF(aoi.pay_type = 'ALIPAY', aoi.pay_money, 0)), 0) as alipay, -- 支付宝
IFNULL(SUM(IF(aoi.pay_type = 'ALIPAY', 1, 0)), 0) as alipayCount, -- 笔数
IFNULL(SUM(IF(aoi.pay_type = 'UNIONPAY', aoi.pay_money, 0)), 0) as unionPay, -- 云闪付
IFNULL(SUM(IF(aoi.pay_type = 'UNIONPAY', 1, 0)), 0) as unionPayCount, -- 笔数
IFNULL(SUM(IF(aoi.type = '8', aoi.pay_money, 0)), 0) as pos, -- POS
IFNULL(SUM(IF(aoi.type = '8', 1, 0)), 0) as posCount, -- 笔数
IFNULL(SUM(IF(aoi.pay_type = 'CASH', aoi.pay_money, 0)), 0) as cash, -- 现金
IFNULL(SUM(IF(aoi.pay_type = 'CASH', 1, 0)), 0) as cashCount, -- 笔数
IFNULL(SUM(IF(mu.id IS NOT NULL, aoi.pay_money, 0)), 0) as vip, -- 会员
IFNULL(SUM(IF(mu.id IS NOT NULL, 1, 0)), 0) as vipCount, -- 笔数
IFNULL(SUM(IF(aoi.pay_type = 'after_pay', aoi.pay_money, 0)), 0) AS afterPay, -- 挂账
IFNULL(SUM(IF(aoi.pay_type = 'after_pay', 1, 0)), 0) as afterPayCount -- 笔数
FROM
all_order_info aoi
LEFT JOIN mt_user mu ON aoi.user_id = mu.id
LEFT JOIN merchant_config mc ON mc.id = aoi.m_id
left join mt_staff ms on aoi.create_by=ms.id
where 1=1
<if test="allOrderInfo.orderNo != null and allOrderInfo.orderNo != ''">
and aoi.order_no like concat('%', #{allOrderInfo.orderNo}, '%')
</if>
<if test="allOrderInfo.payChannel != null and allOrderInfo.payChannel != ''">
and aoi.pay_channel = #{allOrderInfo.payChannel}
</if>
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
</if>
<if test="allOrderInfo.payType != null and allOrderInfo.payType != ''">
and aoi.pay_type = #{allOrderInfo.payType}
</if>
<if test="allOrderInfo.status != null and allOrderInfo.status != ''">
and aoi.status = #{allOrderInfo.status}
</if>
<if test="allOrderInfo.staffId != null and allOrderInfo.staffId != ''">
and aoi.create_by = #{allOrderInfo.staffId}
</if>
<if test="allOrderInfo.userMobile != null and allOrderInfo.userMobile != ''">
and mu.mobile like concat('%', #{allOrderInfo.userMobile}, '%')
</if>
<if test="beginTime != null and beginTime != ''">
<![CDATA[and aoi.create_time >= #{beginTime} ]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ and aoi.create_time <= #{endTime} ]]>
</if>
</select>
<select id="getAllOrderInfo" resultType="com.fuint.business.order.vo.Excel.HandoverOrderExcel">
SELECT
ai.order_no,
CASE WHEN ai.pay_channel = 'cashier' THEN '收银台'
WHEN ai.pay_channel = 'POS' THEN 'POS机'
WHEN ai.pay_channel = 'PC' THEN '平台'
WHEN ai.pay_channel = 'applet' THEN '小程序'
END as payChannel,
CASE WHEN ai.type = '1' THEN '油品订单'
WHEN ai.type = '2' THEN '商品订单'
WHEN ai.type = '3' THEN '储值卡订单'
WHEN ai.type = '4' THEN '积分商城订单'
WHEN ai.type = '5' THEN '囤油卡订单'
WHEN ai.type = '6' THEN '收银台订单'
WHEN ai.type = '7' THEN '挂账订单'
WHEN ai.type = '8' THEN 'POS订单'
END as type,
ai.goods_money,
ai.discount_amount,
ai.pay_money as payMoney,
ai.pay_money as paysMoney,
ai.ref_money,
mu.mobile AS userMobile,
CASE WHEN ai.pay_type = 'ALIPAY' THEN '支付宝'
WHEN ai.pay_type = 'WECHAT' THEN '微信'
WHEN ai.pay_type = 'UNIONPAY' THEN '银联二维码'
WHEN ai.pay_type = 'CASH' THEN '现金'
WHEN ai.pay_type = 'APPLET_CODE' THEN '小程序码'
WHEN ai.pay_type = 'card_value' THEN '储值卡'
WHEN ai.pay_type = 'fule_card' THEN '囤油卡'
WHEN ai.pay_type = 'car_card_value' THEN '车队卡'
WHEN ai.pay_type = 'after_pay' THEN '挂账'
END as payType,
CASE WHEN ai.status = 'paid' THEN '已支付'
WHEN ai.status = 'unpaid' THEN '未支付'
WHEN ai.status = 'refund' THEN '已退款'
WHEN ai.status = 'payFail' THEN '支付失败'
WHEN ai.status = 'refunding' THEN '退款中'
END as status,
mt.account_name as createBy,
ai.create_time,
ai.update_time
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
left join t_account mt on ai.create_by=mt.acct_id
where 1=1
<if test="obj.storeId != null and obj.storeId != ''">
and ai.store_id = #{obj.storeId}
</if>
<if test="obj.paymentChannel != null and obj.paymentChannel != ''">
and ai.payment_channel = #{obj.paymentChannel}
</if>
<if test="obj.orderNo != null and obj.orderNo != ''">
and ai.order_no like concat('%', #{obj.orderNo}, '%')
</if>
<if test="obj.payType != null and obj.payType != ''">
and ai.pay_type = #{obj.payType}
</if>
<if test="obj.type != null and obj.type != ''">
and ai.type = #{obj.type}
</if>
<if test="obj.payChannel != null and obj.payChannel != ''">
and ai.pay_channel = #{obj.payChannel}
</if>
<if test="obj.userName != null and obj.userName != ''">
and mu.name like concat('%', #{obj.userName}, '%')
</if>
<if test="obj.status != null and obj.status != ''">
and ai.status = #{obj.status}
</if>
<if test="obj.staffId != null and obj.staffId != ''">
and ai.create_by = #{obj.staffId}
</if>
<if test="beginTime != null and beginTime != ''">
<![CDATA[and ai.create_time >= #{beginTime} ]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ and ai.create_time <= #{endTime} ]]>
</if>
ORDER BY ai.create_time DESC
</select>
<select id="getOrderInfoById" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
aoi.order_no,
aoi.goods_money,
aoi.pay_money,
aoi.ref_money,
aoi.create_time,
aoi.update_time,
CASE WHEN aoi.type = '1' THEN '油品订单'
WHEN aoi.type = '2' THEN '商品订单'
WHEN aoi.type = '3' THEN '储值卡订单'
WHEN aoi.type = '4' THEN '积分商城订单'
WHEN aoi.type = '5' THEN '囤油卡订单'
WHEN aoi.type = '6' THEN '收银台订单'
WHEN aoi.type = '7' THEN '挂账订单'
WHEN aoi.type = '8' THEN 'POS订单'
END as type,
CASE WHEN aoi.status = 'paid' THEN '已支付'
WHEN aoi.status = 'unpaid' THEN '未支付'
WHEN aoi.status = 'refund' THEN '已退款'
WHEN aoi.status = 'payFail' THEN '支付失败'
WHEN aoi.status = 'refunding' THEN '退款中'
END as status,
CASE WHEN aoi.pay_type = 'ALIPAY' THEN '支付宝'
WHEN aoi.pay_type = 'WECHAT' THEN '微信'
WHEN aoi.pay_type = 'UNIONPAY' THEN '银联二维码'
WHEN aoi.pay_type = 'CASH' THEN '现金'
WHEN aoi.pay_type = 'APPLET_CODE' THEN '小程序码'
WHEN aoi.pay_type = 'card_value' THEN '储值卡'
WHEN aoi.pay_type = 'fule_card' THEN '囤油卡'
WHEN aoi.pay_type = 'car_card_value' THEN '车队卡'
WHEN aoi.pay_type = 'after_pay' THEN '挂账'
END as payType,
ta.account_name createBy,
mu.mobile userMobile
from all_order_info aoi
left join mt_store ms on ms.id = aoi.store_id
left join t_account ta on aoi.create_by = ta.acct_id
left join mt_user mu on mu.id = aoi.user_id
where aoi.id = #{id}
</select>
<select id="selectByPayStatusNum" resultType="java.lang.Integer"
parameterType="com.fuint.business.order.entity.AllOrderInfo">
@ -890,6 +1066,9 @@
<if test="obj.staffId != null and obj.staffId != ''">
and ai.create_by = #{obj.staffId}
</if>
<if test="obj.userMobile != null and obj.userMobile != ''">
and mu.mobile = #{obj.userMobile}
</if>
<if test="beginTime != null and beginTime != ''">
<![CDATA[and ai.create_time >= #{beginTime} ]]>
</if>
@ -1095,11 +1274,13 @@
mu.name userName,
mu.mobile userMobile,
mc.merchant_name as merchantName,
mt.account_name as createBy
mt.account_name as createBy,
ms.name as storeName
from all_order_info aoi
left join mt_user mu ON aoi.user_id = mu.id
LEFT JOIN merchant_config mc on mc.id = aoi.m_id
left join t_account mt on aoi.create_by=mt.acct_id
left join mt_store ms on ms.id = aoi.store_id
where (aoi.status='refund' or aoi.status='refunding') and aoi.store_id=#{allOrderInfo.storeId}
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
@ -1121,6 +1302,9 @@
</if>
<if test="allOrderInfo.status != null and allOrderInfo.status != ''">
and aoi.status = #{allOrderInfo.status}
</if>
<if test="allOrderInfo.userMobile != null and allOrderInfo.userMobile != ''">
and mu.mobile = #{allOrderInfo.userMobile}
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
<![CDATA[ and aoi.create_time >= #{beginTime}]]>
@ -1191,6 +1375,12 @@
<if test="allOrderInfo.status != null and allOrderInfo.status != ''">
and aoi.status = #{allOrderInfo.status}
</if>
<if test="allOrderInfo.userName != null and allOrderInfo.userName != ''">
and mu.name = #{allOrderInfo.userName}
</if>
<if test="allOrderInfo.userMobile != null and allOrderInfo.userMobile != ''">
and mu.mobile = #{allOrderInfo.userMobile}
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
<![CDATA[ and aoi.create_time >= #{beginTime}]]>
</if>

View File

@ -30,6 +30,9 @@ public interface AllOrderInfoService {
* @return
*/
IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo);
Map<String, Object> findOrderStatistics(AllOrderInfoRes allOrderInfoRes);
void exportExcelHandoverOrder(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes);
AllOrderInfoVo getOrderInfoById(Integer id);
IPage<AllOrderInfoVo> getPageListByPos(Page page, AllOrderInfo allOrderInfo);
IPage<AllOrderInfoVo> getFenxiByDaili(Page page, AllOrderInfo allOrderInfo);

View File

@ -151,6 +151,50 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return pageList;
}
@Override
public Map<String, Object> findOrderStatistics(AllOrderInfoRes allOrderInfoRes) {
String startTime = allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[0];
String endTime = allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[1];
return allOrderInfoMapper.findOrderStatistics(allOrderInfoRes, startTime , endTime);
}
@Override
public void exportExcelHandoverOrder(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes) {
List<HandoverOrderExcel> list = getAllOrderInfo(allOrderInfoRes);
List<HandoverOrderExcel> tradingExcel = new ArrayList<>();
for (HandoverOrderExcel record : list) {
HandoverOrderExcel excel = new HandoverOrderExcel();
BeanUtils.copyProperties(record, excel);
excel.setType("其他");
tradingExcel.add(excel);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try {
// 写入文件数据
EasyExcel.write(response.getOutputStream(), HandoverOrderExcel.class).sheet("交易明细").doWrite(tradingExcel);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public List getAllOrderInfo(AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
List list = super.baseMapper.getAllOrderInfo(allOrderInfoRes,
allOrderInfoRes.getDataRange().length == 0 ? "" : allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange().length == 0 ? "" : allOrderInfoRes.getDataRange()[1]);
return list;
}
@Override
public AllOrderInfoVo getOrderInfoById(Integer id) {
return baseMapper.getOrderInfoById(id);
}
@Resource
OilOrderService oilOrderService;
@Resource

View File

@ -0,0 +1,40 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class HandoverOrderExcel {
@ExcelProperty("订单号")
private String orderNo; // 订单号
@ExcelProperty("订单类型")
private String payChannel; // 订单类型
@ExcelProperty("订单分类")
private String type; // 订单分类
@ExcelProperty("订单金额(元)")
private Double goodsMoney; // 订单金额
@ExcelProperty("优惠金额(元)")
private Double discountAmount; // 优惠金额
@ExcelProperty("实收金额(元)")
private Double payMoney; // 实收金额
@ExcelProperty("会员消费金额(元)")
private Double paysMoney; // 会员支付金额
@ExcelProperty("归还金额(元)")
private Double refMoney; // 归还金额
@ExcelProperty("用户手机号")
private String userMobile; // 用户手机号
@ExcelProperty("支付方式")
private String payType; // 支付方式
@ExcelProperty("订单状态")
private String status; // 订单状态
@ExcelProperty("关联员工")
private String createBy; // 收银员
@ExcelProperty("订单创建时间")
private Date createTime; // 支付时间
@ExcelProperty("订单完成时间")
private Date updateTime; // 支付时间
}

View File

@ -19,7 +19,7 @@ public class TradingBackOrderExcel {
private Double payMoney; // 实收金额
@ExcelProperty("会员支付金额")
private Double paysMoney; // 会员支付金额
@ExcelProperty("归还金额")
@ExcelProperty("退款金额")
private Double refMoney; // 归还金额
@ExcelProperty("付款用户")
private String userName; // 付款用户
@ -29,7 +29,7 @@ public class TradingBackOrderExcel {
private String paymentChannel; // 支付渠道
@ExcelProperty("商户号")
private String mchntCd; // 付款用户
@ExcelProperty("收银员")
@ExcelProperty("关联员工")
private String createBy; // 收银员
@ExcelProperty("订单完成时间")
private Date updateTime; // 支付时间