From a45fde5373f62470d69e25f768b70345e10c204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Mon, 29 Apr 2024 16:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E9=94=80bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ActiveExchangeServiceImpl.java | 1 - .../controller/CardExchangeRecordController.java | 4 ++-- .../cardExchange/entity/CardExchangeRecord.java | 1 + .../service/impl/CardExchangeRecordServiceImpl.java | 1 + .../java/com/fuint/business/order/entity/OilOrder.java | 2 ++ .../order/service/impl/OilOrderServiceImpl.java | 10 +++++++++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index c159b37f6..01ffdfea7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -982,7 +982,6 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { paymentActiveVO.setMemberFavorableAmount(bigDecimal2); } } - } if (oilTypebyId.equals("天然气")) { if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java index f0bd532d4..2e430474a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/controller/CardExchangeRecordController.java @@ -139,13 +139,13 @@ public class CardExchangeRecordController extends BaseController { ljOrder.setPayUser(byId.getMobile()); ljOrder.setStoreId(nowAccountInfo.getStoreId()); ljOrder.setUserId(byId.getMtUserId()); - ljOrder.setGoodsNum(1); + ljOrder.setGoodsNum(byId.getProductCount()); ljOrder.setPayType("0"); ljOrder.setStatus("paid"); ljOrder.setPayTime(new Date()); ljOrder.setStaffId(nowAccountInfo.getStaffId()); ljOrderService.addGoodOrder(ljOrder,giftId); - stockStatisticService.insertStockStatisticTrack(giftId,0.0,"核销兑换!",1); + stockStatisticService.insertStockStatisticTrack(giftId,0.0,"核销兑换!",byId.getProductCount()); return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord)); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchangeRecord.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchangeRecord.java index 083efe80d..a7331b4b2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchangeRecord.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/entity/CardExchangeRecord.java @@ -30,6 +30,7 @@ public class CardExchangeRecord extends Model { private Integer chainStorId; //所属店铺id private Integer storeId; + private Integer productCount; //员工id private Integer mtStaffId; //员工姓名 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/service/impl/CardExchangeRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/service/impl/CardExchangeRecordServiceImpl.java index 6e25fb516..7c604a43b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/service/impl/CardExchangeRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardExchange/service/impl/CardExchangeRecordServiceImpl.java @@ -126,6 +126,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl i } // 优惠券 if (ObjectUtil.isNotEmpty(oilOrderVo.getCouponId())) { - CardFavorableVO cardFavorableVO = cardFavorableService.selectOneById(oilOrderVo.getCouponId()); + //CardFavorableVO cardFavorableVO = cardFavorableService.selectOneById(oilOrderVo.getCouponId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CardFavorableRecord::getCardFavorableId, oilOrderVo.getCouponId()); + queryWrapper.eq(CardFavorableRecord::getMtUserId, oilOrderVo.getUserId()); + CardFavorableRecord cardFavorableVO = cardFavorableRecordService.getOne(queryWrapper); oilOrderVo.setCouponAmount(cardFavorableVO.getDiscountAmount()); } else { oilOrderVo.setCouponAmount(0.0); @@ -278,6 +282,8 @@ public class OilOrderServiceImpl extends ServiceImpl i Double goodsActualPay = Double.valueOf(map.get("goodsActualPay")); // 找零金额 Double seekZero = Double.valueOf(map.get("seekZero")); + Double levelAmount = Double.valueOf(map.get("levelAmount")); + Double activeAmount = Double.valueOf(map.get("activeAmount")); // 优惠券id Integer cardFavorableId = null; if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){ @@ -442,6 +448,8 @@ public class OilOrderServiceImpl extends ServiceImpl i staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo); } order.setCouponId(recordId); + order.setActiveAmount(activeAmount); + order.setLevelAmount(levelAmount); }else { order.setOrderType("子订单"); order.setOrderAmount(amount);