diff --git a/data-config/jobconfig/ZjFsCatalogCollectTask b/data-config/jobconfig/ZjFsCatalogCollectTask
index 3a1df60..ac782ac 100644
--- a/data-config/jobconfig/ZjFsCatalogCollectTask
+++ b/data-config/jobconfig/ZjFsCatalogCollectTask
@@ -1,5 +1,6 @@
{
"lastDate": "2024-08-13 00:00:00",
"jobIntervalSeconds": 300,
- "sysCodes":"catalog"
+ "sysCodes":"catalog",
+ "open": 1
}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 41d0666..4b11c2c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,6 +154,14 @@
4.0
+
+
+ com.oracle
+ ojdbc6
+ 11.2.0.4.0
+
+
+
commons-net
commons-net
diff --git a/src/main/java/com/docus/server/jobadmin/thread/ZjFsCatalogCollectTaskHelper.java b/src/main/java/com/docus/server/jobadmin/thread/ZjFsCatalogCollectTaskHelper.java
index db30161..c3dc10d 100644
--- a/src/main/java/com/docus/server/jobadmin/thread/ZjFsCatalogCollectTaskHelper.java
+++ b/src/main/java/com/docus/server/jobadmin/thread/ZjFsCatalogCollectTaskHelper.java
@@ -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 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();
+ }
}
}
diff --git a/src/main/java/com/docus/server/rpc/impl/V2ViewTaskCollectServiceImpl.java b/src/main/java/com/docus/server/rpc/impl/V2ViewTaskCollectServiceImpl.java
index f46c55a..4037ba5 100644
--- a/src/main/java/com/docus/server/rpc/impl/V2ViewTaskCollectServiceImpl.java
+++ b/src/main/java/com/docus/server/rpc/impl/V2ViewTaskCollectServiceImpl.java
@@ -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 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>() {
+ });
}
}
diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml
index 9342dfc..0cd424a 100644
--- a/src/main/resources/bootstrap.yml
+++ b/src/main/resources/bootstrap.yml
@@ -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
diff --git a/src/main/resources/mapper/ArchiveMasterMapper.xml b/src/main/resources/mapper/ArchiveMasterMapper.xml
index 1cc7893..b5d4533 100644
--- a/src/main/resources/mapper/ArchiveMasterMapper.xml
+++ b/src/main/resources/mapper/ArchiveMasterMapper.xml
@@ -9,7 +9,7 @@
select
id,
inp_no as inpNo,
- visit_id as visitId,
+ visit_id as visitId
from
dbo.archive_master