init:联众检查重采

master
wyb 5 months ago
commit 79ee0a2eb3

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,311 @@
<?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-lianzhong-check</artifactId>
<dependencies>
<dependency>
<groupId>com.docus</groupId>
<artifactId>docus-knife4j-starter</artifactId>
</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.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>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!--sqlserver驱动-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<!-- oracle -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-tiff</artifactId>
<version>3.8.1</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,14 @@
package com.docus.server;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication(scanBasePackages = {"com.docus"})
@MapperScan("com.docus.server.**.mapper")
public class AppRunBootstrap {
public static void main(String[] args) {
SpringApplication.run(AppRunBootstrap.class, args);
}
}

@ -0,0 +1,33 @@
package com.docus.server.archive.controller;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archive.service.LianzhongCollectCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author YongBin Wen
* @date 2025/1/16 17:10
*/
@RestController
@Api(tags = "联众检查接口")
@RequestMapping("/lianzhong")
@Slf4j
public class LianzhongController {
@Resource
private LianzhongCollectCheckService lianzhongCollectCheckService;
@ApiOperation(value = "检查联众同步完成的患者,数量对不上和图片损坏则重采")
@GetMapping("/checkLianzhongSourceFile")
public CommonResult<String> checkLianzhongSourceFile() {
lianzhongCollectCheckService.checkLianzhongSourceFile();
return CommonResult.success("检查完成!");
}
}

@ -0,0 +1,55 @@
package com.docus.server.archive.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class ScanAssort implements Serializable {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "病案id")
private String patientId;
@ApiModelProperty(value = "文件标题")
private String fileTitle;
@ApiModelProperty(value = "文件目录 单纯文件夹路径不带文件名F:\\嘉时\\新建文件夹\\")
private String imagePath;
@ApiModelProperty(value = "文件名称")
private String scanPage;
@ApiModelProperty(value = "文件来源 1:采集器2扫描生产软件")
private Integer fileSource;
@ApiModelProperty(value = "1:服务器本地2ftp服务器3共享文件夹")
private Integer fileStorageType;
@ApiModelProperty(value = "是否作废 10否")
private Integer isDel;
private String source;
@ApiModelProperty(value = "加密类型 0-aes 1-pdfbox 2-itext ...")
private Integer encryptedType;
@ApiModelProperty(value = "加密秘钥密文")
private String encryptPassword;
}

@ -0,0 +1,162 @@
package com.docus.server.archive.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TBasic对象", description = "病案基本信息")
public class TBasic implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "住院次数")
private Integer admissTimes;
@ApiModelProperty(value = "病案号")
private String inpatientNo;
@ApiModelProperty(value = "住院ID号")
private String admissId;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "盘号")
private String ph;
@ApiModelProperty(value = "性别")
private String sex;
@ApiModelProperty(value = "年龄_岁")
private Integer age;
@ApiModelProperty(value = "年龄_月")
private Integer ageMonth;
@ApiModelProperty(value = "年龄_天")
private Integer ageDay;
@ApiModelProperty(value = "身份证")
private String idCard;
@ApiModelProperty(value = "手机号码")
private String telphone;
@ApiModelProperty(value = "住院日期")
private Date admissDate;
@ApiModelProperty(value = "住院科室")
private String admissDept;
@ApiModelProperty(value = "住院科室名称")
private String admissDeptName;
@ApiModelProperty(value = "出院日期")
private Date disDate;
@ApiModelProperty(value = "出院科室")
private String disDept;
@ApiModelProperty(value = "出院科室名称")
private String disDeptName;
@ApiModelProperty(value = "实际住院天数")
private Integer admissDays;
@ApiModelProperty(value = "主管医生")
private String attending;
@ApiModelProperty(value = "主管医生名称")
private String attendingName;
@ApiModelProperty(value = "主要诊断编码")
private String mainDiagCode;
@ApiModelProperty(value = "主要诊断名称")
private String mainDiagName;
@ApiModelProperty(value = "主要手术编码")
private String mainOperateCode;
@ApiModelProperty(value = "主要手术名称")
private String mainOperateName;
@ApiModelProperty(value = "是否死亡")
private Integer isDead;
@ApiModelProperty(value = "是否作废(01是)")
private Integer isCancel;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "是否归档 1已归档0未归档")
private Integer isArchive;
@ApiModelProperty(value = "归档时间")
private Date archiveTime;
@ApiModelProperty(value = "文件来源 1:af_archive_detail,2:t_scan_assort")
private Integer fileSource;
@ApiModelProperty(value = "完整性描述")
private String integrityDesc;
private String bColumn1;
private String bColumn2;
private String bColumn3;
private String bColumn4;
private String bColumn5;
private Integer bColumn6;
private Integer bColumn7;
private Integer bColumn8;
private Integer bColumn9;
private Integer bColumn10;
@ApiModelProperty(value = "姓名缩写(内部构成)")
private String nameSpell;
@ApiModelProperty(value = "性别名称")
private String sexName;
@ApiModelProperty(value = "记账号")
private String jzh;
@ApiModelProperty(value = "外部id")
private String externalId;
@ApiModelProperty(value = "档案文件存储类型1pdf默认2图片")
private Integer archiveFileStorageType;
@ApiModelProperty(value = "是否标记编码 0否1是")
private Integer isCoder;
}

