|
@@ -2034,7 +2034,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- //类型1支付回调 类型2货到付款
|
|
|
|
|
|
|
+ //类型1支付回调 类型2物流代收 3.货到付款
|
|
|
public String payConfirm(Integer type, Long orderId, String payCode, String tradeNo, String bankTransactionId, String bankSerialNo) {
|
|
public String payConfirm(Integer type, Long orderId, String payCode, String tradeNo, String bankTransactionId, String bankSerialNo) {
|
|
|
//支付订单
|
|
//支付订单
|
|
|
// try {
|
|
// try {
|
|
@@ -2062,6 +2062,40 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
}else if (type.equals(2)) {
|
|
}else if (type.equals(2)) {
|
|
|
|
|
+ FsStorePaymentScrm storePayment = paymentService.selectFsStorePaymentByCode(payCode);
|
|
|
|
|
+ if (storePayment == null || !storePayment.getStatus().equals(0) || !(storePayment.getPayMoney().compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ FsStorePaymentScrm storePaymentMap = new FsStorePaymentScrm();
|
|
|
|
|
+ storePaymentMap.setPaymentId(storePayment.getPaymentId());
|
|
|
|
|
+ storePaymentMap.setStatus(1);
|
|
|
|
|
+ storePaymentMap.setPayTime(new Date());
|
|
|
|
|
+ storePaymentMap.setTradeNo(tradeNo);
|
|
|
|
|
+ storePaymentMap.setBankSerialNo(bankSerialNo);
|
|
|
|
|
+ storePaymentMap.setBankTransactionId(bankTransactionId);
|
|
|
|
|
+ paymentService.updateFsStorePayment(storePaymentMap);
|
|
|
|
|
+
|
|
|
|
|
+ //货到付款
|
|
|
|
|
+ order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
|
|
|
+ if (!order.getStatus().equals(OrderInfoEnum.STATUS_0.getValue())) {
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (type.equals(3)){
|
|
|
|
|
+ // 3.货到付款
|
|
|
|
|
+ FsStorePaymentScrm storePayment = paymentService.selectFsStorePaymentByCode(payCode);
|
|
|
|
|
+ if (storePayment == null || !storePayment.getStatus().equals(0) || !(storePayment.getPayMoney().compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ FsStorePaymentScrm storePaymentMap = new FsStorePaymentScrm();
|
|
|
|
|
+ storePaymentMap.setPaymentId(storePayment.getPaymentId());
|
|
|
|
|
+ storePaymentMap.setStatus(1);
|
|
|
|
|
+ storePaymentMap.setPayTime(new Date());
|
|
|
|
|
+ storePaymentMap.setTradeNo(tradeNo);
|
|
|
|
|
+ storePaymentMap.setBankSerialNo(bankSerialNo);
|
|
|
|
|
+ storePaymentMap.setBankTransactionId(bankTransactionId);
|
|
|
|
|
+ paymentService.updateFsStorePayment(storePaymentMap);
|
|
|
|
|
+
|
|
|
//货到付款
|
|
//货到付款
|
|
|
order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
order = fsStoreOrderMapper.selectFsStoreOrderById(orderId);
|
|
|
if (!order.getStatus().equals(OrderInfoEnum.STATUS_0.getValue())) {
|
|
if (!order.getStatus().equals(OrderInfoEnum.STATUS_0.getValue())) {
|
|
@@ -2069,6 +2103,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//写入公司佣金 当有归属公司时只进行公司分佣
|
|
//写入公司佣金 当有归属公司时只进行公司分佣
|
|
|
if (order.getCompanyId() != null && order.getCompanyId() > 0) {
|
|
if (order.getCompanyId() != null && order.getCompanyId() > 0) {
|
|
|
companyService.addCompanyTuiMoney(order);
|
|
companyService.addCompanyTuiMoney(order);
|