commit 4e31ac1edefac2afa0a4d80811c400c21ffe9d04 Author: wyb <1977763549@qq.com> Date: Mon Mar 6 09:31:50 2023 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a8a1e4 --- /dev/null +++ b/.gitignore @@ -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* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cc485f --- /dev/null +++ b/README.md @@ -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 实现类 +``` + + +这个是一个模板,需要启动新项目的,复制一份,并且修改 项目名称以及修改docus-demo 跟项目名称一致即可启动。 diff --git a/assembly.xml b/assembly.xml new file mode 100644 index 0000000..b6fb827 --- /dev/null +++ b/assembly.xml @@ -0,0 +1,73 @@ + + + exe + + dir + + false + + + + + /lib + ${basedir}/target/lib + + + + /config + ${basedir}/target/resources + 0755 + + *.xml + *.yml + *.properties + + + + + /dataConfig + ${basedir}/target/dataConfig + 0755 + + *.json + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.bat + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.xml + + + + + / + ${basedir} + 0755 + + *.exe + + + + + ${basedir}/target + / + 0755 + + ${project.build.finalName}.jar + + + + \ No newline at end of file diff --git a/data-config/js-report-config.xml b/data-config/js-report-config.xml new file mode 100644 index 0000000..d74c2a3 --- /dev/null +++ b/data-config/js-report-config.xml @@ -0,0 +1,25 @@ + + + + /Request/Msg/INHOSP_INDEX_NO + + /Request/Msg/INHOSP_NO + + /Request/Msg/INHOSP_NUM + + /Request/Msg/UNIQUE_FILE + + /Request/Msg/FILE_NAME + + /Request/Msg/PDF_PATH + + /Request/Msg/TABLE_TYPE + + + + /Request/Msg/TABLE_TYPE + + + + + \ No newline at end of file diff --git a/data-config/js-table-type.json b/data-config/js-table-type.json new file mode 100644 index 0000000..3a7fd45 --- /dev/null +++ b/data-config/js-table-type.json @@ -0,0 +1,5 @@ +{ + "icu": "重症文件分段id", + "sa": "手麻文件分段id", + "other": "其他文件分段id" +} \ No newline at end of file diff --git a/data-config/js-webservice-template-request.xml b/data-config/js-webservice-template-request.xml new file mode 100644 index 0000000..0d32ef2 --- /dev/null +++ b/data-config/js-webservice-template-request.xml @@ -0,0 +1,25 @@ + + + + + 123456 + + 012345 + + 012345 + + 2 + + icu + + 20220303111800 + + 20220303111801 + + http://192.168.1.108:9012/file/0123_01.pdf + + 0123_01 + + AESHASHMD5DEFIND + + diff --git a/data-config/js-webservice-template-response.xml b/data-config/js-webservice-template-response.xml new file mode 100644 index 0000000..8ceb826 --- /dev/null +++ b/data-config/js-webservice-template-response.xml @@ -0,0 +1,11 @@ + + + + + 0 + + 123456 + + 成功! + + \ No newline at end of file diff --git a/data-config/sdry-report-config.xml b/data-config/sdry-report-config.xml new file mode 100644 index 0000000..d74c2a3 --- /dev/null +++ b/data-config/sdry-report-config.xml @@ -0,0 +1,25 @@ + + + + /Request/Msg/INHOSP_INDEX_NO + + /Request/Msg/INHOSP_NO + + /Request/Msg/INHOSP_NUM + + /Request/Msg/UNIQUE_FILE + + /Request/Msg/FILE_NAME + + /Request/Msg/PDF_PATH + + /Request/Msg/TABLE_TYPE + + + + /Request/Msg/TABLE_TYPE + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..3737721 --- /dev/null +++ b/pom.xml @@ -0,0 +1,334 @@ + + + + com.docus + docus-bom + 1.0-SNAPSHOT + + 4.0.0 + + docus-webservice-report + + + + org.apache.cxf + cxf-spring-boot-starter-jaxws + 3.3.4 + + + + org.dom4j + dom4j + 2.1.1 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + checker-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + + + org.springframework.boot + spring-boot-starter-web + + + com.docus + docus-mybatisplus-starter + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + HdrHistogram + org.hdrhistogram + + + jsr305 + com.google.code.findbugs + + + + + mysql + mysql-connector-java + 8.0.28 + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + + + com.alibaba + druid + 1.2.4 + compile + + + com.baomidou + mybatis-plus-generator + 3.4.1 + compile + + + org.apache.velocity + velocity-engine-core + 2.0 + + + com.xuxueli + xxl-job-core + + + com.docus + docus-base-starter + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-tool-starter + + + + com.docus + docus-shiro-starter + + + + com.docus + docus-base-starter + + + springfox-core + io.springfox + + + springfox-schema + io.springfox + + + springfox-spi + io.springfox + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + junit + junit + test + + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.4 + + ZIP + + + non-exists + non-exists + + + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + target/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + **/*.* + + + + ${project.build.directory}/resources + + + + copy-bin + package + + copy-resources + + + + + src/main/resources + true + + bin/*.xml + *.yml + + + + ${project.build.directory}/resources + + + + copy-data-config + package + + copy-resources + + + + + ../../dataConfig + true + + + ${project.build.directory}/dataConfig + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.yml + + + + + + maven-assembly-plugin + + + + ${project.artifactId} + false + + assembly.xml + + + make-assembly + package + + single + + + + + + + + + + + dev + + prod + + + true + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java new file mode 100644 index 0000000..2381b40 --- /dev/null +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -0,0 +1,19 @@ +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; + + +@Slf4j +@SpringBootApplication(scanBasePackages ={"com.docus"}) +@MapperScan("com.docus.server.**.mapper") +public class AppRunBootstrap { + public static void main(String[] args) { + System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(AppRunBootstrap.class,args); + } +} diff --git a/src/main/java/com/docus/server/CxfConfig.java b/src/main/java/com/docus/server/CxfConfig.java new file mode 100644 index 0000000..8cdabde --- /dev/null +++ b/src/main/java/com/docus/server/CxfConfig.java @@ -0,0 +1,43 @@ +package com.docus.server; + +import com.docus.server.report.webservice.IReportServer; +import org.apache.cxf.jaxws.EndpointImpl; +import lombok.RequiredArgsConstructor; +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 org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBus; +import org.apache.cxf.transport.servlet.CXFServlet; + +import javax.xml.ws.Endpoint; + +@Configuration +@RequiredArgsConstructor +public class CxfConfig { + private final IReportServer reportServer; + + /** + * 注入Servlet,注意beanName不能为dispatcherServlet + * @author Fang Ruichuan + * @date 2022/11/14 19:16 + */ + @Bean + public ServletRegistrationBean cxfServlet() { + return new ServletRegistrationBean(new CXFServlet(), "/webservice/*"); + } + + @Bean(name = Bus.DEFAULT_BUS_ID) + public SpringBus springBus() { + return new SpringBus(); + } + + @Bean + @Qualifier("reportEndPoint") + public Endpoint userEndPoint() { + EndpointImpl endpoint = new EndpointImpl(springBus(), reportServer); + endpoint.publish("/api/report"); + return endpoint; + } +} diff --git a/src/main/java/com/docus/server/MybatisPlusGenerator.java b/src/main/java/com/docus/server/MybatisPlusGenerator.java new file mode 100644 index 0000000..d3fe0b5 --- /dev/null +++ b/src/main/java/com/docus/server/MybatisPlusGenerator.java @@ -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 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注解 + } +} diff --git a/src/main/java/com/docus/server/XxlJobConfig.java b/src/main/java/com/docus/server/XxlJobConfig.java new file mode 100644 index 0000000..d9edbfa --- /dev/null +++ b/src/main/java/com/docus/server/XxlJobConfig.java @@ -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、引入依赖: + * + * org.springframework.cloud + * spring-cloud-commons + * ${version} + * + * + * 2、配置文件,或者容器启动变量 + * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' + * + * 3、获取IP + * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + *//* + +*/ +} diff --git a/src/main/java/com/docus/server/report/config/ApplicationBusinessConfig.java b/src/main/java/com/docus/server/report/config/ApplicationBusinessConfig.java new file mode 100644 index 0000000..b359004 --- /dev/null +++ b/src/main/java/com/docus/server/report/config/ApplicationBusinessConfig.java @@ -0,0 +1,12 @@ +package com.docus.server.report.config; + +import org.springframework.beans.factory.annotation.Value; + +/** + * 应用业务配置 + * @author wyb + */ +public class ApplicationBusinessConfig { + @Value("${docus.report.downurl:}") + private String downUrl; +} diff --git a/src/main/java/com/docus/server/report/dto/ReportDownDto.java b/src/main/java/com/docus/server/report/dto/ReportDownDto.java new file mode 100644 index 0000000..938d506 --- /dev/null +++ b/src/main/java/com/docus/server/report/dto/ReportDownDto.java @@ -0,0 +1,24 @@ +package com.docus.server.report.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class ReportDownDto { + @ApiModelProperty(value = "采集器id") + private String collectorid; + + @ApiModelProperty(value = "采集器ip") + private String ip; + + @ApiModelProperty(value = "文件信息") + private List scanfiles; + + private ReportDownPatientDto patient; + + @ApiModelProperty(value = "分类id") + private String assortid; + +} diff --git a/src/main/java/com/docus/server/report/dto/ReportDownPatientDto.java b/src/main/java/com/docus/server/report/dto/ReportDownPatientDto.java new file mode 100644 index 0000000..0bac9e4 --- /dev/null +++ b/src/main/java/com/docus/server/report/dto/ReportDownPatientDto.java @@ -0,0 +1,10 @@ +package com.docus.server.report.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class ReportDownPatientDto { + @ApiModelProperty(value = "记帐号") + private String jzh; +} diff --git a/src/main/java/com/docus/server/report/dto/ReportDownScanFileDto.java b/src/main/java/com/docus/server/report/dto/ReportDownScanFileDto.java new file mode 100644 index 0000000..ec5682a --- /dev/null +++ b/src/main/java/com/docus/server/report/dto/ReportDownScanFileDto.java @@ -0,0 +1,24 @@ +package com.docus.server.report.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class ReportDownScanFileDto { + @ApiModelProperty(value = "文件标题") + private String filetitle; + @ApiModelProperty(value = "采集类型(文件来源 1:采集器;2:扫描生产软件)") + private int filesource; + @ApiModelProperty(value = "下载类型(1:服务器本地;2:ftp服务器;3:共享文件夹)") + private int filestoragetype; + @ApiModelProperty(value = "下载地址") + private String downurl; + @ApiModelProperty(value = "档案信息") + private String recordid; + @ApiModelProperty("采集流水号") + private String serialnum; + @ApiModelProperty(value = "任务id") + private Long taskid; + @ApiModelProperty("文件类型(1:url,2:base64)") + private Integer filetype = 1; +} diff --git a/src/main/java/com/docus/server/report/dto/ReportDto.java b/src/main/java/com/docus/server/report/dto/ReportDto.java new file mode 100644 index 0000000..0cf01d3 --- /dev/null +++ b/src/main/java/com/docus/server/report/dto/ReportDto.java @@ -0,0 +1,58 @@ +package com.docus.server.report.dto; + +import lombok.Data; + +/** + * 报告推送信息 + */ +@Data +public class ReportDto { + /** + * 住院号 + */ + private String inpatientNo; + /** + * 记账号/住院流水号 + */ + private String jzh; + /** + * 住院次数 + */ + private Integer admisstimes; + /** + * 采集来源系统 + */ + private String sysFlag; + /** + * 下载地址 + */ + private String downUrl; + /** + * 文件名 + */ + private String fileTitle; + /** + * 采集流水号/文件唯一id + */ + private String serialnum; + + /** + * 文件分类id + */ + private String assortId; + + /** + * 采集类型(文件来源 1:采集器;2:扫描生产软件) + */ + private String fileSource; + + /** + * 文件保存位置类型 1:服务器本地;2:ftp服务器;3:共享文件夹 + */ + private String filestoragetype; + + /** + * 下载对应任务id + */ + private Long taskId; +} diff --git a/src/main/java/com/docus/server/report/entity/AfCollectTask.java b/src/main/java/com/docus/server/report/entity/AfCollectTask.java new file mode 100644 index 0000000..a64d76e --- /dev/null +++ b/src/main/java/com/docus/server/report/entity/AfCollectTask.java @@ -0,0 +1,81 @@ +package com.docus.server.report.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案采集任务 + *

+ * + * @author 曾文和 + * @since 2021-05-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "AfCollectTask对象", description = "病案采集任务") +public class AfCollectTask implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "id 主键") + @TableId(value = "id", type = IdType.INPUT) + private Long id; + + @ApiModelProperty(value = "病案主键") + private String patientId; + + + + @ApiModelProperty(value = "来源 1护理文书,2 电子病历,3 Pacs检查,4心电图,5手麻系统,6 Lis检验,7病案首页,8长临医嘱") + private String sysflag; + + @ApiModelProperty(value = "开始时间") + private Date startTime; + + @ApiModelProperty(value = "结束时间") + private Date endTime; + + @ApiModelProperty(value = "任务耗时(毫秒)") + private Long consumingTime; + + @ApiModelProperty(value = "-1 等待采集,0:未开始,1:正在采集,2:采集错误,3采集完成") + private String state; + + @ApiModelProperty(value = "同步时间") + private Date syncTime; + + @ApiModelProperty(value = "最新重新采集时间") + private Date recollectTime; + + @ApiModelProperty(value = "最新重新采集人") + private String recollectName; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "报告唯一单号") + private String C1; + + @ApiModelProperty(value = "c2") + private String C2; + + @ApiModelProperty(value = "记账号") + private String C3; + + @ApiModelProperty(value = "c4") + private String C4; + + @ApiModelProperty(value = "c6") + private String C6; + + @ApiModelProperty(value = "c9") + private String C9; +} diff --git a/src/main/java/com/docus/server/report/entity/TBasic.java b/src/main/java/com/docus/server/report/entity/TBasic.java new file mode 100644 index 0000000..42e40e4 --- /dev/null +++ b/src/main/java/com/docus/server/report/entity/TBasic.java @@ -0,0 +1,158 @@ +package com.docus.server.report.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @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 = "病案主键") + @TableId(value = "patient_id", type = IdType.ASSIGN_ID) + 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 = "是否作废(0:否,1:是)") + 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; + + +} diff --git a/src/main/java/com/docus/server/report/event/ReportDownEvent.java b/src/main/java/com/docus/server/report/event/ReportDownEvent.java new file mode 100644 index 0000000..0448259 --- /dev/null +++ b/src/main/java/com/docus/server/report/event/ReportDownEvent.java @@ -0,0 +1,19 @@ +package com.docus.server.report.event; + +import com.docus.server.report.dto.ReportDto; +import lombok.Getter; +import org.springframework.context.ApplicationEvent; + +/** + * 下载触发 + * @author wyb + */ +@Getter +public class ReportDownEvent extends ApplicationEvent { + private final ReportDto reportDto; + + public ReportDownEvent(ReportDto reportDto) { + super(reportDto); + this.reportDto = reportDto; + } +} diff --git a/src/main/java/com/docus/server/report/listener/ReportDownListener.java b/src/main/java/com/docus/server/report/listener/ReportDownListener.java new file mode 100644 index 0000000..8ad13b5 --- /dev/null +++ b/src/main/java/com/docus/server/report/listener/ReportDownListener.java @@ -0,0 +1,19 @@ +package com.docus.server.report.listener; + +import com.docus.server.report.event.ReportDownEvent; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +/** + * 上报下载监听 + * @author wyb + */ +@Component +public class ReportDownListener { + @EventListener + @Async + public void reportDown(ReportDownEvent reportDownEvent){ + + } +} diff --git a/src/main/java/com/docus/server/report/mapper/AfCollectTaskMapper.java b/src/main/java/com/docus/server/report/mapper/AfCollectTaskMapper.java new file mode 100644 index 0000000..8922c04 --- /dev/null +++ b/src/main/java/com/docus/server/report/mapper/AfCollectTaskMapper.java @@ -0,0 +1,11 @@ +package com.docus.server.report.mapper; + +/** + * 任务采集表mapper + * @author wyb + * + */ +public interface AfCollectTaskMapper { + + +} diff --git a/src/main/java/com/docus/server/report/mapper/TBasicMapper.java b/src/main/java/com/docus/server/report/mapper/TBasicMapper.java new file mode 100644 index 0000000..e0512ff --- /dev/null +++ b/src/main/java/com/docus/server/report/mapper/TBasicMapper.java @@ -0,0 +1,17 @@ +package com.docus.server.report.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.server.report.entity.TBasic; + +/** + *

+ * 病案基本信息 Mapper 接口 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +public interface TBasicMapper{ + +} diff --git a/src/main/java/com/docus/server/report/service/ReportService.java b/src/main/java/com/docus/server/report/service/ReportService.java new file mode 100644 index 0000000..7e91eb5 --- /dev/null +++ b/src/main/java/com/docus/server/report/service/ReportService.java @@ -0,0 +1,16 @@ +package com.docus.server.report.service; + +import com.docus.server.report.dto.ReportDto; + +/** + * 报告服务 + * @author wyb + */ +public interface ReportService { + + /** + * 上报文件 + * @param reportDto 上报文件参数 + */ + void report(ReportDto reportDto); +} diff --git a/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java b/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java new file mode 100644 index 0000000..bfe91ab --- /dev/null +++ b/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java @@ -0,0 +1,28 @@ +package com.docus.server.report.service.impl; + +import com.docus.server.report.dto.ReportDto; +import com.docus.server.report.event.ReportDownEvent; +import com.docus.server.report.service.ReportService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; +import org.springframework.stereotype.Service; + +/** + * 报告服务实现类 + * @author wyb + */ +@Slf4j +@Service +public class ReportServiceImpl implements ReportService { + + @Autowired + private ApplicationContext applicationContext; + + @Override + public void report(ReportDto reportDto) { + + applicationContext.publishEvent(new ReportDownEvent(reportDto)); + } +} diff --git a/src/main/java/com/docus/server/report/util/IdUtil.java b/src/main/java/com/docus/server/report/util/IdUtil.java new file mode 100644 index 0000000..57781ca --- /dev/null +++ b/src/main/java/com/docus/server/report/util/IdUtil.java @@ -0,0 +1,19 @@ +package com.docus.server.report.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(); + } + +} diff --git a/src/main/java/com/docus/server/report/util/JSXMLResult.java b/src/main/java/com/docus/server/report/util/JSXMLResult.java new file mode 100644 index 0000000..7c80654 --- /dev/null +++ b/src/main/java/com/docus/server/report/util/JSXMLResult.java @@ -0,0 +1,41 @@ +package com.docus.server.report.util; + +import lombok.Data; + +/** + * 嘉时软件自定义 成功/失败消息 XML 格式 + * @author wyb + */ +@Data +public class JSXMLResult { + + private static final String SUCCESS_TEMPLATE="" + + "" + + "0" + + "%s" + + "成功!" + + "" + + ""; + + private static final String FAILED_TEMPLATE="" + + "" + + "500" + + "%s" + + "%s" + + "" + + ""; + + public static String success(String msgId){ + return String.format(SUCCESS_TEMPLATE,msgId); + } + + public static String failed(String msgId,String message){ + return String.format(FAILED_TEMPLATE,msgId,message); + } + + public static void main(String[] args) { + System.out.println(success("100")); + System.out.println(failed("100","随便输出了")); + } + +} diff --git a/src/main/java/com/docus/server/report/util/TableJsonRead.java b/src/main/java/com/docus/server/report/util/TableJsonRead.java new file mode 100644 index 0000000..83270f6 --- /dev/null +++ b/src/main/java/com/docus/server/report/util/TableJsonRead.java @@ -0,0 +1,180 @@ +package com.docus.server.report.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 Read(String path,String fileName,Class 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() { }); + } + bufferedReader.close(); + } + + return dto; + } + catch (Exception ex){ + ex.printStackTrace(); + return null; + } + } + + public T Read(File file,Class 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() { }); + } + bufferedReader.close(); + } + + return dto; + } + catch (Exception ex){ + ex.printStackTrace(); + return null; + } + } + /** + * 取得当前jar路径 + * @return + */ + private String CurrentPath(){ + File dir = new File("."); + String currentpath =""; + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException e) { + e.printStackTrace(); + } + return currentpath; + } + + /** + * 读取文件内容 + * @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(); + } + } + } + +} diff --git a/src/main/java/com/docus/server/report/util/XmlUtil.java b/src/main/java/com/docus/server/report/util/XmlUtil.java new file mode 100644 index 0000000..e199e2e --- /dev/null +++ b/src/main/java/com/docus/server/report/util/XmlUtil.java @@ -0,0 +1,850 @@ +/* + * 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.report.util; + +import com.docus.core.util.Exceptions; +import com.docus.core.util.IoUtil; +import org.springframework.lang.Nullable; +import org.w3c.dom.*; +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; + +/** + * xpath解析xml + * + *
+ *     文档地址:
+ *     http://www.w3school.com.cn/xpath/index.asp
+ * 
+ * + * @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); + } + + /** + * 转换工具类 + * + * @param xmlStr xmlStr + * @return XmlUtil + */ + public static XmlUtil of(String 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 toMap() { + Element root = doc.getDocumentElement(); + Map 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) { + 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(); + } + private static String str; + static { + str=" \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 59 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 205室 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 2号楼16楼西区 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 南方医科大学顺德医院 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 常规 \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 张存良 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 耳鼻咽喉头颈外科 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 突发特发性听觉丧失 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 文本 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 乳房病类 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 治愈 \n" + + " \n" + + " O \n" + + " \n" + + " 0 \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " 01 \n" + + " \n" + + " 出院医嘱 \n" + + " \n" + + "
\n"; + } + + public static void main(String[] args) { + XmlUtil a=XmlUtil.of(str); + Node node=null; + //id-消息流水号 + node = a.getNode("/PRPA_HIP0032/id/@extension"); + String serialId = node.toString(); + System.out.println(serialId); + //住院流水号 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension"); + String jzh = node.toString(); + System.out.println(jzh); + //住院号标识 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension"); + String inpatientNo = node.toString(); + System.out.println(inpatientNo); + //住院次数[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value"); + String admissTimes=node.toString(); + System.out.println(admissTimes); + //姓名 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value"); + String name = node.toString(); + System.out.println(name); + //入院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value"); + String admissDate = node.toString(); + System.out.println(admissDate); + //出院日期时间 + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value"); + String disDate = node.toString(); + System.out.println(disDate); + //入院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String admissDeptName = node.getTextContent(); + System.out.println(admissDeptName); + //出院诊断科室名称[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name"); + String disDeptName = node.getTextContent(); + System.out.println(disDeptName); + //主治医师[] + node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name"); + String attendingName = node.getTextContent(); + System.out.println(attendingName); + } +} diff --git a/src/main/java/com/docus/server/report/webservice/IReportServer.java b/src/main/java/com/docus/server/report/webservice/IReportServer.java new file mode 100644 index 0000000..853f9ee --- /dev/null +++ b/src/main/java/com/docus/server/report/webservice/IReportServer.java @@ -0,0 +1,39 @@ +package com.docus.server.report.webservice; + +import javax.jws.WebMethod; +import javax.jws.WebService; + +/** + * @author Fang Ruichuan + * @date 2022-11-14 19:03 + */ +@WebService +public interface IReportServer { + /** + * 接收手麻报告信息 + * @param saReportMessage 手麻报告信息 + * @return 返回信息 + */ + String pushSAReport(String saReportMessage); + + /** + * 接收重症报告信息 + * @param icuReportMessage 重症报告信息 + * @return 返回信息 + */ + String pushICUReport(String icuReportMessage); + + /** + * 接收检查检验报告的信息 - 新增 + * @param inspectionReportMessage 检查检验报告信息 - 新增 + * @return 成功或者异常信息 + */ + String pushAddInspectionReport(String inspectionReportMessage); + + /** + * 接收检查检验报告的信息 - 更新 + * @param inspectionReportMessage 检查检验报告信息 -更新 + * @return 成功或者异常信息 + */ + String pushUpdateInspectionReport(String inspectionReportMessage); +} diff --git a/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java new file mode 100644 index 0000000..8477272 --- /dev/null +++ b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java @@ -0,0 +1,237 @@ +package com.docus.server.report.webservice.impl; + +import com.alibaba.fastjson.JSONObject; +import com.docus.core.util.Func; +import com.docus.infrastructure.core.exception.BaseException; +import com.docus.server.report.dto.ReportDto; +import com.docus.server.report.service.ReportService; +import com.docus.server.report.util.JSXMLResult; +import com.docus.server.report.util.TableJsonRead; +import com.docus.server.report.util.XmlUtil; +import com.docus.server.report.webservice.IReportServer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +/** + * @author wyb + * @date 2023年3月3日13:42:36 + */ +@Service +@Slf4j +public class SdryReportServerImpl implements IReportServer { + + @Autowired + private ReportService reportService; + + @Override + public String pushSAReport(String saReportMessage) { + // 待做 + log.info("收到手麻消息:{}", saReportMessage); + String msgId = ""; + try { + XmlUtil xmlUtil = XmlUtil.of(saReportMessage); + Node msgNode = xmlUtil.getNode("/Request/Msg/ID"); + msgId = msgNode.getTextContent(); + ReportDto reportDto = getReportDtoByJSXML(xmlUtil); + reportService.report(reportDto); + return JSXMLResult.success(msgId); + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + return JSXMLResult.failed(msgId, baseException.getMessage()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + return JSXMLResult.failed(msgId, "系统故障!"); + } + } + + public static void main(String[] args) { + TableJsonRead jsonRead = new TableJsonRead(); + JSONObject jsonObject = jsonRead.Read("data-config", "js-table-type.json", JSONObject.class); + String jsReportConfigXml = jsonRead.ReadContent("data-config", "js-report-config.xml"); + XmlUtil of = XmlUtil.of(jsReportConfigXml); + Node node = of.getNode("/REPORT/ASSORT_ID"); + System.out.println(node.getTextContent()); + System.out.println(node.getNodeValue()); + NamedNodeMap attributes = node.getAttributes(); + System.out.println(attributes.getNamedItem("value").getNodeValue()); + + } + + /** + * 嘉时自定义接收接口使用,从xml工具读取返回文件上报需要的数据 + * + * @param xmlUtil xml消息工具封装 + * @return 文件上报数据 + */ + public ReportDto getReportDtoByJSXML(XmlUtil xmlUtil) { + TableJsonRead jsonRead = new TableJsonRead(); + JSONObject tableTypeJson = jsonRead.Read("data-config", "js-table-type.json", JSONObject.class); + String jsReportConfigXml = jsonRead.ReadContent("data-config", "js-report-config.xml"); + XmlUtil configXmlUtil = XmlUtil.of(jsReportConfigXml); + + Node inpatientNoXPathNode = configXmlUtil.getNode("/REPORT/INPATIENT_NO"); + String inpatientNoXPath = inpatientNoXPathNode.getTextContent(); + Node inpatientNoNode = xmlUtil.getNode(inpatientNoXPath); + String inpatientNo = inpatientNoNode.getTextContent(); + + Node jzhXPathNode = configXmlUtil.getNode("/REPORT/JZH"); + String jzhXPath = jzhXPathNode.getTextContent(); + Node jzhNode = xmlUtil.getNode(jzhXPath); + String jzh = jzhNode.getTextContent(); + + Node admissTimesXPathNode = configXmlUtil.getNode("/REPORT/ADMISS_TIMES"); + String admissTimesXPath = admissTimesXPathNode.getTextContent(); + Node admissTimesNode = xmlUtil.getNode(admissTimesXPath); + Integer admissTimes = Integer.valueOf(admissTimesNode.getTextContent()); + + Node serialnumXPathNode = configXmlUtil.getNode("/REPORT/SERIALNUM"); + String serialnumXPath = serialnumXPathNode.getTextContent(); + Node serialnumNode = xmlUtil.getNode(serialnumXPath); + String serialnum = serialnumNode.getTextContent(); + + Node fileTitleXPathNode = configXmlUtil.getNode("/REPORT/FILE_TITLE"); + String fileTitleXPath = fileTitleXPathNode.getTextContent(); + Node fileTitleNode = xmlUtil.getNode(fileTitleXPath); + String fileTitle = fileTitleNode.getTextContent(); + + Node downUrlXPathNode = configXmlUtil.getNode("/REPORT/DOWNURL"); + String downUrlXPath = downUrlXPathNode.getTextContent(); + Node downUrlNode = xmlUtil.getNode(downUrlXPath); + String downUrl = downUrlNode.getTextContent(); + + Node tableTypeXPathNode = configXmlUtil.getNode("/REPORT/TABLE_TYPE"); + String tableTypeXPath = tableTypeXPathNode.getTextContent(); + Node tableTypeNode = xmlUtil.getNode(tableTypeXPath); + String tableType = tableTypeNode.getTextContent(); + + + Node assortIdXPathNode = configXmlUtil.getNode("/REPORT/ASSORT_ID"); + String assortIdXPath = assortIdXPathNode.getTextContent(); + String assortId; + if (Func.isBlank(assortIdXPath)) { + // 如果没有配置 取value 属性,如果value也未配置 取 tableType 对应的json配置,最终方案默认 other 分段 + Node assortIdValueNode = assortIdXPathNode.getAttributes().getNamedItem("value"); + if (Func.isEmpty(assortIdValueNode)) { + assortId = assortIdValueNode.getNodeValue(); + } else { + assortId = tableTypeJson.getString(tableType); + } + if (Func.isBlank(assortId)) { + assortId = tableTypeJson.getString("other"); + } + } else { + Node assortIdNode = xmlUtil.getNode(assortIdXPath); + assortId = assortIdNode.getTextContent(); + } + + Node sysFlagXPathNode = configXmlUtil.getNode("/REPORT/SYSTEM_FLAG"); + String sysFlagXPath = sysFlagXPathNode.getTextContent(); + Node sysFlagNode = xmlUtil.getNode(sysFlagXPath); + String sysFlag = sysFlagNode.getTextContent(); + + Node fileSourceXPathNode = configXmlUtil.getNode("/REPORT/FILESOURCE"); + String fileSourceXPath = fileSourceXPathNode.getTextContent(); + String fileSource; + if (Func.isBlank(fileSourceXPath)) { + Node fileSourceValueNode = fileSourceXPathNode.getAttributes().getNamedItem("value"); + if (Func.isEmpty(fileSourceValueNode)) { + fileSource = null; + } else { + fileSource = fileSourceValueNode.getNodeValue(); + } + + } else { + Node fileSourceNode = xmlUtil.getNode(fileSourceXPath); + fileSource = fileSourceNode.getTextContent(); + } + + + Node fileStorageTypeXPathNode = configXmlUtil.getNode("/REPORT/FILE_STORAGE_TYPE"); + String fileStorageTypeXPath = fileStorageTypeXPathNode.getTextContent(); + String fileStorageType; + if (Func.isBlank(fileStorageTypeXPath)) { + Node filestoragetypeValueNode = fileStorageTypeXPathNode.getAttributes().getNamedItem("value"); + if (Func.isEmpty(filestoragetypeValueNode)) { + fileStorageType = "1"; + } else { + fileStorageType = filestoragetypeValueNode.getNodeValue(); + } + + } else { + Node filestoragetypeNode = xmlUtil.getNode(fileStorageTypeXPath); + fileStorageType = filestoragetypeNode.getTextContent(); + } + + ReportDto reportDto = new ReportDto(); + reportDto.setAdmisstimes(admissTimes); + reportDto.setInpatientNo(inpatientNo); + reportDto.setJzh(jzh); + reportDto.setSerialnum(serialnum); + reportDto.setFileTitle(fileTitle); + reportDto.setDownUrl(downUrl); + reportDto.setAssortId(assortId); + reportDto.setSysFlag(sysFlag); + reportDto.setFileSource(fileSource); + reportDto.setFilestoragetype(fileStorageType); + return reportDto; + } + + @Override + public String pushICUReport(String icuReportMessage) { + log.info("收到重症消息:{}", icuReportMessage); + String msgId = ""; + try { + XmlUtil xmlUtil = XmlUtil.of(icuReportMessage); + Node msgNode = xmlUtil.getNode("/Request/Msg/ID"); + msgId = msgNode.getTextContent(); + ReportDto reportDto = getReportDtoByJSXML(xmlUtil); + reportService.report(reportDto); + return JSXMLResult.success(msgId); + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + return JSXMLResult.failed(msgId, baseException.getMessage()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + return JSXMLResult.failed(msgId, "系统故障!"); + } + } + + @Override + public String pushAddInspectionReport(String inspectionReportMessage) { + log.info("收到检查检验报告新增消息:{}", inspectionReportMessage); + try { + XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage); + Node msgNode = xmlUtil.getNode("/Request/Msg/ID"); + + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + + } + return null; + } + + @Override + public String pushUpdateInspectionReport(String inspectionReportMessage) { + log.info("收到检查检验报告更新消息{}", inspectionReportMessage); + try { + XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage); + Node msgNode = xmlUtil.getNode(""); + msgNode.getTextContent(); + + + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + + } + return null; + } +} diff --git a/src/main/resources/bin/install.bat b/src/main/resources/bin/install.bat new file mode 100644 index 0000000..7a651bc --- /dev/null +++ b/src/main/resources/bin/install.bat @@ -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 +) + + + + + diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat new file mode 100644 index 0000000..58c25cb --- /dev/null +++ b/src/main/resources/bin/start.bat @@ -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 + + + + + diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat new file mode 100644 index 0000000..98468a0 --- /dev/null +++ b/src/main/resources/bin/stop.bat @@ -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 +) + diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat new file mode 100644 index 0000000..b1cc228 --- /dev/null +++ b/src/main/resources/bin/update.bat @@ -0,0 +1,19 @@ +@echo off + +set deployDir=%1\docus-backup-sys +if %deployDir%=="" set deployDir=d:\webroot\docus-backup-sys + +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 + diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml new file mode 100644 index 0000000..3d3f083 --- /dev/null +++ b/src/main/resources/bin/winsw.xml @@ -0,0 +1,8 @@ + + docus-webservice-report + 生产-webservice-报告接收 + 生产-webservice-报告接收 + Automatic + %BASE%\start.bat + + \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..9a46237 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,72 @@ +server: + port: 9312 +spring: + application: + name: @artifactId@ + profiles: + active: dev + datasource: + 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 + + 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 + report: + downurl: http://localhost:9291/api/downplatform/report + +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-webservice-report + address: + ip: + port: 19312 + logretentiondays: 30 + logpath: D:/xxl-job/inspection diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..5cb6f99 --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -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 \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..2c982f3 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,95 @@ + + + docus-server-fistpage + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}%d.%i.log + + 500MB + + 30 + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}external%d.%i.log + + 500MB + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/AfCollectTaskMapper.xml b/src/main/resources/mapper/AfCollectTaskMapper.xml new file mode 100644 index 0000000..668771c --- /dev/null +++ b/src/main/resources/mapper/AfCollectTaskMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..620124f --- /dev/null +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/src/test/java/com/docus/server/report/webservice/impl/SdryReportServerImplTest.java b/src/test/java/com/docus/server/report/webservice/impl/SdryReportServerImplTest.java new file mode 100644 index 0000000..1c8ac33 --- /dev/null +++ b/src/test/java/com/docus/server/report/webservice/impl/SdryReportServerImplTest.java @@ -0,0 +1,46 @@ +package com.docus.server.report.webservice.impl; + +import com.docus.server.report.dto.ReportDto; +import com.docus.server.report.util.XmlUtil; +import org.junit.Test; + +/** + * @author wyb + * @date 2023年3月3日13:42:36 + */ +public class SdryReportServerImplTest { + + @Test + public void getReportDtoByJSXMLTest(){ + SdryReportServerImpl reportServer = new SdryReportServerImpl(); + XmlUtil xmlUtil = XmlUtil.of( + "\n" + + "\n" + + "\n" + + "123456\n" + + "\n" + + "012345\n" + + "\n" + + "012345\n" + + "\n" + + "2\n" + + "\n" + + "icu\n" + + "\n" + + "20220303111800\n" + + "\n" + + "20220303111801\n" + + "\n" + + "http://192.168.1.108:9012/file/0123_01.pdf\n" + + "\n" + + "0123_01\n" + + "\n" + + "AESHASHMD5DEFIND\n" + + "\n" + + "\n"); + ReportDto reportDtoByJSXML = reportServer.getReportDtoByJSXML(xmlUtil); + System.out.println(reportDtoByJSXML); + + } + +} diff --git a/winsw.exe b/winsw.exe new file mode 100644 index 0000000..ba27e3f Binary files /dev/null and b/winsw.exe differ