no message

This commit is contained in:
wangh 2024-05-13 14:18:31 +08:00
parent ef49ddc855
commit 17a10d4f1b
28 changed files with 1564 additions and 1744 deletions
fuintAdmin_zt/src
fuintBackend
fuint-application/src/main/java/com/fuint
fuint-repository/src/main
java/com/fuint/repository/mapper
resources/mapper

View File

@ -26,4 +26,67 @@ export function getOrderInfo(orderId) {
method: 'post',
data: data
})
}
}
export function getTradingPageApi(query) {
return request({
url: 'business/allOrderInfo/trading',
method: 'get',
params: query
})
}
export function getInstituionListApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByInstituion',
method: 'get',
params: query
})
}
export function getNoneListApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByNone',
method: 'get',
params: query
})
}
export function getDayListApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByDay',
method: 'get',
params: query
})
}
//统计
export function getRunningWaterByDataApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByData',
method: 'get',
params: query
})
}
//统计
export function getRunningWaterByTissueApi(query) {
return request({
url: 'business/allOrderInfo/runningWaterByTissue',
method: 'get',
params: query
})
}
//统计
export function getTissueByDataApi(query) {
return request({
url: 'business/allOrderInfo/getTradingData',
method: 'get',
params: query
})
}

View File

