feat:广东省中医报告作废电生理项目初始化

解封患者病历-unbloking
wyb 2 years ago
commit 7a4519ff15

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,34 @@
框架说明
项目结构
```
backup --业务模块 备份
controller --前端接口层
param --接口参数
vo --返回视图
feign --服务接口层
infrastructure --基础设施层
cache --mybatis 和 feign 接口的缓存层
client --访问对外接口,例如 feign ws 等
dao --连接数据库
job --xxl-job
service --业务代码
impl --service 实现类
inspection -- 业务模块 采集器
controller --前端接口层
param --接口参数
vo --返回视图
feign --服务接口层
infrastructure --基础设施层
cache --mybatis 和 feign 接口的缓存层
client --访问对外接口,例如 feign ws 等
dao --连接数据库
job --xxl-job
service --业务代码
impl --service 实现类
```
这个是一个模板,需要启动新项目的,复制一份,并且修改 项目名称以及修改<artifactId>docus-demo</artifactId> 跟项目名称一致即可启动。

@ -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,353 @@
<?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-report-manager</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>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<exclusions>
<exclusion>
<artifactId>checker-qual</artifactId>
<groupId>org.checkerframework</groupId>
</exclusion>
<exclusion>
<artifactId>error_prone_annotations</artifactId>
<groupId>com.google.errorprone</groupId>
</exclusion>
</exclusions>
</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>
<!--nacos-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<exclusions>
<exclusion>
<artifactId>HdrHistogram</artifactId>
<groupId>org.hdrhistogram</groupId>
</exclusion>
<exclusion>
<artifactId>jsr305</artifactId>
<groupId>com.google.code.findbugs</groupId>
</exclusion>
</exclusions>
</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>
</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,26 @@
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 org.springframework.scheduling.annotation.EnableAsync;
import java.util.Properties;
@Slf4j
@SpringBootApplication(scanBasePackages ={"com.docus"})
@MapperScan("com.docus.server.**.mapper")
@EnableAsync
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,48 @@
package com.docus.server;
import com.docus.server.reportmanager.service.ReportManagerService;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
@Configuration
public class CxfConfig {
@Autowired
@Qualifier("SzyReportManagerService")
private ReportManagerService reportManagerService;
/**
* ServletbeanNamedispatcherServlet
*
* @author Fang Ruichuan
* @date 2022/11/14 19:16
*/
@Bean
public ServletRegistrationBean cxfServlet() {
return new ServletRegistrationBean(new CXFServlet(), "/wzhws/*");
}
@Bean(name = Bus.DEFAULT_BUS_ID)
public SpringBus springBus() {
return new SpringBus();
}
@Bean
@Qualifier("reportEndPoint")
public Endpoint reportEndPoint() {
EndpointImpl endpoint = new EndpointImpl(springBus(), reportManagerService);
endpoint.publish("/report");
return endpoint;
}
}

@ -0,0 +1,95 @@
package com.docus.server;//package com.docus.server.clinicqualitycontrol.all;
//
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import java.util.HashMap;
import java.util.Map;
/**
* mybatis plus
*/
public class MybatisPlusGenerator {
public static void main(String[] args) {
//获得entity目录
String entity = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\entity\\";
//获取mapper目录
String mapper = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\mapper";
//获取mapper的xml目录
String mapperxml = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\resources\\mapper";
//获取模块名
//获取service目录
String service = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\facade";
//获得serviceimpl目录
String serviceImpl = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\service";
// //获得controller目录
String controller = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-controller\\src\\main\\java\\com\\docus\\services\\system\\controller";
//1,代码生成器
AutoGenerator mpg = new AutoGenerator();
// 2、全局配置
GlobalConfig gc = new GlobalConfig();
gc.setFileOverride(true); //重新生成时文件是否覆盖
//UserServie
//gc.setServiceName("%sService"); //去掉Service接口的首字母I
gc.setAuthor("jiashi"); //自定义作者
gc.setOpen(false); //生成后是否打开资源管理器
gc.setIdType(IdType.INPUT); //主键策略
gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型
gc.setSwagger2(true);//开启Swagger2模式
mpg.setGlobalConfig(gc);
//数据库配置
DataSourceConfig dataSourceConfig = new DataSourceConfig();
dataSourceConfig.setUrl("jdbc:log4jdbc:mysql://8.134.10.251:3306/docus_inspection?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai");
dataSourceConfig.setDriverName("net.sf.log4jdbc.sql.jdbcapi.DriverSpy");
dataSourceConfig.setUsername("docus");
dataSourceConfig.setPassword("docus702");
mpg.setDataSource(dataSourceConfig);
//包配置
PackageConfig pc = new PackageConfig();
//设置自定义输出目录(分布式项目使用)
Map<String, String> pathInfo = new HashMap<>();
// pathInfo.put(ConstVal.ENTITY_PATH, entity);
// pathInfo.put(ConstVal.MAPPER_PATH, mapper);
// pathInfo.put(ConstVal.XML_PATH, mapperxml);
// pathInfo.put(ConstVal.SERVICE_PATH, service);
// pathInfo.put(ConstVal.SERVICE_IMPL_PATH, serviceImpl);
pathInfo.put(ConstVal.CONTROLLER_PATH, controller);
pc.setPathInfo(pathInfo);
mpg.setPackageInfo(pc);
//设置自定义包名
pc.setParent("com.docus.services.system");
pc.setService("facade");
pc.setServiceImpl("service");
mpg.setPackageInfo(pc);
// 5、策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setInclude("inspection_status"); //要生成的表
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀
strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
strategy.setRestControllerStyle(true); //restful api风格控制器
strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符
mpg.setStrategy(strategy);
// 6、执行
mpg.execute();
//7注意的是需将service包中生成的serviceImpl中的@Service注解改成@DubboService注解
}
}

