feat: 湛江附属首页编目视图查询队列生成,完善配置

master
wyb 11 months ago
parent db3e7ceb7f
commit 0e37ab26f7

@ -1,5 +1,6 @@
{
"lastDate": "2024-08-13 00:00:00",
"jobIntervalSeconds": 300,
"sysCodes":"catalog"
"sysCodes":"catalog",
"open": 1
}

@ -154,6 +154,14 @@
<version>4.0</version>
</dependency>
<!--oracle 驱动-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>

@ -47,16 +47,23 @@ public class ZjFsCatalogCollectTaskHelper {
String configFileName = "ZjFsCatalogCollectTask";
while (!toStop) {
try {
// 读取配置,实时观察配置文件状况
JSONObject jobConfig = tableJsonRead.Read(configPath, configFileName, JSONObject.class);
int jobIntervalSeconds = jobConfig.getIntValue("jobIntervalSeconds");
String lastDate = jobConfig.getString("lastDate");
String sysCodes = jobConfig.getString("sysCodes");
int open = jobConfig.getIntValue("open");
if (open == 0) {
TimeUnit.SECONDS.sleep(60);
continue;
}
Date maxCatalogDate = zjFsPatIndexViewMapper.maxCatalogDate();
String maxCatalogDateStr = Func.formatDateTime(maxCatalogDate);
// 查询视图数据视图数据查询患者信息id进行任务生成
List<ZjFsPatIndexView> zjFsPatIndexViews = zjFsPatIndexViewMapper.listByCatalogDateRange(lastDate, maxCatalogDateStr);
if (Func.isNotEmpty(zjFsPatIndexViews)) {
logger.info("首页编目数据查询,根据最后编目时间查询(不包含截止时间),开始时间:{},截止时间:{},视图数据:{} 条,数据为:{}", lastDate, maxCatalogDate, zjFsPatIndexViews.size(), Func.toJson(zjFsPatIndexViews));
logger.info("首页编目数据查询,根据最后编目时间查询(不包含截止时间),开始时间:{},截止时间:{},视图数据:{} 条,数据为:{}", lastDate, maxCatalogDateStr, zjFsPatIndexViews.size(), Func.toJson(zjFsPatIndexViews));
for (ZjFsPatIndexView view : zjFsPatIndexViews) {
String inpNo = view.getInpNo();
Integer visitId = view.getVisitId();
@ -86,6 +93,11 @@ public class ZjFsCatalogCollectTaskHelper {
} catch (Exception ex) {
if (!toStop) {
logger.error(">>>>>>>>>>> zjFs Catalog CollectTask Thread error:" + ex.getMessage(), ex);
try {
TimeUnit.SECONDS.sleep(60);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

@ -1,8 +1,14 @@
package com.docus.server.rpc.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.docus.core.util.Func;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.rpc.V2ViewTaskCollectService;
import com.docus.server.rpc.dto.TaskMakeupDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
@ -10,11 +16,20 @@ import org.springframework.stereotype.Service;
* @date 2024/8/13 17:41
*/
@Service
@Slf4j
public class V2ViewTaskCollectServiceImpl implements V2ViewTaskCollectService {
@Value("${docus.url.viewtask-v2:}")
private String v2ViewTaskServerUrl;
@Override
public CommonResult<String> generateTaskByPatientIdAndSysCodes(TaskMakeupDto makeupDto) {
// todo(wyb): 调用任务生成
return null;
String uri = "api/NoViewCollect/generateTaskByPatientIdAndSysCodes";
String url = v2ViewTaskServerUrl + uri;
String body = Func.toJson(makeupDto);
log.info("2.0任务生成,地址:{},参数:{}", url, body);
String result = HttpUtil.post(url, body);
return JSONObject.parseObject(result, new TypeReference<CommonResult<String>>() {
});
}
}

@ -55,7 +55,7 @@ spring:
test-on-borrow: false
test-on-return: false
validation-query: select 1 from dual
blood:
archivesqlserver:
url: jdbc:sqlserver://192.168.16.103\DOCUS;DatabaseName=hq_framework
username: sa
password: docus702
@ -83,11 +83,8 @@ spring:
docus:
url:
# 采集任务补偿地址
compensate-task-url: http://localhost:9295/
# 下载地址
down-url: http://localhost:9291/api/downplatform/report
medicalrecord: http://192.168.16.85:9102
# 2.0视图采集服务地址
viewtask-v2: http://localhost:9295/
dbtype: mysql

@ -9,7 +9,7 @@
select
id,
inp_no as inpNo,
visit_id as visitId,
visit_id as visitId
from
dbo.archive_master
<where>

Loading…
Cancel
Save