This commit is contained in:
wangh 2024-02-28 13:25:00 +08:00
commit 2a6abf3b57
12 changed files with 217 additions and 83 deletions

View File

@ -49,8 +49,8 @@ public class Const {
public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB";
//异步通知(回调地址)
// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
//下单
public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate";

View File

@ -269,6 +269,18 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
e.printStackTrace();
}
}
}else {
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
if (ObjectUtil.isNotEmpty(tAccount)) {
if (tAccount.getAccountName().matches("\\d+")) {
tAccount.setAccountName(staff.getMobile());
}
try {
accountService.editAccount(tAccount, null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return row;
}

View File

@ -38,6 +38,23 @@ public class OrderGoods extends BaseEntity implements Serializable {
* 商品数量
*/
private Integer num;
/**
* 商品单价
*/
private Double retailPrice;
/**
* 商品会员价
*/
private Double memberPrice;
/**
* 商品合计金额
*/
private Double allAmount;
/**
* 商品实付金额
*/
private Double payAmount;
}

View File

@ -2,7 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.order.mapper.OrderGoodsMapper">
<sql id="selectOrderGoods">
select mog.id,mog.order_id,mog.goods_id as goods_id,mg.id as goodsId,mg.name,mg.retail_price,mg.member_price,mog.num,mg.unit
select mog.id,mog.order_id,mog.goods_id as goods_id,mg.id as goodsId,mg.name,mog.retail_price,
mog.member_price,mog.num,mg.unit,mog.all_amount,mog.pay_amount
from mt_order_goods mog inner join mt_goods mg on mog.goods_id = mg.id
</sql>

View File

@ -6,6 +6,8 @@ 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.business.convenienceSore.entity.LJGoods;
import com.fuint.business.convenienceSore.service.LJGoodsService;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.entity.OrderGoods;
import com.fuint.business.order.mapper.LJOrderMapper;
@ -122,6 +124,9 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
return baseMapper.getStatisticsByTime(time, goodsId, payType);
}
@Autowired
private LJGoodsService goodsService;
@Override
public void addGoodOrder(LJOrder order,Integer goodsId) {
if (ObjectUtil.isEmpty(order.getOrderNo())){
@ -134,10 +139,15 @@ public class LJOrderServiceImpl extends ServiceImpl<LJOrderMapper, LJOrder> impl
}
baseMapper.insert(order);
LJOrder ljOrder = this.selectGoodsOrder(order.getOrderNo());
LJGoods ljGoods = goodsService.selectLJGoodsById(goodsId);
OrderGoods orderGoods = new OrderGoods();
orderGoods.setGoodsId(goodsId);
orderGoods.setOrderId(ljOrder.getId());
orderGoods.setNum(ljOrder.getGoodsNum());
orderGoods.setRetailPrice(ljGoods.getRetailPrice());
orderGoods.setMemberPrice(ljGoods.getMemberPrice());
orderGoods.setAllAmount(order.getAmount());
orderGoods.setPayAmount(order.getPayAmount());
orderGoodsService.save(orderGoods);
}
}

View File

@ -521,6 +521,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// throw new RuntimeException("支付失败");
}
}else {
cashierOrder.setPayAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount);
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
}

View File