@ -1,163 +1,64 @@
<template>
<div class="app-container">
<el-form :model="queryParams" class="main-search" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="会员ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入会员ID"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入会员手机号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="状态"
clearable
>
<el-option key="A" label="有效" value="A"/>
<el-option key="N" label="无效" value="N"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column label="ID" prop="id" width="80"/>
<el-table-column label="会员ID" align="center" prop="userId" />
<el-table-column label="手机号" align="center" prop="userInfo.mobile">
<template slot-scope="scope">
<span v-if="scope.row.userInfo.mobile">{{ scope.row.userInfo.mobile }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="会员名称" align="center" prop="userInfo.name">
<template slot-scope="scope">
<span v-if="scope.row.userInfo.name">
<span>{{ scope.row.userInfo.name }}</span>
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="变动数量" align="center" prop="amount">
<template slot-scope="scope">
<span v-if="scope.row.amount > 0" style="color:forestgreen">+{{ scope.row.amount }}</span>
<span v-else style="color:red">{{ scope.row.amount }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark">
<template slot-scope="scope">
<span v-if="scope.row.description">{{ scope.row.description }}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="时间" align="center" prop="createTime">
<template slot-scope="scope">
<span v-if="scope.row.createTime">{{ parseTime(scope.row.createTime) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="createTime">
<template slot-scope="scope">
<span v-if="scope.row.operator">{{ scope.row.operator }}</span>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div class="app-center">
<div class="app-top">
<el-card >
<el-radio-group v-model="radio1">
<el-radio-button label="交易明细"></el-radio-button>
<el-radio-button label="退款明细"></el-radio-button>
<!-- <el-radio-button label="按时间统计手续费"></el-radio-button>-->
<!-- <el-radio-button label="按门店统计手续费"></el-radio-button>-->
</el-radio-group>
</el-card>
</div>
<reconciliation-trading v-if="radio1 == '交易明细' "></reconciliation-trading>
<reconciliation-ref v-if="radio1 == '退款明细' "></reconciliation-ref>
<reconciliation-time v-if="radio1 == '按时间统计手续费' "></reconciliation-time>
<reconciliation-store v-if="radio1 == '按门店统计手续费' "></reconciliation-store>
</div>
</template>
<script>
import { getBalanceList } from "@/api/balance";
import ReconciliationTrading from "@/views/financialStatement/reconciliation/tab/trading.vue";
import ReconciliationRef from "@/views/financialStatement/reconciliation/tab/ref.vue";
import ReconciliationTime from "@/views/financialStatement/reconciliation/tab/time.vue";
import ReconciliationStore from "@/views/financialStatement/reconciliation/tab/store.vue";
export default {
name: "BalanceList",
data() {
return {
//
loading: true,
//
ids: [],
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
queryParams: {
page: 1,
pageSize: 10,
mobile: '',
userId: '',
orderSn: '',
status: ''
}
};
name: "reconciliation-list",
data(){
return{
radio1:'交易明细'
}
},
created() {
this.getList();
components:{
ReconciliationStore,
ReconciliationTime,
ReconciliationRef,
ReconciliationTrading
},
methods: {
//
getList() {
this.loading = true;
getBalanceList(this.queryParams).then( response => {
this.list = response.data.paginationResponse.content;
this.total = response.data.paginationResponse.totalElements;
this.catchTypeList = response.data.catchTypeList
this.loading = false;
}
);
},
//
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.multiple = !selection.length
},
//
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
handleClick(tab, event) {
console.log(tab, event);
}
}
};
}
</script>
<style scoped>
.app-center{
width: 100%;
box-sizing: border-box;
padding: 10px;
}
.app-top{
width: 100%;
margin-bottom: 20px;
height: 60px;
box-sizing: border-box;
}
</style>

View File

@ -52,28 +52,18 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
</div>
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">退款笔数</div>
<div class="size-bole">{{
orderStatistics.refBalanceCount }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">退款余额</div>
<div class="size-bole">{{ orderStatistics.refBalance }}</div>
</div>
</div>
</el-card>
<el-card class="box-card">
@ -85,64 +75,60 @@
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="payTime" align="center" label="支付时间" width="220"> </el-table-column>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额"> </el-table-column>
<el-table-column prop="seekZero" align="center" label="找零金额"> </el-table-column>
<el-table-column align="center" label="订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品金额">
<template slot-scope="scope">
<span>{{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品金额">
<template slot-scope="scope">
<span>{{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="实付订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品实付金额" width="100">
<template slot-scope="scope">
<span>{{scope.row.oilPayAmount ? scope.row.oilPayAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品实付金额" width="110">
<template slot-scope="scope">
<span>{{scope.row.goodsPayAmount ? scope.row.goodsPayAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="storeName" align="center" label="门店"> </el-table-column>
<el-table-column prop="createBy" align="center" label="收银员"> </el-table-column>
<el-table-column prop="payChannel" align="center" label="支付渠道"> </el-table-column>
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="amount" align="center" label="费率"> </el-table-column>
<el-table-column prop="type" align="center" label="订单来源">
<el-table-column prop="payUser" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="status" align="center" label="状态">
</el-table-column>
<el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
<span v-if="scope.row.payType=='CASH'">现金</span>
<span v-else-if="scope.row.payType=='WECHAT'">微信</span>
<span v-else-if="scope.row.payType=='ALIPAY'">支付宝</span>
<span v-else="">余额</span>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" width="160" prop="payTime">
</el-table-column>
<el-table-column label="操作人" align="center" prop="staffId">
</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="payMoney" align="center" label="退款金额"> </el-table-column>
<!-- <el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>-->
<!-- <el-table-column prop="payAmount" align="center" label="手续费"> </el-table-column>-->
<el-table-column prop="userName" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="reasonRefund" align="content" label="备注" width="110"> </el-table-column>
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini"
@click="getOrdersInfo(scope.row)"
type="success" plain round>详情</el-button>
</template>
</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>
<!-- <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"
/>
</el-card>
</div>
@ -150,13 +136,18 @@
<script>
import {getRunningWaterByTissueApi, getTissueByDataApi, getTradingPageApi} from "@/api/allOrder";
export default {
name: "reconciliation-trading",
name: "reconciliation-ref",
data(){
return{
radio1:"油号选错",
loading:false,
dialogVisible:false,
ordersInfo: {},
//
deptList:[],
staffList:[],
//
dateRange: [],
@ -172,14 +163,14 @@
pageSize: 10,
beginTime:"",
endTime:"",
orderNo:"",
status:"refund",
payType:"",
payChannel:"",
},
orderStatistics:{
numberOfStrokes:'0',
theTotalAmountOfTheOrder:'0',
theTotalAmountPaid:'0',
oilDiscounts:'0',
theTotalAmountOfOil:'0',
theTotalAmountOfTheItem:'0',
refBalance:"0",
refBalanceCount:"0",
},
total:0,
}
@ -195,10 +186,14 @@
this.endTime = new Date()
this.isSysDate = true
this.getList();
this.getDeptList();
},
methods:{
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
},
exportExcelCashier() {
let dateRange = []
if (this.beginTime && this.endTime) {
@ -218,22 +213,27 @@
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// this.orderStatistics = res.data
// })
getTissueByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
//
getList(val){
// listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then( response => {
// this.orderList = response.data.records;
// this.total = response.data.total;
// this.isSysDate = false
// })
getTradingPageApi(this.addDateRange(this.queryParams)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},
getDeptList() {
getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
this.deptList = response.data.records;
})
},
//
handleQuery() {
this.queryParams.page = 1;

View File

@ -52,28 +52,28 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
</div>
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">手续费合计</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">微信支付手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">支付宝手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">银行卡手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">银联云闪付手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
</div>
</el-card>
<el-card class="box-card">
@ -151,7 +151,7 @@
<script>
export default {
name: "reconciliation-trading",
name: "reconciliation-store",
data(){
return{
radio1:"油号选错",

View File

@ -52,26 +52,26 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
</div>
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-hui">手续费合计</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-hui">微信支付手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-hui">支付宝手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-hui">银行卡手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-hui">银联云闪付手续费</div>
<div class="size-bole">{{ 0 }}</div>
</div>
</div>
@ -151,10 +151,9 @@
<script>
export default {
name: "reconciliation-trading",
name: "reconciliation-time",
data(){
return{
radio1:"油号选错",
loading:false,
//
staffList:[],

View File

@ -2,162 +2,270 @@
<template>
<div style="margin-top: 30px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="流水编号:">
<el-input v-model="queryParams.orderNo"></el-input>
</el-form-item>
<el-form-item label="交易时间:">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 400px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="datetimerange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<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>
<el-form-item label="机构:" prop="deptId">
<el-select
v-model="queryParams.deptId"
clearable
placeholder="全部"
>
<el-option v-for="item in deptList" :key="item.id" :label="item.deptName" :value="item.deptId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付渠道:" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
clearable
placeholder="全部"
>
<el-option label="小程序" value="applet"/>
<el-option label="收银台" value="cashier"/>
<el-option label="POS端" value="POS"/>
</el-select>
</el-form-item>
<el-form-item label="支付方式:" prop="payType">
<el-select
v-model="queryParams.payType"
clearable
placeholder="全部"
>
<el-option label="现金" value="CASH"/>
<el-option label="微信" value="WECHAT"/>
<el-option label="支付宝" value="ALIPAY"/>
<el-option label="余额" value="balance"/>
</el-select>
</el-form-item>
<el-form-item label="支付状态 " 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>
<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" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card">
<!-- <div slot="header" class="clearfix">-->
<!-- <span>收银台订单统计</span>-->
<!-- </div>-->
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">微信收款</div>
<div class="size-bole">{{ orderStatistics.cash }}/{{orderStatistics.cashcount}}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">支付宝收款</div>
<div class="size-bole">{{ orderStatistics.wechat }}/{{orderStatistics.wechatcount}}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">会员钱包收款</div>
<div class="size-bole">{{ orderStatistics.alipay }}/{{orderStatistics.alipaycount}}</div>
</div>
<!-- <div class="box">-->
<!-- <div class="size-hui">银行卡收款</div>-->
<!-- <div class="size-bole">{{ 0 }}/{{0}}</div>-->
<!-- </div>-->
<!-- <div class="box">-->
<!-- <div class="size-hui">银联云闪付收款</div>-->
<!-- <div class="size-bole">{{ 0 }}/{{0}}</div>-->
<!-- </div>-->
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-hui">现金支付收款</div>
<div class="size-bole">{{ orderStatistics.balance }}/{{orderStatistics.balanceCount}}</div>
</div>
</div>
</el-card>
<el-card class="box-card">
<div class="wgang">
<div>机构流水分析列表</div>
<div style="display: flex ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="交易时间:">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 400px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="datetimerange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<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>
<el-form-item label="机构:" prop="staffId">
<el-select
v-model="queryParams.staffId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<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" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="table-box">
<el-table
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="payTime" align="center" label="支付时间" width="220"> </el-table-column>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额"> </el-table-column>
<el-table-column prop="seekZero" align="center" label="找零金额"> </el-table-column>
<el-table-column align="center" label="订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品金额">
<template slot-scope="scope">
<span>{{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品金额">
<template slot-scope="scope">
<span>{{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="实付订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品实付金额" width="100">
<template slot-scope="scope">
<span>{{scope.row.oilPayAmount ? scope.row.oilPayAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品实付金额" width="110">
<template slot-scope="scope">
<span>{{scope.row.goodsPayAmount ? scope.row.goodsPayAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="storeName" align="center" label="门店"> </el-table-column>
<el-table-column prop="createBy" align="center" label="收银员"> </el-table-column>
<el-table-column prop="payChannel" align="center" label="支付渠道"> </el-table-column>
<el-table-column prop="mchntCd" align="center" label="商户号"> </el-table-column>
<el-table-column prop="amount" align="center" label="费率"> </el-table-column>
<el-table-column prop="type" align="center" label="订单来源">
<el-table-column prop="payUser" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="status" align="center" label="状态">
</el-table-column>
<el-table-column prop="amount" align="center" label="所属模块"> </el-table-column>
<el-table-column prop="payType" align="center" label="支付方式">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<span v-if="scope.row.payType=='CASH'">现金</span>
<span v-else-if="scope.row.payType=='WECHAT'">微信</span>
<span v-else-if="scope.row.payType=='ALIPAY'">支付宝</span>
<span v-else="">余额</span>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="支付状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status == 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" width="160" prop="payTime">
<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="refMoney" align="center" label="退款金额"> </el-table-column>
<el-table-column prop="payMoney" align="center" label="实收金额"> </el-table-column>
<!-- <el-table-column prop="payAmount" align="center" label="手续费"> </el-table-column>-->
<el-table-column prop="userName" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="content" align="content" label="备注" width="110"> </el-table-column>
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button style="width: 60px" size="mini"
@click="getOrdersInfo(scope.row)"
type="success" plain round>详情</el-button>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="staffId">
</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>
<!-- <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"
/>
</el-card>
<el-dialog
title="订单信息"
:visible.sync="dialogVisible">
<el-descriptions :title="'订单号:'+ordersInfo.orderNo">
<el-descriptions-item label="门店">{{ordersInfo.storeName}}</el-descriptions-item>
<el-descriptions-item label="收银员">{{ordersInfo.createBy}}</el-descriptions-item>
<el-descriptions-item label="支付渠道">{{ordersInfo.payChannel}}</el-descriptions-item>
<el-descriptions-item label="商户号">{{ordersInfo.mchntCd}}</el-descriptions-item>
<el-descriptions-item label="费率">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="订单来源">{{ordersInfo.type}}</el-descriptions-item>
<el-descriptions-item label="所属模块">{{ordersInfo.amount}}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{ordersInfo.payType}}</el-descriptions-item>
<el-descriptions-item label="付款用户">{{ordersInfo.userName}}</el-descriptions-item>
<el-descriptions-item label="支付状态">{{ordersInfo.status}}</el-descriptions-item>
<el-descriptions-item label="备注">{{ordersInfo.content}}</el-descriptions-item>
<!-- <el-descriptions-item label="备注">-->
<!-- <el-tag size="small">学校</el-tag>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
<el-descriptions class="margin-top" title="金额详情" :column="3" border>
<el-descriptions-item>
<template slot="label">
订单金额
</template>
{{ordersInfo.goodsMoney?ordersInfo.goodsMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
优惠后应付金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
退款金额
</template>
{{ordersInfo.refMoney?ordersInfo.refMoney:"--"}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
实收金额
</template>
{{ordersInfo.payMoney?ordersInfo.payMoney:"--"}}
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>
<script>
import {
getRunningWaterByTissueApi,
getTissueByDataApi,
getTradingPageApi
} from "@/api/allOrder";
export default {
name: "runningWater-institution",
name: "reconciliation-trading",
data(){
return{
radio1:"油号选错",
loading:false,
dialogVisible:false,
//
staffList:[],
ordersInfo:{},
//
dateRange: [],
beginTime:"",
@ -166,20 +274,33 @@
isSysDate:false,
//
orderList:[],
deptList:[],
//
queryParams: {
page: 1,
pageSize: 10,
beginTime:"",
endTime:"",
orderNo:"",
status:"",
payType:"",
payChannel:"",
deptType:"3",
storeId:"",
deptId:"",
},
orderStatistics:{
numberOfStrokes:'0',
theTotalAmountOfTheOrder:'0',
theTotalAmountPaid:'0',
oilDiscounts:'0',
theTotalAmountOfOil:'0',
theTotalAmountOfTheItem:'0',
CASH:"0",
WECHAT:"0",
ALIPAY:"0",
balance:"0",
CASHCount:"0",
WECHATCount:"0",
ALIPAYCount:"0",
balanceCount:"0",
refBalance:"0",
refBalanceCount:"0",
},
total:0,
}
@ -195,10 +316,15 @@
this.endTime = new Date()
this.isSysDate = true
this.getList();
this.getDeptList();
},
methods:{
getDeptList() {
getRunningWaterByTissueApi(this.addDateRange(this.queryParams)).then( response => {
this.deptList = response.data.records;
})
},
exportExcelCashier() {
let dateRange = []
if (this.beginTime && this.endTime) {
@ -218,22 +344,29 @@
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// this.orderStatistics = res.data
// })
getTissueByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
//
getList(val){
// listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then( response => {
// this.orderList = response.data.records;
// this.total = response.data.total;
// this.isSysDate = false
// })
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 => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},
getOrdersInfo(data) {
this.dialogVisible = true;
this.ordersInfo = data
},
//
handleQuery() {
this.queryParams.page = 1;

View File

@ -1,163 +1,65 @@
<template>
<div class="app-container">
<el-form :model="queryParams" class="main-search" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="会员ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入会员ID"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入会员手机号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="状态"
clearable
>
<el-option key="A" label="有效" value="A"/>
<el-option key="N" label="无效" value="N"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column label="ID" prop="id" width="80"/>
<el-table-column label="会员ID" align="center" prop="userId" />
<el-table-column label="手机号" align="center" prop="userInfo.mobile">
<template slot-scope="scope">
<span v-if="scope.row.userInfo.mobile">{{ scope.row.userInfo.mobile }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="会员名称" align="center" prop="userInfo.name">
<template slot-scope="scope">
<span v-if="scope.row.userInfo.name">
<span>{{ scope.row.userInfo.name }}</span>
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="变动数量" align="center" prop="amount">
<template slot-scope="scope">
<span v-if="scope.row.amount > 0" style="color:forestgreen">+{{ scope.row.amount }}</span>
<span v-else style="color:red">{{ scope.row.amount }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark">
<template slot-scope="scope">
<span v-if="scope.row.description">{{ scope.row.description }}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="时间" align="center" prop="createTime">
<template slot-scope="scope">
<span v-if="scope.row.createTime">{{ parseTime(scope.row.createTime) }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="createTime">
<template slot-scope="scope">
<span v-if="scope.row.operator">{{ scope.row.operator }}</span>
<span v-else>-</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div class="app-center">
<div class="app-top">
<el-card>
<el-radio-group v-model="radio1">
<el-radio-button label="机构流水分析"></el-radio-button>
<el-radio-button label="油站流水分析"></el-radio-button>
<el-radio-button label="无流水门店"></el-radio-button>
<el-radio-button label="日流水分析"></el-radio-button>
</el-radio-group>
</el-card>
</div>
<running-water-institution v-if="radio1 == '机构流水分析' "></running-water-institution>
<running-water-oil-depot v-if="radio1 == '油站流水分析' "></running-water-oil-depot>
<running-water-day v-if="radio1 == '日流水分析' "></running-water-day>
<running-water-none v-if="radio1 == '无流水门店' "></running-water-none>
</div>
</template>
<script>
import { getBalanceList } from "@/api/balance";
import RunningWaterInstitution from "@/views/financialStatement/runningWater/tab/instituion.vue";
import RunningWaterOilDepot from "@/views/financialStatement/runningWater/tab/oilDepot.vue";
import RunningWaterDay from "@/views/financialStatement/runningWater/tab/day.vue";
import RunningWaterNone from "@/views/financialStatement/runningWater/tab/none.vue";
export default {
name: "BalanceList",
data() {
return {
//
loading: true,
//
ids: [],
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
list: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
queryParams: {
page: 1,
pageSize: 10,
mobile: '',
userId: '',
orderSn: '',
status: ''
}
};
name: "runningWater-list",
data(){
return{
radio1:'机构流水分析'
}
},
created() {
this.getList();
components:{
RunningWaterNone,
RunningWaterDay,
RunningWaterOilDepot,
RunningWaterInstitution
},
methods: {
//
getList() {
this.loading = true;
getBalanceList(this.queryParams).then( response => {
this.list = response.data.paginationResponse.content;
this.total = response.data.paginationResponse.totalElements;
this.catchTypeList = response.data.catchTypeList
this.loading = false;
}
);
},
//
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.multiple = !selection.length
},
//
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
handleClick(tab, event) {
console.log(tab, event);
}
}
};
}
</script>
<style scoped>
.app-center{
width: 100%;
box-sizing: border-box;
padding: 10px;
}
.app-top{
width: 100%;
margin-bottom: 20px;
height: 60px;
box-sizing: border-box;
}
</style>

View File

@ -4,7 +4,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
</div>
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
@ -32,9 +32,9 @@
<div class="wgang">
<div>机构流水分析列表</div>
<div style="display: flex ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="60px">
<el-form-item label="交易时间:">
<el-form-item label="时间:">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 400px"-->
@ -85,51 +85,29 @@
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额"> </el-table-column>
<el-table-column prop="seekZero" align="center" label="找零金额"> </el-table-column>
<el-table-column align="center" label="订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品金额">
<template slot-scope="scope">
<span>{{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品金额">
<template slot-scope="scope">
<span>{{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="实付订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品实付金额" width="100">
<template slot-scope="scope">
<span>{{scope.row.oilPayAmount ? scope.row.oilPayAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品实付金额" width="110">
<template slot-scope="scope">
<span>{{scope.row.goodsPayAmount ? scope.row.goodsPayAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="payUser" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="status" align="center" label="状态">
<el-table-column prop="payTime" align="center" label="日期"></el-table-column>
<!-- <el-table-column prop="seekZero" align="center" label="活跃机构数量"> </el-table-column>-->
<el-table-column prop="storeCount" align="center" label="活跃门店数量"> </el-table-column>
<el-table-column prop="amount" align="center" label="交易金额"> </el-table-column>
<el-table-column prop="strokeCount" align="center" label="交易笔数"> </el-table-column>
<el-table-column prop="unitPrice" align="center" label="笔单价">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
<span>{{scope.row.unitPrice}}</span>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" width="160" prop="payTime">
<el-table-column prop="dailyAmount" align="center" label="日均交易金额">
<template slot-scope="scope">
<span>{{ (scope.row.amount / scope.row.storeCount).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="staffId">
<el-table-column prop="strokesPerDay" align="center" label="日均交易笔数">
<template slot-scope="scope">
<span>{{ (scope.row.strokeCount / scope.row.storeCount).toFixed(2) }}</span>
</template>
</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-column prop="seekZero" align="center" label="门店日均交易金额"> </el-table-column>-->
</el-table>
</div>
<div class="pagination-box">
@ -150,12 +128,15 @@
<script>
import {getDayListApi} from "@/api/allOrder";
export default {
name: "runningWater-institution",
name: "runningWater-day",
data(){
return{
radio1:"油号选错",
loading:false,
deptList:[],
//
staffList:[],
//
@ -225,12 +206,16 @@
//
getList(val){
// listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then( response => {
// this.orderList = response.data.records;
// this.total = response.data.total;
// this.isSysDate = false
// })
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getDayListApi(this.addDateRange(this.queryParams, dateRange)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},

View File

@ -1,135 +1,31 @@
<!-- 收银台订单-->
<template>
<div style="margin-top: 30px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
</div>
</div>
</el-card>
<el-card class="box-card">
<div class="wgang">
<div>机构流水分析列表</div>
<div style="display: flex ">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
<el-form-item label="交易时间:">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 400px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="datetimerange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<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>
<el-form-item label="机构:" prop="staffId">
<el-select
v-model="queryParams.staffId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<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" icon="el-icon-plus" @click = "exportExcelCashier()">导出订单</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="table-box">
<el-table
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额"> </el-table-column>
<el-table-column prop="seekZero" align="center" label="找零金额"> </el-table-column>
<el-table-column align="center" label="订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品金额">
<template slot-scope="scope">
<span>{{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品金额">
<template slot-scope="scope">
<span>{{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="实付订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品实付金额" width="100">
<template slot-scope="scope">
<span>{{scope.row.oilPayAmount ? scope.row.oilPayAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品实付金额" width="110">
<template slot-scope="scope">
<span>{{scope.row.goodsPayAmount ? scope.row.goodsPayAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="payUser" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="status" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" width="160" prop="payTime">
</el-table-column>
<el-table-column label="操作人" align="center" prop="staffId">
</el-table-column>
<el-table-column prop="deptId" align="center" label="门店编号"> </el-table-column>
<el-table-column prop="deptName" align="center" label="门店名称"> </el-table-column>
<!-- <el-table-column prop="seekZero" align="center" label="门店省市"> </el-table-column>-->
<el-table-column prop="leaderName" align="center" label="联系人"> </el-table-column>
<el-table-column prop="leaderPhone" align="center" label="联系电话"> </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="leaderPhone" align="center" label="业务员联系电话"> </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-column prop="seekZero" align="center" label="省"> </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-column prop="addr" align="center" label="地址"> </el-table-column>
<el-table-column prop="createTime" align="center" label="创建日期"> </el-table-column>
</el-table>
</div>
<div class="pagination-box">
@ -150,8 +46,10 @@
<script>
import {getNoneListApi} from "@/api/allOrder";
export default {
name: "runningWater-institution",
name: "runningWater-none",
data(){
return{
radio1:"油号选错",
@ -210,28 +108,14 @@
// this.$download.saveAs(blob,'.xLsx')
// })
},
//
getOrderStatistics() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// this.orderStatistics = res.data
// })
},
//
getList(val){
// listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then( response => {
// this.orderList = response.data.records;
// this.total = response.data.total;
// this.isSysDate = false
// })
this.getOrderStatistics()
getNoneListApi(this.addDateRange(this.queryParams)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
},
//

View File

@ -4,27 +4,31 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>收银台订单统计</span>
</div>交易金额交易笔数笔单价日均交易金额日均交易笔数
</div>
<div class="box-gang">
<div class="box">
<div class="size-hui">交易金额</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.amount }}</div>
</div>
<div class="box">
<div class="size-hui">交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.strokeCount }}</div>
</div>
<div class="box">
<div class="size-hui">笔单价</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.unitPrice }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易金额</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.dailyAmount }}</div>
</div>
<div class="box">
<div class="size-hui">日均交易笔数</div>
<div class="size-bole">{{ 0 }}</div>
<div class="size-bole">{{ orderStatistics.strokesPerDay }}</div>
</div>
<div class="box">
<div class="size-hui">活跃机构数</div>
<div class="size-bole">{{ orderStatistics.inertiaStore }}</div>
</div>
</div>
</el-card>
@ -85,51 +89,19 @@
:data="orderList"
style="width: 100%">
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="orderNo" align="center" label="订单号" width="220"> </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额"> </el-table-column>
<el-table-column prop="afterDiscountAmount" align="center" label="优惠后应付金额"> </el-table-column>
<el-table-column prop="payAmount" align="center" label="实付金额"> </el-table-column>
<el-table-column prop="seekZero" align="center" label="找零金额"> </el-table-column>
<el-table-column align="center" label="订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品金额">
<template slot-scope="scope">
<span>{{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品金额">
<template slot-scope="scope">
<span>{{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="实付订单金额组成">
<el-table-column prop="oilOrderAmount" align="center" label="油品实付金额" width="100">
<template slot-scope="scope">
<span>{{scope.row.oilPayAmount ? scope.row.oilPayAmount : '0'}}</span>
</template>
</el-table-column>
<el-table-column prop="goodsOrderAmount" align="center" label="商品实付金额" width="110">
<template slot-scope="scope">
<span>{{scope.row.goodsPayAmount ? scope.row.goodsPayAmount : '0'}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="payUser" align="center" label="付款用户" width="110"> </el-table-column>
<el-table-column prop="status" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status === 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" width="160" prop="payTime">
</el-table-column>
<el-table-column label="操作人" align="center" prop="staffId">
</el-table-column>
<el-table-column prop="deptId" align="center" label="门店编号"> </el-table-column>
<el-table-column prop="deptName" align="center" label="门店名称"> </el-table-column>
<el-table-column prop="addr" align="center" label="门店省市"> </el-table-column>
<el-table-column prop="amount" align="center" label="交易金额"> </el-table-column>
<el-table-column prop="strokeCount" align="center" label="交易笔数"> </el-table-column>
<el-table-column prop="unitPrice" align="center" label="笔单价"> </el-table-column>
<el-table-column prop="dailyAmount" align="center" label="日均交易金额"> </el-table-column>
<el-table-column prop="strokesPerDay" align="center" label="日均交易笔数"> </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="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">
@ -150,11 +122,12 @@
<script>
import {getInstituionListApi, getRunningWaterByDataApi} from "@/api/allOrder";
export default {
name: "runningWater-institution",
name: "runningWater-oilDepot",
data(){
return{
radio1:"油号选错",
loading:false,
//
staffList:[],
@ -172,6 +145,8 @@
pageSize: 10,
beginTime:"",
endTime:"",
deptType:"3",
},
orderStatistics:{
numberOfStrokes:'0',
@ -218,19 +193,19 @@
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
// orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
// this.orderStatistics = res.data
// })
getRunningWaterByDataApi(this.addDateRange(this.queryParams, dateRange)).then(res=>{
this.orderStatistics = res.data
})
},
//
getList(val){
// listCashierOrder(this.addDateRange(this.queryParams, dateRange)).then( response => {
// this.orderList = response.data.records;
// this.total = response.data.total;
// this.isSysDate = false
// })
getInstituionListApi(this.addDateRange(this.queryParams)).then( response => {
this.orderList = response.data.records;
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},

View File

@ -2,6 +2,7 @@ package com.fuint.business.order.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.service.AllOrderInfoService;
@ -9,9 +10,11 @@ import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import com.fuint.system.dept.vo.SysDeptVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@ -76,4 +79,77 @@ public class AllOrderInfoController extends BaseController {
public ResponseObject getOrderInfo(String orderNo, String type) {
return getSuccessResult(allOrderInfoService.getOrderInfo(orderNo,type));
}
/**
* 交易对账
* 交易明细分页查询
*/
@GetMapping("trading")
public ResponseObject getTradingPage(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.getTradingPage(page, allOrderInfo);
return getSuccessResult(list);
}
@GetMapping("getTradingData")
public ResponseObject getTradingData(AllOrderInfoDto allOrderInfo,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
AllOrderInfoVo list = allOrderInfoService.getTradingData(allOrderInfo);
return getSuccessResult(list);
}
/**
* 机构流水分析
*/
@GetMapping("runningWaterByInstituion")
public ResponseObject runningWaterByInstituion(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<SysDeptVo> list = allOrderInfoService.runningWaterByInstituion(page, allOrderInfoDto);
return getSuccessResult(list);
}
/**
* 机构流水分析
*/
@GetMapping("runningWaterByNone")
public ResponseObject runningWaterByNone(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<SysDeptVo> list = allOrderInfoService.runningWaterByNone(page, allOrderInfoDto);
return getSuccessResult(list);
}
@GetMapping("runningWaterByDay")
public ResponseObject runningWaterByDay(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<AllOrderInfoVo> list = allOrderInfoService.runningWaterByDay(page, allOrderInfoDto);
return getSuccessResult(list);
}
@GetMapping("runningWaterByData")
public ResponseObject runningWaterByData(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,100000);
AllOrderInfoVo list = allOrderInfoService.runningWaterByData(page, allOrderInfoDto);
return getSuccessResult(list);
}
@GetMapping("runningWaterByTissue")
public ResponseObject runningWaterByTissue(AllOrderInfoDto allOrderInfoDto,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,100000);
IPage<SysDeptVo> list = allOrderInfoService.runningWaterByTissue(page, allOrderInfoDto);
return getSuccessResult(list);
}
}

View File

@ -0,0 +1,13 @@
package com.fuint.business.order.dto;
import com.fuint.business.order.entity.AllOrderInfo;
import lombok.Data;
import java.util.List;
@Data
public class AllOrderInfoDto extends AllOrderInfo {
private String deptType; //节点类型:1代理商2连锁店3基本门店4三方机构
private Long deptId; //节点类型:1代理商2连锁店3基本门店4三方机构
private List<Long> storeIds;
}

View File

@ -3,6 +3,7 @@ package com.fuint.business.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.vo.AllOrderInfoVo;
@ -20,4 +21,19 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
String sumPayMoney( @Param("allOrderInfo") AllOrderInfo allOrderInfo);
// 根据storeId List查询总流水
BigDecimal allStream(@Param("list") List<MtStore> mtStoreList);
AllOrderInfoVo getTradingData(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getTradingPage(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfo allOrderInfo);
IPage<AllOrderInfoVo> getTradingPage(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getRunningWaterByInstituion(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
// 计算不活跃的店铺数量
AllOrderInfoVo getStoreNDynamic(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getRunningWaterByDay(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
AllOrderInfoVo getRunningWaterByData(@Param("allOrderInfo") AllOrderInfoDto allOrderInfo);
}

View File

@ -13,7 +13,7 @@
</foreach>
</where>
</select>
<select id="getPageList" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
<select id="getTradingPage" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
aoi.id AS id,
aoi.order_no AS orderNo,
@ -26,37 +26,107 @@
aoi.pay_type AS payType,
aoi.user_id AS userId,
aoi.pay_channel AS payChannel,
aoi.status AS orderStatus,
aoi.status AS status,
aoi.content AS orderContent,
aoi.create_time AS createTime,
aoi.create_by AS createBy,
aoi.update_time AS updateTime,
aoi.update_by AS updateBy,
aoi.reason_Refund AS reasonRefund,
aoi.ref_order_no AS refOrderNo,
aoi.ref_money AS refMoney,
aoi.ref_by AS refBy,
mu.name userName,
mu.mobile userMobile
from all_order_info aoi
left join mt_user mu ON aoi.user_id = mu.id
where aoi.store_id = #{allOrderInfo.storeId}
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
</if>
<if test="allOrderInfo.orderNo != null and allOrderInfo.orderNo != ''">
and aoi.order_no = #{allOrderInfo.orderNo}
</if>
<if test="allOrderInfo.payChannel != null and allOrderInfo.payChannel != ''">
and aoi.pay_channel = #{allOrderInfo.payChannel}
</if>
<if test="allOrderInfo.payType != null and allOrderInfo.payType != ''">
and aoi.pay_type = #{allOrderInfo.payType}
</if>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<where>
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
</if>
<if test="allOrderInfo.orderNo != null and allOrderInfo.orderNo != ''">
and 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.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.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<if test="allOrderInfo.storeIds != null">
and aoi.store_id in
<foreach collection="allOrderInfo.storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
order by aoi.create_time desc
</select>
<select id="getRunningWaterByInstituion" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
COALESCE(SUM(pay_money), 0) AS amount,
COALESCE(COUNT(*), 0) AS strokeCount,
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE SUM(pay_money) / COUNT(*)
END AS unitPrice
from all_order_info aoi
<where>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<if test="allOrderInfo.storeIds != null">
and aoi.store_id in
<foreach collection="allOrderInfo.storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<!-- sum(pay_money) amount,-->
<!-- count(*) strokeCount,-->
<!-- SUM(pay_money) / COUNT(*) AS unitPrice,-->
<!-- store_id storeId,-->
<select id="getStoreNDynamic" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
COUNT(DISTINCT aoi.store_id) AS storeCount
from all_order_info aoi
<where>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<if test="allOrderInfo.storeIds != null">
and aoi.store_id in
<foreach collection="allOrderInfo.storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
AND aoi.pay_money &gt; 0
</where>
</select>
<!-- &#45;&#45; aoi.store_id = #{allOrderInfo.storeId}-->
<select id="sumPayMoney" resultType="java.lang.String">
select
sum(aoi.pay_money) sumPayMoney
@ -82,4 +152,145 @@
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
</select>
<select id="getPageList" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
aoi.id AS id,
aoi.order_no AS orderNo,
aoi.type AS type,
aoi.transaction_id AS transactionId,
aoi.store_id AS storeId,
aoi.goods_money AS goodsMoney,
aoi.pay_money AS payMoney,
aoi.pay_time AS payTime,
aoi.pay_type AS payType,
aoi.user_id AS userId,
aoi.pay_channel AS payChannel,
aoi.status AS orderStatus,
aoi.content AS orderContent,
aoi.create_time AS createTime,
aoi.create_by AS createBy,
aoi.update_time AS updateTime,
aoi.update_by AS updateBy,
mu.name userName,
mu.mobile userMobile
from all_order_info aoi
left join mt_user mu ON aoi.user_id = mu.id
where aoi.store_id = #{allOrderInfo.storeId}
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
</if>
<if test="allOrderInfo.orderNo != null and allOrderInfo.orderNo != ''">
and aoi.order_no = #{allOrderInfo.orderNo}
</if>
<if test="allOrderInfo.payChannel != null and allOrderInfo.payChannel != ''">
and aoi.pay_channel = #{allOrderInfo.payChannel}
</if>
<if test="allOrderInfo.payType != null and allOrderInfo.payType != ''">
and aoi.pay_type = #{allOrderInfo.payType}
</if>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
order by aoi.create_time desc
</select>
<select id="getRunningWaterByDay" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
SELECT DATE(pay_time) AS pay_time,
COUNT(DISTINCT aoi.store_id) storeCount,
COALESCE(SUM(pay_money), 0) AS amount,
COALESCE(COUNT(*), 0) AS strokeCount,
ROUND(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE SUM(pay_money) / COUNT(*)
END,
2
) AS unitPrice
from all_order_info aoi
WHERE date_format(aoi.pay_time,'%y%m%d') BETWEEN date_format(#{allOrderInfo.params.beginTime},'%y%m%d') AND date_format(#{allOrderInfo.params.endTime},'%y%m%d')
GROUP BY date_format(aoi.pay_time,'%y%m%d')
HAVING
amount > 0
Order by aoi.pay_time
</select>
<select id="getRunningWaterByData" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
COUNT(DISTINCT aoi.store_id) storeCount,
COALESCE(SUM(pay_money), 0) AS amount,
COALESCE(COUNT(*), 0) AS strokeCount,
ROUND(
CASE
WHEN COUNT(*) = 0 THEN 0
ELSE SUM(pay_money) / COUNT(*)
END,
2
) AS unitPrice
from all_order_info aoi
<where>
<if test="allOrderInfo.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<if test="allOrderInfo.storeIds != null">
and aoi.store_id in
<foreach collection="allOrderInfo.storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
AND aoi.pay_money &gt; 1
</where>
</select>
<select id="getTradingData" resultType="com.fuint.business.order.vo.AllOrderInfoVo">
select
SUM(CASE WHEN pay_type = 'CASH' THEN pay_money ELSE 0 END) AS CASH,
SUM(CASE WHEN pay_type = 'WECHAT' THEN pay_money ELSE 0 END) AS WECHAT,
SUM(CASE WHEN pay_type = 'ALIPAY' THEN pay_money ELSE 0 END) AS ALIPAY,
SUM(CASE WHEN pay_type = 'balance' THEN pay_money ELSE 0 END) AS balance,
COUNT(CASE WHEN pay_type = 'CASH' THEN 0 END) AS CASHCount,
COUNT(CASE WHEN pay_type = 'WECHAT' THEN 0 END) AS WECHATCount,
COUNT(CASE WHEN pay_type = 'ALIPAY' THEN 0 END) AS ALIPAYCount,
COUNT(CASE WHEN pay_type = 'balance' THEN 0 END) AS balanceCount,
SUM(CASE WHEN aoi.status = 'refunt' THEN pay_money ELSE 0 END) AS refBalance,
COUNT(CASE WHEN aoi.status = 'refunt' THEN 0 END) AS refBalanceCount
from all_order_info aoi
left join mt_user mu ON aoi.user_id = mu.id
<where>
<if test="allOrderInfo.type != null and allOrderInfo.type != ''">
and aoi.type = #{allOrderInfo.type}
</if>
<if test="allOrderInfo.orderNo != null and allOrderInfo.orderNo != ''">
and 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.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.params.beginTime != null and allOrderInfo.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(pay_time,'%y%m%d') &gt;= date_format(#{allOrderInfo.params.beginTime},'%y%m%d')
</if>
<if test="allOrderInfo.params.endTime != null and allOrderInfo.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(pay_time,'%y%m%d') &lt;= date_format(#{allOrderInfo.params.endTime},'%y%m%d')
</if>
<if test="allOrderInfo.storeIds != null">
and aoi.store_id in
<foreach collection="allOrderInfo.storeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@ -2,9 +2,12 @@ package com.fuint.business.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.system.dept.vo.SysDeptVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
@ -63,5 +66,13 @@ public interface AllOrderInfoService {
Map<String,String> getOrderInfo(String orderNo, String type);
AllOrderInfoVo getTradingData(AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> getTradingPage(Page page, AllOrderInfoDto allOrderInfo);
IPage<SysDeptVo> runningWaterByInstituion(Page page, AllOrderInfoDto allOrderInfo);
IPage<SysDeptVo> runningWaterByNone(Page page, AllOrderInfoDto allOrderInfo);
IPage<AllOrderInfoVo> runningWaterByDay(Page page, AllOrderInfoDto allOrderInfo);
AllOrderInfoVo runningWaterByData(Page page, AllOrderInfoDto allOrderInfo);
IPage<SysDeptVo> runningWaterByTissue(Page page, AllOrderInfoDto allOrderInfo);
}

View File

@ -18,6 +18,7 @@ import com.fuint.business.convenienceSore.entity.StockTrack;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.convenienceSore.service.StockTrackService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.order.dto.AllOrderInfoDto;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.entity.CashierOrder;
import com.fuint.business.order.entity.LJOrder;
@ -31,12 +32,25 @@ import com.fuint.business.petrolStationManagement.entity.OilTracking;
import com.fuint.business.petrolStationManagement.service.OilGunService;
import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.service.OilTrackingService;
import com.fuint.business.store.entity.MtStore;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.service.MemberService;
import com.fuint.common.service.StaffService;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.repository.mapper.MtOpenGiftMapper;
import com.fuint.repository.mapper.MtUserMapper;
import com.fuint.repository.model.MtOrderGoods;
import com.fuint.repository.model.MtStaff;
import com.fuint.repository.model.MtUser;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.mapper.SysDeptMapper;
import com.fuint.system.dept.service.ISysDeptService;
import com.fuint.system.dept.vo.SysDeptVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -45,10 +59,12 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Slf4j
@ -303,6 +319,9 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
@Resource
CardFavorableRecordService cardFavorableRecordService;
@Resource
StoreService storeService;
// 处理油品
private void disposeOil(OilOrder oilOrder,Map<String, String> map) {
@ -401,4 +420,319 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return res;
}
@Resource
StaffService staffService;
@Resource
MemberService memberService;
@Resource
private MtUserMapper mtUserMapper;
public AllOrderInfoVo getTradingData(AllOrderInfoDto allOrderInfo) {
return allOrderInfoMapper.getTradingData(allOrderInfo);
}
@Override
public IPage<AllOrderInfoVo> getTradingPage(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// IPage<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptById2( page,nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType());
//
// allOrderInfo.setStoreIds(sysDepts.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
//
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getTradingPage(page, allOrderInfo);
for (AllOrderInfoVo record : pageList.getRecords()) {
MtStore mtStore = storeService.queryStoreById3(record.getStoreId());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(record.getStoreId());
record.setStoreName(mtStore.getName());
if(ObjectUtil.isNotEmpty(merchantConfig)) {
record.setMchntCd(merchantConfig.getMchntCd());
}else {
record.setMchntCd("--");
}
// 收银员
if (ObjectUtil.isNotEmpty(allOrderInfo.getCreateBy())) {
MtStaff mtStaff = staffService.queryStaffById2(Integer.parseInt(allOrderInfo.getCreateBy()));
if(ObjectUtil.isNotEmpty(mtStaff)) {
record.setCreateBy(mtStaff.getRealName());
}else {
record.setCreateBy("--");
}
}
MtUser byId = mtUserMapper.queryMemberById(allOrderInfo.getUserId());
if(ObjectUtil.isNotEmpty(byId)) {
record.setUserName(byId.getName());
}else {
record.setUserName("--");
}
}
return pageList;
}
@Resource
ISysDeptService iSysDeptService;
@Resource
SysDeptMapper sysDeptMapper;
@Override
public IPage<SysDeptVo> runningWaterByInstituion(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
IPage<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptById2( page,nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType());
for (SysDeptVo sysDept : sysDepts.getRecords()) {
long dayNum = 0;
// 查询父级
SysDept sysDept1 = sysDeptMapper.selectDeptById(sysDept.getParentId());
sysDept.setParentStoreId(sysDept.getParentId());
sysDept.setParentStoreName(sysDept1.getParentName());
//计算天数
if (ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("beginTime")) && ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("endTime"))) {
String beginTimeStr = allOrderInfo.getParams().get("beginTime").toString();
String endTimeStr = allOrderInfo.getParams().get("endTime").toString();
dayNum = dayCount(beginTimeStr, endTimeStr);
} else {
LocalDate createDate = sysDept.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
dayNum = dayCount2(createDate);
}
if (dayNum<1) {
dayNum = 1;
}
List<SysDeptVo> store = new ArrayList<>();
if (ObjectUtil.isNotEmpty(allOrderInfo.getDeptType()) && "3".equals(allOrderInfo.getDeptType())) {
SysDeptVo storeByDept = sysDeptMapper.getStoreByDept(sysDept.getDeptId());
sysDept.setAddr(storeByDept.getAddr());
store.add(storeByDept);
}else {
store = sysDeptMapper.selectChildrenDeptByIdStore(sysDept.getDeptId());
}
if (ObjectUtil.isNotEmpty(store)){
allOrderInfo.setStoreIds(store.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
}else {
continue;
}
AllOrderInfoVo runningWaterByInstituion = allOrderInfoMapper.getRunningWaterByInstituion(allOrderInfo);
sysDept.setAmount(runningWaterByInstituion.getAmount());
sysDept.setStrokeCount(runningWaterByInstituion.getStrokeCount());
sysDept.setUnitPrice(runningWaterByInstituion.getUnitPrice());
calculatedMean(sysDept,dayNum);
//查询不活跃
AllOrderInfoVo storeNDynamic = allOrderInfoMapper.getStoreNDynamic(allOrderInfo);
sysDept.setInertiaStore(storeNDynamic.getStoreCount());
}
return sysDepts;
}
@Override
public IPage<SysDeptVo> runningWaterByNone(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfo.setDeptType("3");
IPage<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptById2( page,nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType());
List<SysDeptVo> sysDeptVos = new ArrayList<>();
for (SysDeptVo sysDept : sysDepts.getRecords()) {
long dayNum = 0;
// 查询父级
SysDept sysDept1 = sysDeptMapper.selectDeptById(sysDept.getParentId());
sysDept.setParentStoreId(sysDept.getParentId());
sysDept.setParentStoreName(sysDept1.getParentName());
//计算天数
if (ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("beginTime")) && ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("endTime"))) {
String beginTimeStr = allOrderInfo.getParams().get("beginTime").toString();
String endTimeStr = allOrderInfo.getParams().get("endTime").toString();
dayNum = dayCount(beginTimeStr, endTimeStr);
} else {
LocalDate createDate = sysDept.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
dayNum = dayCount2(createDate);
}
if (dayNum<1) {
dayNum = 1;
}
List<SysDeptVo> store = new ArrayList<>();
if (ObjectUtil.isNotEmpty(allOrderInfo.getDeptType()) && "3".equals(allOrderInfo.getDeptType())) {
SysDeptVo storeByDept = sysDeptMapper.getStoreByDept(sysDept.getDeptId());
sysDept.setAddr(storeByDept.getAddr());
store.add(storeByDept);
}else {
store = sysDeptMapper.selectChildrenDeptByIdStore(sysDept.getDeptId());
}
if (ObjectUtil.isNotEmpty(store)){
allOrderInfo.setStoreIds(store.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
}else {
continue;
}
AllOrderInfoVo runningWaterByInstituion = allOrderInfoMapper.getRunningWaterByInstituion(allOrderInfo);
sysDept.setAmount(runningWaterByInstituion.getAmount());
sysDept.setStrokeCount(runningWaterByInstituion.getStrokeCount());
sysDept.setUnitPrice(runningWaterByInstituion.getUnitPrice());
calculatedMean(sysDept,dayNum);
//查询不活跃
AllOrderInfoVo storeNDynamic = allOrderInfoMapper.getStoreNDynamic(allOrderInfo);
sysDept.setInertiaStore(storeNDynamic.getStoreCount());
if (Double.parseDouble(runningWaterByInstituion.getAmount()) <= 0.00) {
sysDeptVos.add(sysDept);
}
}
sysDepts.setRecords(sysDeptVos);
return sysDepts;
}
public IPage<AllOrderInfoVo> runningWaterByDay(Page page, AllOrderInfoDto allOrderInfo) {
//计算天数
if (!ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("beginTime")) && ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("endTime"))) {
throw new RuntimeException("");
}
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
allOrderInfo.setDeptType("3");
List<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptByIdStore(nowAccountInfo.getDeptId());
allOrderInfo.setStoreIds(sysDepts.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
// 数据查询
IPage<AllOrderInfoVo> runningWaterByDay = allOrderInfoMapper.getRunningWaterByDay(page,allOrderInfo);
return runningWaterByDay;
}
@Override
public AllOrderInfoVo runningWaterByData(Page page, AllOrderInfoDto allOrderInfo){
AllOrderInfoVo allOrderInfoVo = new AllOrderInfoVo();
allOrderInfoVo.setAmount("0");
allOrderInfoVo.setStrokeCount("0");
allOrderInfoVo.setUnitPrice("0");
allOrderInfoVo.setDailyAmount("0");
allOrderInfoVo.setStrokesPerDay("0");
allOrderInfoVo.setStoreCount("0");
allOrderInfoVo.setInertiaStore("0");
//流水数据分析
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
IPage<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptById2( page,nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(),allOrderInfo.getDeptType());
for (SysDeptVo sysDept : sysDepts.getRecords()) {
long dayNum = 0;
// 查询父级
SysDept sysDept1 = sysDeptMapper.selectDeptById(sysDept.getParentId());
sysDept.setParentStoreId(sysDept.getParentId());
sysDept.setParentStoreName(sysDept1.getParentName());
//计算天数
if (ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("beginTime")) && ObjectUtil.isNotEmpty(allOrderInfo.getParams().get("endTime"))) {
String beginTimeStr = allOrderInfo.getParams().get("beginTime").toString();
String endTimeStr = allOrderInfo.getParams().get("endTime").toString();
dayNum = dayCount(beginTimeStr, endTimeStr);
} else {
LocalDate createDate = sysDept.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
dayNum = dayCount2(createDate);
}
if (dayNum<1) {
dayNum = 1;
}
List<SysDeptVo> store = new ArrayList<>();
if (ObjectUtil.isNotEmpty(allOrderInfo.getDeptType()) && "3".equals(allOrderInfo.getDeptType())) {
SysDeptVo storeByDept = sysDeptMapper.getStoreByDept(sysDept.getDeptId());
sysDept.setAddr(storeByDept.getAddr());
store.add(storeByDept);
}else {
store = sysDeptMapper.selectChildrenDeptByIdStore(sysDept.getDeptId());
}
if (ObjectUtil.isNotEmpty(store)){
allOrderInfo.setStoreIds(store.stream().map(SysDeptVo::getStoreId).collect(Collectors.toList()));
}else {
continue;
}
AllOrderInfoVo runningWaterByInstituion = allOrderInfoMapper.getRunningWaterByInstituion(allOrderInfo);
sysDept.setAmount(runningWaterByInstituion.getAmount());
sysDept.setStrokeCount(runningWaterByInstituion.getStrokeCount());
sysDept.setUnitPrice(ObjectUtil.isNotEmpty(runningWaterByInstituion.getUnitPrice())?runningWaterByInstituion.getUnitPrice():"0");
calculatedMean(sysDept,dayNum);
//查询不活跃
AllOrderInfoVo storeNDynamic = allOrderInfoMapper.getStoreNDynamic(allOrderInfo);
sysDept.setInertiaStore(storeNDynamic.getStoreCount());
Double amount = Double.parseDouble(allOrderInfoVo.getAmount()) + Double.parseDouble(sysDept.getAmount());
Double strokeCount = Double.parseDouble(allOrderInfoVo.getStrokeCount()) + Double.parseDouble(sysDept.getStrokeCount());
Double unitPrice = Double.parseDouble(allOrderInfoVo.getUnitPrice()) + Double.parseDouble(sysDept.getUnitPrice());
Double dailyAmount = Double.parseDouble(allOrderInfoVo.getDailyAmount()) + Double.parseDouble(sysDept.getDailyAmount());
Double strokesPerDay = Double.parseDouble(allOrderInfoVo.getStrokesPerDay()) + Double.parseDouble(sysDept.getStrokesPerDay());
Integer inertiaStore = Integer.parseInt(allOrderInfoVo.getInertiaStore()) + Integer.parseInt(sysDept.getInertiaStore());
allOrderInfoVo.setAmount(amount.toString());
allOrderInfoVo.setStrokeCount(strokeCount.toString());
allOrderInfoVo.setUnitPrice(unitPrice.toString());
allOrderInfoVo.setDailyAmount(dailyAmount.toString());
allOrderInfoVo.setStrokesPerDay(strokesPerDay.toString());
allOrderInfoVo.setInertiaStore(inertiaStore.toString());
}
return allOrderInfoVo;
}
// 组织查询
@Override
public IPage<SysDeptVo> runningWaterByTissue(Page page, AllOrderInfoDto allOrderInfo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
IPage<SysDeptVo> sysDepts = sysDeptMapper.selectChildrenDeptById2(page, nowAccountInfo.getDeptId(),allOrderInfo.getDeptId(), allOrderInfo.getDeptType());
return sysDepts;
}
private long dayCount(String beginTimeStr, String endTimeStr ) {
// 将字符串表示的时间转换成 LocalDate 对象
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/M/d");
LocalDate beginDate = LocalDate.parse(beginTimeStr, formatter);
LocalDate endDate = LocalDate.parse(endTimeStr, formatter);
// 计算两个日期之间的天数差
return endDate.toEpochDay() - beginDate.toEpochDay() + 1;
}
private long dayCount2(LocalDate createDate) {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 计算两个日期之间的天数差
return ChronoUnit.DAYS.between(createDate, currentDate);
}
private void calculatedMean(SysDeptVo sysDept,long day) {
// 创建 DecimalFormat 对象指定保留两位小数的格式
DecimalFormat df = new DecimalFormat("#.00");
// 将字符串转换成数值类型进行计算
double amount = Double.parseDouble(sysDept.getAmount());
double strokeCount = Double.parseDouble(sysDept.getStrokeCount());
// 计算平均值
double meanAmount = amount / day;
double meanStrokeCount = strokeCount / day;
// 格式化计算结果保留两位小数
String meanAmountStr = df.format(meanAmount);
String meanStrokeCountStr = df.format(meanStrokeCount);
// 将计算结果设置回对象中
sysDept.setDailyAmount(meanAmountStr);
sysDept.setStrokesPerDay(meanStrokeCountStr);
}
}

View File

@ -7,5 +7,36 @@ import lombok.Data;
public class AllOrderInfoVo extends AllOrderInfo {
private String userName;
private String userMobile;
private String storeName;
private String mchntCd;
private Double sumPayMoney;
//交易金额
private String amount;
// 交易笔数
private String strokeCount;
// 笔单价
private String unitPrice;
// 日均交易金额
private String dailyAmount;
// 日均交易笔数
private String strokesPerDay;
private String storeCount ;
private String inertiaStore;
private String CASH;
private String WECHAT;
private String ALIPAY;
private String balance;
private String CASHCount;
private String WECHATCount;
private String ALIPAYCount;
private String balanceCount;
private String refBalance;
private String refBalanceCount;
}

View File

@ -114,7 +114,7 @@ public class PrinterServiceImpl implements PrinterService {
if ("success".equals(errorDescription)) {
JSONObject body = jsonObject.getJSONObject("body");
String accessToken = body.getString("access_token");
RedisUtil.set("scancodemodel+"+storeId,accessToken,60*60*24*20);
RedisUtil.set("scancodemodel+"+storeId,accessToken,60*60*24*7);
return accessToken;
}
} catch (Exception e) {
@ -170,6 +170,14 @@ public class PrinterServiceImpl implements PrinterService {
Map<String, Object> map = jsonObject.getInnerMap();
//获取支付参数
log.info("url:{}",url);
if (ObjectUtil.isNotEmpty(url)) {
String error = jsonObject.getString("error");
if ("18".equals(error)) {
getToken(storeId);
printIndex(payAmount,storeId);
}
}
return map.get("error_description").toString();
}

View File

@ -49,6 +49,7 @@ public interface StoreService extends IService<MtStore> {
MtStore queryStoreById(Integer id) throws BusinessCheckException;
MtStore queryStoreById2(Integer id) throws BusinessCheckException;
MtStore queryStoreById3(Integer id);
/**
* 根据店铺id列表获取店铺信息

View File

@ -188,6 +188,14 @@ public class StoreServiceImpl extends ServiceImpl<MtStoreMapper, MtStore> implem
return mtStoreMapper.selectById(id);
}
@Override
public MtStore queryStoreById3(Integer id) {
if (id == null) {
return null;
}
return mtStoreMapper.selectById(id);
}
/**
* 获取系统默认店铺
*

View File

@ -38,6 +38,7 @@ public interface StaffService {
* @throws BusinessCheckException
*/
MtStaff queryStaffById(Integer id) throws BusinessCheckException;
MtStaff queryStaffById2(Integer id);
/**
* 审核更改状态(禁用审核通过)

View File

@ -170,6 +170,10 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
public MtStaff queryStaffById(Integer id) {
return mtStaffMapper.selectById(id);
}
@Override
public MtStaff queryStaffById2(Integer id) {
return mtStaffMapper.selectById(id);
}
/**
* 更改员工状态

View File

@ -1,7 +1,10 @@
package com.fuint.system.dept.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.system.dept.entity.SysDept;
import com.fuint.system.dept.vo.SysDeptVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -46,6 +49,10 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
*/
public List<SysDept> selectChildrenDeptById(Long deptId);
IPage<SysDeptVo> selectChildrenDeptById2(@Param("page") Page page, @Param("ancestors") Long ancestors, @Param("deptId") Long deptId, @Param("deptType") String deptType);
List<SysDeptVo> selectChildrenDeptByIdStore(@Param("deptId") Long deptId);
SysDeptVo getStoreByDept(@Param("deptId") Long deptId);
/**
* 根据ID查询所有子部门正常状态
*

View File

@ -62,7 +62,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectChildrenDeptById" resultType="com.fuint.system.dept.entity.SysDept">
select * from sys_dept where find_in_set(#{deptId}, ancestors)
</select>
<select id="selectChildrenDeptById2" resultType="com.fuint.system.dept.vo.SysDeptVo">
select * from sys_dept where find_in_set(#{ancestors}, ancestors)
<if test="deptType !=null">
and dept_type = #{deptType}
</if>
<if test="deptId !=null and deptId !=''">
and dept_id = #{deptId}
</if>
</select>
<select id="selectChildrenDeptByIdStore" resultType="com.fuint.system.dept.vo.SysDeptVo">
select sd.dept_id deptId,
ms.id storeId,
ms.address
from sys_dept sd
left join mt_store ms on sd.dept_id = ms.contract_dept_id
where find_in_set(#{deptId}, sd.ancestors)
and sd.dept_type = '3'
</select>
<select id="getStoreByDept" resultType="com.fuint.system.dept.vo.SysDeptVo">
select sd.dept_id deptId,
ms.id storeId,
ms.address addr
from sys_dept sd
left join mt_store ms on sd.dept_id = ms.contract_dept_id
where sd.dept_id = #{deptId}
and sd.dept_type = '3'
limit 1
</select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = 'qy' and find_in_set(#{deptId}, ancestors) and if_delete = 0
</select>

View File

@ -0,0 +1,26 @@
package com.fuint.system.dept.vo;
import com.fuint.system.dept.entity.SysDept;
import lombok.Data;
@Data
public class SysDeptVo extends SysDept {
private Long storeId;
private String addr;
//交易金额
private String amount;
// 交易笔数
private String strokeCount;
// 笔单价
private String unitPrice;
// 日均交易金额
private String dailyAmount;
// 日均交易笔数
private String strokesPerDay;
private String inertiaStore;
private String parentStoreName;
private Long parentStoreId;
}

View File

@ -22,6 +22,7 @@ public interface MtUserMapper extends BaseMapper<MtUser> {
List<MtUser> queryMemberByName(@Param("merchantId") Integer merchantId, @Param("name") String name);
MtUser queryMemberByOpenId(@Param("merchantId") Integer merchantId, @Param("openId") String openId);
MtUser queryMemberById(@Param("id") Integer id);
MtUser queryMemberByOpenId2(@Param("openId") String openId);

View File

@ -86,5 +86,9 @@
</if>
GROUP BY u.`ID` ORDER BY SUM(o.`AMOUNT`) DESC LIMIT 10
</select>
<select id="queryMemberById" resultType="com.fuint.repository.model.MtUser">
select * from mt_user t where t.Id = #{id}
limit 1
</select>
</mapper>