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}