油站财务报表,交易

This commit is contained in:
齐天大圣 2024-11-01 15:43:16 +08:00
parent a793ab76a9
commit 0ef0c7045d
10 changed files with 468 additions and 95 deletions

View File

@ -242,4 +242,29 @@ export function exportExcelOrderMsgsApi(data) {
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function exportExcelBackOrderMsgsApi(data) {
return request({
url: 'business/allOrderInfo/exportExcelBackOrderMsgsApi',
method: 'post',
responseType: 'blob', // 表明响应类型为二进制流
data: data // 通过 data 参数传递需要的数据
});
}
export function getTradingNewPageApi(query) {
return request({
url: 'business/allOrderInfo/tradingNewList',
method: 'get',
params: query
})
}
export function getTissueByDataNewsApi(query) {
return request({
url: 'business/allOrderInfo/getTradingNewData',
method: 'get',
params: query
})
}

View File

@ -6,7 +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-form-item label="" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
@ -16,30 +16,34 @@
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
</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="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="请选择订单类"
placeholder="请选择订单类型"
>
<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-select
v-model="queryParams.type"
clearable
placeholder="请选择订单分类"
>
<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="status">
@ -51,45 +55,33 @@
<el-option label="已支付" value="paid"/>
<el-option label="未支付" value="unpaid"/>
<el-option label="已退款" value="refund"/>
<el-option label="支付失败" value="payFail"/>
<el-option label="退款中" value="refunding"/>
</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="" 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-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="交易结束日期">
</el-date-picker>
<el-form-item label="" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入付款用户"></el-input>
</el-form-item>
<el-date-picker
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 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>
@ -99,8 +91,9 @@
<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.discountMoneyAll?orderStatistics.discountMoneyAll:0 }}/
{{ orderStatistics.discountMoneyAllNo?orderStatistics.discountMoneyAllNo:0 }}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
@ -108,8 +101,9 @@
</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.discountMoneyOil?orderStatistics.discountMoneyOil:0 }}/
{{ orderStatistics.discountMoneyOilNo?orderStatistics.discountMoneyOilNo:0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -118,8 +112,9 @@
</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.discountMoneyStore?orderStatistics.discountMoneyStore:0 }}
/{{ orderStatistics.discountMoneyStoreNo?orderStatistics.discountMoneyStoreNo:0 }}</div>
</el-tooltip>
<div class="size-hui">
@ -128,8 +123,9 @@
</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.discountMoneyIntegral?orderStatistics.discountMoneyIntegral:0}}
/{{orderStatistics.discountMoneyIntegralNo?orderStatistics.discountMoneyIntegralNo:0}}</div>
</el-tooltip>
<div class="size-hui">
@ -154,15 +150,15 @@
<span v-else>其他</span>
</template>
</el-table-column>
<el-table-column prop="payChannel" 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>
</template>
</el-table-column>
<!-- <el-table-column prop="payChannel" 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>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="type" align="center" label="订单分类">
<template slot-scope="scope">
<span v-if="scope.row.type=='1'">油品</span>
@ -272,8 +268,13 @@ import {
exportExcelTradingApi, getmyDataApi,
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi
getTradingPageApi,
getDicts,
getStaffByStorId,
getTradingNewPageApi,
getTissueByDataNewsApi
} from "@/api/allOrder";
import {getTissueByDataNewApi} from "../../../../api/allOrder";
export default {
name: "reconciliation-trading",
@ -320,6 +321,14 @@ export default {
balanceCount:"0",
refBalance:"0",
refBalanceCount:"0",
discountMoneyAll:"0",
discountMoneyAllNo:"0",
discountMoneyOil:"0",
discountMoneyOilNo:"0",
discountMoneyStore:"0",
discountMoneyStoreNo:"0",
discountMoneyIntegral:"0",
discountMoneyIntegralNo:"0",
},
total:0,
}
@ -347,7 +356,9 @@ export default {
await getmyDataApi(this.addDateRange(this.queryParams)).then( response => {
this.queryParams.deptId = response.data.deptId;
this.getList()
this.getDicts()
this.getStaffByStorId()
this.getOrderStatistics()
})
},
exportExcelCashier() {
@ -362,35 +373,34 @@ export default {
})
},
//
async getStaffByStorId() {
getStaffByStorId().then(response => {
this.staffList = response.data;
})
},
//
async getDicts() {
getDicts("payment_channel").then(response => {
this.dict = response.data;
})
getDicts("payment_type").then(response => {
this.dictPayType = response.data;
})
},
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=>{
getTissueByDataNewsApi(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 => {
getTradingNewPageApi(this.queryParams).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
// this.getDeptList()
this.getOrderStatistics()
})
},
getOrdersInfo(data) {

View File

@ -80,7 +80,7 @@
<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>
@ -251,7 +251,8 @@ import {
getTradingPageApi,
getDicts,
getStaffByStorId,
getTradingOnsPageApi
getTradingOnsPageApi,
exportExcelBackOrderMsgsApi
} from "@/api/allOrder";
import {getTradingOnPageApi} from "../../../../api/allOrder";
@ -342,12 +343,7 @@ export default {
})
},
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=>{
exportExcelBackOrderMsgsApi(this.queryParams).then(res=>{
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
this.$download.saveAs(blob,'交易明细统计.xLsx')
})

View File

@ -453,4 +453,34 @@ public class AllOrderInfoController extends BaseController {
public void exportExcelOrderMsgApi(HttpServletResponse response, @RequestBody AllOrderInfoRes allOrderInfoRes) {
this.allOrderInfoService.exportExcelOrderMsgApi(response, allOrderInfoRes);
}
/**
* 导出退款明细
* @param response
*/
@PostMapping("exportExcelBackOrderMsgsApi")
public void exportExcelBackOrderMsgsApi(HttpServletResponse response, @RequestBody AllOrderInfoRes allOrderInfoRes) {
this.allOrderInfoService.exportExcelBackOrderMsgsApi(response, allOrderInfoRes);
}
/**
* 交易对账
* 交易明细分页查询
*/
@GetMapping("tradingNewList")
public ResponseObject tradingNewList(AllOrderInfoDto allOrderInfo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<AllOrderInfoVo> list = allOrderInfoService.tradingNewList(page, allOrderInfo);
return getSuccessResult(list);
}
@GetMapping("getTradingNewData")
public ResponseObject getTradingNewData(AllOrderInfoDto allOrderInfo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
AllOrderInfoVo list = allOrderInfoService.getTradingNewData(allOrderInfo);
return getSuccessResult(list);
}
}

View File

@ -15,6 +15,7 @@ import com.fuint.business.order.vo.AllOrderActivityVo;
import com.fuint.business.order.vo.AllOrderInfoUniVo;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.business.order.vo.Excel.TradingBackOrderExcel;
import com.fuint.business.order.vo.Excel.allorderVOo;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.userManager.vo.UserBalanceVo;
@ -121,4 +122,14 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
IPage<AllOrderInfoVo> gettradingListPage(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfo allOrderInfo,
@Param("beginTime") String beginTime,@Param("endTime") String endTime);
List<TradingBackOrderExcel> transactionBackAllList(@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
IPage<AllOrderInfoVo> tradingNewList(Page page,@Param("obj") AllOrderInfoDto allOrderInfo,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
AllOrderInfoVo getTradingNewData(@Param("obj") AllOrderInfoDto allOrderInfo,
@Param("beginTime") String beginTime,@Param("endTime") String endTime);
}

View File

@ -1197,4 +1197,187 @@
<![CDATA[and aoi.create_time <= #{endTime}]]>
</if>
</select>
<select id="transactionBackAllList" resultType="com.fuint.business.order.vo.Excel.TradingBackOrderExcel">
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,
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,
ai.payment_channel as paymentChannel,
ai.mchnt_cd,
ai.create_time,
ai.update_time,
mu.NAME AS userName,
mc.merchant_name as merchantName,
mt.account_name as createBy
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 and (ai.status='refund' or ai.status='refunding') and ai.store_id=#{obj.storeId}
<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="tradingNewList" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
SELECT
ai.*,
mu.NAME AS userName,
mc.merchant_name as merchantName,
mt.account_name as createBy
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
and ai.store_id = #{obj.storeId} and discount_amount !=0.00
<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="getTradingNewData" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
SUM(pay_money) AS discountMoneyAll,
COUNT(pay_money) AS discountMoneyAllNo,
SUM(CASE WHEN aoi.type = '1' THEN pay_money ELSE 0 END) AS discountMoneyOil,
COUNT(CASE WHEN aoi.type = '1' THEN 0 END) AS discountMoneyOilNo,
SUM(CASE WHEN aoi.type = '6' THEN pay_money ELSE 0 END) AS discountMoneyStore,
COUNT(CASE WHEN aoi.type = '6' THEN 0 END) AS discountMoneyStoreNo,
SUM(CASE WHEN aoi.type = '4' THEN pay_money ELSE 0 END) AS discountMoneyIntegral,
COUNT(CASE WHEN aoi.type = '4' THEN 0 END) AS discountMoneyIntegralNo
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
where 1=1
and aoi.store_id = #{obj.storeId} and discount_amount !=0.00
<if test="obj.paymentChannel != null and obj.paymentChannel != ''">
and aoi.payment_channel = #{obj.paymentChannel}
</if>
<if test="obj.orderNo != null and obj.orderNo != ''">
and aoi.order_no like concat('%', #{obj.orderNo}, '%')
</if>
<if test="obj.payType != null and obj.payType != ''">
and aoi.pay_type = #{obj.payType}
</if>
<if test="obj.type != null and obj.type != ''">
and aoi.type = #{obj.type}
</if>
<if test="obj.payChannel != null and obj.payChannel != ''">
and aoi.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 aoi.status = #{obj.status}
</if>
<if test="obj.staffId != null and obj.staffId != ''">
and aoi.create_by = #{obj.staffId}
</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>
</mapper>

View File

@ -208,4 +208,8 @@ AllOrderActivityVo getOneByOrderId(Integer orderId);
List<MtStaff> getStaffByStorId();
void exportExcelOrderMsgApi(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes);
void exportExcelBackOrderMsgsApi(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes);
IPage<AllOrderInfoVo> tradingNewList(Page page, AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getTradingNewData(AllOrderInfoDto allOrderInfo);
}

View File

@ -2557,5 +2557,66 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
return allOrderInfoVo;
}
@Override
public void exportExcelBackOrderMsgsApi(HttpServletResponse response, AllOrderInfoRes allOrderInfoRes) {
List<TradingBackOrderExcel> list= transactionBackAllList(allOrderInfoRes);
List<TradingBackOrderExcel> tradingExcel = new ArrayList<>();
for (TradingBackOrderExcel record : list) {
TradingBackOrderExcel excel1 = new TradingBackOrderExcel();
BeanUtils.copyProperties(record, excel1);
tradingExcel.add(excel1);
}
// 设置响应头信息
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-disposition", "attachment;filename=demo.xlsx");
try {
// 写入文件数据
EasyExcel.write(response.getOutputStream(), TradingBackOrderExcel.class).sheet("download").doWrite(tradingExcel);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
/**
* 查询退单订单数据
* @param
* @param allOrderInfoRes
* @return
*/
public List transactionBackAllList(AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
List allOrderInfoVo = super.baseMapper.transactionBackAllList(allOrderInfoRes,
allOrderInfoRes.getDataRange().length==0?"":allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange().length==0?"":allOrderInfoRes.getDataRange()[1]);
return allOrderInfoVo;
}
/**
* 查询退单订单数据
* @param
* @param allOrderInfo
* @return
*/
@Override
public IPage<AllOrderInfoVo> tradingNewList(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfo.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.tradingNewList(page,allOrderInfo,
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[0],
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[1]);
}
@Override
public AllOrderInfoVo getTradingNewData(AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfo.setStoreId(nowAccountInfo.getStoreId());
return allOrderInfoMapper.getTradingNewData(allOrderInfo,
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[0],
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[1]);
}
}

View File

@ -104,6 +104,23 @@ public class AllOrderInfoVo extends AllOrderInfo {
private String integral;
@TableField(exist = false)
private String integralCount;
@TableField(exist = false)
//优惠金额
private String discountMoneyAll;
@TableField(exist = false)
private String discountMoneyAllNo;
@TableField(exist = false)
private String discountMoneyOil;
@TableField(exist = false)
private String discountMoneyOilNo;
@TableField(exist = false)
private String discountMoneyStore;
@TableField(exist = false)
private String discountMoneyStoreNo;
@TableField(exist = false)
private String discountMoneyIntegral;
@TableField(exist = false)
private String discountMoneyIntegralNo;
}

View File

@ -0,0 +1,36 @@
package com.fuint.business.order.vo.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class TradingBackOrderExcel {
@ExcelProperty("订单号")
private String orderNo; // 订单号
@ExcelProperty("订单类型")
private String payChannel; // 订单类型
@ExcelProperty("订单分类")
private String type; // 订单分类
@ExcelProperty("订单金额")
private Double goodsMoney; // 订单金额
@ExcelProperty("实收金额")
private Double payMoney; // 实收金额
@ExcelProperty("会员支付金额")
private Double paysMoney; // 会员支付金额
@ExcelProperty("归还金额")
private Double refMoney; // 归还金额
@ExcelProperty("付款用户")
private String userName; // 付款用户
@ExcelProperty("支付方式")
private String payType; // 支付方式
@ExcelProperty("支付渠道")
private String paymentChannel; // 支付渠道
@ExcelProperty("商户号")
private String mchntCd; // 付款用户
@ExcelProperty("收银员")
private String createBy; // 收银员
@ExcelProperty("订单完成时间")
private Date updateTime; // 支付时间
}