fix: 慢性病管理,定时任务修改完善。

This commit is contained in:
tianyongbao
2026-03-21 22:28:06 +08:00
parent 8821e01422
commit 6cff4a2e7a
24 changed files with 368 additions and 55 deletions

View 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.intc</groupId>
<artifactId>intc-api</artifactId>
<version>3.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>intc-api-health</artifactId>
<description>
intc-api-health 健康模块远程调用接口
</description>
<dependencies>
<!-- RuoYi Common Core-->
<dependency>
<groupId>com.intc</groupId>
<artifactId>intc-common-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,40 @@
package com.intc.api.health;
import com.intc.common.core.constant.ServiceNameConstants;
import com.intc.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* 健康模块远程调用服务
*
* @author intc
*/
@FeignClient(contextId = "remoteHealthService", value = ServiceNameConstants.INTC_HEALTH, fallbackFactory = com.intc.api.health.factory.RemoteHealthFallbackFactory.class)
public interface RemoteHealthService {
/**
* 每日生成服药任务
*
* @return 结果
*/
@RequestMapping(value = "/job/generateDailyTasks", method = RequestMethod.POST)
R generateDailyTasks();
/**
* 扫描并发送服药提醒
*
* @return 结果
*/
@RequestMapping(value = "/job/scanAndSendReminders", method = RequestMethod.POST)
R scanAndSendReminders();
/**
* 扫描超时未服药任务
*
* @return 结果
*/
@RequestMapping(value = "/job/scanOverdueRecords", method = RequestMethod.POST)
R scanOverdueRecords();
}

View File

@@ -0,0 +1,41 @@
package com.intc.api.health.factory;
import com.intc.api.health.RemoteHealthService;
import com.intc.common.core.domain.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* 健康服务降级处理
*
* @author intc
*/
@Component
public class RemoteHealthFallbackFactory implements FallbackFactory<RemoteHealthService> {
private static final Logger log = LoggerFactory.getLogger(RemoteHealthFallbackFactory.class);
@Override
public RemoteHealthService create(Throwable throwable) {
log.error("健康服务调用失败:{}", throwable.getMessage());
return new RemoteHealthService() {
@Override
public R generateDailyTasks() {
return R.fail("健康服务调用每日生成服药任务失败");
}
@Override
public R scanAndSendReminders() {
return R.fail("健康服务调用扫描服药提醒失败");
}
@Override
public R scanOverdueRecords() {
return R.fail("健康服务调用扫描超时未服药记录失败");
}
};
}
}

View File

@@ -0,0 +1 @@
com.intc.api.health.factory.RemoteHealthFallbackFactory

View File

@@ -11,6 +11,7 @@
<modules>
<module>intc-api-system</module>
<module>intc-api-invest</module>
<module>intc-api-health</module>
</modules>
<artifactId>intc-api</artifactId>
<packaging>pom</packaging>