This commit is contained in:
ds 2024-11-06 17:36:11 +08:00
parent ab4217e0e6
commit e13687be01
9 changed files with 336 additions and 81 deletions

View File

@ -292,6 +292,16 @@ export function exportExcelOrderMsgsApi(data) {
}); });
} }
// 交接班-交易对账EXCEL导出
export function exportExcelHandoverOrderApi(data) {
return request({
url: 'business/allOrderInfo/exportExcelHandoverOrder',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function getTradingNewPageApi(query) { export function getTradingNewPageApi(query) {
return request({ return request({
url: 'business/allOrderInfo/tradingNewList', url: 'business/allOrderInfo/tradingNewList',
@ -428,6 +438,13 @@ export function getRunningWaterByDataApi29(query) {
} }
export function findOrderStatistics(query) {
return request({
url: 'business/allOrderInfo/findOrderStatistics',
method: 'get',
params: query
})
}

View File

@ -19,7 +19,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="payChannel"> <el-form-item label="" prop="type">
<el-select <el-select
v-model="queryParams.type" v-model="queryParams.type"
clearable clearable
@ -49,15 +49,13 @@
<el-form-item label="" prop="payType"> <el-form-item label="" prop="payType">
<el-select <el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable>
v-model="queryParams.payType" <el-option
clearable v-for="dicts in this.dictPayType"
placeholder="请选择支付方式" :key="dicts.dictValue"
> :label="dicts.dictLabel"
<el-option label="现金" value="CASH"/> :value="dicts.dictValue"
<el-option label="微信" value="WECHAT"/> />
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="" prop="payType"> <!-- <el-form-item label="" prop="payType">
@ -73,7 +71,7 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="" prop="paymentChannel"> <!-- <el-form-item label="" prop="paymentChannel">
<el-select v-model="queryParams.paymentChannel" placeholder="请选择支付渠道" clearable> <el-select v-model="queryParams.paymentChannel" placeholder="请选择支付渠道" clearable>
<el-option <el-option
v-for="dicts in this.dict" v-for="dicts in this.dict"
@ -82,7 +80,7 @@
:value="dicts.dictValue" :value="dicts.dictValue"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="" prop="status"> <el-form-item label="" prop="status">
<el-select <el-select
@ -97,7 +95,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="staffId"> <el-form-item label="" prop="staffId">
<el-select v-model="queryParams.staffId" placeholder="请选择员工" clearable> <el-select v-model="queryParams.staffId" placeholder="请选择关联员工" clearable>
<el-option <el-option
v-for="dicts in this.staffList" v-for="dicts in this.staffList"
:key="dicts.acctId" :key="dicts.acctId"
@ -107,8 +105,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="userName"> <el-form-item label="" prop="userMobile">
<el-input v-model="queryParams.userName" placeholder="请输入付款用户"></el-input> <el-input v-model="queryParams.userMobile" placeholder="请输入用户手机号"></el-input>
</el-form-item> </el-form-item>
@ -127,7 +125,7 @@
<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 type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="exportExcelCashier">导出</el-button> <el-button type="primary" icon="el-icon-search" @click="exportExcel">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -135,7 +133,7 @@
<div class="box-gang"> <div class="box-gang">
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="微信收款(元)/ 笔数" placement="top-start" > <el-tooltip class="item" effect="dark" content="微信收款(元)/ 笔数" placement="top-start" >
<div class="size-bole">{{ wechat}}/{{ wechats}}</div> <div class="size-bole">{{ orderStatistics.wechat || 0 }} / {{ orderStatistics.wechatCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
<div class="dian" style="background: #0DC291"></div> <div class="dian" style="background: #0DC291"></div>
@ -144,7 +142,7 @@
</div> </div>
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="支付宝收款(元)/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="支付宝收款(元)/ 笔数" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">{{ orderStatistics.alipay?orderStatistics.alipay:0 }}/0</div> <div class="size-bole" style="color:#00CAFF;">{{ orderStatistics.alipay || 0 }} / {{ orderStatistics.alipayCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
<div class="dian" style="background: #00CAFF"></div> <div class="dian" style="background: #00CAFF"></div>
@ -153,7 +151,7 @@
</div> </div>
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="云闪付收款(元)/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="云闪付收款(元)/ 笔数" placement="top-start">
<div class="size-bole" style="color:#F44522;" >{{ orderStatistics.balance?orderStatistics.balance:0 }}/0</div> <div class="size-bole" style="color:#F44522;" >{{ orderStatistics.unionPay || 0 }} / {{ orderStatistics.unionPayCount || 0 }} </div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
@ -164,7 +162,7 @@
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="pos机收款/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="pos机收款/ 笔数" placement="top-start">
<div class="size-bole" style="color:#FF7E00;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div> <div class="size-bole" style="color:#FF7E00;" >{{ orderStatistics.pos || 0 }} / {{ orderStatistics.posCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
@ -174,10 +172,9 @@
</div> </div>
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="现金收款(元)/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="现金收款(元)/ 笔数" placement="top-start">
<div class="size-bole" style="color:#0D2ED8;">{{ orderStatistics.cash?orderStatistics.cash:0 }}/0</div> <div class="size-bole" style="color:#0D2ED8;">{{ orderStatistics.cash || 0 }} / {{ orderStatistics.cashCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
<div class="dian" style="background: #0D2ED8"></div> <div class="dian" style="background: #0D2ED8"></div>
<div class="nei">现金收款/ 笔数</div> <div class="nei">现金收款/ 笔数</div>
@ -185,7 +182,7 @@
</div> </div>
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="会员消费(元)/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="会员消费(元)/ 笔数" placement="top-start">
<div class="size-bole" style="color:#790DD8;">{{orderStatistics.cashcount?orderStatistics.cashcount:0}}/0</div> <div class="size-bole" style="color:#790DD8;">{{ orderStatistics.vip || 0 }} / {{ orderStatistics.vipCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
@ -195,7 +192,7 @@
</div> </div>
<div class="box"> <div class="box">
<el-tooltip class="item" effect="dark" content="挂帐收款(元)/ 笔数" placement="top-start"> <el-tooltip class="item" effect="dark" content="挂帐收款(元)/ 笔数" placement="top-start">
<div class="size-bole" style="color:#D80D54;">0/0</div> <div class="size-bole" style="color:#D80D54;">{{orderStatistics.afterPay || 0 }} / {{orderStatistics.afterPayCount || 0 }}</div>
</el-tooltip> </el-tooltip>
<div class="size-hui"> <div class="size-hui">
@ -227,33 +224,53 @@
<span v-else-if="scope.row.type=='3'">储值卡</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=='4'">积分</span>
<span v-else-if="scope.row.type=='5'">囤油卡</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=='6'">收银台订单</span>
<span v-else-if="scope.row.type=='7'">挂账订单</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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额(元)"> <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="实收金额(元)">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type=='3'">{{scope.row.goodsMoney + scope.row.payMoney}}</span> <span v-if="scope.row.payType == 'ALIPAY'">{{ scope.row.payMoney}}</span>
<span v-else>{{scope.row.goodsMoney}}</span> <span v-else-if="scope.row.payType == 'WECHAT'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'UNIONPAY'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'CASH'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'APPLET_CODE'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'after_pay'">{{ scope.row.payMoney}}</span>
<span v-else> -- </span>
</template>
</el-table-column>
<el-table-column prop="payMoney" align="center" label="会员消费金额(元)">
<template slot-scope="scope">
<span v-if="scope.row.payType == 'card_value'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'fule_card'">{{ scope.row.payMoney}}</span>
<span v-else-if="scope.row.payType == 'car_card_value'">{{ scope.row.payMoney}}</span>
<span v-else> -- </span>
</template> </template>
</el-table-column> </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 prop="refMoney" align="center" label="挂账/归还金额(元)">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 'refund'">{{scope.row.payMoney}}</span> <span v-if="scope.row.type == 7">{{ scope.row.goodsMoney}}</span>
<span type="danger" v-else>--</span> <span v-else> -- </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userMobile" align="center" label="用户手机号" > </el-table-column> <el-table-column prop="userMobile" align="center" label="用户手机号" > </el-table-column>
<el-table-column prop="payType" align="center" label="支付方式"> <el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.payType=='CASH'">现金</span>
<span v-else-if="scope.row.payType=='WECHAT'">微信</span> <span v-if="scope.row.payType == 'ALIPAY'">支付宝</span>
<span v-else-if="scope.row.payType=='ALIPAY'">支付宝</span> <span v-else-if="scope.row.payType == 'WECHAT'">微信</span>
<span v-else="">余额</span> <span v-else-if="scope.row.payType == 'UNIONPAY'">银联二维码</span>
<span v-else-if="scope.row.payType == 'CASH'">现金</span>
<span v-else-if="scope.row.payType == 'APPLET_CODE'">小程序码</span>
<span v-else-if="scope.row.payType == 'card_value'">储值卡</span>
<span v-else-if="scope.row.payType == 'fule_card'">囤油卡</span>
<span v-else-if="scope.row.payType == 'car_card_value'">车队卡</span>
<span v-else-if="scope.row.payType == 'after_pay'">挂账</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" align="center" label="订单状态"> <el-table-column prop="status" align="center" label="订单状态">
@ -266,8 +283,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="createBy" 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="createTime" align="center" label="订单创建时间" width="180"> </el-table-column>
<el-table-column prop="updateTime" align="center" label="订单完成时间" width="220"> </el-table-column> <el-table-column prop="updateTime" align="center" label="订单完成时间" width="180"> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -338,10 +355,7 @@
<script> <script>
import { import {
exportExcelTradingApi, getmyDataApi, exportExcelHandoverOrderApi, getmyDataApi,findOrderStatistics,
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi,
transactionList, transactionList,
getDicts, getDicts,
getStaffByStorId getStaffByStorId
@ -353,6 +367,7 @@ export default {
return{ return{
dict:{}, dict:{},
orderStatistics:{},
wechat:0, wechat:0,
@ -386,18 +401,9 @@ export default {
deptType:"3", deptType:"3",
storeId:"", storeId:"",
deptId:"", deptId:"",
}, userName:"",
orderStatistics:{ staffId:"",
CASH:"0", dataRange:[],
WECHAT:"0",
ALIPAY:"0",
balance:"0",
CASHCount:"0",
WECHATCount:"0",
ALIPAYCount:"0",
balanceCount:"0",
refBalance:"0",
refBalanceCount:"0",
}, },
total:0, total:0,
} }
@ -418,6 +424,7 @@ export default {
this.getDicts(); this.getDicts();
this.getStaffByStorId(); this.getStaffByStorId();
this.getOrderStatistics()
}, },
methods:{ methods:{
@ -448,28 +455,21 @@ export default {
}) })
}, },
exportExcelCashier() { exportExcel() {
let dateRange = [] exportExcelHandoverOrderApi(this.queryParams).then(res => {
if (this.beginTime && this.endTime) { const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
dateRange.push(this.beginTime.toLocaleDateString()) this.$download.saveAs(blob, '交易明细统计.xLsx')
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() { async getOrderStatistics() {
// await this.getDeptList()
let dateRange = [] let dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString()) dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString()) dateRange.push(this.endTime.toLocaleDateString())
} }
getTissueByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{ findOrderStatistics(this.addDateRange(this.queryParams, dateRange)).then(res => {
this.orderStatistics = res.data this.orderStatistics = res.data
}) })
}, },
@ -484,7 +484,7 @@ export default {
}, },
getOrdersInfo(data) { getOrdersInfo(data) {
this.dialogVisible = true; this.dialogVisible = true;
this.ordersInfo = data this.ordersInfo = data
@ -493,6 +493,7 @@ export default {
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1;
this.getDeptList() this.getDeptList()
this.getOrderStatistics()
// this.getList(); // this.getList();
}, },
@ -519,7 +520,6 @@ export default {
background: #f4f5f9; background: #f4f5f9;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 8px; padding-bottom: 8px;
//height: 87.5vh;
} }
.app-top{ .app-top{
width: 100%; width: 100%;
@ -629,7 +629,7 @@ export default {
} }
.table-box{ .table-box{
width: 100%; width: 100%;
height: 58vh; height: 54vh;
overflow: auto; overflow: auto;
} }
.pagination-box{ .pagination-box{
@ -648,7 +648,7 @@ export default {
margin: 10px 0; margin: 10px 0;
} }
.new-top{ .new-top{
width: 98%; width: 99%;
background: #FFFFFF; background: #FFFFFF;
margin: 15px auto; margin: 15px auto;
height: 115px; height: 115px;
@ -658,13 +658,13 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
.wit_box{ .wit_box{
width: 98%; width: 99%;
background: #FFFFFF; background: #FFFFFF;
margin: 5px auto; margin: 5px auto;
box-sizing: border-box; box-sizing: border-box;
padding: 15px; padding: 15px;
border-radius: 4px; border-radius: 8px;
height: 74vh; height: 73vh;
} }
</style> </style>

View File

@ -196,6 +196,17 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(map); return getSuccessResult(map);
} }
@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);
}
/** /**
* 机构流水分析 * 机构流水分析
*/ */

View File

@ -8,4 +8,9 @@ import lombok.Data;
*/ */
@Data @Data
public class AllOrderInfoRes extends AllOrderInfo { public class AllOrderInfoRes extends AllOrderInfo {
/**
*用户手机号
*/
private String userMobile;
} }

View File

@ -110,6 +110,12 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
Double getCountMemberBalance(@Param("storeId") Integer storeId,@Param("endTime") String endTime); Double getCountMemberBalance(@Param("storeId") Integer storeId,@Param("endTime") String endTime);
AllOrderInfoVo selectByOrderNo(String orderNo); AllOrderInfoVo selectByOrderNo(String orderNo);
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);
IPage<AllOrderInfoVo> transactionList(Page page,@Param("obj") AllOrderInfoRes allOrderInfoRes, IPage<AllOrderInfoVo> transactionList(Page page,@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime,@Param("endTime") String endTime); @Param("beginTime") String beginTime,@Param("endTime") String endTime);

View File

@ -852,6 +852,142 @@
from all_order_info from all_order_info
where order_no = #{orderNo} where order_no = #{orderNo}
</select> </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="transactionList" resultType="com.fuint.business.order.vo.AllOrderInfoVo"> <select id="transactionList" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
SELECT SELECT
ai.*, ai.*,
@ -890,6 +1026,9 @@
<if test="obj.staffId != null and obj.staffId != ''"> <if test="obj.staffId != null and obj.staffId != ''">
and ai.create_by = #{obj.staffId} and ai.create_by = #{obj.staffId}
</if> </if>
<if test="obj.userMobile != null and obj.userMobile != ''">
and mu.mobile = #{obj.userMobile}
</if>
<if test="beginTime != null and beginTime != ''"> <if test="beginTime != null and beginTime != ''">
<![CDATA[and ai.create_time >= #{beginTime} ]]> <![CDATA[and ai.create_time >= #{beginTime} ]]>
</if> </if>

View File

@ -22,6 +22,10 @@ public interface AllOrderInfoService {
Map<String, Object> orderStatistics(AllOrderInfoRes allOrderInfoRes); Map<String, Object> orderStatistics(AllOrderInfoRes allOrderInfoRes);
Map<String, Object> findOrderStatistics(AllOrderInfoRes allOrderInfoRes);
void exportExcelHandoverOrder(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes);
/** /**
* 分页查询全部订单信息 * 分页查询全部订单信息
* @param allOrderInfo * @param allOrderInfo

View File

@ -26,17 +26,13 @@ import com.fuint.business.fleet.entity.FleetInfo;
import com.fuint.business.fleet.entity.FleetMember; import com.fuint.business.fleet.entity.FleetMember;
import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper; import com.fuint.business.fleet.mapper.FleetConsumeRecordMapper;
import com.fuint.business.fleet.mapper.FleetInfoMapper; import com.fuint.business.fleet.mapper.FleetInfoMapper;
import com.fuint.business.fleet.mapper.FleetLinesChangeMapper;
import com.fuint.business.fleet.mapper.FleetMemberMapper; import com.fuint.business.fleet.mapper.FleetMemberMapper;
import com.fuint.business.largeSscreen.vo.OrderGoodsVO; import com.fuint.business.largeSscreen.vo.OrderGoodsVO;
import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser;
import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper; import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelChangeMapper; import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelChangeMapper;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper;
import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders;
import com.fuint.business.order.dto.*; import com.fuint.business.order.dto.*;
import com.fuint.business.order.entity.*; import com.fuint.business.order.entity.*;
import com.fuint.business.order.mapper.AllOrderInfoMapper; import com.fuint.business.order.mapper.AllOrderInfoMapper;
@ -76,13 +72,11 @@ import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.mapper.SysDeptMapper; import com.fuint.system.dept.mapper.SysDeptMapper;
import com.fuint.system.dept.service.ISysDeptService; import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.dept.vo.SysDeptVo; import com.fuint.system.dept.vo.SysDeptVo;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.yaml.snakeyaml.reader.StreamReader;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -145,6 +139,45 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[1]); allOrderInfoRes.getDataRange() == null ? "" : allOrderInfoRes.getDataRange()[1]);
} }
@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 @Override
public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) { public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) {
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo); IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo);

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; // 支付时间
}