From 181d89e65a693f2406a39b561b4fa55135d7a4f2 Mon Sep 17 00:00:00 2001 From: wengding <18458794212@163.com> Date: Fri, 27 Jun 2025 11:04:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E8=AE=A2=E5=8D=95=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=A2=9E=E5=8A=A0=E6=95=B0=E9=87=8F=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=AE=8C=E6=88=90=E8=AE=A2=E5=8D=95=E5=90=8E=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProductOrderServiceImpl.java | 16 ++++++++++------ .../impl/PromotionCouponTemplateServiceImpl.java | 2 +- .../system/BusinessMonthStatisticsMapper.xml | 2 +- .../mapper/system/SysBusinessMapper.xml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductOrderServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductOrderServiceImpl.java index c6b74b6..aa20acb 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductOrderServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductOrderServiceImpl.java @@ -281,12 +281,7 @@ public class ProductOrderServiceImpl implements IProductOrderService { } @Override public void paySuccessAfterVo(ProductOrderVo vo) { - //支付完成 - for (ProductOrderItemsVo productOrderItemsVo : vo.getItemsList()) { - appBusinessProductService.addSaleCount(productOrderItemsVo.getProductId(), productOrderItemsVo.getNum()); - appProductAttrValueService.addSaleCount(productOrderItemsVo.getProductId(), productOrderItemsVo.getProductAttrSn(),productOrderItemsVo.getNum()); - sysBusinessService.addSaleCount(vo.getBusinessId(), vo.getNum()); - } + SysBusinessVo sysBusinessVo = sysBusinessService.getByIdAndColumns(vo.getBusinessId(), "appointment", "auto_receiving"); @@ -899,6 +894,15 @@ public class ProductOrderServiceImpl implements IProductOrderService { finshUW.set(ProductOrder::getSettlement, 1L); int update = baseMapper.update(finshUW); if (update > 0) { + //支付完成 + ProductOrderItemsBo bo = new ProductOrderItemsBo(); + bo.setProductId(id); + List productOrderItemsVos = productOrderItemsService.queryList(bo); + for (ProductOrderItemsVo productOrderItemsVo : productOrderItemsVos) { + appBusinessProductService.addSaleCount(productOrderItemsVo.getProductId(), productOrderItemsVo.getNum()); + appProductAttrValueService.addSaleCount(productOrderItemsVo.getProductId(), productOrderItemsVo.getProductAttrSn(),productOrderItemsVo.getNum()); + sysBusinessService.addSaleCount(productOrderVo.getBusinessId(), productOrderItemsVo.getNum()); + } ProductOrderPriceVo productOrderPriceVo = productOrderPriceMapper.selectVoById(id); BigDecimal settlementCurrentPrice = productOrderPriceVo.getSettlementCurrentPrice(); if (productOrderVo.getSettlement() == 0L) { diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/PromotionCouponTemplateServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/PromotionCouponTemplateServiceImpl.java index 4472a96..02c4750 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/PromotionCouponTemplateServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/PromotionCouponTemplateServiceImpl.java @@ -156,7 +156,7 @@ public class PromotionCouponTemplateServiceImpl implements IPromotionCouponTempl SysUser sysUser = sysUserMapper.selectById(bo.getUserId()); lqw.apply( " (take_limit_count = -1 or take_limit_count >= (select count(bc.id) from promotion_coupon bc where bc.template_id = id and bc.user_id = {0} )) " + - "and ( product_scope_type in (1, 2, 3) or (product_scope_type = 4 and date_format(register_date, '%y-%m-%d') <= date_format({1}, '%y-%m-%d')))", + "and ( product_scope_type in (1, 2, 3) or (product_scope_type = 4 and date_format(register_date, '%y-%m-%d') <= date_format({1}, '%y-%m-%d'))", bo.getUserId(), sysUser.getCreateTime()); }else if (bo.getUserId() != null){ lqw.apply( diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BusinessMonthStatisticsMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BusinessMonthStatisticsMapper.xml index 34eeb51..3f13a40 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BusinessMonthStatisticsMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BusinessMonthStatisticsMapper.xml @@ -22,7 +22,7 @@ values (#{id}, #{businessId}, date_format(now(), '%Y-%m'), - (select count(po.id) from product_order po where po.del_flag= '0' and po.status in ('1', '2', '4', '5') and po.business_id = #{businessId}), + (select count(po.id) from product_order po where po.del_flag= '0' and po.status in ('4', '5') and po.business_id = #{businessId}), (select count(po.id) from product_order po where po.del_flag= '0' and po.status = '9' and po.business_id = #{businessId}), now()) ON DUPLICATE KEY UPDATE diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysBusinessMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysBusinessMapper.xml index 2486de3..24828ba 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysBusinessMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysBusinessMapper.xml @@ -37,7 +37,7 @@ update sys_business set sale_count = sale_count + #{num} where id = #{id} - update sys_business set month_sale = (select count(po.id) from product_order po where po.del_flag= '0' and po.status in ('1', '2', '4', '5') and po.business_id = #{id}) where id = #{id} + update sys_business set month_sale = (select count(po.id) from product_order po where po.del_flag= '0' and po.status in ( '4', '5') and po.business_id = #{id}) where id = #{id}