@ -0,0 +1,87 @@
package com.docus.server;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @ProjectName:
* @Description:
* @Param
* @Return
* @Author:
* @CreateDate: 2021/5/7 16:23
* @UpdateUser:
* @UpdateDate: 2021/5/7 16:23
* @UpdateRemark:
* @Version: 1.0
*/
@Configuration
public class XxlJobConfig {
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@Value("${xxl.job.admin.addresses}")
private String adminAddresses;
@Value("${xxl.job.accessToken}")
private String accessToken;
@Value("${xxl.job.executor.appname}")
private String appname;
@Value("${xxl.job.executor.address}")
private String address;
@Value("${xxl.job.executor.ip}")
private String ip;
@Value("${xxl.job.executor.port}")
private int port;
@Value("${xxl.job.executor.logpath}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Bean
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppname(appname);
xxlJobSpringExecutor.setAddress(address);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
/**
* "spring-cloud-commons" "InetUtils" IP
*
* 1
* <dependency>
* <groupId>org.springframework.cloud</groupId>
* <artifactId>spring-cloud-commons</artifactId>
* <version>${version}</version>
* </dependency>
*
* 2
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
*
* 3IP
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
*//*
*/
}

@ -0,0 +1,54 @@
package com.docus.server.reportmanager.entity;
import lombok.Data;
import java.util.Date;
@Data
public class AfCollectTask {
private Long id;
private String patientId;
private Long afArchiveDetailId;
private String sysflag;
private Date startTime;
private Date endTime;
private Long consumingTime;
private String state;
private Date syncTime;
private Date recollectTime;
private String recollectName;
private String remark;
private String pResult;
private String C1;
private String C2;
private String C3;
private String C4;
private String C5;
private String C6;
private String C7;
private String C8;
private String C9;
private String C10;
private Double N1;
private Double N2;
private Double N3;
private Double N4;
private Double N5;
private Date T1;
private Date T2;
private Date T3;
private Date T4;
private Date T5;
private Date T6;
private String C11;
private String C12;
private String C13;
private String C14;
private String C15;
private String C16;
private String C17;
private String C18;
private String C19;
private String C20;
private Date createTime;
}

@ -0,0 +1,34 @@
package com.docus.server.reportmanager.mapper;
import com.docus.server.reportmanager.entity.AfCollectTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author wyb
*/
@Mapper
public interface CollectTaskMapper {
/**
* id
*
* @param task
* @return java.util.List<java.lang.Long> id
* @date 2024/1/3 16:47
* @author YongBin Wen
*/
List<AfCollectTask> getTasks(@Param("task") AfCollectTask task);
/**
* id
*
* @param ids id
* @return int
* @date 2024/1/3 17:07
* @author YongBin Wen
*/
int cancel(@Param("ids") List<Long> ids);
}

@ -0,0 +1,34 @@
package com.docus.server.reportmanager.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author wyb
*/
@Mapper
public interface ScanAssortMapper {
/**
* id
*
* @param ids id
* @return int
* @date 2024/1/3 17:06
* @author YongBin Wen
*/
int cancel(@Param("ids") List<Long> ids);
/**
* id
*
* @param patientId
* @param taskId id
* @return java.util.List<java.lang.Long> id
* @date 2024/1/3 17:06
* @author YongBin Wen
*/
List<Long> getIdByPatientTask(@Param("patientId") String patientId, @Param("taskId") Long taskId);
}

@ -0,0 +1,21 @@
package com.docus.server.reportmanager.service;
import javax.jws.WebService;
/**
*
*
* @author YongBin Wen
* @date 2024/1/3 16:11
*/
@WebService
public interface ReportManagerService {
/**
*
*
* @param message
* @return
*/
String DeleteReport(String message);
}

@ -0,0 +1,104 @@
package com.docus.server.reportmanager.service.impl;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.infrastructure.core.utils.SpringUtil;
import com.docus.server.reportmanager.entity.AfCollectTask;
import com.docus.server.reportmanager.mapper.CollectTaskMapper;
import com.docus.server.reportmanager.mapper.ScanAssortMapper;
import com.docus.server.reportmanager.service.ReportManagerService;
import com.docus.server.reportmanager.util.XmlUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.w3c.dom.Node;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* @author YongBin Wen
* @date 2024/1/3 16:11
*/
@Service("SzyReportManagerService")
@Slf4j
public class SzyReportManagerServiceImpl implements ReportManagerService {
@Resource
private CollectTaskMapper collectTaskMapper;
@Resource
private ScanAssortMapper scanAssortMapper;
@Override
public String DeleteReport(String message) {
log.info("广东省中医报告管理,收到作废报告的信息:{}", message);
try {
XmlUtil xmlUtil = XmlUtil.of(message);
Node reportNoNode = xmlUtil.getNode("/request/REPORT_NO");
String reportNo = reportNoNode.getTextContent();
// todo 此方法暂时只做电生理 的作废,
cancelElectrophysiologyReport(reportNo);
return success();
} catch (BaseException baseException) {
log.error(baseException.getMessage(), baseException);
return error(baseException.getMessage());
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
return error("系统内部错误,请联系开发人员");
}
}
/**
* id 13
*
* @param reportNo
* @date 2024/1/3 17:19
* @author YongBin Wen
*/
private void cancelElectrophysiologyReport(String reportNo) {
final String sysFlag = "13";
AfCollectTask task = new AfCollectTask();
task.setC1(reportNo);
task.setSysflag(sysFlag);
List<AfCollectTask> tasks = collectTaskMapper.getTasks(task);
if (Func.isEmpty(tasks)) {
throw new BaseException("无纸化系统没有可作废的电生理报告:" + reportNo);
}
ArrayList<Long> taskIds = new ArrayList<>();
ArrayList<Long> scanAssortIds = new ArrayList<>();
for (AfCollectTask collectTask : tasks) {
taskIds.add(collectTask.getId());
List<Long> scanAssortIdsByTask = scanAssortMapper.getIdByPatientTask(collectTask.getPatientId(), collectTask.getId());
scanAssortIds.addAll(scanAssortIdsByTask);
}
SzyReportManagerServiceImpl service = SpringUtil.getBean(SzyReportManagerServiceImpl.class);
service.cancelReportTaskAndFile(taskIds, scanAssortIds);
}
@Transactional(rollbackFor = Exception.class)
public void cancelReportTaskAndFile(List<Long> taskIds, List<Long> scanAssortIds) {
collectTaskMapper.cancel(taskIds);
scanAssortMapper.cancel(scanAssortIds);
}
private String error(String msg) {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>1</RetCode>\n" +
" <RetCon>" + msg + "</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
private String success() {
return "<Response>\n" +
" <RetInfo>\n" +
" <RetCode>0</RetCode>\n" +
" <RetCon>成功</RetCon>\n" +
" </RetInfo>\n" +
"</Response>";
}
}

@ -0,0 +1,54 @@
package com.docus.server.reportmanager.util;
import com.docus.core.util.Func;
import java.util.HashMap;
import java.util.Map;
/**
* http
*
* @author WYBDEV
*/
public class HttpUrlUtil {
/**
* url
*
* @param url url
* @param param
* @return url
*/
public static String addUrlParam(String url, Map<String, String> param) {
if (Func.isEmpty(param)) {
return url;
}
StringBuilder urlBuilder = new StringBuilder(url);
// url已经添加过参数的标记
String addFlag = "?";
// url 参数连接符号,如果没有添加过,连接符号置为空
String connect = "&";
if (!url.contains(addFlag)) {
urlBuilder.append("?");
connect = "";
}
for (Map.Entry<String, String> entry : param.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
urlBuilder.append(connect).append(key).append("=").append(value);
// 添加过参数,连接符置为&
connect = "&";
}
return urlBuilder.toString();
}
public static void main(String[] args) {
System.out.println(addUrlParam("http://www.baidu.com", null));
System.out.println(addUrlParam("http://www.baidu.com?word=1", null));
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("en","some");
System.out.println(addUrlParam("http://www.baidu.com", stringStringHashMap));
System.out.println(addUrlParam("http://www.baidu.com?word=1", stringStringHashMap));
}
}

@ -0,0 +1,19 @@
package com.docus.server.reportmanager.util;
import lombok.Data;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
@Data
public class IdUtil {
/**
* 8-4-4-4-12 UUID
* @return 8-4-4-4-12 UUID
*/
public static String standardUUID(){
ThreadLocalRandom random = ThreadLocalRandom.current();
return (new UUID(random.nextLong(), random.nextLong())).toString();
}
}

@ -0,0 +1,68 @@
package com.docus.server.reportmanager.util;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.namespace.QName;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 使JaxWsDynamicClientFactory webservice
* @author wyb
*/
public class JaxWsDynamicClient {
private static final JaxWsDynamicClientFactory CLIENT_FACTORY = JaxWsDynamicClientFactory.newInstance();
private static final Map<String, Client> CLIENT_MAP=new ConcurrentHashMap<>();
private static final Logger logger= LoggerFactory.getLogger(JaxWsDynamicClient.class);
public static String send(String wsdlUrl,String namespaceUri,String operationName,Object[] params){
logger.debug("wsdlUrl" + wsdlUrl +" ,namespaceUri: "+namespaceUri+ " operationName" + operationName + "param:" + Arrays.toString(params));
try {
Client client = getClient(wsdlUrl);
Object[] result;
if (namespaceUri == null || namespaceUri.isEmpty()) {
result = client.invoke(operationName, params);
} else {
QName qName = new QName(namespaceUri, operationName);
result = client.invoke(qName, params);
}
if (result == null || result[0] == null) {
return null;
}
return String.valueOf(result[0]);
} catch (Exception ex) {
ex.printStackTrace();
logger.error("wsdlUrl" + wsdlUrl +",namespaceUri: "+namespaceUri+ " operationName" + operationName + "param:" + Arrays.toString(params)+" 调用失败了!", ex);
return null;
}
}
public static Client getClient(String wsdlUrl){
if(CLIENT_MAP.get(wsdlUrl)==null){
synchronized (JaxWsDynamicClient.class){
if(CLIENT_MAP.get(wsdlUrl)==null){
Client client = CLIENT_FACTORY.createClient(wsdlUrl);
setClientParam(client);
CLIENT_MAP.put(wsdlUrl,client);
}
}
}
return CLIENT_MAP.get(wsdlUrl);
}
private static void setClientParam(Client client) {
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(30000);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setReceiveTimeout(30000);
HTTPConduit clientConduit = (HTTPConduit) client.getConduit();
clientConduit.setClient(httpClientPolicy);
}
}

@ -0,0 +1,196 @@
package com.docus.server.reportmanager.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.util.StringUtils;
import java.io.*;
public class TableJsonRead {
/**
*
* @param path
* @param fileName
* @return
*/
public <T> T Read(String path,String fileName,Class<T> clazz){
String currentPath=CurrentPath();
path = currentPath+"\\"+path;
StringBuilder sb = new StringBuilder();
T dto =null;
File file = new File(path+"\\"+fileName);
try {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
BufferedReader bufferedReader = null;
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line;
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
sb.append(line);
}
if (sb.length() > 0) {
ObjectMapper objectMapper = new ObjectMapper();
//dto = (T)JSONObject.parse(sb.toString());
dto= objectMapper.readValue(sb.toString(), clazz);
//dto = objectMapper.convertValue(o, new TypeReference<T>() { });
}
bufferedReader.close();
}
return dto;
}
catch (Exception ex){
ex.printStackTrace();
return null;
}
}
public <T> T Read(File file,Class<T> clazz) {
StringBuilder sb = new StringBuilder();
T dto =null;
try {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
BufferedReader bufferedReader = null;
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line;
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
sb.append(line);
}
if (sb.length() > 0) {
ObjectMapper objectMapper = new ObjectMapper();
//dto = (T)JSONObject.parse(sb.toString());
dto= objectMapper.readValue(sb.toString(), clazz);
//dto = objectMapper.convertValue(o, new TypeReference<T>() { });
}
bufferedReader.close();
}
return dto;
}
catch (Exception ex){
ex.printStackTrace();
return null;
}
}
/**
* jar
* @return
*/
public static String CurrentPath(){
File dir = new File(".");
String currentpath ="";
try {
currentpath = dir.getCanonicalPath();
} catch (IOException e) {
e.printStackTrace();
}
return currentpath;
}
/**
* jar
* @return
*/
public static String currentPath(String dir){
String path = CurrentPath() + File.separator + dir;
File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
return path;
}
/**
*
* @param path
* @param fileName
* @return
*/
public String ReadContent(String path,String fileName){
String currentPath=CurrentPath();
path = currentPath+"\\"+path;
StringBuilder sb = new StringBuilder();
File file = new File(path+"\\"+fileName);
try {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
BufferedReader bufferedReader = null;
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line;
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
sb.append(line);
}
bufferedReader.close();
}
return sb.toString();
}
catch (Exception ex){
ex.printStackTrace();
return null;
}
}
/**
* json
* @param path
* @param fileName
* @param data json
* @return
*/
public void Save(String path,String fileName,String data){
String currentPath=CurrentPath();
path = currentPath+"\\"+path;
FileWriter fwriter = null;
try {
File file = new File(path);
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
fwriter = new FileWriter(path+"\\"+fileName);
fwriter.write(data);
} catch (IOException ex) {
ex.printStackTrace();
} finally {
try {
fwriter.flush();
fwriter.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
}

@ -0,0 +1,315 @@
/*
* Copyright (c) 2018-2028, DreamLu All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: DreamLu (596392912@qq.com)
*/
package com.docus.server.reportmanager.util;
import com.docus.core.util.Exceptions;
import com.docus.core.util.IoUtil;
import com.docus.core.util.StringUtil;
import org.springframework.lang.Nullable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
/**
* xpathxml
*
* <pre>
*
* http://www.w3school.com.cn/xpath/index.asp
* </pre>
*
* @author L.cm
*/
public class XmlUtil {
private final XPath path;
private final Document doc;
private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = getDocumentBuilderFactory();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(inputSource);
path = getXPathFactory().newXPath();
}
/**
*
*
* @param inputSource inputSource
* @return XmlUtil
*/
private static XmlUtil create(InputSource inputSource) {
try {
return new XmlUtil(inputSource);
} catch (ParserConfigurationException | SAXException | IOException e) {
throw Exceptions.unchecked(e);
}
}
/**
*
*
* @param inputStream inputStream
* @return XmlUtil
*/
public static XmlUtil of(InputStream inputStream) {
InputSource inputSource = new InputSource(inputStream);
return create(inputSource);
}
/**
* xml
*/
public static String specialCharacterSubstitution(String str){
str = StringUtil.replace(str, "\u00A0", " ");
return str;
}
/**
*
*
* @param xmlStr xmlStr
* @return XmlUtil
*/
public static XmlUtil of(String xmlStr) {
xmlStr=specialCharacterSubstitution(xmlStr);
StringReader sr = new StringReader(xmlStr.trim());
InputSource inputSource = new InputSource(sr);
XmlUtil xmlUtil = create(inputSource);
IoUtil.closeQuietly(sr);
return xmlUtil;
}
/**
*
*
* @param expression
* @param item
* @param returnType
* @return Object
*/
private Object evalXPath(String expression, @Nullable Object item, QName returnType) {
item = null == item ? doc : item;
try {
return path.evaluate(expression, item, returnType);
} catch (XPathExpressionException e) {
throw Exceptions.unchecked(e);
}
}
/**
* String
*
* @param expression
* @return {String}
*/
public String getString(String expression) {
return (String) evalXPath(expression, null, XPathConstants.STRING);
}
/**
* Boolean
*
* @param expression
* @return {String}
*/
public Boolean getBoolean(String expression) {
return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN);
}
/**
* Number
*
* @param expression
* @return {Number}
*/
public Number getNumber(String expression) {
return (Number) evalXPath(expression, null, XPathConstants.NUMBER);
}
/**
*
*
* @param expression
* @return {Node}
*/
public Node getNode(String expression) {
return (Node) evalXPath(expression, null, XPathConstants.NODE);
}
/**
*
*
* @param expression
* @return NodeList
*/
public NodeList getNodeList(String expression) {
return (NodeList) evalXPath(expression, null, XPathConstants.NODESET);
}
/**
* String
*
* @param node
* @param expression node
* @return {String}
*/
public String getString(Object node, String expression) {
return (String) evalXPath(expression, node, XPathConstants.STRING);
}
/**
*
*
* @param node
* @param expression node
* @return {String}
*/
public Boolean getBoolean(Object node, String expression) {
return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN);
}
/**
*
*
* @param node
* @param expression node
* @return {Number}
*/
public Number getNumber(Object node, String expression) {
return (Number) evalXPath(expression, node, XPathConstants.NUMBER);
}
/**
*
*
* @param node
* @param expression
* @return {Node}
*/
public Node getNode(Object node, String expression) {
return (Node) evalXPath(expression, node, XPathConstants.NODE);
}
/**
*
*
* @param node
* @param expression node
* @return NodeList
*/
public NodeList getNodeList(Object node, String expression) {
return (NodeList) evalXPath(expression, node, XPathConstants.NODESET);
}
/**
*
*
* @return map
*/
public Map<String, String> toMap() {
Element root = doc.getDocumentElement();
Map<String, String> params = new HashMap<>(16);
// 将节点封装成map形式
NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
if (node instanceof Element) {
params.put(node.getNodeName(), node.getTextContent());
}
}
return params;
}
private static volatile boolean preventedXXE = false;
private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException {
DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory;
if (!preventedXXE) {
synchronized (XmlUtil.class) {
if (!preventedXXE) {
preventXXE(dbf);
}
}
}
return dbf;
}
/**
* preventXXE
*
* @param dbf
* @throws ParserConfigurationException
*/
private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException {
// This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented
// Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
// If you can't completely disable DTDs, then at least do the following:
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities
// JDK7+ - http://xml.org/sax/features/external-general-entities
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities
// JDK7+ - http://xml.org/sax/features/external-parameter-entities
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
// Disable external DTDs as well
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
// and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks"
dbf.setXIncludeAware(false);
dbf.setExpandEntityReferences(false);
preventedXXE = true;
}
private static XPathFactory getXPathFactory() {
return XmlHelperHolder.xPathFactory;
}
/**
*
*/
private static class XmlHelperHolder {
private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
private static XPathFactory xPathFactory = XPathFactory.newInstance();
}
}

