From 101ef539c36003b29abeb6f7244b9bc85b0d9b45 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Tue, 27 Feb 2024 17:59:16 +0800 Subject: [PATCH 1/2] bug --- .../com/fuint/api/fuyou/entity/Const.java | 4 +- .../service/impl/LJStaffServiceImpl.java | 12 +++ .../business/order/entity/OrderGoods.java | 17 ++++ .../order/mapper/xml/OrderGoodsMapper.xml | 3 +- .../service/impl/LJOrderServiceImpl.java | 10 +++ .../service/impl/OilOrderServiceImpl.java | 1 + .../service/impl/OrderGoodsServiceImpl.java | 9 ++ .../fuint/business/order/vo/OrderGoodsVo.java | 6 +- .../views/cashier/NewComponents/homeindex.vue | 89 +++++++++++++------ .../cashier/orderComponents/order_Cashier.vue | 59 ++++++------ .../cashier/vipComponents/balanceList.vue | 82 +++++++++++++---- gasStation-uni/pages/index/index.vue | 8 +- 12 files changed, 217 insertions(+), 83 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java index fc1531ef8..c69471fc9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java @@ -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"; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 66788ef4f..f7f8b62a9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -269,6 +269,18 @@ public class LJStaffServiceImpl extends ServiceImpl 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; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java index c47611296..00e63a005 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/OrderGoods.java @@ -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; + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml index 395da0293..1199a20e9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OrderGoodsMapper.xml @@ -2,7 +2,8 @@ - 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 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java index 6ede16b6d..8a29a3732 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/LJOrderServiceImpl.java @@ -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 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 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); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index a06a6aa5a..2afe2deb1 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -521,6 +521,7 @@ public class OilOrderServiceImpl extends ServiceImpl 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"); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java index 79562e954..65c6caa0d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OrderGoodsServiceImpl.java @@ -40,6 +40,15 @@ public class OrderGoodsServiceImpl extends ServiceImpl0){ 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; diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue index cc1448221..3d0fb9ce2 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue @@ -256,32 +256,32 @@
- - - + + - - - - - - - - - - - - - - - - - - - - - + :data="oilInfo" + style="width: 100%"> + + + + + + + + + + + + @@ -294,8 +294,8 @@ - - + + diff --git a/fuintCashierWeb/src/views/cashier/vipComponents/balanceList.vue b/fuintCashierWeb/src/views/cashier/vipComponents/balanceList.vue index 25494d9ba..254aea939 100644 --- a/fuintCashierWeb/src/views/cashier/vipComponents/balanceList.vue +++ b/fuintCashierWeb/src/views/cashier/vipComponents/balanceList.vue @@ -20,16 +20,29 @@ + + + + + + + + + + + v-model="beginTime" + style="width: 160px" + type="date" + placeholder="开始日期"> + + 至 + + 搜索 @@ -142,16 +155,29 @@ + + + + + + + + + + + v-model="beginTime" + style="width: 160px" + type="date" + placeholder="开始日期"> + + 至 + + 搜索 @@ -164,7 +190,7 @@
- 升数卡统计 + 囤油卡统计
@@ -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 diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index d1d89f71f..a79dfbee2 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -86,9 +86,9 @@ {{store.name}}{{store.description ? "("+store.description+")" : ""}} - + @@ -490,6 +490,10 @@ }, // 获取当前位置 getAddress(storeId) { + uni.showToast({ + title:"店铺id"+storeId, + icon:"none" + }) let _this = this; uni.getLocation({ // 谷歌使用wgs84 其他使用gcj02 From 5fe8443e1ba1253c40ecd1bdd27399fda3583798 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Tue, 27 Feb 2024 18:08:55 +0800 Subject: [PATCH 2/2] bug --- gasStation-uni/pages/index/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index a79dfbee2..3fdb049c8 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -490,10 +490,10 @@ }, // 获取当前位置 getAddress(storeId) { - uni.showToast({ - title:"店铺id"+storeId, - icon:"none" - }) + // uni.showToast({ + // title:"店铺id"+storeId, + // icon:"none" + // }) let _this = this; uni.getLocation({ // 谷歌使用wgs84 其他使用gcj02