中台增加订单

This commit is contained in:
wangh 2024-01-12 13:58:51 +08:00
parent a6cc143bed
commit dde91a7108
19 changed files with 697 additions and 44 deletions

View File

@ -15,7 +15,7 @@
</el-popover> -->
</div>
<div class="box-size">
{{ this.statisticsData.today_sum ? parseFloat(this.statisticsData.today_sum).toFixed(2) : 0 }}
{{ this.statisticsData.today_sum ? this.statisticsData.today_sum : 0 }}
</div>
<div class="box-but">
@ -41,7 +41,7 @@
<span style="margin-right: 5px">本周流水总额</span>
</div>
<div class="box-size">
{{ this.statisticsData.this_week_sum?parseFloat(this.statisticsData.this_week_sum).toFixed(2):0 }}
{{ this.statisticsData.this_week_sum?this.statisticsData.this_week_sum:0 }}
</div>
<div class="box-but">
@ -70,7 +70,7 @@
<span style="margin-right: 5px">本月流水总额</span>
</div>
<div class="box-size">
{{this.statisticsData.this_month_sum?parseFloat(this.statisticsData.this_month_sum).toFixed(2):0}}
{{this.statisticsData.this_month_sum?this.statisticsData.this_month_sum:0}}
</div>
<div class="box-but">
@ -229,8 +229,17 @@ export default {
getDate() {
this.loading = true
turnoverStatisticsApi().then(res=>{
if (res.code == 200) {
if (res.code === 200) {
this.statisticsData = res.data
// this.statisticsData
for (const key in this.statisticsData) {
if (Object.hasOwnProperty.call(this.statisticsData, key)) {
//
if (typeof this.statisticsData[key] === 'number') {
this.statisticsData[key] = this.statisticsData[key].toFixed(2);
}
}
}
this.loading = false
}
@ -278,8 +287,11 @@ export default {
font-size: 14px;
}
.icon-lv{
width: 71px;
//width: 71px;
width: auto;
height: 24px;
padding-left: 10px;
padding-right: 10px;
background: #E3F9E9;
border-radius: 3px 3px 3px 3px;
display: flex;
@ -290,7 +302,10 @@ export default {
}
.icon-lv2{
width: 71px;
//width: 71px;
width: auto;
padding-left: 10px;
padding-right: 10px;
height: 24px;
background: #f9e3e3;
border-radius: 3px 3px 3px 3px;

View File

@ -118,26 +118,26 @@
</div>
</el-card>
<el-card>
<el-card :key="childComponentKey">
<template>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="加油订单" name="refuelOrder">
<oilOrder :pUserId="form.id"></oilOrder>
<oilOrder :key="childComponentKey" :pUserId="form.id"></oilOrder>
</el-tab-pane>
<el-tab-pane label="商品订单" name="shopOrder">
<goodsOrder :pUserId="form.id"></goodsOrder>
<goodsOrder :key="childComponentKey" :pUserId="form.id"></goodsOrder>
</el-tab-pane>
<el-tab-pane label="余额记录" name="balanceRecord">
<balanceRecord :pUserId="form.id"></balanceRecord>
<balanceRecord :key="childComponentKey" :pUserId="form.id"></balanceRecord>
</el-tab-pane>
<el-tab-pane label="积分记录" name="pointRecord">
<pointsRecord :pUserId="form.id"></pointsRecord>
<pointsRecord :key="childComponentKey" :pUserId="form.id"></pointsRecord>
</el-tab-pane>
<el-tab-pane label="卡券列表" name="cardList">
<couponList :pUserId="form.id"></couponList>
<couponList :key="childComponentKey" :pUserId="form.id"></couponList>
</el-tab-pane>
<el-tab-pane label="成长值记录" name="growthValue">
<growthValueRecord :pUserId="form.id"></growthValueRecord>
<growthValueRecord :key="childComponentKey" :pUserId="form.id"></growthValueRecord>
</el-tab-pane>
<!-- <el-tab-pane label="加油金记录" name="refuelMoney"> -->
<!-- <refuelMoneyRecord :pUserId="form.id"></refuelMoneyRecord> -->
@ -667,6 +667,7 @@ export default {
growthValue: '', //
remark: '',
paymentType: 'WECHAT', //
payType:'',
royaltyType: '',//
percentageCommissions: null,
amountCommission: null,
@ -684,12 +685,15 @@ export default {
remark: '',
rechargeBalance: '', //
paymentType: 'WECHAT',
payType:'',
oilType: '',
type: '',
chainStorId: '',
incomeLitres: '',
},
childComponentKey:1,
authCode: '', //
timer: null,
@ -1293,7 +1297,7 @@ export default {
let this_ = this
}
this.$forceUpdate();
},
@ -1320,6 +1324,7 @@ export default {
this.iniz()
this.cardFuelDieselForm = {}
this.childComponentKey = this.childComponentKey+1
},
iniz() {

View File

@ -5,7 +5,7 @@
<el-radio-button label="literCard">升数卡记录</el-radio-button>
</el-radio-group>
<div v-if="tabPosition=='giftCard'">
<el-table ref="tables" v-loading="loading" :data="cardList">
<el-table key="1" ref="tables" v-loading="loading" :data="cardList">
<el-table-column align="center" prop="storeName" label="所属油站"/>
<!-- <el-table-column prop="date" label="变动账户"/> -->
<el-table-column align="center" prop="changeType" label="类型">
@ -16,9 +16,9 @@
</el-table-column>
<el-table-column align="center" label="详细信息">
<el-table-column align="center" prop="balance" label="变动金额"/>
<el-table-column align="center" prop="address" label="变动前余额">
<el-table-column align="center" label="变动前余额">
<template slot-scope="scope">
<span>{{ scope.row.afterTheChange?scope.row.afterTheChange + scope.row.balance : '/'}}</span>
<span>{{ scope.row.afterTheChange?parseFloat(scope.row.afterTheChange - scope.row.balance).toFixed(2) : '/'}}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="afterTheChange" label="变动后余额">
@ -41,11 +41,11 @@
/>
</div>
<div v-else>
<el-table ref="tables2" v-loading="loading" :data="fuelList">
<el-table ref="tables2" key="2" v-loading="loading" :data="fuelList">
<el-table-column align="center" label="所属油站" prop="storeName"/>
<el-table-column align="center" label="油品" >
<template slot-scope="scope">
-<span>{{scope.row.type?scope.row.type:' -- '}}</span>
<span> {{scope.row.type?scope.row.type:' -- '}}</span>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
@ -60,6 +60,11 @@
<span>{{scope.row.balance?scope.row.balance:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="变动之后升数" align="center" prop="balance">
<template slot-scope="scope">
<span>{{scope.row.afterTheChange?scope.row.afterTheChange:"--"}}</span>
</template>
</el-table-column>
<el-table-column label="订单号" align="center" prop="orderNo"/>
<el-table-column label="描述" align="center" prop="fromType"/>
<el-table-column label="变动时间" align="center" prop="createTime"/>

View File

@ -0,0 +1,29 @@
import request from '@/utils/request'
// 分页查询所有的订单信息
export function getOrderListApi(query) {
return request({
url: 'business/allOrderInfo/getPageList',
method: 'get',
params: query
})
}
// 分页查询所有的订单信息
export function getSumPayMoneyApi(query) {
return request({
url: 'business/allOrderInfo/sumPayMoney',
method: 'get',
params: query
})
}
// 查询订单信息
export function getOrderInfo(orderId) {
return request({
url: 'backendApi/order/info/' + orderId,
method: 'post',
data: data
})
}

View File

@ -9,13 +9,14 @@
</el-tab-pane>
<el-tab-pane label="支付配置" name="second">
<!-- <peizhi></peizhi>
-->
<payment :id="id"></payment>
</el-tab-pane>
<el-tab-pane label="员工管理" name="staff">
<staff :id="id"></staff>
</el-tab-pane>
<el-tab-pane label="订单查看" name="allOrder">
<allOrder :id="id"></allOrder>
</el-tab-pane>
</el-tabs>
</div>
@ -29,6 +30,7 @@
// import peizhi from '../components/Service/peizhi'
import payment from '../components/Service/payment'
import staff from '../components/Service/staff'
import allOrder from '../components/Service/allOrder'
import jcindex from '../components/Service/index'
export default {
name: 'details',
@ -41,7 +43,7 @@
// peizhi
components:{
jcindex,staff,payment,
jcindex,staff,payment,allOrder
},
created() {
this.id = this.$route.query.id

View File

@ -0,0 +1,384 @@
<template>
<div class="app-container">
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="订单类型" prop="type">
<el-select
v-model="queryParams.type"
placeholder="请选择订单类型"
clearable
style="width: 240px"
>
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="订单号" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="请输入订单号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付渠道" prop="payChannel">
<el-select
v-model="queryParams.payChannel"
placeholder="请选择支付渠道"
clearable
style="width: 240px"
>
<el-option
v-for="item in payChannelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="付款方式" prop="payType">
<el-select
v-model="queryParams.payType"
placeholder="状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.payment_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</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-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 20px" >
<!-- <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>新增员工</el-button>
</el-col>
</el-row> -->
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="订单类型" align="center" prop="type" width="100">
<template slot-scope="scope">
{{ getType(scope.row.type) }}
</template>
</el-table-column>
<el-table-column label="渠道订单号" align="center" prop="transactionId"/>
<el-table-column :label="sumPayMoney" align="center" prop="payMoney">
</el-table-column>
<el-table-column label="支付时间" align="center" prop="payTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" prop="payType">
<template slot-scope="scope">
<dict-tag :options="dict.type.payment_type" :value="scope.row.payType"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="支付渠道" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ scope.row.payChannel==='applet'?'小程序': '收银台'}}</span>
</template>
</el-table-column>
<el-table-column label="付款用户手机号" align="center" prop="userMobile" width="150">
<template slot-scope="scope">
<span>{{ scope.row.userMobile?scope.row.userMobile: '散户'}}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import {getName} from "../../../utils/fuint";
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "../../../api/staff/staff";
// import {getDuty, listDuty} from "@/api/staff/duty";
import { getOrderListApi,getSumPayMoneyApi } from "../../../api/allOrder";
export default {
name: "asdf",
dicts: ['transaction','handover','handover_quit','payment_type',
'jbjl','official','notice','role'],
props: ["id"],
data() {
return {
drawer: false,
//
title: "",
//
loading: false,
//
ids: [],
//
multiple: true,
//
showSearch: true,
categoryOptions: [],
storeOptions: [],
posPrem:'',
props: { multiple: true },
appletPrem:'',
writeOff:[],
write:[],
specialPrem:[],
special:[],
//
total: 0,
//
list: [],
//
open: false,
//
dateRange: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
form: {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
},
//
queryParams: {
type:'',
orderNo:'',
payChannel:'',
payType:'',
page: 1,
pageSize: 10,
},
typeList:[
{ value: '1',label: '油品'},
{ value: '2',label: '商品'},
{ value: '3',label: '储值卡'},
{ value: '4',label: '积分'},
{ value: '5',label: '囤油卡'},
{ value: '6',label: '油品加加商品(收银台订单)'},
{ value: '7',label: '挂账订单'},
],
payTypeList:[
{ value: '选项1',label: '黄金糕'},
],
payChannelList:[
{ value: 'applet',label: '小程序'},
{ value: 'cashier',label: '收银台'},
],
sumPayMoney:'支付金额'
};
},
created() {
this.getList();
},
methods: {
//
getList() {
this.loading = true;
this.queryParams.storeId = this.id
getOrderListApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.data.records;
this.total = response.data.total;
this.getSumPayMoney()
this.loading = false;
}
);
},
//
getSumPayMoney() {
// this.loading = true;
this.queryParams.storeId = this.id
getSumPayMoneyApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
if(response.data > 0) {
const sum = response.data
this.sumPayMoney = '支付金额(总计:¥'+sum+')'
}else {
this.sumPayMoney = '支付金额'
}
// this.loading = false;
}
);
},
getType(data) {
const matchedElement = this.typeList.find(element => element.value === data);
if (matchedElement) {
return matchedElement.label;
}
return null;
},
showDesc(){
this.drawer = true;
},
handleNodeClick1(data) {
this.form.posPrem = JSON.stringify(data);
},
handleNodeClick2(data) {
this.form.appletPrem = JSON.stringify(data);
},
getCheckbox(){
this.form.writeOff = this.writeOff.toString();
this.form.specialPrem = this.specialPrem.toString();
},
//
toTarget(url) {
this.$router.push( { path: url } );
},
//
getDuty(){
listDuty().then(response => {
this.role = response.data
})
},
//
getStoreList() {
listStaff().then(response => {
this.storeOptions = response.data.records;
}
);
// searchStore().then(response => {
// this.storeOptions = response.data.storeList;
// }
// );
},
//
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.operId)
this.multiple = !selection.length
},
//
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
//
handleAdd() {
this.reset();
this.open = true;
this.title = "新增员工";
},
//
reset() {
this.posPrem = '';
this.appletPrem = '';
this.writeOff = []
this.form = {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:this.id, auditedStatus:'A',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
};
this.resetForm("form");
},
//
cancel() {
this.open = false;
this.reset();
},
}
};
</script>
<style scoped>
.app-container{
width: 100%;
height: 100%;
/* height: 100vh; */
background: white;
}
.pagin-box{
background: white;
box-sizing: border-box;
padding: 20px;
}
.baoguo{
background: white;
box-sizing: border-box;
padding: 20px;
margin-bottom: 20px;
}
</style>

View File

@ -136,8 +136,9 @@
cfc.change_type changeType,
cfc.balance balance,
cfc.order_no orderNo,
cfc.from_type from_type,
cfc.create_time createTime
cfc.from_type fromType,
cfc.create_time createTime,
cfc.after_the_change afterTheChange
from card_fuel_change cfc
left join mt_store ms on ms.id = cfc.store_id
<where>
@ -148,12 +149,13 @@
and cfc.store_id = #{cardFuelChange.storeId}
</if>
</where>
order by cfc.id desc
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into card_fuel_change(user_id, chain_store_id, store_id, change_type, from_type, balance, create_time, create_by, update_time, update_by, type, oil_type, unit,order_no)
values (#{userId}, #{chainStoreId}, #{storeId}, #{changeType}, #{fromType}, #{balance}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{type}, #{oilType}, #{unit},#{orderNo})
insert into card_fuel_change(user_id, chain_store_id, store_id, change_type, from_type, balance, create_time, create_by, update_time, update_by, type, oil_type, unit,order_no,after_the_change)
values (#{userId}, #{chainStoreId}, #{storeId}, #{changeType}, #{fromType}, #{balance}, #{createTime}, #{createBy}, #{updateTime}, #{updateBy}, #{type}, #{oilType}, #{unit},#{orderNo},#{afterTheChange})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">

View File

@ -248,6 +248,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
@Autowired
private RedisLock redisLock;
private static String beforeLitres = new String("0");
/**
* 查询支付状态 修改相关关联表
* @param id
@ -264,8 +265,10 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
// 查询用户信息
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(cardFuelRecord.getMtUserId(),cardFuelRecord.getChainStoreId());
beforeLitres = "0";
// 修改该用户的余额信息
if (!ObjectUtil.isEmpty(ljUserVos)) {
UserBalance userBalance = editRefuelMoney(cardFuelRecord, ljUserVos);
if (!ObjectUtil.isEmpty(userBalance)) {
userBalanceService.updateUserBalance(userBalance);
@ -274,6 +277,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
// 添加余额充值纪录表
CardFuelChange cardFuelChange = editFuelChange(cardFuelRecord);
cardFuelChange.setAfterTheChange(Double.valueOf(beforeLitres));
cardFuelChangeService.insert(cardFuelChange);
// 积分表变动
if (!ObjectUtil.isEmpty(cardFuelRecord.getPoints()) && cardFuelRecord.getPoints() != 0) {
@ -294,6 +298,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
}
public UserBalance editRefuelMoney(CardFuelRecord cardFuelRecord,LJUserVo ljUserVos) {
beforeLitres = "0";
List<Map<String, String>> refuelMoneyList = new ArrayList<>();
UserBalance userBalance = new UserBalance();
userBalance.setId(ljUserVos.getBalanceId());
@ -305,6 +310,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
refuelMoney.put("type",cardFuelRecord.getType());
refuelMoney.put("oilType",cardFuelRecord.getOilType());
refuelMoney.put("refuelMoney",cardFuelRecord.getIncomeLitres().toString());
beforeLitres = cardFuelRecord.getIncomeLitres().toString();
refuelMoneyList.add(refuelMoney);
String jsonString = JSON.toJSONString(refuelMoneyList);
@ -323,6 +329,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
BigDecimal ref = new BigDecimal(refuelMoney);
BigDecimal inconLitres = new BigDecimal(cardFuelRecord.getIncomeLitres().toString());
BigDecimal add = ref.add(inconLitres);
beforeLitres = add.toString();
stringObjectMap.put("refuelMoney",add.toString());
flag = false;
break;
@ -349,7 +358,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
cardFuelChange.setStoreId(cardFuelRecord.getStoreId());
cardFuelChange.setUserId(cardFuelRecord.getMtUserId());
cardFuelChange.setChangeType("1");
cardFuelChange.setFromType("油卡充值赠送");
cardFuelChange.setFromType("油卡充值");
cardFuelChange.setBalance(cardFuelRecord.getIncomeLitres());
cardFuelChange.setType(cardFuelRecord.getType());
cardFuelChange.setOilType(cardFuelRecord.getOilType());

View File

@ -405,14 +405,23 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
// 添加余额充值纪录表
CardBalanceChange cardBalanceChange = addCardBalance(cardValueRecord);
cardBalanceChangeService.insertCardBalance(cardBalanceChange);
cardBalanceChange.setAfterTheChange(userBalance.getCardBalance());
cardBalanceChangeService.insertCardBalance2(cardBalanceChange);
double epsilon = 1e-10; // 阈值
// 插入 余额赠送
// 插入 余额赠送--
if (cardValueRecord.getGiftBalance()>epsilon) {
cardBalanceChange.setFromType("余额充值赠送");
cardBalanceChange.setBalance(cardValueRecord.getGiftBalance());
cardBalanceChange.setStoreId(cardValueRecord.getStoreId());
cardBalanceChange.setChainStoreId(cardValueRecord.getChainStoreId());
cardBalanceChange.setOrderNo(cardValueRecord.getPaymentNo());
// 处理赠送
BigDecimal resCardBalance = new BigDecimal(userBalance.getCardBalance().toString()); // 原有数据
BigDecimal getGiftBalance = resCardBalance.add(new BigDecimal(cardValueRecord.getGiftBalance().toString())); // 原有数据
userBalance.setCardBalance(Double.valueOf(getGiftBalance.toString()));
userBalanceService.updateUserBalance(userBalance);
cardBalanceChange.setAfterTheChange(userBalance.getCardBalance());
cardBalanceChange.setCreateBy(cardValueRecord.getMtStaffId().toString());
cardBalanceChangeService.insertCardBalance2(cardBalanceChange);
@ -454,6 +463,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardBalanceChange.setFromType("余额充值");
cardBalanceChange.setBalance(cardValueRecord.getRechargeBalance());
cardBalanceChange.setStoreId(cardValueRecord.getStoreId());
cardBalanceChange.setOrderNo(cardValueRecord.getPaymentNo());
cardBalanceChange.setChainStoreId(cardValueRecord.getChainStoreId());
return cardBalanceChange;

View File

@ -1,6 +1,12 @@
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.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.service.AllOrderInfoService;
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 org.springframework.beans.factory.annotation.Autowired;
@ -14,6 +20,30 @@ public class AllOrderInfoController extends BaseController {
@Autowired
private AllOrderInfoService allOrderInfoService;
/**
* 分页查询全部订单信息
* @param allOrderInfo
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("getPageList")
public ResponseObject getPageList(AllOrderInfo 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.getPageList(page, allOrderInfo);
return getSuccessResult(list);
}
@GetMapping("sumPayMoney")
public ResponseObject sumPayMoney(AllOrderInfo allOrderInfo) {
String sum = allOrderInfoService.sumPayMoney(allOrderInfo);
return getSuccessResult(sum);
}
/**
* 根据订单号修改订单支付状态
* @param map

View File

@ -1,7 +1,12 @@
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.entity.AllOrderInfo;
import com.fuint.business.order.entity.CardBalanceChange;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
import com.fuint.business.store.entity.MtStore;
import org.apache.ibatis.annotations.Param;
@ -9,6 +14,10 @@ import java.math.BigDecimal;
import java.util.List;
public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
IPage<AllOrderInfoVo> getPageList(@Param("page") Page page, @Param("allOrderInfo") AllOrderInfo allOrderInfo);
String sumPayMoney( @Param("allOrderInfo") AllOrderInfo allOrderInfo);
// 根据storeId List查询总流水
BigDecimal allStream(@Param("list") List<MtStore> mtStoreList);
}

View File

@ -12,4 +12,73 @@
</foreach>
</where>
</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 pay_time desc
</select>
<select id="sumPayMoney" resultType="java.lang.String">
select
sum(aoi.pay_money) sumPayMoney
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>
</select>
</mapper>

View File

@ -24,6 +24,6 @@
and cbc.store_id = #{cardBalanceChange.storeId}
</if>
</where>
order by cbc.create_time DESC
order by cbc.id DESC
</select>
</mapper>

View File

@ -1,8 +1,28 @@
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.entity.AllOrderInfo;
import com.fuint.business.order.vo.AllOrderInfoVo;
import com.fuint.business.order.vo.CardBalanceChangeVo;
public interface AllOrderInfoService {
/**
* 分页查询全部订单信息
* @param allOrderInfo
* @param page
* @return
*/
IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo);
/**
* 统计总的金额
* @param allOrderInfo
* @return
*/
String sumPayMoney(AllOrderInfo allOrderInfo);
/**
* 根据订单号查询所有订单信息
* @param orderNo

View File

@ -2,19 +2,50 @@ package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.business.order.entity.AllOrderInfo;
import com.fuint.business.order.mapper.AllOrderInfoMapper;
import com.fuint.business.order.service.AllOrderInfoService;
import com.fuint.business.order.service.OilOrderService;
import com.fuint.business.order.vo.AllOrderInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllOrderInfo> implements AllOrderInfoService {
@Autowired
private MerchantConfigService merchantConfigService;
@Autowired
private OilOrderService orderService;
@Resource
AllOrderInfoMapper allOrderInfoMapper;
@Override
public IPage<AllOrderInfoVo> getPageList(Page page, AllOrderInfo allOrderInfo) {
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getPageList(page, allOrderInfo);
return pageList;
}
public String sumPayMoney(AllOrderInfo allOrderInfo){
String sumPayMoney = allOrderInfoMapper.sumPayMoney(allOrderInfo);
if (ObjectUtil.isEmpty(sumPayMoney)) {
sumPayMoney = "-1";
}
return sumPayMoney;
}
@Override
public AllOrderInfo selectAllOrderInfoByOrderNo(String orderNo) {
QueryWrapper queryWrapper = new QueryWrapper<>();
@ -27,8 +58,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return baseMapper.insert(allOrderInfo);
}
@Autowired
private MerchantConfigService merchantConfigService;
@Override
public int updateAllOrderInfo(AllOrderInfo allOrderInfo) {
@ -36,8 +65,6 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return baseMapper.updateById(allOrderInfo);
}
@Autowired
private OilOrderService orderService;
@Override
public int updateAllOrderInfoByOrderNo(String orderNo, String status) {

View File

@ -1096,11 +1096,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
);
// 计算对应的环比
chainMaps(mergedMap);
Map<String, Double> stringDoubleMap = chainMaps(mergedMap);
// 数据组装
return mergedMap;
return stringDoubleMap;
// return mergedMap;
}
// 员工统计
@ -1231,6 +1231,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 计算环比增长率
double growthRate = (res - last) / last * 100;
// double growthRate = ((res - last) / Math.abs(last)) * 100.0;
// 使用DecimalFormat将结果格式化为两位小数
DecimalFormat decimalFormat = new DecimalFormat("#.##");

View File

@ -0,0 +1,11 @@
package com.fuint.business.order.vo;
import com.fuint.business.order.entity.AllOrderInfo;
import lombok.Data;
@Data
public class AllOrderInfoVo extends AllOrderInfo {
private String userName;
private String userMobile;
private Double sumPayMoney;
}

View File

@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept
where parent_id = #{deptId} limit 1
where parent_id = #{deptId} and if_delete = 0 limit 1
</select>
<select id="selectChildrenDeptById" resultType="com.fuint.system.dept.entity.SysDept">

View File

@ -91,10 +91,12 @@
<div class="bottom-posi">
<div class="center-left-wrap">
<div class="wrap-box" v-for="item in payList"
v-if="item.dictValue!='APPLET_CODE'"
v-if="item.dictValue!=='APPLET_CODE'"
:key="item.dictValue"
:value="item.dictValue">
<span @click="payMethod(item.dictValue)">{{ item.dictLabel }}</span>
:value="item.dictValue"
:class="{ 'wrap-box2': item.dictValue === paymentType }"
>
<span @click="payMethod(item)">{{ item.dictLabel }}</span>
</div>
</div>
<div class="center-left-bottom">
@ -320,7 +322,7 @@
</el-dialog>
<!-- 立即结算-->
<el-dialog
title="扫码支付"
:title="payType"
:visible.sync="dialogVisiblej"
width="30%"
:close-on-click-modal="false">
@ -333,6 +335,8 @@
<div style="text-align: center;margin-bottom: 10px">
减去积分{{ allPoints }}
</div>
<template v-if="paymentType !== 'CASH'">
<div>
<el-input v-model="authCode"
autofocus="autofocus"
@ -352,6 +356,8 @@
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
</div>
</div>
</template>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
<el-button @click="dialogVisiblej = false" class="but"> </el-button>
@ -446,7 +452,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
isPay:true,
isPaySuccess:false,
loading:false,
paymentType : '',
paymentType : 'ALIPAY', //
payType:'支付宝支付'
// isTheBalanceIsSufficient:false, //
}
@ -483,7 +490,8 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
})
},
payMethod(payType){
this.paymentType = payType
this.paymentType = payType.dictValue
this.payType = payType.dictLabel +"支付"
},
//
@ -1129,6 +1137,7 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
/*background: #00afff !important;*/
width: 100%;
height: 100%;
border-radius: 8px;
height: 80px;
display: flex;
@ -1139,6 +1148,21 @@ import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/u
/*color: white;*/
}
.wrap-box2{
background: #36b713 !important;
color: white;
//width: 100%;
//height: 100%;
//border-radius: 8px;
//height: 80px;
//display: flex;
//align-items: center;
//justify-content: center;
//border: 1px solid #20b400;
//cursor: pointer;
//color: #20b400;
}
.center-left-bottom{
width: 100%;
background-color: white;