Pārlūkot izejas kodu

汇付回调还原

yjwang 5 dienas atpakaļ
vecāks
revīzija
784c9fe360

+ 6 - 14
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1412,7 +1412,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 if (storePayment != null) {
                     if (storePayment.getStatus().equals(0)) {
                         log.info(payCode + "待支付");
-                        FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                        FsStorePayment paymentMap = new FsStorePayment();
                         paymentMap.setPaymentId(storePayment.getPaymentId());
                         paymentMap.setStatus(1);
                         paymentMap.setPayTime(new Date());
@@ -1429,7 +1429,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                             paymentMap.setBankSerialNo(orderResult.getBankOrderId());
                             paymentMap.setBankTransactionId(orderResult.getBankTrxId());
                         }
-                        fsStorePaymentScrmMapper.updateFsStorePayment(paymentMap);
+                        fsStorePaymentMapper.updateFsStorePayment(paymentMap);
                         log.info(payCode + "已支付");
                         order = fsStoreOrderScrmMapper.selectFsStoreOrderById(Long.parseLong(storePayment.getBusinessOrderId()));
                     }
@@ -1440,19 +1440,12 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             } else if (type.equals(2)) {
                 order = fsStoreOrderScrmMapper.selectFsStoreOrderByOrderCode(orderCode);
             }
-//            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
-//                log.info(payCode + "订单号不为待支付回退");
-//                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-//                return R.error();
-//            }
-
-            //orderScrm迁移的表待支付状态码为:0
-            if (order != null && !order.getStatus().equals(0)) {//判断订单状态是否待支付
+            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
                 log.info(payCode + "订单号不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return R.error();
             }
-
+            FsStoreOrder order1=new FsStoreOrder();
             if (order != null && !order.getPaid().equals(0)) {
                 log.info(payCode + "订单号支付不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -1463,8 +1456,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
             storeOrder.setId(order.getId());
             storeOrder.setPaid(1);
-//            storeOrder.setStatus(2);
-            storeOrder.setStatus(1);//代发货
+            storeOrder.setStatus(2);
             storeOrder.setPrescribePrice(order.getTotalPrice());
             SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
             Map<String, Object> config = (Map<String, Object>) JSON.parse(sysConfig.getConfigValue());
@@ -1477,7 +1469,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             } else {
                 storeOrder.setFollowDoctorId(iFsDoctorService.selectFollowDoctorDoctorByPackage());
             }
-            if (order.getCycle() != null && order.getCycle() >= followRate) {
+            if (order.getCycle() >= followRate) {
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTime(new Date());
                 calendar.add(Calendar.DAY_OF_MONTH, followRate);