int: 湛江附属首页编目视图查询队列生成

master
wyb 11 months ago
commit db3e7ceb7f

35
.gitignore vendored

@ -0,0 +1,35 @@
target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
docus-services/docus-services-system1/
### IntelliJ IDEA ###
*.log
.idea
*.iws
*.iml
*.ipr
mvnw*
*.cmd
*.mvn
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
logs*

@ -0,0 +1,73 @@
<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
<id>exe</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>/lib</outputDirectory>
<directory>${basedir}/target/lib</directory>
</fileSet>
<fileSet>
<outputDirectory>/config</outputDirectory>
<directory>${basedir}/target/resources</directory>
<fileMode>0755</fileMode>
<includes>
<include>*.xml</include>
<include>*.yml</include>
<include>*.properties</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>/dataConfig</outputDirectory>
<directory>${basedir}/target/dataConfig</directory>
<fileMode>0755</fileMode>
<includes>
<include>*.json</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>${basedir}/target/resources/bin</directory>
<fileMode>0755</fileMode>
<includes>
<include>*.bat</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>${basedir}/target/resources/bin</directory>
<fileMode>0755</fileMode>
<includes>
<include>*.xml</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>${basedir}</directory>
<fileMode>0755</fileMode>
<includes>
<include>*.exe</include>
</includes>
</fileSet>
<!-- 将项目启动jar打包到boot目录中 -->
<fileSet>
<directory>${basedir}/target</directory>
<outputDirectory>/</outputDirectory>
<fileMode>0755</fileMode>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>

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

@ -0,0 +1,330 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.docus</groupId>
<artifactId>docus-bom</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>docus-collect-taskcontrol</artifactId>
<dependencies>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-knife4j-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--mybatis plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-base-starter</artifactId>
<exclusions>
<exclusion>
<artifactId>knife4j-spring-boot-autoconfigure</artifactId>
<groupId>com.github.xiaoymin</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-tool-starter</artifactId>
</dependency>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-shiro-starter</artifactId>
</dependency>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-base-starter</artifactId>
<exclusions>
<exclusion>
<artifactId>springfox-core</artifactId>
<groupId>io.springfox</groupId>
</exclusion>
<exclusion>
<artifactId>springfox-schema</artifactId>
<groupId>io.springfox</groupId>
</exclusion>
<exclusion>
<artifactId>springfox-spi</artifactId>
<groupId>io.springfox</groupId>
</exclusion>
<exclusion>
<artifactId>knife4j-spring-boot-autoconfigure</artifactId>
<groupId>com.github.xiaoymin</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<!--&lt;!&ndash;添加feign依赖&ndash;&gt;-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!--sqlserver驱动-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.10.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<!--打包时去除第三方依赖-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.4</version>
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>non-exists</groupId>
<artifactId>non-exists</artifactId>
</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!--拷贝第三方依赖文件到指定目录-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!--target/lib是依赖jar包的输出目录根据自己喜好配置-->
<outputDirectory>target/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<!-- copy资源文件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/resources</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-bin</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>bin/*.xml</include>
<include>*.yml</include>
<include>bin/*.bat</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/resources</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-data-config</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>../../dataConfig</directory>
<filtering>true</filtering>
</resource>
</resources>
<outputDirectory>${project.build.directory}/dataConfig</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- 打jar包时忽略配置文件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/*.yml</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<finalName>${project.artifactId}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<properties>
<profile.name>prod</profile.name>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
</project>

@ -0,0 +1,24 @@
package com.docus.server;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.Properties;
@Slf4j
@SpringBootApplication(scanBasePackages ={"com.docus"})
@MapperScan("com.docus.server.**.mapper")
public class AppRunBootstrap {
public static void main(String[] args) {
Properties props = System.getProperties();
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
props.setProperty("UseSunHttpHandler", "true");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
SpringApplication.run(AppRunBootstrap.class, args);
}
}

@ -0,0 +1,21 @@
package com.docus.server.archivesqlserver.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author YongBin Wen
* @date 2024/8/13 16:33
*/
@ApiModel("归档患者主表")
@Data
public class ArchiveMaster {
@ApiModelProperty("患者主键")
private String id;
@ApiModelProperty("住院号")
private String inpNo;
@ApiModelProperty("住院次数")
private String visitId;
}

