gao 1 bulan lalu
induk
melakukan
4e424de5e2

+ 0 - 7
crm-settlement/src/main/java/com/crm/settlement/controller/SettlementController.java

@@ -28,11 +28,4 @@ public class SettlementController {
         return settlementService.validateWithdrawOrder(request);
     }
 
-    @PostMapping("/test")
-    public BaseResultDto test() throws Exception {
-        settlementService.scheduleCallback();
-        return BaseResultDto.success();
-    }
-
-
 }

+ 1 - 2
crm-settlement/src/main/java/com/crm/settlement/service/SettlementService.java

@@ -2,7 +2,6 @@ package com.crm.settlement.service;
 
 import com.crm.rely.backend.core.dto.base.BaseResultDto;
 import com.crm.rely.backend.core.exception.PayValidatedException;
-import com.crm.rely.backend.core.exception.ServiceException;
 import com.crm.rely.backend.model.entity.settlement.SettlementDepositEntity;
 import com.crm.rely.backend.model.entity.settlement.SettlementWithdrawEntity;
 
@@ -13,5 +12,5 @@ public interface SettlementService {
 
     BaseResultDto validateWithdrawOrder(SettlementWithdrawEntity entity) throws PayValidatedException;
 
-    void scheduleCallback() throws ServiceException;
+
 }

+ 2 - 1
crm-settlement/src/main/java/com/crm/settlement/service/impl/SettlementServiceImpl.java

@@ -279,6 +279,7 @@ public class SettlementServiceImpl extends BaseSettlementServiceImpl implements
         }
 
         table.setCallbackMerchantCount(table.getCallbackMerchantCount() + 1);
+        table.setCallbackMerchantTime(new Date());
         settlementDepositRecordRepository.save(table);
         if (table.getCallbackMerchantStatus().equals(2) && table.getCallbackMerchantCount() < table.getCallbackMerchantMaxRetryCount()){
             mqSendService.send(ConfigConstants.DEPOSIT_RETRY_CALLBACK, table , 3 * 60 * 1000);
@@ -335,6 +336,7 @@ public class SettlementServiceImpl extends BaseSettlementServiceImpl implements
         }
 
         table.setCallbackMerchantCount(table.getCallbackMerchantCount() + 1);
+        table.setCallbackMerchantTime(new Date());
         settlementWithdrawRecordRepository.save(table);
         if (table.getCallbackMerchantStatus().equals(2) && table.getCallbackMerchantCount() < table.getCallbackMerchantMaxRetryCount()){
             mqSendService.send(ConfigConstants.WITHDRAW_RETRY_CALLBACK, table , 3 * 60 * 1000);
@@ -347,7 +349,6 @@ public class SettlementServiceImpl extends BaseSettlementServiceImpl implements
      */
     @Scheduled(cron = "0 23 0 * * ?")
     @Transactional(rollbackFor = Exception.class)
-    @Override
     public void scheduleCallback() throws ServiceException {
         log.info("scheduleCallback start");
         List<SettlementDepositRecordTable> depositRecordTables = settlementDepositRecordMapper.getAllCallback();

+ 3 - 3
crm-settlement/src/main/java/com/crm/settlement/service/impl/VaultodyServiceImpl.java

@@ -243,7 +243,7 @@ public class VaultodyServiceImpl extends BaseSettlementServiceImpl implements Va
             log.error("vaultody withdraw callback valid error");
             throw new ServiceException("vaultody withdraw callback valid error");
         }
-        VaultodyCallbackEntity entity = com.alibaba.fastjson.JSON.parseObject(content, VaultodyCallbackEntity.class);
+        VaultodyCallbackEntity entity = JSON.parseObject(content, VaultodyCallbackEntity.class);
         VaultodyDataEntity dataEntity = entity.getData();
         String event = dataEntity.getEvent();
         VaultodyItemEntity itemEntity = dataEntity.getItem();
@@ -255,7 +255,7 @@ public class VaultodyServiceImpl extends BaseSettlementServiceImpl implements Va
         }
 
         if (StringUtils.isEmpty(event)) {
-            log.error("vaultody withdraw callback:event is empty,{}", com.alibaba.fastjson.JSON.toJSONString(entity));
+            log.error("vaultody withdraw callback:event is empty,{}", JSON.toJSONString(entity));
             return BaseResultDto.error();
         }
 
@@ -264,7 +264,7 @@ public class VaultodyServiceImpl extends BaseSettlementServiceImpl implements Va
             return BaseResultDto.error();
         }
 
-        SettlementWithdrawRecordTable withdrawRecordTable = settlementWithdrawRecordRepository.findFirstByRequestSerialAndChannelCode(requestId, SettlementConstant.VAULTODY_PAY_KEY);
+        SettlementWithdrawRecordTable withdrawRecordTable = settlementWithdrawRecordRepository.findFirstByRequestSerialAndChannelCode(requestId, SettlementConstant.VAULTODY_PAY_REMIT);
         if (withdrawRecordTable == null) {
             log.error("Vaultody withdraw 通知回调:未找到对应的记录,{}", content);
             return BaseResultDto.error();