退款回退库存
This commit is contained in:
@@ -2,7 +2,6 @@ package com.czg.service.order.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
@@ -164,6 +163,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean agreeRefund(PointGoodsRefundDTO param, Long shopId) {
|
||||
MkPointsGoodsRecord record = goodsRecordService.getOne(QueryWrapper.create()
|
||||
.eq(MkPointsGoodsRecord::getId, param.getRecordId())
|
||||
@@ -183,6 +183,11 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
|
||||
payService.unifyRefund(shopId, record.getId(), record.getPayOrderId(), refPayOrderNo,
|
||||
StrUtil.isBlankIfStr(param.getReason()) ? "积分商品退款" : param.getReason(), record.getExtraPaymentAmount());
|
||||
}
|
||||
//回退 库存
|
||||
MkPointsGoods goods = goodsService.getById(record.getPointsGoodsId());
|
||||
if (goods != null) {
|
||||
goodsService.upNumberById(goods.getId(), goods.getQuantity() + record.getNumber(), null);
|
||||
}
|
||||
MkPointsGoodsRecord upRecord = new MkPointsGoodsRecord();
|
||||
upRecord.setId(record.getId());
|
||||
upRecord.setStatus("已退款");
|
||||
|
||||
Reference in New Issue
Block a user