@ -0,0 +1,22 @@
package com.docus.server.archivesqlserver.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.archivesqlserver.entity.ArchiveMaster;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author YongBin Wen
* @date 2024/8/13 16:38
*/
@DS("archivesqlserver")
public interface ArchiveMasterMapper {
/**
*
*
* @param condition
* @return
*/
List<ArchiveMaster> listByCondition(@Param("condition") ArchiveMaster condition);
}

@ -0,0 +1,67 @@
package com.docus.server.jobadmin.config;
import com.docus.server.archivesqlserver.mapper.ArchiveMasterMapper;
import com.docus.server.jobadmin.scheduler.JobScheduler;
import com.docus.server.rpc.V2ViewTaskCollectService;
import com.docus.server.zjfsjhemr.mapper.ZjFsPatIndexViewMapper;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* jobservicedaomapper
*
* @author YongBin Wen
* @date 2024/1/23 14:13
*/
@Component
public class JobAdminConfig implements InitializingBean, DisposableBean {
private static JobAdminConfig jobAdminConfig = null;
public static JobAdminConfig getJobAdminConfig() {
return jobAdminConfig;
}
// ---------------------- JobScheduler ----------------------
private JobScheduler xxlJobScheduler;
@Override
public void afterPropertiesSet() throws Exception {
jobAdminConfig = this;
xxlJobScheduler = new JobScheduler();
xxlJobScheduler.init();
}
@Override
public void destroy() throws Exception {
xxlJobScheduler.destroy();
}
// dao service
@Resource
private ZjFsPatIndexViewMapper zjFsPatIndexViewMapper;
@Resource
private ArchiveMasterMapper archiveMasterMapper;
@Resource
private V2ViewTaskCollectService v2ViewTaskCollectService;
public ZjFsPatIndexViewMapper getZjFsPatIndexViewMapper() {
return zjFsPatIndexViewMapper;
}
public ArchiveMasterMapper getArchiveMasterMapper() {
return archiveMasterMapper;
}
public V2ViewTaskCollectService getV2ViewTaskCollectService() {
return v2ViewTaskCollectService;
}
}

@ -0,0 +1,26 @@
package com.docus.server.jobadmin.scheduler;
import com.docus.server.jobadmin.thread.ZjFsCatalogCollectTaskHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author YongBin Wen
* @date 2024/1/23 14:04
*/
public class JobScheduler {
private static final Logger logger = LoggerFactory.getLogger(JobScheduler.class);
public void init() throws Exception {
ZjFsCatalogCollectTaskHelper.getInstance().start();
logger.info(">>>>>>>>> init job admin success.");
}
public void destroy() {
ZjFsCatalogCollectTaskHelper.getInstance().toStop();
}
}