@ -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-report-manager
if %deployDir%=="" set deployDir=d:\webroot\docus-report-manager
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-report-manager</id>
<name>生产-嘉时-报告管理服务</name>
<description>生产-嘉时-报告管理服务</description>
<startmode>Automatic</startmode>
<executable>%BASE%\start.bat</executable>
<log mode="none"></log>
</service>

@ -0,0 +1,77 @@
server:
port: 9444
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_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
redis:
host: redis.docus.cn
password: JSdocus@702
cloud:
nacos:
discovery:
server-addr: nacos.docus.cn
namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5
file-extension: yml
shared-configs:
- comm.${spring.cloud.nacos.config.file-extension}
docus:
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
xxl:
job:
accessToken:
admin:
addresses: http://job.docus.cn:8180/xxl-job-admin
executor:
appname: docus-report-manager
address:
ip:
port: 19444
logretentiondays: 30
logpath: D:/xxl-job/docus-report-manager

@ -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-report-manager</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>60</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,33 @@
<?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.reportmanager.mapper.CollectTaskMapper">
<update id="cancel">
UPDATE `docus_archivefile`.`af_collect_task`
SET `state` = '4'
WHERE `id` in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<select id="getTasks" resultType="com.docus.server.reportmanager.entity.AfCollectTask">
SELECT
id,
patient_id as patientId
FROM
`docus_archivefile`.`af_collect_task`
<where>
<if test="task.sysflag !=null and task.sysflag != ''">
and sysflag=#{task.sysflag}
</if>
<if test="task.patient_id !=null and task.patient_id != ''">
and patient_id=#{task.patientId}
</if>
<if test="task.C1 !=null and task.C1 != ''">
and C1=#{task.C1}
</if>
</where>
</select>
</mapper>

@ -0,0 +1,21 @@
<?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.reportmanager.mapper.ScanAssortMapper">
<update id="cancel">
UPDATE `docus_archivefile`.`t_scan_assort`
SET `is_del` = 1
WHERE `id` in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<select id="getIdByPatientTask" resultType="java.lang.Long">
select id
from `docus_archivefile`.`t_scan_assort`
where patient_id = #{patientId}
and task_id = #{taskId}
</select>
</mapper>

Binary file not shown.
Loading…
Cancel
Save