Browse Source

月订单统计支付增加数量改为完成订单后增加数量

master
wengding 18 hours ago
parent
commit
181d89e65a
  1. 16
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/ProductOrderServiceImpl.java
  2. 2
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/PromotionCouponTemplateServiceImpl.java
  3. 2
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/BusinessMonthStatisticsMapper.xml
  4. 2
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysBusinessMapper.xml

16
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<ProductOrderItemsVo> 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) {

2
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(

2
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

2
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>
<update id="businessMonthStatistics" parameterType="java.lang.Long">
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}
</update>
<select id="getInfoWithDistance" resultMap="businessWithDistance"
parameterType="org.dromara.system.domain.bo.BusinessIdBo">

Loading…
Cancel
Save