@ -40,6 +40,15 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
@Override
public int insertOrderGoods(OrderGoods goods,Integer storeId,Boolean isMember) {
LJGoods ljGoods = goodsService.selectLJGoodsById(goods.getGoodsId());
goods.setRetailPrice(ljGoods.getRetailPrice());
goods.setMemberPrice(ljGoods.getMemberPrice());
goods.setAllAmount(ljGoods.getRetailPrice()*goods.getNum());
if (isMember){
goods.setPayAmount(ljGoods.getMemberPrice()*goods.getNum());
}else {
goods.setPayAmount(ljGoods.getRetailPrice()*goods.getNum());
}
int row = baseMapper.insert(goods);
this.insertStockTrack(goods,storeId,isMember);
return row;

View File

@ -9,8 +9,10 @@ public class OrderGoodsVo {
private Integer goods_id;
private Integer goodsId;
private String name;
private String retailPrice;
private String memberPrice;
private Double retailPrice;
private Double memberPrice;
private Double allAmount;
private Double payAmount;
private Integer num;
private String unit;
}

View File

@ -2460,7 +2460,6 @@
// LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789');
// let preview = LODOP.PREVIEW();
// console.log("preview",preview);
LODOP.PRINT();
}
},
@ -2700,7 +2699,9 @@
this.isOilStorageCard = false;
if (this.balance>0){
this.checkAll4 = true
this.payType = "balance"
if (this.goodsOrder.length==0) {
this.payType = "balance"
}
}
}else {
this.checkAll4 = false
@ -2720,7 +2721,9 @@
this.checkAll3 = false
this.isOilStorageCard = false;
this.consumeRefuelMoney = 0;
this.payType = "balance"
if (this.goodsOrder.length==0) {
this.payType = "balance"
}
this.countAmountFull();
this.isUseBalance = false;
}
@ -2742,7 +2745,9 @@
this.couponAmount = 0
if (this.balance>0){
this.checkAll4 = true
this.payType = "balance"
if (this.goodsOrder.length==0) {
this.payType = "balance"
}
}
}
this.countAmountFull();
@ -2920,13 +2925,11 @@
// if (response.data.fixingLevel.storeValue=="no" && _this.consumeAmount>0){
// _this.oilDiscount = 0
// _this.checkAll4 = false
// console.log(111)
// }else {
_this.oilDiscount += discount.discount
_this.gradeDiscount.push(discount)
_this.checkAll2 = true
_this.checkedCities2.push(discount.gunName)
// console.log(222)
// }
}
}
@ -3085,7 +3088,9 @@
// }
if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){
this.checkAll4 = true
this.payType = "balance"
if (this.goodsOrder.length==0){
this.payType = "balance"
}
this.countAmountFull()
}
await this.getGrade(this.member.id,this.member.gradeId)
@ -3172,7 +3177,6 @@
}
}
// }
// console.log(_this.couponAmount,222)
if(!this.isOilStorageCard){
this.countAmountFull()
}
@ -3182,7 +3186,6 @@
if (type==0){
this.countAmountFull()
}
// console.log(discount,_this.gradeDiscount,_this.couponDiscount,_this.fullReduceDiscount,"1264")
})
})
},
@ -3258,7 +3261,9 @@
//
_this.checkAll1 = false
_this.checkAll4 = true;
this.payType = "balance"
if (_this.goodsOrder.length==0) {
_this.payType = "balance"
}
_this.fullReduction = 0
_this.isUseFull = true;
}else {
@ -3448,7 +3453,6 @@
},
//
chooseStaff(data){
console.log(data,"qusnv")
this.staff = data;
this.map.staffId = this.staff.id;
this.dialogVisible = false
@ -3460,6 +3464,7 @@
},
//
changeGoods(val){
this.payType = "WECHAT"
let result = true;
let goods = this.goodsOrder;
let _this = this;
@ -3473,19 +3478,20 @@
break;
}
goods[i].num = goods[i].num + 1;
val.num = goods[i].num + 1;
this.goodsTotal += 1;
if (_this.isMember) {
this.goodsDiscount += +((goods[i].retailPrice-goods[i].memberPrice)*goods[i].num).toFixed(2)
}
amount += goods[i].retailPrice * goods[i].num
result = false;
break;
} else {
result = true;
}
if (_this.isMember) {
this.goodsDiscount += +((goods[i].retailPrice-goods[i].memberPrice)*goods[i].num).toFixed(2)
}
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
// this.goodsAmount = amount;
// this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
} else {
result = true;
}
@ -3498,6 +3504,7 @@
if (_this.isMember) {
this.goodsDiscount += (val.retailPrice - val.memberPrice)
}
console.log(this.goodsAmount)
this.goodsAmount += +val.retailPrice
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val);
@ -3507,14 +3514,26 @@
this.$modal.msgError("商品库存不足,请重新选择商品")
return;
}
if (_this.isMember) {
this.goodsDiscount += (val.retailPrice - val.memberPrice) * val.num
// if (_this.isMember) {
// this.goodsDiscount += (val.retailPrice - val.memberPrice) * val.num
// }
// this.goodsAmount += val.retailPrice * val.num
// this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
_this.goodsDiscount = 0
_this.goodsAmount = 0
if (this.goodsOrder.length > 0) {
goods.forEach(item => {
// if (item.id != val.id){
if (_this.isMember) {
_this.goodsDiscount += (item.retailPrice - item.memberPrice) * item.num
}
_this.goodsAmount += item.retailPrice * item.num
_this.goodsActualPay = _this.goodsAmount - _this.goodsDiscount;
// }
})
}
this.goodsAmount += +val.retailPrice * val.num
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
}
this.goods = ""
},
//
settlement(){
@ -3555,6 +3574,7 @@
this.gradeDiscount = [];
this.couponDiscount = [];
this.checkAll4 = false;
this.isExistOilOrder = false
if (this.member.refuelMoney!=null){
this.refuelMoney = JSON.parse(this.member.refuelMoney)
@ -3621,7 +3641,9 @@
}
if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){
this.checkAll4 = true
this.payType = "balance"
if (this.goodsOrder.length==0) {
this.payType = "balance"
}
this.countAmountFull()
}
await this.getGrade(this.member.id,this.member.gradeId)
@ -3845,6 +3867,7 @@
this.map.staffId = this.staff.id
this.map.cardFavorableId = this.cardFavorableId
this.map.recordId = this.recordId
this.map.userId = this.member.id
let _this = this;
if (this.payType=="APPLET_CODE"){
@ -3877,7 +3900,6 @@
let isPaySuccess = false;
await addLJGoods(_this.map).then( response => {
console.log('3867386738673867')
_this.orderNo = response.data.orderNo;
if (response.data.oilOrder!=null){
if (response.data.oilOrder.orderStatus == "paid"){
@ -4147,11 +4169,15 @@
payMethod(payType){
if (payType == 'oilCard'){
if (this.isMember){
if (this.goodsOrder.length>0){
this.$message.error("商品不可使用囤油卡付款")
return;
}
if (this.refuelMoney1.length>0){
this.checkAll3 = true
this.handleCheckAllChange3(true)
}else {
this.$message.error("请先充值囤油卡")
this.$message.error("请先充值")
return;
}
}else {
@ -4161,8 +4187,17 @@
}
if (payType == 'balance'){
if (this.isMember){
this.checkAll4 = true
this.handleCheckAllChange4(true)
if (this.goodsOrder.length>0){
this.$message.error("商品不可使用储值卡付款")
return;
}
if (this.balance>0){
this.checkAll4 = true
this.handleCheckAllChange4(true)
}else {
this.$message.error("请先充值!!")
return;
}
}else {
this.$message.error("请先选择会员")
return;

View File

@ -256,32 +256,32 @@
</div>
<div style="margin-top: 30px">
<el-descriptions :column="1" direction="vertical">
<!-- <el-descriptions-item label="油品详情">-->
<!-- <el-table-->
<!-- v-loading="loading"-->
<el-descriptions-item label="油品详情">
<el-table
v-loading="loading"
<!-- :data="oilInfo"-->
<!-- style="width: 100%">-->
<!-- <el-table-column label="油号油枪" prop="terminal">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ getName(oilNameList,scope.row.oils) }}/{{ getName1(oilGunList,scope.row.oilGunNum) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="油品金额" align="center" prop="orderAmount">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.orderAmount }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="加油升数" align="center" prop="oilNum" >-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.oilNum }}L</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="油品单价" align="center" prop="amount">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.oilPrice }}/L</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
:data="oilInfo"
style="width: 100%">
<el-table-column label="油号油枪" prop="terminal">
<template slot-scope="scope">
<span>{{ getName(oilNameList,scope.row.oils) }}/{{ getName1(oilGunList,scope.row.oilGunNum) }}</span>
</template>
</el-table-column>
<el-table-column label="油品金额" align="center" prop="orderAmount">
<template slot-scope="scope">
<span>{{ scope.row.orderAmount }}</span>
</template>
</el-table-column>
<el-table-column label="加油升数" align="center" prop="oilNum" >
<template slot-scope="scope">
<span>{{ scope.row.oilNum }}L</span>
</template>
</el-table-column>
<el-table-column label="油品单价" align="center" prop="amount">
<template slot-scope="scope">
<span>{{ scope.row.oilPrice }}/L</span>
</template>
</el-table-column>
<!-- <el-table-column label="满减活动优惠" align="center" prop="activeId">-->
<!-- <template slot-scope="scope">-->
<!-- <span v-if="scope.row.activeType==1">{{ scope.row.deductionAmount }}</span>-->
@ -294,8 +294,8 @@
<!-- <span v-else>0</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- </el-descriptions-item>-->
</el-table>
</el-descriptions-item>
<el-descriptions-item label="商品详情">
<el-table
:data="goodsInfo"
@ -314,13 +314,12 @@
<el-table-column label="数量" align="center" prop="num"/>
<el-table-column label="合计金额" align="center" prop="num">
<template slot-scope="scope">
<span>{{ (scope.row.retailPrice * scope.row.num).toFixed(2) }}</span>
<span>{{ scope.row.allAmount }}</span>
</template>
</el-table-column>
<el-table-column label="实付金额" align="center" prop="num">
<template slot-scope="scope">
<span v-if="cashierOrder.payUser == '散客'">{{ (scope.row.retailPrice * scope.row.num).toFixed(2) }}</span>
<span v-else>{{ (scope.row.memberPrice * scope.row.num).toFixed(2) }}</span>
<span>{{ scope.row.payAmount }}</span>
</template>
</el-table-column>
</el-table>

View File

@ -20,16 +20,29 @@
<el-input v-model="queryParams.orderNo" clearable placeholder="订单号检索"></el-input>
</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-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>
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -142,16 +155,29 @@
<el-input v-model="queryParams.orderNo" clearable placeholder="订单号检索"></el-input>
</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-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>
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -164,7 +190,7 @@
</div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>升数卡统计</span>
<span>囤油卡统计</span>
</div>
<div class="box-gang">
<!-- <div class="box" v-for="(item,index) in 7" :key="index">-->
@ -507,6 +533,8 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
totalConsumption1:0,
totalRecharge1:0,
dateRange:[],
beginTime:"",
endTime:"",
//
userList:[],
@ -623,6 +651,10 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){
this.queryParams.page = val
}
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
listCardBalanceRecord(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.cardBalanceList = res.data.records
this.total = res.data.total
@ -633,6 +665,10 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){
this.queryParams.page = val
}
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
cardBalanceCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.inCount = res.data.inCount
this.outCount = res.data.outCount
@ -645,6 +681,10 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){
this.queryParams.page = val
}
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
listCardOilRecord(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.cardOilList = res.data.records
this.total1 = res.data.total
@ -655,6 +695,10 @@ import {oilNumbers} from "@/api/cashier/oilnumber";
if (val!=undefined){
this.queryParams.page = val
}
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
cardOilCount(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.inCount1 = res.data.inCount
this.outCount1 = res.data.outCount

View File

@ -86,9 +86,9 @@
<view class="station-title" style="display: flex;justify-content: space-between;">
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
<view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<!-- <view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<view>切换位置 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
</view>
</view> -->
</view><!--顺通石化加油站(工业南路站)-->
<view style="display: flex;">
<view class="bule-icon" v-if="welfare.length!=0" v-for="(item,index) in welfare" :key="index">
@ -490,6 +490,10 @@
},
//
getAddress(storeId) {
// uni.showToast({
// title:"id"+storeId,
// icon:"none"
// })
let _this = this;
uni.getLocation({
// 使wgs84 使gcj02