【同步】BOOT 和 CLOUD 的功能(所有)
This commit is contained in:
@@ -399,7 +399,7 @@ public class AfterSaleServiceImpl implements AfterSaleService {
|
||||
@AfterSaleLog(operateType = AfterSaleOperateTypeEnum.MEMBER_CANCEL)
|
||||
public void cancelAfterSale(Long userId, Long id) {
|
||||
// 校验售后单的状态,并状态待退款
|
||||
AfterSaleDO afterSale = tradeAfterSaleMapper.selectById(id);
|
||||
AfterSaleDO afterSale = tradeAfterSaleMapper.selectByIdAndUserId(id, userId);
|
||||
if (afterSale == null) {
|
||||
throw exception(AFTER_SALE_NOT_FOUND);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.net.NetUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
@@ -888,8 +889,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
if (!order.getPayStatus()) {
|
||||
throw exception(ORDER_CANCEL_PAID_FAIL, "已支付");
|
||||
}
|
||||
// 1.3 校验订单是否已退款
|
||||
if (ObjUtil.equal(TradeOrderRefundStatusEnum.NONE.getStatus(), order.getRefundStatus())) {
|
||||
// 1.3 校验订单是否未退款
|
||||
if (ObjUtil.notEqual(TradeOrderRefundStatusEnum.NONE.getStatus(), order.getRefundStatus())) {
|
||||
throw exception(ORDER_CANCEL_PAID_FAIL, "未退款");
|
||||
}
|
||||
|
||||
@@ -897,7 +898,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
cancelOrder0(order, TradeOrderCancelTypeEnum.COMBINATION_CLOSE);
|
||||
// 2.2 创建退款单
|
||||
payRefundApi.createRefund(new PayRefundCreateReqDTO()
|
||||
.setAppKey(tradeOrderProperties.getPayAppKey()).setUserIp(getClientIP()) // 支付应用
|
||||
.setAppKey(tradeOrderProperties.getPayAppKey()) // 支付应用
|
||||
.setUserIp(NetUtil.getLocalhostStr()) // 使用本机 IP,因为是服务器发起退款的
|
||||
.setMerchantOrderId(String.valueOf(order.getId())) // 支付单号
|
||||
.setMerchantRefundId(String.valueOf(order.getId()))
|
||||
.setReason(TradeOrderCancelTypeEnum.COMBINATION_CLOSE.getName()).setPrice(order.getPayPrice())).checkError(); // 价格信息
|
||||
|
||||
@@ -122,7 +122,7 @@ public class TradePriceServiceImpl implements TradePriceService {
|
||||
List<ProductSkuRespDTO> skuList = spuIdAndSkuListMap.get(spuId);
|
||||
List<AppTradeProductSettlementRespVO.Sku> skuVOList = convertList(skuList, sku -> {
|
||||
AppTradeProductSettlementRespVO.Sku skuVO = new AppTradeProductSettlementRespVO.Sku()
|
||||
.setId(sku.getId()).setPromotionPrice(sku.getPrice());
|
||||
.setId(sku.getId());
|
||||
TradePriceCalculateRespBO.OrderItem orderItem = new TradePriceCalculateRespBO.OrderItem()
|
||||
.setPayPrice(sku.getPrice()).setCount(1);
|
||||
// 计算限时折扣的优惠价格
|
||||
|
||||
Reference in New Issue
Block a user