@ -0,0 +1,21 @@
package com.docus.server.archive.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.archive.entity.TBasic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* mapper
*
* @author wyb
*/
@DS("archive-mysql")
@Mapper
public interface BasicMapper {
List<TBasic> getByPatientIds(@Param("patientIdList") List<String> patientIdList);
}

@ -0,0 +1,20 @@
package com.docus.server.archive.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.archive.entity.ScanAssort;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author YongBin Wen
* @date 2025/3/3 22:22
*/
@DS("archive-mysql")
@Mapper
public interface ScanAssortMapper {
List<String> getPatientIdsBySource(@Param("source") String source);
List<ScanAssort> getByPatientIdAndSource(@Param("patientId") String patientId,@Param("source") String source);
}

@ -0,0 +1,9 @@
package com.docus.server.archive.service;
/**
* @author YongBin Wen
* @date 2025/3/3 22:16
*/
public interface LianzhongCollectCheckService {
void checkLianzhongSourceFile();
}

@ -0,0 +1,104 @@
package com.docus.server.archive.service.impl;
import com.docus.core.util.Func;
import com.docus.server.archive.entity.ScanAssort;
import com.docus.server.archive.entity.TBasic;
import com.docus.server.archive.mapper.BasicMapper;
import com.docus.server.archive.mapper.ScanAssortMapper;
import com.docus.server.archive.service.LianzhongCollectCheckService;
import com.docus.server.lianzhong.entity.CardInfoUpload;
import com.docus.server.lianzhong.mapper.CardInfoUploadMapper;
import com.docus.server.lianzhong.mapper.PictureMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
* @author YongBin Wen
* @date 2025/3/3 22:16
*/
@Slf4j
@Service
public class LianzhongCollectCheckServiceImpl implements LianzhongCollectCheckService {
@Autowired
private BasicMapper basicMapper;
@Autowired
private ScanAssortMapper scanAssortMapper;
@Autowired
private CardInfoUploadMapper cardInfoUploadMapper;
@Autowired
private PictureMapper pictureMapper;
@Override
public void checkLianzhongSourceFile() {
final String source = "lianzhong";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
List<String> lianzhongPatientIds = scanAssortMapper.getPatientIdsBySource(source);
log.info("联众文件检查,患者主键:{} 个。", lianzhongPatientIds.size());
for (String patientId : lianzhongPatientIds) {
try {
List<TBasic> basics = basicMapper.getByPatientIds(Collections.singletonList(patientId));
if (Func.isEmpty(basics)) {
continue;
}
TBasic basic = basics.get(0);
List<ScanAssort> scanAssortList = scanAssortMapper.getByPatientIdAndSource(patientId, source);
String disDateFmt = sdf.format(basic.getDisDate());
String patno = basic.getInpatientNo();
List<CardInfoUpload> cardInfoUploadList = cardInfoUploadMapper.getSuccessByPatno(patno);
for (CardInfoUpload cardInfoUpload : cardInfoUploadList) {
if (disDateFmt.equals(sdf.format(cardInfoUpload.getOutdate()))) {
String fileid = cardInfoUpload.getId();
int lzFileCount = pictureMapper.fileCount(fileid);
if (scanAssortList.size() != lzFileCount) {
cardInfoUploadMapper.recollect(cardInfoUpload.getId());
break;
}
if (hasDamage(scanAssortList)) {
cardInfoUploadMapper.recollect(cardInfoUpload.getId());
break;
}
}
}
} catch (Exception ex) {
log.error("联众检查,出错啦,病案主键:" + patientId, ex);
}
}
}
private boolean hasDamage(List<ScanAssort> scanAssortList) {
try {
for (ScanAssort assort : scanAssortList) {
String filePath = assort.getImagePath() + File.separator + assort.getScanPage();
BufferedImage image = ImageIO.read(new File(filePath));
if (image.getHeight() <= 0 || image.getWidth() <= 0) {
return true;
}
}
return false;
} catch (Exception ex) {
return true;
}
}
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
System.out.println(sdf.format(new Date()));
ScanAssort scanAssort = new ScanAssort();
scanAssort.setImagePath("C:\\Users\\wyb\\Pictures\\联想截图");
scanAssort.setScanPage("yuai2.png");
List<ScanAssort> scanAssortList = Arrays.asList(scanAssort);
System.out.println(new LianzhongCollectCheckServiceImpl().hasDamage(scanAssortList));
}
}

