From 383f52870b964c49cfd197e231acfec30d2bcaa2 Mon Sep 17 00:00:00 2001 From: ds Date: Thu, 24 Oct 2024 18:53:29 +0800 Subject: [PATCH 1/2] 10.24 --- .../fuint/business/order/controller/CashierOrderController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CashierOrderController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CashierOrderController.java index 6f649a1b6..6a708b747 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CashierOrderController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CashierOrderController.java @@ -33,7 +33,7 @@ public class CashierOrderController extends BaseController { */ @GetMapping("/list") public ResponseObject list(CashierOrder order, - @RequestParam(value = "page[page]",defaultValue = "1") Integer pageNo, + @RequestParam(value = "page",defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ Page page =new Page(pageNo,pageSize); IPage list = cashierOrderService.selectCashierOrderList(page,order); From 5541b75d61110528cfc2a7d6bb07fea8fd99d5ae Mon Sep 17 00:00:00 2001 From: ds Date: Fri, 25 Oct 2024 11:41:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?10.24-=E7=8E=B0=E9=87=91=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=97=B6=E4=BC=98=E6=83=A0=E5=88=B8bug=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=8F=8A=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/CardCouponUserMapper.java | 1 + .../mapper/xml/CardCouponUserMapper.xml | 4 ++++ .../order/mapper/AllOrderInfoMapper.java | 2 ++ .../order/mapper/xml/AllOrderInfoMapper.xml | 3 +++ .../service/impl/AllOrderInfoServiceImpl.java | 15 ++++++++++++ .../service/impl/OilOrderServiceImpl.java | 24 +++++++++++++++++-- 6 files changed, 47 insertions(+), 2 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java index 39d2c1b6b..48d9bfd09 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/CardCouponUserMapper.java @@ -47,5 +47,6 @@ public interface CardCouponUserMapper extends BaseMapper { List> selectUserCardVerification(@Param("str") String str); + CardCouponUser selectByOrderId(String orderNo); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml index 4548ace45..18a8aed3b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardCoupon/mapper/xml/CardCouponUserMapper.xml @@ -71,6 +71,10 @@ AND userCard.STATUS = 0 AND userCard.start_time <= NOW() AND userCard.end_time >= NOW() + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java index ba6f63894..0ba428902 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/AllOrderInfoMapper.java @@ -105,4 +105,6 @@ public interface AllOrderInfoMapper extends BaseMapper { IPage queryAllByLimit(Page page, @Param("allOrderInfo") AllOrderInfoUniVo allOrderInfo); Double getCountMemberBalance(@Param("storeId") Integer storeId,@Param("endTime") String endTime); + + AllOrderInfoVo selectByOrderNo(String orderNo); } \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml index 16e3159ef..0aca4f5cc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/AllOrderInfoMapper.xml @@ -851,6 +851,9 @@ store_id = #{storeId} AND pay_time < #{endTime}; + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java index 2a766ddfa..305842361 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/AllOrderInfoServiceImpl.java @@ -21,6 +21,8 @@ import com.fuint.business.convenienceSore.mapper.LJGoodsMapper; import com.fuint.business.convenienceSore.service.LJGoodsService; import com.fuint.business.convenienceSore.service.StockTrackService; import com.fuint.business.largeSscreen.vo.OrderGoodsVO; +import com.fuint.business.marketingActivity.cardCoupon.entity.CardCouponUser; +import com.fuint.business.marketingActivity.cardCoupon.mapper.CardCouponUserMapper; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardValueOrders.entity.CardValueOrders; import com.fuint.business.order.dto.AllOrderInfoDto; @@ -398,6 +400,9 @@ public class AllOrderInfoServiceImpl extends ServiceImpl map) { @@ -465,6 +470,16 @@ public class AllOrderInfoServiceImpl extends ServiceImpl i @Autowired private FleetConsumeRecordService fleetConsumeRecordService; + @Autowired + private CardCouponUserMapper cardCouponUserMapper; + + @Autowired + private AllOrderInfoMapper allOrderInfoMapper; + @Override public IPage selectOilOrderList(Page page, OilOrder order) { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); @@ -430,8 +440,8 @@ public class OilOrderServiceImpl extends ServiceImpl i Double activeAmount = Double.valueOf(ObjectUtil.isNotEmpty(map.get("activeAmount")) ? map.get("activeAmount") : "0.0"); // 优惠券 用户 id Integer couponUserId = null; - if (StringUtils.isNotEmpty(map.get("couponUserId"))) { - couponUserId = Integer.valueOf(map.get("couponUserId")); + if (StringUtils.isNotEmpty(map.get("userId"))) { + couponUserId = Integer.valueOf(map.get("userId")); } // 优惠券类型 String couponType = map.get("couponType"); @@ -747,6 +757,16 @@ public class OilOrderServiceImpl extends ServiceImpl i } orders.put("orderNo", orderNo); cashierOrderService.insertCashierOrder(cashierOrder); + + // 下单完成需要更新一下优惠券的状态 当订单退款以后也要调用这样的代码修改优惠券的状态 + if(StringUtils.isNotEmpty(map.get("couponId"))){ + CardCouponUser cardCouponUser = cardCouponUserMapper.selectById(map.get("couponId")); + cardCouponUser.setStatus("1"); + // 查询订单号并赋值 + AllOrderInfoVo allOrderInfoVo = allOrderInfoMapper.selectByOrderNo(orderNo); + cardCouponUser.setOrderId(allOrderInfoVo.getId()); + cardCouponUserMapper.updateById(cardCouponUser); + } return orders; }