fix:定时任务相关功能完善,自测问题修复。

This commit is contained in:
tianyongbao
2024-04-28 16:53:43 +08:00
parent eae2dc899b
commit 5a8f726968
18 changed files with 485 additions and 13 deletions

View File

@@ -0,0 +1,33 @@
package com.ruoyi.api.invest;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
/**
* 基础服务
*
* @author YaphetS
*/
@FeignClient(contextId = "remoteInvestService", value = ServiceNameConstants.INTC_INVEST, fallbackFactory = com.ruoyi.api.invest.factory.RemoteInvestFallbackFactory.class)
public interface RemoteInvestService
{
/**
* 生成未出信用卡账单数据
*
* @return 结果
*/
@RequestMapping(value = "/job/generateUnpaidCreditBill",method = RequestMethod.POST)
public R generateUnpaidCreditBillTask();
/**
* 更新未出信用卡分期账单入账数据
*
* @return 结果
*/
@RequestMapping(value = "/job/updateUnpaidInstallmentData",method = RequestMethod.POST)
public R updateUnpaidInstallmentDataTask();
}

View File

@@ -0,0 +1,39 @@
package com.ruoyi.api.invest.factory;
import com.ruoyi.api.invest.RemoteInvestService;
import com.ruoyi.common.core.domain.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* 用户服务降级处理
*
* @author ruoyi
*/
@Component
public class RemoteInvestFallbackFactory implements FallbackFactory<RemoteInvestService>
{
private static final Logger log = LoggerFactory.getLogger(com.ruoyi.api.invest.factory.RemoteInvestFallbackFactory.class);
@Override
public RemoteInvestService create(Throwable throwable)
{
log.error("投资服务调用失败:{}", throwable.getMessage());
return new RemoteInvestService()
{
@Override
public R generateUnpaidCreditBillTask() {
return R.fail("投资服务调用生成未出信用卡账单数据失败");
}
@Override
public R updateUnpaidInstallmentDataTask() {
return R.fail("投资服务调用更新未出信用卡分期账单入账数据失败");
}
};
}
}

View File

@@ -0,0 +1 @@
com.ruoyi.api.invest.factory.RemoteInvestFallbackFactory