@ -0,0 +1,58 @@
package com.docus.server.lianzhong.entity;
import lombok.Data;
import java.util.Date;
@Data
public class CardInfoUpload {
private String id;
private String patno;
private String patname;
private Date outdate;
private Date indate;
private String outdeptcode;
private String outdeptname;
private String patsex;
private Date patbirthday;
private Integer state;
private String describe;
private String icdecode11;
private String icdename11;
private String mjwesticde;
private String mjwestname;
private String patciticard;
private Integer patage;
private String indeptcode;
private String indeptname;
private String outwardname;
private Integer patnum;
private String gestno;
}

@ -0,0 +1,20 @@
package com.docus.server.lianzhong.entity;
import lombok.Data;
@Data
public class Picture {
private String picid;
private String picname;
private String fileid;
private Double rotatedegree;
private String pickind;
private Integer picno;
}

@ -0,0 +1,20 @@
package com.docus.server.lianzhong.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.lianzhong.entity.CardInfoUpload;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author YongBin Wen
* @date 2025/3/3 22:32
*/
@DS("lianzhong-sqlserver")
@Mapper
public interface CardInfoUploadMapper {
List<CardInfoUpload> getSuccessByPatno(@Param("patno") String patno);
int recollect(@Param("id") String id);
}

@ -0,0 +1,15 @@
package com.docus.server.lianzhong.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author YongBin Wen
* @date 2025/3/3 22:32
*/
@DS("lianzhong-sqlserver")
@Mapper
public interface PictureMapper {
int fileCount(@Param("fileid") String fileid);
}

@ -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,8 @@
<service>
<id>docus-task-ydzyy</id>
<name>生产-嘉时病案无纸化-英德中医院视图任务同步</name>
<description>生产-嘉时病案无纸化-英德中医院视图任务同步</description>
<startmode>Automatic</startmode>
<executable>%BASE%\start.bat</executable>
<log mode="none"></log>
</service>

@ -0,0 +1,78 @@
server:
port: 8285
spring:
application:
name: @artifactId@
datasource:
dynamic:
primary: archive-mysql
#是否用严格模式,如果启用在味匹配到指定数据源时抛出异常
strict: false
datasource:
# 多数据源
archive-mysql:
url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?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
lianzhong-sqlserver:
# url: jdbc:sqlserver://192.169.2.170:14330;DatabaseName=u_medrecord
# username: sa
# password: 17931@Uni
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=u_medrecord
username: sa
password: 123456
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
profiles:
active: dev
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,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="1 seconds">
<contextName>docus-lianzhong-check</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"/>
</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,34 @@
<?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.archive.mapper.BasicMapper">
<sql id="basicInfoColumns">
patient_id
AS patientId,
admiss_times AS admissTimes,
inpatient_no AS inpatientNo,
admiss_id AS admissId,
admiss_date AS admissDate,
dis_date AS disDate,
admiss_dept_name AS admissDeptName,
dis_dept_name AS disDeptName ,
jzh,
name,
id_card AS idCard
</sql>
<select id="getByPatientIds" resultType="com.docus.server.archive.entity.TBasic">
SELECT
<include refid="basicInfoColumns"></include>
FROM
docus_medicalrecord.t_basic
WHERE
patient_id IN
<foreach collection="patientIdList" item="patientId" separator="," open="(" close=")">
#{patientId}
</foreach>
ORDER BY dis_date DESC
</select>
</mapper>

@ -0,0 +1,18 @@
<?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.lianzhong.mapper.CardInfoUploadMapper">
<update id="recollect">
update dbo.t_card_info_upload
set state = 0
where id = #{id}
</update>
<select id="getSuccessByPatno" resultType="com.docus.server.lianzhong.entity.CardInfoUpload">
select id, patno, outdate
from dbo.t_card_info_upload
where patno = #{patno} and state = 3
</select>
</mapper>

@ -0,0 +1,13 @@
<?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.lianzhong.mapper.PictureMapper">
<select id="fileCount" resultType="java.lang.Integer">
select count(1)
from dbo.T_Picture
where fileid = #{fileid}
</select>
</mapper>

@ -0,0 +1,19 @@
<?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.archive.mapper.ScanAssortMapper">
<select id="getPatientIdsBySource" resultType="java.lang.String">
select patient_id
from t_scan_assort tsa
where source = #{source}
group by patient_id
</select>
<select id="getByPatientIdAndSource" resultType="com.docus.server.archive.entity.ScanAssort">
select id, patient_id, image_path, scan_page
from t_scan_assort
where source = #{source}
and patient_id = #{patientId}
</select>
</mapper>

Binary file not shown.
Loading…
Cancel
Save