油站财务报表,交易

This commit is contained in:
齐天大圣 2024-11-02 13:50:53 +08:00
parent 4d5d426b4d
commit 71e06407e2
10 changed files with 285 additions and 54 deletions

View File

@ -268,3 +268,21 @@ export function getTissueByDataNewsApi(query) {
})
}
export function getInstituionListApi2(query) {
return request({
url: 'business/allOrderInfo/getInstituionListApi2',
method: 'get',
params: query
})
}
export function getInstituionListApi6(query) {
return request({
url: 'business/allOrderInfo/getInstituionListApi3',
method: 'get',
params: query
})
}

View File

@ -396,7 +396,6 @@ export default {
//
async getList(val){
getTradingNewPageApi(this.queryParams).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;

View File

@ -54,7 +54,7 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<el-tooltip class="item" effect="dark" content="退款总金额(元)" placement="top-start">
<div class="size-bole" style="color:#F44522;" >0/0</div>
</el-tooltip>
@ -64,7 +64,7 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<el-tooltip class="item" effect="dark" content="挂账总金额/归还总金额" placement="top-start">
<div class="size-bole" style="color:#FF7E00;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
</el-tooltip>
@ -74,7 +74,7 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<el-tooltip class="item" effect="dark" content="实收总金额(元)" placement="top-start">
<div class="size-bole" style="color:#0D2ED8;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
</el-tooltip>
@ -84,7 +84,7 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<el-tooltip class="item" effect="dark" content="充值总金额/会员消费总金额" placement="top-start">
<div class="size-bole" style="color:#790DD8;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
</el-tooltip>
@ -94,7 +94,7 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<el-tooltip class="item" effect="dark" content="新增会员数" placement="top-start">
<div class="size-bole" style="color:#D80D54;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
</el-tooltip>

View File

@ -6,7 +6,7 @@
<div style="display: flex;align-items: center ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-date-picker
v-model="this.dateRange"
v-model="queryParams.dataRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
@ -26,7 +26,9 @@
<div class="box-gang">
<div class="box">
<el-tooltip class="item" effect="dark" content="订单总金额(元)/笔数" placement="top-start">
<div class="size-bole">0/0</div>
<div class="size-bole">
{{orderNewStatisticstow.orderMoney?orderNewStatisticstow.orderMoney:0}}/
{{orderNewStatisticstow.orderNum?orderNewStatisticstow.orderNum:0}}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
@ -35,7 +37,8 @@
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="实收总金额(元)" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">0</div>
<div class="size-bole" style="color:#00CAFF;">
{{orderNewStatisticstow.trueMoney?orderNewStatisticstow.trueMoney:0}}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #00CAFF"></div>
@ -44,7 +47,8 @@
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="退款总金额(元)/笔数" placement="top-start">
<div class="size-bole" style="color:#F44522;" >0/0</div>
<div class="size-bole" style="color:#F44522;" >{{orderNewStatisticstow.backOrderMoney?orderNewStatisticstow.backOrderMoney:0}}/
{{orderNewStatisticstow.backOrderNum?orderNewStatisticstow.backOrderNum:0}}</div>
</el-tooltip>
<div class="size-hui">
@ -54,7 +58,7 @@
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="日均订单金额(元)" placement="top-start">
<div class="size-bole" style="color:#FF7E00;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}</div>
<div class="size-bole" style="color:#FF7E00;" >{{orderNewStatisticstow.dayaverageOrderMoney?orderNewStatisticstow.dayaverageOrderMoney:0}}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #FF7E00"></div>
@ -66,40 +70,26 @@
<div class="table-box">
<el-table
:data="orderList"
:data="orderNewStatistics"
border
style="width: 100%;margin-top: 15px">
<el-table-column type="index" width="50" align="center" label="序号"/>
<!-- <el-table-column prop="deptId" align="center" label="门店编号"> </el-table-column>-->
<el-table-column prop="content" align="center" label="订单分类"> </el-table-column>
<el-table-column prop="goodsMoney" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>
<el-table-column prop="count" align="center" label="订单笔数"> </el-table-column>
<el-table-column prop="unitPrice" align="center" label="笔单价">
<el-table-column prop="orderType" align="center" label="订单分类"> </el-table-column>
<el-table-column prop="orderMoney" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="trueMoney" align="center" label="实收金额"> </el-table-column>
<el-table-column prop="orderNum" align="center" label="订单笔数"> </el-table-column>
<el-table-column prop="oneOrderMoney" align="center" label="笔单价">
</el-table-column>
<el-table-column prop="dayaverageOrderMoney" align="center" label="日均交易金额">
</el-table-column>
<el-table-column prop="dayaverageOrderNum" align="center" label="日订单笔数">
<template slot-scope="scope">
{{ (scope.row.payMoney/scope.row.count).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="dailyAmount" align="center" label="日均交易金额">
<template slot-scope="scope">
{{ (scope.row.payMoney / timeDifference).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="strokesPerDay" align="center" label="日订单笔数">
<template slot-scope="scope">
{{ (scope.row.count / timeDifference).toFixed(2) }} </template>
</el-table-column>
<!-- <el-table-column prop="parentStoreId" align="center" label="机构编号"> </el-table-column>-->
<el-table-column prop="parentStoreName" align="center" label="退款金额"> </el-table-column>
<el-table-column prop="leaderName" align="center" label="退款笔数"> </el-table-column>
<el-table-column prop="backOrderMoney" align="center" label="退款金额"> </el-table-column>
<el-table-column prop="backOrderNum" align="center" label="退款笔数"> </el-table-column>
<el-table-column prop="leaderName" align="center" label="统计周期">
{{this.beginTime }} {{this.endTime}}
</el-table-column>
<!-- <el-table-column prop="seekZero" align="center" label="品牌编号"> </el-table-column>-->
<!-- <el-table-column prop="seekZero" align="center" label="品牌名称"> </el-table-column>-->
</el-table>
</div>
<div class="pagination-box">
@ -125,9 +115,10 @@ import {
getRunningWaterByDataApi,
exportExcelOilDeptApi,
getmyDataApi,
getInstituionListApi2
getInstituionListApi2,
getInstituionListApi6
} from "@/api/allOrder";
import {getInstituionListApi3} from "../../../../api/allOrder";
export default {
name: "runningWater-oilDepot",
data(){
@ -136,7 +127,7 @@ import {
//
staffList:[],
//
dateRange: [],
dataRange: [],
beginTime:"",
endTime:"",
//
@ -150,7 +141,7 @@ import {
beginTime:"",
endTime:"",
deptType:"3",
dataRange: [],
},
orderStatistics:{
numberOfStrokes:'0',
@ -160,6 +151,30 @@ import {
theTotalAmountOfOil:'0',
theTotalAmountOfTheItem:'0',
},
orderNewStatistics:{
orderType:'',
orderMoney:"0",
trueMoney:"0",
orderNum:"0",
oneOrderMoney:"0",
dayaverageOrderMoney:"0",
dayaverageOrderNum:"0",
backOrderMoney:"0",
backOrderNum:"0",
},
orderNewStatisticstow:{
orderType:'',
orderMoney:"0",
trueMoney:"0",
orderNum:"0",
oneOrderMoney:"0",
dayaverageOrderMoney:"0",
dayaverageOrderNum:"0",
backOrderMoney:"0",
backOrderNum:"0",
},
total:0,
timeDifference:1,
}
@ -170,17 +185,14 @@ import {
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.dateRange = [start,new Date()];
this.beginTime = start
this.endTime = new Date()
this.timeDifferenceMilliseconds = this.endTime - this.beginTime;
this.timeDifference = timeDifferenceMilliseconds / (1000 * 60 * 60 * 24);
console.log("timeDifference",this.timeDifference)
let year = start.getFullYear(); //
let month = String(start.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(start.getDate()).padStart(2, '0'); //
this.queryParams.dataRange = [ year+'-'+month+'-'+date, year+'-'+month+'-'+date];
this.isSysDate = true
await this.getDeptList();
this.getList();
this.getStatisticsAll()
},
methods:{
@ -220,20 +232,28 @@ import {
},
//
getList(val){
getInstituionListApi2(this.queryParams).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
getList(val){
getInstituionListApi2(this.queryParams).then( response => {
this.orderNewStatistics = response.data
console.log(this.orderNewStatistics.orderMoney)
this.isSysDate = false
})
//this.getOrderStatistics()
},
//
getStatisticsAll(val){
getInstituionListApi6(this.queryParams).then( response => {
this.orderNewStatisticstow = response.data
console.log(this.orderNewStatisticstow.orderMoney)
})
//this.getOrderStatistics()
},
//
async handleQuery() {
this.queryParams.page = 1;
await this.getDeptList();
this.getList();
this.getStatisticsAll();
},
//

View File

@ -5,6 +5,7 @@ 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.dto.StatisticsOrderAllDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.CashierOrder;
@ -483,4 +484,25 @@ public class AllOrderInfoController extends BaseController {
AllOrderInfoVo list = allOrderInfoService.getTradingNewData(allOrderInfo);
return getSuccessResult(list);
}
/**
* 订单流水分析
* @param allOrderInfoRes
* @return
*/
@GetMapping("/getInstituionListApi2")
public ResponseObject getInstituionListApi2(AllOrderInfoRes allOrderInfoRes){
List<StatisticsOrderAllDto> map = allOrderInfoService.getInstituionListApi2(allOrderInfoRes);
return getSuccessResult(map);
}
/**
* 订单流水分析
* @param allOrderInfoRes
* @return
*/
@GetMapping("/getInstituionListApi3")
public ResponseObject getInstituionListApi3(AllOrderInfoRes allOrderInfoRes){
StatisticsOrderAllDto map = allOrderInfoService.getInstituionListApi3(allOrderInfoRes);
return getSuccessResult(map);
}
}

View File

@ -0,0 +1,32 @@
package com.fuint.business.order.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StatisticsOrderAllDto implements Serializable {
private static final long serialVersionUID = 1L;
//订单类型
private String orderType;
//订单金额
private String orderMoney;
//实收金额
private String trueMoney;
//订单数量
private String orderNum;
//订单单价
private String oneOrderMoney;
//日均订单金额
private String dayaverageOrderMoney;
//日均订单数
private String dayaverageOrderNum;
//退款金额
private String backOrderMoney;
//退款订单数
private String backOrderNum;
//计算周期
private String leaderName;
}

View File

@ -8,6 +8,7 @@ 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.dto.StatisticsOrderAllDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.entity.HandoverRecord;
@ -132,4 +133,9 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
AllOrderInfoVo getTradingNewData(@Param("obj") AllOrderInfoDto allOrderInfo,
@Param("beginTime") String beginTime,@Param("endTime") String endTime);
List<StatisticsOrderAllDto> getInstituionListApi2(@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
StatisticsOrderAllDto getInstituionListApi3(@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}

View File

@ -1380,4 +1380,115 @@
</if>
</select>
<select id="getInstituionListApi2" resultType="com.fuint.business.order.dto.StatisticsOrderAllDto">
select
'油品订单'
as orderType,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(COUNT(*),0) AS orderNum,
IFNULL(SUM(aoi.goods_money)/if(COUNT(*) =0,1,COUNT(*)),0) as oneOrderMoney,
IFNULL(COUNT(aoi.pay_money)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderMoney,
IFNULL(COUNT(*)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderNum,
IFNULL(SUM(aoi.ref_money),0)AS backOrderMoney,
IFNULL(sum(CASE WHEN aoi.ref_order_no is not null THEN 1 ELSE 0 END),0) as backOrderNum,
concat(#{beginTime},'-', #{endTime}) as leaderName
from all_order_info aoi
where 1=1 and aoi.store_id = #{obj.storeId} and
aoi.type='1'
<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>
union all
select
'积分商城订单' as orderType,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(COUNT(*),0) AS orderNum,
IFNULL(SUM(aoi.goods_money)/if(COUNT(*) =0,1,COUNT(*)),0) as oneOrderMoney,
IFNULL(COUNT(aoi.pay_money)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderMoney,
IFNULL(COUNT(*)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderNum,
IFNULL(SUM(aoi.ref_money),0)AS backOrderMoney,
IFNULL(sum(CASE WHEN aoi.ref_order_no is not null THEN 1 ELSE 0 END),0) as backOrderNum,
concat(#{beginTime},'-', #{endTime}) as leaderName
from all_order_info aoi
where 1=1 and aoi.store_id = #{obj.storeId} and
aoi.type='4'
<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>
union all
select
'收银台订单' as orderType,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(COUNT(*),0) AS orderNum,
IFNULL(SUM(aoi.goods_money)/if(COUNT(*) =0,1,COUNT(*)),0) as oneOrderMoney,
IFNULL(COUNT(aoi.pay_money)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderMoney,
IFNULL(COUNT(*)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderNum,
IFNULL(SUM(aoi.ref_money),0)AS backOrderMoney,
IFNULL(sum(CASE WHEN aoi.ref_order_no is not null THEN 1 ELSE 0 END),0) as backOrderNum,
concat(#{beginTime},'-', #{endTime}) as leaderName
from all_order_info aoi
where 1=1 and aoi.store_id = #{obj.storeId} and
aoi.type='6'
<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>
union all
select
'挂账订单'
as orderType,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(COUNT(*),0) AS orderNum,
IFNULL(SUM(aoi.goods_money)/if(COUNT(*) =0,1,COUNT(*)),0) as oneOrderMoney,
IFNULL(COUNT(aoi.pay_money)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderMoney,
IFNULL(COUNT(*)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderNum,
IFNULL(SUM(aoi.ref_money),0)AS backOrderMoney,
IFNULL(sum(CASE WHEN aoi.ref_order_no is not null THEN 1 ELSE 0 END),0) as backOrderNum,
concat(#{beginTime},'-', #{endTime}) as leaderName
from all_order_info aoi
where 1=1 and aoi.store_id = #{obj.storeId} and
aoi.type = '7'
<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="getInstituionListApi3" resultType="com.fuint.business.order.dto.StatisticsOrderAllDto">
select
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(COUNT(*),0) AS orderNum,
IFNULL(SUM(aoi.goods_money)/if(COUNT(*) =0,1,COUNT(*)),0) as oneOrderMoney,
IFNULL(COUNT(aoi.pay_money)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderMoney,
IFNULL(COUNT(*)/((TIMESTAMPDIFF(day, #{beginTime}, #{endTime}))+1),0) as dayaverageOrderNum,
IFNULL(SUM(aoi.ref_money),0)AS backOrderMoney,
IFNULL(sum(CASE WHEN aoi.ref_order_no is not null THEN 1 ELSE 0 END),0) as backOrderNum,
concat(#{beginTime},'-', #{endTime}) as leaderName
from all_order_info aoi
where 1=1 and aoi.store_id = #{obj.storeId} and
(aoi.type='1' or aoi.type='4' or aoi.type='6' or aoi.type='7')
<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

@ -5,6 +5,7 @@ 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.dto.StatisticsOrderAllDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.HandoverRecord;
@ -212,4 +213,8 @@ AllOrderActivityVo getOneByOrderId(Integer orderId);
IPage<AllOrderInfoVo> tradingNewList(Page page, AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getTradingNewData(AllOrderInfoDto allOrderInfo);
List<StatisticsOrderAllDto> getInstituionListApi2(AllOrderInfoRes allOrderInfoRes);
StatisticsOrderAllDto getInstituionListApi3(AllOrderInfoRes allOrderInfoRes);
}

View File

@ -37,6 +37,7 @@ import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper
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.dto.StatisticsOrderAllDto;
import com.fuint.business.order.entity.*;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.mapper.CardBalanceChangeMapper;
@ -2619,4 +2620,21 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[0],
allOrderInfo.getDataRange()==null?"":allOrderInfo.getDataRange()[1]);
}
@Override
public List<StatisticsOrderAllDto> getInstituionListApi2(AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
return allOrderInfoMapper.getInstituionListApi2(allOrderInfoRes,
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
}
@Override
public StatisticsOrderAllDto getInstituionListApi3(AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
return allOrderInfoMapper.getInstituionListApi3(allOrderInfoRes,
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
}
}