@ -0,0 +1,116 @@
package com.docus.server.jobadmin.thread;
import com.alibaba.fastjson.JSONObject;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.utils.TableJsonRead;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archivesqlserver.entity.ArchiveMaster;
import com.docus.server.archivesqlserver.mapper.ArchiveMasterMapper;
import com.docus.server.jobadmin.config.JobAdminConfig;
import com.docus.server.rpc.V2ViewTaskCollectService;
import com.docus.server.rpc.dto.TaskMakeupDto;
import com.docus.server.zjfsjhemr.entity.ZjFsPatIndexView;
import com.docus.server.zjfsjhemr.mapper.ZjFsPatIndexViewMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* job
*
* @author YongBin Wen
* @date 2024/1/23 10:59
*/
public class ZjFsCatalogCollectTaskHelper {
private static final Logger logger = LoggerFactory.getLogger(ZjFsCatalogCollectTaskHelper.class);
private static final ZjFsCatalogCollectTaskHelper instance = new ZjFsCatalogCollectTaskHelper();
public static ZjFsCatalogCollectTaskHelper getInstance() {
return instance;
}
private Thread zjFsCatalogCollectTaskThread;
private volatile boolean toStop = false;
public void start() {
zjFsCatalogCollectTaskThread = new Thread(() -> {
TableJsonRead tableJsonRead = new TableJsonRead();
ZjFsPatIndexViewMapper zjFsPatIndexViewMapper = JobAdminConfig.getJobAdminConfig().getZjFsPatIndexViewMapper();
ArchiveMasterMapper archiveMasterMapper = JobAdminConfig.getJobAdminConfig().getArchiveMasterMapper();
V2ViewTaskCollectService v2ViewTaskCollectService = JobAdminConfig.getJobAdminConfig().getV2ViewTaskCollectService();
String configPath = "data-config\\jobconfig";
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");
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));
for (ZjFsPatIndexView view : zjFsPatIndexViews) {
String inpNo = view.getInpNo();
Integer visitId = view.getVisitId();
ArchiveMaster condition = new ArchiveMaster();
condition.setInpNo(inpNo);
condition.setVisitId(visitId.toString());
List<ArchiveMaster> archiveMasters = archiveMasterMapper.listByCondition(condition);
if (Func.isEmpty(archiveMasters)) {
logger.warn("首页编目数据查询,住院号:{},住院次数:{} 未找到患者主表数据!", inpNo, visitId);
continue;
}
// 生成采集任务
List<String> masterIds = archiveMasters.stream().map(ArchiveMaster::getId).collect(Collectors.toList());
TaskMakeupDto makeupDto = new TaskMakeupDto();
makeupDto.setPatientIds(masterIds);
makeupDto.setSysCodes(sysCodes);
logger.info("首页编目生成队列参数:{}", Func.toJson(makeupDto));
CommonResult<String> result = v2ViewTaskCollectService.generateTaskByPatientIdAndSysCodes(makeupDto);
logger.info("首页编目生成队列返回结果:{}", Func.toJson(result));
}
// 刷新配置
jobConfig.put("lastDate", maxCatalogDateStr);
tableJsonRead.Save(configPath, configFileName, jobConfig.toJSONString());
}
TimeUnit.SECONDS.sleep(jobIntervalSeconds);
} catch (Exception ex) {
if (!toStop) {
logger.error(">>>>>>>>>>> zjFs Catalog CollectTask Thread error:" + ex.getMessage(), ex);
}
}
}
logger.info(">>>>>>>>>>> zjFs Catalog CollectTask Thread stop");
});
zjFsCatalogCollectTaskThread.setDaemon(true);
zjFsCatalogCollectTaskThread.setName("ZjFsCatalogCollectTaskHelper");
zjFsCatalogCollectTaskThread.start();
}
public void toStop() {
toStop = false;
zjFsCatalogCollectTaskThread.interrupt();
try {
zjFsCatalogCollectTaskThread.join();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
public static void main(String[] args) {
TableJsonRead tableJsonRead = new TableJsonRead();
JSONObject config = tableJsonRead.Read("data-config\\jobconfig", "ZjFsCatalogCollectTask", JSONObject.class);
System.out.println(config);
}
}

@ -0,0 +1,12 @@
package com.docus.server.rpc;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.rpc.dto.TaskMakeupDto;
/**
* @author YongBin Wen
* @date 2024/8/13 17:40
*/
public interface V2ViewTaskCollectService {
CommonResult<String> generateTaskByPatientIdAndSysCodes(TaskMakeupDto makeupDto);
}

@ -0,0 +1,20 @@
package com.docus.server.rpc.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
* @author wyb
*/
@Data
@ApiModel("任务补偿参数")
public class TaskMakeupDto {
@ApiModelProperty("采集器id多个使用英文逗号 , 分割")
private String sysCodes;
@ApiModelProperty("病案主键集合")
private List<String> patientIds;
}

@ -0,0 +1,20 @@
package com.docus.server.rpc.impl;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.rpc.V2ViewTaskCollectService;
import com.docus.server.rpc.dto.TaskMakeupDto;
import org.springframework.stereotype.Service;
/**
* @author YongBin Wen
* @date 2024/8/13 17:41
*/
@Service
public class V2ViewTaskCollectServiceImpl implements V2ViewTaskCollectService {
@Override
public CommonResult<String> generateTaskByPatientIdAndSysCodes(TaskMakeupDto makeupDto) {
// todo(wyb): 调用任务生成
return null;
}
}

@ -0,0 +1,34 @@
package com.docus.server.zjfsjhemr.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author YongBin Wen
* @date 2024/8/13 16:07
*/
@ApiModel("湛江附属医院 首页编目数据")
@Data
public class ZjFsPatIndexView {
@ApiModelProperty("患者ID")
private String patientId;
@ApiModelProperty("住院号")
private String inpNo;
@ApiModelProperty("住院次数")
private Integer visitId;
@ApiModelProperty("入院日期")
private Date admissionDateTime;
@ApiModelProperty("出院日期")
private Date dischargeDateTime;
@ApiModelProperty("编目最后完成日期")
private Date catalogDate;
@ApiModelProperty("编目人员工号")
private String catalogerId;
}

@ -0,0 +1,31 @@
package com.docus.server.zjfsjhemr.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.zjfsjhemr.entity.ZjFsPatIndexView;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* @author YongBin Wen
* @date 2024/8/13 16:13
*/
@DS("zjfsjhemr")
public interface ZjFsPatIndexViewMapper {
/**
*
*
* @return java.util.Date
*/
Date maxCatalogDate();
/**
* startDate <= catalog_date < endDate
*
* @param startDate yyyy-MM-dd HH:mm:ss
* @param endDate yyyy-MM-dd HH:mm:ss
* @return
*/
List<ZjFsPatIndexView> listByCatalogDateRange(@Param("startDate") String startDate, @Param("endDate") String endDate);
}

@ -0,0 +1,33 @@
@echo off
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
echo %str%
if %str%==Started (
echo "restart....."
winsw stop
PING 127.0.0.1 -n 10 -w 30000 >NUL
winsw start
)
if %str%==Stopped (
echo "start....."
winsw start
)
if %str%==NonExistent (
echo "deploy and start....."
winsw install
winsw start
echo c
)

@ -0,0 +1,21 @@
set java_opts=-Xms512m -Xmx512m
set key="java_opts"
rem 文件不存在,就跳过
if not exist java-ops.ini goto end
for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do (
if "%%i"==%key% set java_opts=%%j)
echo java_opts is : %java_opts%
:end
rem 启动java
java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar

@ -0,0 +1,13 @@
@echo off
for /f "delims=" %%t in ('winsw.exe status') do set str=%%t
echo %str%
if %str%==Started (
winsw stop
@echo wait program stop .....
PING 127.0.0.1 -n 30 -w 10000 >NUL
)

@ -0,0 +1,19 @@
@echo off
set deployDir=%1\docus-collect-taskcontrol
if %deployDir%=="" set deployDir=d:\webroot\docus-collect-taskcontrol
set curr_file=%cd%
cd /d %deployDir%
call stop.bat
cd %curr_file%
sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
rd/s/q %deployDir%\lib
rd/s/q %deployDir%\dataConfig
rd/s/q %deployDir%\config
del /s/q %deployDir%\*.jar
xcopy /Y/E/I * %deployDir%
cd /d %deployDir%
call install.bat

@ -0,0 +1,8 @@
<service>
<id>docus-collect-taskcontrol</id>
<name>生产-嘉时-采集任务控制服务</name>
<description>生产-嘉时-采集任务控制服务</description>
<startmode>Automatic</startmode>
<executable>%BASE%\start.bat</executable>
<log mode="none"></log>
</service>

@ -0,0 +1,103 @@
server:
port: 9314
spring:
application:
name: @artifactId@
profiles:
active: test
datasource:
dynamic:
primary: master #设置默认的数据源默认值为master
strict: false #是否用严格模式,如果启用在味匹配到指定数据源时抛出异常
datasource:
master:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_medicalrecord?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: docus
password: docus702
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
type: com.alibaba.druid.pool.DruidDataSource
# 初始化配置
initial-size: 3
# 最小连接数
min-idle: 3
# 最大连接数
max-active: 15
# 获取连接超 时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 90000
# 最大空闲时间
min-evictable-idle-time-millis: 1800000
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: select 1
zjfsjhemr:
url: jdbc:oracle:thin:@10.6.0.150:1521:jhemr
username: jswzh
password: jswzh123
driver-class-name: oracle.jdbc.driver.OracleDriver
type: com.alibaba.druid.pool.DruidDataSource
# 初始化配置
initial-size: 3
# 最小连接数
min-idle: 3
# 最大连接数
max-active: 10
# 获取连接超 时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 90000
# 最大空闲时间
min-evictable-idle-time-millis: 1800000
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: select 1 from dual
blood:
url: jdbc:sqlserver://192.168.16.103\DOCUS;DatabaseName=hq_framework
username: sa
password: docus702
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
type: com.alibaba.druid.pool.DruidDataSource
# 初始化配置
initial-size: 3
# 最小连接数
min-idle: 3
# 最大连接数
max-active: 15
# 获取连接超 时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 90000
# 最大空闲时间
min-evictable-idle-time-millis: 1800000
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: select 1
redis:
host: redis.docus.cn
password: JSdocus@702
docus:
url:
# 采集任务补偿地址
compensate-task-url: http://localhost:9295/
# 下载地址
down-url: http://localhost:9291/api/downplatform/report
medicalrecord: http://192.168.16.85:9102
dbtype: mysql
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
field-strategy: NOT_EMPTY
db-type: MYSQL

@ -0,0 +1,2 @@
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>docus-server-fistpage</contextName>
<property name="log.path" value="logs/logback"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<!-- 指定日志输出格式 -->
<pattern>[%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n</pattern>
<charset>utf-8</charset>
</encoder>
<!-- 指定收集策略:滚动策略-->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--指定生成日志保存地址 -->
<fileNamePattern>${log.path}%d.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>500MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<MaxHistory>30</MaxHistory>
</rollingPolicy>
</appender>
<springProfile name="dev">
<root level="debug">
<appender-ref ref="console"/>
</root>
</springProfile>
<springProfile name="test|prod">
<root level="INFO">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</root>
</springProfile>
<!-- 监控sql日志输出-->
<!-- 如想看到表格数据将OFF改为INFO -->
<logger name="jdbc.resultsettable" level="OFF" additivity="false">
<appender-ref ref="console"/>
</logger>
<!-- 包含 SQL 语句实际的执行时间 及sql语句与jdbc.sqlonly功能重复 -->
<logger name="jdbc.sqltiming" level="OFF" additivity="false">
<appender-ref ref="file"/>
</logger>
<!-- 仅仅记录 SQL 语句,会将占位符替换为实际的参数-->
<logger name="jdbc.sqlonly" level="OFF" additivity="false">
<appender-ref ref="console"/>
</logger>
<!-- 包含 ResultSet 的信息,输出篇幅较长 -->
<logger name="jdbc.resultset" level="OFF" additivity="false">
<appender-ref ref="console"/>
</logger>
<!-- 输出了 Connection 的 open、close 等信息 -->
<logger name="jdbc.connection" level="OFF" additivity="false">
<appender-ref ref="console"/>
</logger>
<!-- 除了 ResultSet 之外的所有JDBC调用信息篇幅较长 -->
<logger name="jdbc.audit" level="OFF" additivity="false">
<appender-ref ref="console"/>
</logger>
</configuration>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.archivesqlserver.mapper.ArchiveMasterMapper">
<select id="listByCondition" resultType="com.docus.server.archivesqlserver.entity.ArchiveMaster">
select
id,
inp_no as inpNo,
visit_id as visitId,
from
dbo.archive_master
<where>
<if test="condition.id !=null and condition.id != ''">
AND id=#{condition.id}
</if>
<if test="condition.inpNo != null and condition.inpNo != ''">
AND inp_no=#{condition.inpNo}
</if>
<if test="condition.visitId != null and condition.visitId != ''">
AND visit_id=#{condition.visitId}
</if>
</where>
</select>
</mapper>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.zjfsjhemr.mapper.ZjFsPatIndexViewMapper">
<select id="listByCatalogDateRange" resultType="com.docus.server.zjfsjhemr.entity.ZjFsPatIndexView">
select patient_id,
inp_no,
visit_id,
admission_date_time,
discharge_date_time,
catalog_date,
cataloger_id
from jhemr.v_pat_index
where catalog_date >= TO_DATE(#{startDate}, 'yyyy-mm-dd hh24:mi:ss')
and catalog_date <![CDATA[<]]> TO_DATE(#{endDate}, 'yyyy-mm-dd hh24:mi:ss')
order by catalog_date
</select>
<select id="maxCatalogDate" resultType="java.util.Date">
select max(catalog_date) from jhemr.v_pat_index
</select>
</mapper>

Binary file not shown.
Loading…
Cancel
Save