|
@@ -33,8 +33,7 @@ import com.fs.huifuPay.domain.HuiFuRefundResult;
|
|
|
import com.fs.huifuPay.dto.*;
|
|
|
import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
-import com.fs.store.mapper.FsStoreDeliversMapper;
|
|
|
-import com.fs.store.mapper.FsWarehousesMapper;
|
|
|
+import com.fs.store.mapper.*;
|
|
|
import com.fs.tzBank.TzBankService;
|
|
|
import com.fs.pay.pay.domain.RefundResult;
|
|
|
import com.fs.pay.pay.service.PayService;
|
|
@@ -44,7 +43,6 @@ import com.fs.store.dto.StoreOrderProductDTO;
|
|
|
import com.fs.store.enums.AfterSalesStatusEnum;
|
|
|
import com.fs.store.enums.AfterStatusEnum;
|
|
|
import com.fs.store.enums.OrderInfoEnum;
|
|
|
-import com.fs.store.mapper.FsStoreOrderItemMapper;
|
|
|
import com.fs.store.param.*;
|
|
|
import com.fs.store.service.*;
|
|
|
import com.fs.store.vo.FsStoreAfterSalesQueryVO;
|
|
@@ -61,7 +59,6 @@ import org.springframework.aop.framework.AopContext;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.fs.store.mapper.FsStoreAfterSalesMapper;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
@@ -212,6 +209,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
|
|
|
notAllowRefundStatusSet.add(-2);
|
|
|
notAllowRefundStatusSet.add(-3);
|
|
|
notAllowRefundStatusSet.add(0);
|
|
|
+ notAllowRefundStatusSet.add(2);
|
|
|
notAllowRefundStatusSet.add(3);
|
|
|
if(notAllowRefundStatusSet.contains(order.getStatus())){
|
|
|
throw new CustomException("该订单不可申请售后");
|
|
@@ -604,6 +602,11 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
|
|
|
IFsStoreAfterSalesService fsStoreAfterSalesService = (IFsStoreAfterSalesService) AopContext.currentProxy();
|
|
|
return fsStoreAfterSalesService.refundStoreMoney(param);
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsUserMapper fsUserMapper;
|
|
|
+ @Autowired
|
|
|
+ private RemainingClaimLimitLogMapper remainingClaimLimitLogMapper;
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)
|
|
|
public R refundStoreMoney(FsStoreAfterSalesRefundParam param){
|
|
@@ -759,6 +762,30 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
|
|
|
userService.subTuiMoney(order);
|
|
|
}
|
|
|
|
|
|
+ // 理赔额度金额加回去
|
|
|
+ Long userId = order.getUserId();
|
|
|
+ FsUser fsUser = fsUserMapper.selectFsUserByIdForUpdate(userId);
|
|
|
+ RemainingClaimLimitLog log = remainingClaimLimitLogMapper.selectByOrderId(order.getId(),userId);
|
|
|
+ if(log == null){
|
|
|
+ throw new RuntimeException(String.format("当前用户的订单购买记录没有找到!订单id:%d 用户:%d",order.getId(),userId));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fsUser.getRemainingClaimLimit() != null) {
|
|
|
+ if(log.getMoney() != null) {
|
|
|
+ fsUser.setRemainingClaimLimit(fsUser.getRemainingClaimLimit().add(log.getMoney()));
|
|
|
+ fsUserMapper.updateFsUser(fsUser);
|
|
|
+
|
|
|
+ RemainingClaimLimitLog remainingClaimLimitLog = new RemainingClaimLimitLog();
|
|
|
+ remainingClaimLimitLog.setId(null);
|
|
|
+ remainingClaimLimitLog.setStatus(1);
|
|
|
+ remainingClaimLimitLog.setOrderId(order.getId());
|
|
|
+ remainingClaimLimitLog.setUserId(order.getUserId());
|
|
|
+ remainingClaimLimitLog.setOrderMoney(order.getPayMoney());
|
|
|
+ remainingClaimLimitLog.setMoney(log.getMoney());
|
|
|
+ remainingClaimLimitLog.setCreateTime(new Date());
|
|
|
+ remainingClaimLimitLogMapper.insert(remainingClaimLimitLog);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return R.ok();
|
|
|
}
|