称重打包费问题

退款原因
This commit is contained in:
wangw 2025-03-14 10:01:00 +08:00
parent fe16a49a2c
commit 9af7a6a742
4 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
package com.czg.config;
package com.czg.task;
import cn.hutool.core.date.DateUtil;
import com.czg.order.entity.OrderInfo;

View File

@ -46,7 +46,6 @@ import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
@ -483,11 +482,14 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
if (userAllPack != null) {
if (userAllPack.equals(1)) {
orderDetail.setPackNumber(orderDetail.getNum().subtract(orderDetail.getReturnNum()));
if("weight".equals(orderDetail.getProductType())){
orderDetail.setPackNumber(BigDecimal.ONE);
}
} else {
orderDetail.setPackNumber(BigDecimal.ZERO);
}
} else if (isAllPack) {
if ("weigh".equals(orderDetail.getProductType())) {
if ("weight".equals(orderDetail.getProductType())) {
orderDetail.setPackNumber(BigDecimal.ONE);
} else {
orderDetail.setPackNumber(orderDetail.getNum().subtract(orderDetail.getReturnNum()));

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.exceptions.ValidateException;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject;
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
import com.czg.account.entity.*;
@ -590,7 +591,7 @@ public class PayServiceImpl implements PayService {
} else if (!orderInfo.getPayType().equals(PayEnums.CASH_PAY.getValue())) {
//退款 param.getRefundAmount()
refundOrder(orderInfo.getShopId(), orderInfo.getId(), orderInfo.getPayOrderId(),
refPayOrderNo, param.getRefundReason(), param.getRefundAmount());
refPayOrderNo, StrUtil.isBlank(param.getRefundReason()) ? "退款" : param.getRefundReason(), param.getRefundAmount());
}
}
} else {

View File

@ -62,6 +62,9 @@ public class ProductRpcServiceImpl implements ProductRpcService {
}
for (ProductStockSubtractDTO dto : list) {
Product product = productMapper.selectOneById(dto.getProductId());
if (product == null) {
continue;
}
productMapper.updateProductStockNum(dto.getProductId(), dto.getShopId(), "sub", dto.getNum());
// 记录商品库存流水
ProductStockFlow flow = new ProductStockFlow();
@ -119,9 +122,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
consStockFlowMapper.insert(consStockFlow);
}
}
ThreadUtil.execAsync(() -> {
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
});
ThreadUtil.execAsync(() -> rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId)));
log.info("ProductService.--------------------------------------------库存更新成功");
}
@ -191,9 +192,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
consStockFlowMapper.insert(consStockFlow);
}
}
ThreadUtil.execAsync(() -> {
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
});
ThreadUtil.execAsync(() -> rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId)));
log.info("ProductService.--------------------------------------------库存更新成功");
}
@ -266,9 +265,7 @@ public class ProductRpcServiceImpl implements ProductRpcService {
consStockFlowMapper.insert(consStockFlow);
}
}
ThreadUtil.execAsync(() -> {
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
});
ThreadUtil.execAsync(() -> rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId)));
log.info("ProductService.--------------------------------------------库存更新成功");
}
}