fix:定时任务相关功能完善,自测问题修复。
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
|
||||
<modules>
|
||||
<module>ruoyi-api-system</module>
|
||||
<module>ruoyi-api-invest</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-api</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
28
ruoyi-api/ruoyi-api-invest/pom.xml
Normal file
28
ruoyi-api/ruoyi-api-invest/pom.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-api</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-api-invest</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-api-invest
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- RuoYi Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -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();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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("投资服务调用更新未出信用卡分期账单入账数据失败");
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
com.ruoyi.api.invest.factory.RemoteInvestFallbackFactory
|
||||
Reference in New Issue
Block a user