|
@@ -7,6 +7,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alipay.api.AlipayApiException;
|
|
|
import com.alipay.api.domain.AlipayTradeRefundModel;
|
|
@@ -27,9 +28,12 @@ import com.fs.pay.pay.domain.OrderResult;
|
|
|
import com.fs.pay.pay.domain.RefundResult;
|
|
|
import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
|
import com.fs.pay.pay.service.PayService;
|
|
|
+import com.fs.store.domain.FsStoreOrder;
|
|
|
import com.fs.store.domain.TzConfigInfoDTO;
|
|
|
import com.fs.store.param.FsStorePaymentParam;
|
|
|
import com.fs.store.service.IFsStoreOrderService;
|
|
|
+import com.fs.store.service.impl.FsCouponScheduleServiceImpl;
|
|
|
+import com.fs.store.service.impl.FsStoreOrderServiceImpl;
|
|
|
import com.fs.store.vo.FsStorePaymentVO;
|
|
|
import com.fs.pay.service.IPayService;
|
|
|
import com.fs.tzBank.TzBankService;
|
|
@@ -41,6 +45,7 @@ import com.ijpay.alipay.AliPayApiConfigKit;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -80,6 +85,13 @@ public class FsStorePaymentController extends BaseController
|
|
|
|
|
|
@Autowired
|
|
|
private IFsStoreOrderService orderService;
|
|
|
+ @Autowired
|
|
|
+ private FsCouponScheduleServiceImpl fsCouponScheduleService;
|
|
|
+ @Autowired
|
|
|
+ private FsStoreOrderServiceImpl fsStoreOrderServiceImpl;
|
|
|
+ @Autowired
|
|
|
+ private FsStoreOrderServiceImpl fsStoreOrderService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询支付明细列表
|
|
|
*/
|
|
@@ -217,7 +229,7 @@ public class FsStorePaymentController extends BaseController
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('store:storePayment:refund')")
|
|
|
@PostMapping("refundStorePayment")
|
|
|
- @Transactional
|
|
|
+ @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
|
|
|
public R refundStorePayment(@RequestBody FsStorePayment fsStorePayment)
|
|
|
{
|
|
|
FsStorePayment payment=fsStorePaymentService.selectFsStorePaymentById(fsStorePayment.getPaymentId());
|
|
@@ -295,6 +307,12 @@ public class FsStorePaymentController extends BaseController
|
|
|
TzReqResultDTO<TzRefundNotifyDTO> resultDTO;
|
|
|
|
|
|
try {
|
|
|
+ // 退款将定时发放优惠券的状态设置为已退款
|
|
|
+ FsStoreOrder fsStoreOrder = fsStoreOrderService.selectFsStoreOrderById(payment.getOrderId());
|
|
|
+ if(ObjectUtil.isNotNull(fsStoreOrder)){
|
|
|
+ fsCouponScheduleService.setScheduleCouponRefund(fsStoreOrder.getOrderCode());
|
|
|
+ }
|
|
|
+
|
|
|
resultDTO = tzBankService.payRefund(requestDTO);
|
|
|
TzRefundNotifyDTO body = resultDTO.getBody();
|
|
|
String refundOrdStatus = body.getRefundOrdStatus();
|