Compare commits

...

3 Commits

12 changed files with 562 additions and 141 deletions

View File

@ -268,3 +268,38 @@ 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
})
}
export function getInstituionListApi7(query) {
return request({
url: 'business/allOrderInfo/getInstituionListApi7',
method: 'get',
params: query
})
}
export function getInstituionListApi9(query) {
return request({
url: 'business/allOrderInfo/getInstituionListApi9',
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

@ -295,7 +295,7 @@
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getDeptList"
@pagination="getList"
/>
</div>
<el-dialog
@ -433,6 +433,7 @@ export default {
this.getList()
this.getDicts()
this.getStaffByStorId()
this.getOrderStatistics()
},
exportExcelCashier() {
exportExcelOrderMsgsApi(this.queryParams).then(res => {
@ -455,17 +456,10 @@ export default {
//
async getList(val) {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime)
dateRange.push(this.endTime)
}
console.log(this.beginTime)
transactionList(this.queryParams).then(response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
this.getOrderStatistics()
})
},

View File

@ -6,21 +6,15 @@
<div style="display: flex;align-items: center ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 140px"
type="date"
@change="getDays()"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 140px"
type="date"
@change="getDays()"
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>
@ -35,8 +29,8 @@
<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">0/0</div>
<el-tooltip class="item" effect="dark" content="订单总金额(元)" placement="top-start">
<div class="size-bole">{{orderStatisticsAll.orderMoney}}</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
@ -44,8 +38,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;">0/0</div>
<el-tooltip class="item" effect="dark" content="优惠总金额(元)" placement="top-start">
<div class="size-bole" style="color:#00CAFF;">{{orderStatisticsAll.discountAmount}}</div>
</el-tooltip>
<div class="size-hui">
@ -54,8 +48,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;" >0/0</div>
<el-tooltip class="item" effect="dark" content="退款总金额(元)" placement="top-start">
<div class="size-bole" style="color:#F44522;" >{{orderStatisticsAll.refMoney}}</div>
</el-tooltip>
<div class="size-hui">
@ -64,8 +58,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;" >{{orderStatisticsAll.accountPending}}/{{orderStatisticsAll.repaidAmount}}</div>
</el-tooltip>
<div class="size-hui">
@ -74,8 +68,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#0D2ED8;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
<el-tooltip class="item" effect="dark" content="实收总金额(元)" placement="top-start">
<div class="size-bole" style="color:#0D2ED8;" >{{orderStatisticsAll.trueMoney}}</div>
</el-tooltip>
<div class="size-hui">
@ -84,8 +78,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#790DD8;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
<el-tooltip class="item" effect="dark" content="充值总金额/会员消费总金额" placement="top-start">
<div class="size-bole" style="color:#790DD8;" >{{orderStatisticsAll.bidBalance?orderStatisticsAll.bidBalance:0}}/{{orderStatisticsAll.memberMoney?orderStatisticsAll.memberMoney:0}}</div>
</el-tooltip>
<div class="size-hui">
@ -94,8 +88,8 @@
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color:#D80D54;" >{{orderStatistics.balanceCount?orderStatistics.balanceCount:0}}/0</div>
<el-tooltip class="item" effect="dark" content="新增会员数" placement="top-start">
<div class="size-bole" style="color:#D80D54;" >{{orderStatisticsAll.newNum?orderStatisticsAll.newNum:0}}</div>
</el-tooltip>
<div class="size-hui">
@ -108,35 +102,30 @@
<div class="table-box">
<el-table
:data="orderList"
:data="orderStatistics"
border
style="width: 100%;margin-top: 15px">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="content" align="center" label="日期"> </el-table-column>
<el-table-column prop="content" align="center" label="订单金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="优惠金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="退款金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="挂账金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="实收金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="充值金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="充值赠送金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="会员消费金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="归还金额(元)"> </el-table-column>
<el-table-column prop="content" align="center" label="新增会员数"> </el-table-column>
<el-table-column prop="days" align="center" label="日期"> </el-table-column>
<el-table-column prop="orderMoney" align="center" label="订单金额(元)"> </el-table-column>
<el-table-column prop="discountAmount" align="center" label="优惠金额(元)"> </el-table-column>
<el-table-column prop="refMoney" align="center" label="退款金额(元)"> </el-table-column>
<el-table-column prop="accountPending" align="center" label="挂账金额(元)"> </el-table-column>
<el-table-column prop="trueMoney" align="center" label="实收金额(元)"> </el-table-column>
<el-table-column prop="bidBalance" align="center" label="充值金额(元)"> </el-table-column>
<el-table-column prop="giftBalance" align="center" label="充值赠送金额(元)"> </el-table-column>
<el-table-column prop="memberMoney" align="center" label="会员消费金额(元)"> </el-table-column>
<el-table-column prop="repaidAmount" align="center" label="归还金额(元)"> </el-table-column>
<el-table-column prop="newNum" align="center" label="新增会员数"> </el-table-column>
</el-table>
</div>
<div class="pagination-box">
<el-pagination
background
v-show="total>0"
layout="prev, pager, next"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@current-change="getList">
</el-pagination>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</div>
</template>
@ -148,7 +137,9 @@ import {
getRunningWaterByDataApi,
exportExcelOilDeptApi,
getmyDataApi,
getInstituionListApi2
getInstituionListApi2,
getInstituionListApi7,
getInstituionListApi9
} from "@/api/allOrder";
export default {
@ -173,15 +164,32 @@ export default {
beginTime:"",
endTime:"",
deptType:"3",
dataRange:[]
},
orderStatistics:{
numberOfStrokes:'0',
theTotalAmountOfTheOrder:'0',
theTotalAmountPaid:'0',
oilDiscounts:'0',
theTotalAmountOfOil:'0',
theTotalAmountOfTheItem:'0',
day:'',
orderMoney:'0',
discountAmount:'0',
refMoney:'0',
accountPending:'0',
trueMoney:'0',
bidBalance:'0',
giftBalance:'0',
memberMoney:'0',
repaidAmount:'0',
newNum:'0',
},
orderStatisticsAll:{
orderMoney:'0',
discountAmount:'0',
refMoney:'0',
accountPending:'0',
trueMoney:'0',
bidBalance:'0',
giftBalance:'0',
memberMoney:'0',
repaidAmount:'0',
newNum:'0',
},
total:0,
timeDifference:1,
@ -193,22 +201,17 @@ export default {
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.getOrderStatistics();
},
methods:{
getDays(){
this.timeDifferenceMilliseconds = this.endTime - this.beginTime;
this.timeDifference = timeDifferenceMilliseconds / (1000 * 60 * 60 * 24);
console.log("timeDifference",this.timeDifference)
@ -228,13 +231,8 @@ export default {
//
getOrderStatistics() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getRunningWaterByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
getInstituionListApi9(this.queryParams).then(res=>{
this.orderStatisticsAll = res.data
})
},
async getDeptList() {
@ -245,13 +243,8 @@ export default {
//
getList(val){
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getInstituionListApi2(this.addDateRange(this.queryParams,dateRange)).then( response => {
this.orderList = response.data.records;
getInstituionListApi7(this.queryParams).then( response => {
this.orderStatistics = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})

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,8 @@ 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.StatisticsOneDayOrderAllDto;
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 +485,49 @@ 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);
}
/**
* 订单流水分析
* @param allOrderInfoRes
* @return
*/
@GetMapping("/getInstituionListApi7")
public ResponseObject getInstituionListApi7(AllOrderInfoRes allOrderInfoRes,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<StatisticsOneDayOrderAllDto> map = allOrderInfoService.getInstituionListApi7(page,allOrderInfoRes);
return getSuccessResult(map);
}
/**
* 订单流水分析
* @param allOrderInfoRes
* @return
*/
@GetMapping("/getInstituionListApi9")
public ResponseObject getInstituionListApi9(AllOrderInfoRes allOrderInfoRes){
StatisticsOneDayOrderAllDto map = allOrderInfoService.getInstituionListApi9(allOrderInfoRes);
return getSuccessResult(map);
}
}

View File

@ -0,0 +1,32 @@
package com.fuint.business.order.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class StatisticsOneDayOrderAllDto implements Serializable {
private static final long serialVersionUID = 1L;
//日期时间
private String days;
//订单金额
private String orderMoney;
//优惠金额
private String discountAmount;
//退款金额
private String refMoney;
//挂在金额
private String accountPending;
//实收金额
private String trueMoney;
//充值金额
private String bidBalance;
//充值赠送金额
private String giftBalance;
//会员消费金额
private String memberMoney;
//归还金额
private String repaidAmount;
//新增人数
private String newNum;
}

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,8 @@ 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.StatisticsOneDayOrderAllDto;
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 +134,15 @@ 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);
IPage<StatisticsOneDayOrderAllDto> getInstituionListApi7(@Param("page") Page page,@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
StatisticsOneDayOrderAllDto getInstituionListApi9(@Param("obj") AllOrderInfoRes allOrderInfoRes,
@Param("beginTime") String beginTime, @Param("endTime") String endTime);
}

View File

@ -1380,4 +1380,216 @@
</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>
<select id="getInstituionListApi7" resultType="com.fuint.business.order.dto.StatisticsOneDayOrderAllDto">
SELECT
c.Date as days,
IFNULL(d.orderMoney,0) as orderMoney,
IFNULL(d.discountAmount,0) as discountAmount,
IFNULL(d.refMoney,0) as refMoney,
IFNULL(d.accountPending,0) as accountPending,
IFNULL(d.trueMoney,0) as trueMoney,
IFNULL(d.bidBalance,0) as bidBalance,
IFNULL(d.giftBalance,0) as giftBalance,
IFNULL(d.memberMoney,0) as memberMoney,
IFNULL(d.repaidAmount,0) as repaidAmount,
IFNULL(d.newNum,0) as newNum
from (select a.Date
from (
select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a) + (1000 * d.a)) DAY as Date
from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as d
) a
where a.Date between #{beginTime} and #{endTime}) c
LEFT JOIN
(SELECT
a.days as days,
a.orderMoney as orderMoney,
a.discountAmount as discountAmount,
a.refMoney as refMoney,
a.accountPending as accountPending,
a.trueMoney as trueMoney,
a.bidBalance as bidBalance,
a.giftBalance as giftBalance,
a.memberMoney as memberMoney,
a.repaidAmount as repaidAmount,
b.newNum as newNum
from (SELECT
DATE_FORMAT(aoi.create_time, '%Y-%m-%d') as days,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.discount_amount),0) AS discountAmount,
IFNULL(SUM(aoi.ref_money),0) AS refMoney,
IFNULL(SUM(hb.amount),0) AS accountPending,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(SUM(cvo.bid_balance),0) AS bidBalance,
IFNULL(SUM(cvo.gift_balance),0) AS giftBalance,
IFNULL(SUM(CASE WHEN mu.id is not null THEN pay_money ELSE 0 END),0) AS memberMoney,
IFNULL(SUM(hb.repaid_amount),0) AS repaidAmount
from
all_order_info aoi
LEFT JOIN hang_bill hb on aoi.user_id=hb.id
LEFT JOIN mt_user mu on aoi.user_id = mu.id
LEFT JOIN card_value_orders cvo on aoi.order_no= cvo.order_no
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 >= concat(#{beginTime},' 00:00:00') ]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ and aoi.create_time <= concat(#{endTime},' 23:59:59') ]]>
</if>
group by DATE_FORMAT(aoi.create_time, '%Y-%m-%d')) a
LEFT JOIN (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') as dayss, IFNULL(count(*),0) as newNum from mt_user
group by DATE_FORMAT(create_time, '%Y-%m-%d')) b on a.days=b.dayss) d on c.Date=d.days
</select>
<select id="getInstituionListApi9" resultType="com.fuint.business.order.dto.StatisticsOneDayOrderAllDto">
SELECT
DATE_FORMAT(aoi.create_time, '%Y-%m-%d') as days,
IFNULL(SUM(aoi.goods_money),0) AS orderMoney,
IFNULL(SUM(aoi.discount_amount),0) AS discountAmount,
IFNULL(SUM(aoi.ref_money),0) AS refMoney,
IFNULL(SUM(hb.amount),0) AS accountPending,
IFNULL(SUM(aoi.pay_money),0) AS trueMoney,
IFNULL(SUM(cvo.bid_balance),0) AS bidBalance,
IFNULL(SUM(cvo.gift_balance),0) AS giftBalance,
IFNULL(SUM(CASE WHEN mu.id is not null THEN pay_money ELSE 0 END),0) AS memberMoney,
IFNULL(SUM(hb.repaid_amount),0) AS repaidAmount,
IFNULL((SELECT COUNT(*) from mt_user where 1=1
<if test="beginTime != null and beginTime != ''">
<![CDATA[and create_time >= concat(#{beginTime},' 00:00:00') ]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ and create_time <= concat(#{endTime},' 23:59:59') ]]>
</if>),0) AS newNum
from
all_order_info aoi
LEFT JOIN hang_bill hb on aoi.user_id=hb.id
LEFT JOIN mt_user mu on aoi.user_id = mu.id
LEFT JOIN card_value_orders cvo on aoi.order_no= cvo.order_no
where 1=1 and aoi.store_id = 157 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 >= concat(#{beginTime},' 00:00:00') ]]>
</if>
<if test="endTime != null and endTime != ''">
<![CDATA[ and aoi.create_time <= concat(#{endTime},' 23:59:59') ]]>
</if>
</select>
</mapper>

View File

@ -5,6 +5,8 @@ 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.StatisticsOneDayOrderAllDto;
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 +214,11 @@ AllOrderActivityVo getOneByOrderId(Integer orderId);
IPage<AllOrderInfoVo> tradingNewList(Page page, AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getTradingNewData(AllOrderInfoDto allOrderInfo);
List<StatisticsOrderAllDto> getInstituionListApi2(AllOrderInfoRes allOrderInfoRes);
StatisticsOrderAllDto getInstituionListApi3(AllOrderInfoRes allOrderInfoRes);
IPage<StatisticsOneDayOrderAllDto> getInstituionListApi7(Page page,AllOrderInfoRes allOrderInfoRes);
StatisticsOneDayOrderAllDto getInstituionListApi9(AllOrderInfoRes allOrderInfoRes);
}

View File

@ -37,6 +37,8 @@ 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.StatisticsOneDayOrderAllDto;
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 +2621,37 @@ 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]);
}
@Override
public IPage<StatisticsOneDayOrderAllDto> getInstituionListApi7(Page page,AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
return allOrderInfoMapper.getInstituionListApi7(page,allOrderInfoRes,
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
}
@Override
public StatisticsOneDayOrderAllDto getInstituionListApi9(AllOrderInfoRes allOrderInfoRes) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfoRes.setStoreId(nowAccountInfo.getStoreId());
return allOrderInfoMapper.getInstituionListApi9(allOrderInfoRes,
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[0],
allOrderInfoRes.getDataRange()==null?"":allOrderInfoRes.getDataRange()[1]);
}
}