From bbc3bfff82d76b23ebe81721d6415332be476b4b Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Thu, 22 Jan 2026 14:17:05 +0800 Subject: [PATCH] =?UTF-8?q?init:=20=E5=B9=BF=E4=B8=9C=E7=9C=81=E4=B8=AD?= =?UTF-8?q?=E5=8C=BB=E9=99=A2=EF=BC=8C=E5=8A=A8=E6=80=81=E5=BF=83=E7=94=B5?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=8F=8D=E7=BC=96=E8=AF=91=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 35 + dataConfig/RequestDetailsParams.xml | 38 + dataConfig/RequestParams.xml | 45 ++ dataConfig/homeQualitySet.json | 54 ++ pom.xml | 177 +++++ .../java/com/docus/bgts/DemoApplication.java | 32 + .../com/docus/bgts/config/DbMysqlConfig.java | 65 ++ .../com/docus/bgts/config/DbOracleConfig.java | 56 ++ .../docus/bgts/config/LocalBusFactory.java | 23 + .../com/docus/bgts/config/MyConstruct.java | 24 + .../com/docus/bgts/config/MyScheduling.java | 87 +++ .../docus/bgts/config/ThreadPoolConfig.java | 28 + .../docus/bgts/controller/BgtsController.java | 248 ++++++ .../com/docus/bgts/entity/AfCollectAdd.java | 115 +++ .../com/docus/bgts/entity/AfCollectTask.java | 362 +++++++++ .../docus/bgts/entity/AfInterfaceCollect.java | 175 +++++ .../bgts/entity/AfInterfaceCollectSub.java | 224 ++++++ .../com/docus/bgts/entity/CommonResult.java | 170 +++++ .../com/docus/bgts/entity/IErrorCode.java | 12 + .../com/docus/bgts/entity/JzhListSync.java | 82 ++ .../com/docus/bgts/entity/MrReportError.java | 137 ++++ .../java/com/docus/bgts/entity/MzSync.java | 87 +++ .../com/docus/bgts/entity/MzSyncDetails.java | 175 +++++ .../com/docus/bgts/entity/ReportDownDto.java | 150 ++++ .../bgts/entity/ReportDownPatientDto.java | 106 +++ .../bgts/entity/ReportDownScanFileDto.java | 178 +++++ .../com/docus/bgts/entity/ResultCode.java | 33 + .../com/docus/bgts/entity/TableJsonRead.java | 90 +++ .../com/docus/bgts/entity/TaskDetail.java | 101 +++ .../com/docus/bgts/entity/VDocumentPdf.java | 147 ++++ .../java/com/docus/bgts/entity/ZdAssort.java | 203 +++++ src/main/java/com/docus/bgts/enums/Codes.java | 43 ++ .../bgts/facade/IAfCollectTaskService.java | 38 + .../com/docus/bgts/facade/IBgtsService.java | 24 + .../com/docus/bgts/facade/IMzSyncService.java | 13 + .../mapper/dbmysql/AfCollectAddMapper.java | 32 + .../mapper/dbmysql/AfCollectTaskMapper.java | 34 + .../dbmysql/AfInterfaceCollectMapper.java | 12 + .../dbmysql/AfInterfaceCollectSubMapper.java | 12 + .../mapper/dbmysql/MrReportErrorMapper.java | 13 + .../mapper/dbmysql/TScanAssortMapper.java | 14 + .../bgts/mapper/dbmysql/ZdAssortMapper.java | 17 + .../bgts/mapper/dboracle/MzSyncMapper.java | 14 + .../bgts/mapper/dboracle/TestMapper.java | 12 + .../mapper/dboracle/VDocumentPdfMapper.java | 15 + .../service/AfCollectTaskServiceImpl.java | 275 +++++++ .../docus/bgts/service/BgtsServiceImpl.java | 706 ++++++++++++++++++ .../bgts/service/CheckIntegrityService.java | 105 +++ .../com/docus/bgts/service/MzSyncService.java | 119 +++ .../docus/bgts/service/UpdateFileService.java | 124 +++ .../java/com/docus/bgts/utils/FileUtils.java | 44 ++ .../java/com/docus/bgts/utils/HttpUtils.java | 219 ++++++ .../bgts/utils/JAXDynamicClientFactory.java | 43 ++ .../java/com/docus/bgts/utils/JsonUtils.java | 50 ++ .../docus/bgts/utils/SnowflakeIdWorker.java | 78 ++ .../java/com/docus/bgts/utils/XmlUtils.java | 132 ++++ .../java/com/docus/bgts/web/FilterConfig.java | 20 + .../java/com/docus/bgts/web/MyFilter.java | 39 + src/main/resources/application.yml | 37 + .../mapper/dbmysql/AfCollectAddMapper.xml | 76 ++ .../mapper/dbmysql/AfCollectTaskMapper.xml | 90 +++ .../mapper/dbmysql/MrReportErrorMapper.xml | 10 + .../mapper/dbmysql/TScanAssortMapper.xml | 25 + .../mapper/dbmysql/ZdAssortMapper.xml | 22 + .../mapper/dboracle/MzSyncMapper.xml | 38 + .../resources/mapper/dboracle/TestMapper.xml | 10 + .../mapper/dboracle/VDocumentPdfMapper.xml | 33 + 67 files changed, 6047 insertions(+) create mode 100644 .gitignore create mode 100644 dataConfig/RequestDetailsParams.xml create mode 100644 dataConfig/RequestParams.xml create mode 100644 dataConfig/homeQualitySet.json create mode 100644 pom.xml create mode 100644 src/main/java/com/docus/bgts/DemoApplication.java create mode 100644 src/main/java/com/docus/bgts/config/DbMysqlConfig.java create mode 100644 src/main/java/com/docus/bgts/config/DbOracleConfig.java create mode 100644 src/main/java/com/docus/bgts/config/LocalBusFactory.java create mode 100644 src/main/java/com/docus/bgts/config/MyConstruct.java create mode 100644 src/main/java/com/docus/bgts/config/MyScheduling.java create mode 100644 src/main/java/com/docus/bgts/config/ThreadPoolConfig.java create mode 100644 src/main/java/com/docus/bgts/controller/BgtsController.java create mode 100644 src/main/java/com/docus/bgts/entity/AfCollectAdd.java create mode 100644 src/main/java/com/docus/bgts/entity/AfCollectTask.java create mode 100644 src/main/java/com/docus/bgts/entity/AfInterfaceCollect.java create mode 100644 src/main/java/com/docus/bgts/entity/AfInterfaceCollectSub.java create mode 100644 src/main/java/com/docus/bgts/entity/CommonResult.java create mode 100644 src/main/java/com/docus/bgts/entity/IErrorCode.java create mode 100644 src/main/java/com/docus/bgts/entity/JzhListSync.java create mode 100644 src/main/java/com/docus/bgts/entity/MrReportError.java create mode 100644 src/main/java/com/docus/bgts/entity/MzSync.java create mode 100644 src/main/java/com/docus/bgts/entity/MzSyncDetails.java create mode 100644 src/main/java/com/docus/bgts/entity/ReportDownDto.java create mode 100644 src/main/java/com/docus/bgts/entity/ReportDownPatientDto.java create mode 100644 src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java create mode 100644 src/main/java/com/docus/bgts/entity/ResultCode.java create mode 100644 src/main/java/com/docus/bgts/entity/TableJsonRead.java create mode 100644 src/main/java/com/docus/bgts/entity/TaskDetail.java create mode 100644 src/main/java/com/docus/bgts/entity/VDocumentPdf.java create mode 100644 src/main/java/com/docus/bgts/entity/ZdAssort.java create mode 100644 src/main/java/com/docus/bgts/enums/Codes.java create mode 100644 src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java create mode 100644 src/main/java/com/docus/bgts/facade/IBgtsService.java create mode 100644 src/main/java/com/docus/bgts/facade/IMzSyncService.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectAddMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectTaskMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectSubMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/MrReportErrorMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/TScanAssortMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dbmysql/ZdAssortMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dboracle/MzSyncMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dboracle/TestMapper.java create mode 100644 src/main/java/com/docus/bgts/mapper/dboracle/VDocumentPdfMapper.java create mode 100644 src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java create mode 100644 src/main/java/com/docus/bgts/service/BgtsServiceImpl.java create mode 100644 src/main/java/com/docus/bgts/service/CheckIntegrityService.java create mode 100644 src/main/java/com/docus/bgts/service/MzSyncService.java create mode 100644 src/main/java/com/docus/bgts/service/UpdateFileService.java create mode 100644 src/main/java/com/docus/bgts/utils/FileUtils.java create mode 100644 src/main/java/com/docus/bgts/utils/HttpUtils.java create mode 100644 src/main/java/com/docus/bgts/utils/JAXDynamicClientFactory.java create mode 100644 src/main/java/com/docus/bgts/utils/JsonUtils.java create mode 100644 src/main/java/com/docus/bgts/utils/SnowflakeIdWorker.java create mode 100644 src/main/java/com/docus/bgts/utils/XmlUtils.java create mode 100644 src/main/java/com/docus/bgts/web/FilterConfig.java create mode 100644 src/main/java/com/docus/bgts/web/MyFilter.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/mapper/dbmysql/AfCollectAddMapper.xml create mode 100644 src/main/resources/mapper/dbmysql/AfCollectTaskMapper.xml create mode 100644 src/main/resources/mapper/dbmysql/MrReportErrorMapper.xml create mode 100644 src/main/resources/mapper/dbmysql/TScanAssortMapper.xml create mode 100644 src/main/resources/mapper/dbmysql/ZdAssortMapper.xml create mode 100644 src/main/resources/mapper/dboracle/MzSyncMapper.xml create mode 100644 src/main/resources/mapper/dboracle/TestMapper.xml create mode 100644 src/main/resources/mapper/dboracle/VDocumentPdfMapper.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c7759d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar +*.iml +# 直接在这里添加即可,注意加上备注,好知道是忽略什么文件 # + +############################## +## Folders ## +############################## +target +out +log +configLog +.idea +.project +**/.mvn +**/mvnw +**/mvnw.cmd \ No newline at end of file diff --git a/dataConfig/RequestDetailsParams.xml b/dataConfig/RequestDetailsParams.xml new file mode 100644 index 0000000..086b373 --- /dev/null +++ b/dataConfig/RequestDetailsParams.xml @@ -0,0 +1,38 @@ + + + 1 + WZHBAGL + WZHBAGL_1127 + BS14002 + BS14002S51001 + GZ + + + BS14002 + BS14002S51001 + S51 + S00 + 2022-05-06 02:54:08 + + + 0 + 500 + + + + + + + + + + + + + + + + + + + diff --git a/dataConfig/RequestParams.xml b/dataConfig/RequestParams.xml new file mode 100644 index 0000000..9aa86ad --- /dev/null +++ b/dataConfig/RequestParams.xml @@ -0,0 +1,45 @@ + + + 1 + WZHBAGL + WZHBAGL_1127 + BS14002 + BS14002S51001 + GZ + + + BS14002 + BS14002S51001 + S51 + S00 + 2020-05-06 02:54:08 + + + 0 + 500 + + + + + + + + + + + + + + + + 2020-12-01 + 2023-12-31 + + + + + + + + + diff --git a/dataConfig/homeQualitySet.json b/dataConfig/homeQualitySet.json new file mode 100644 index 0000000..621103d --- /dev/null +++ b/dataConfig/homeQualitySet.json @@ -0,0 +1,54 @@ +{ + //唯一键目录结构数组,最高层为前面,最后一层为数据采集层,根节点不填 + "directory":["Msg","ReportInfo"], + //患者主索引号 + "indexFlag":"INHOSP_NO", + //采集流水号 + "serialnum":"EXAM_NO", + //文件标题 + "filetitle":"EXAM_ITEM_NAME", + //下载地址 + "downurl":"IMAGE_URL", + //时间格式 + "dateFormat": "yyyy-MM-dd HH:mm:ss", + //分类id + "assortid":"e4525abec7cb4c9097b81c56b551112f", + //系统id + "collectorid":"23", + //采集类型(文件来源 1:采集器;2:扫描生产软件) + "filesource":1, + //下载类型(1:服务器本地;2:ftp服务器;3:共享文件夹) + "filestoragetype":1, + //上传接口 + "uploadConnector":"http://192.9.100.171:9291/api/downplatform/report", + //基本数据存放处,根节点不填,最后一层为基本信息存放标签与doubleBasic配合 + "basicDirectory":["Msg","ReportInfo"], + //可能存在存储基本数据不同情况的标签 + "doubleBasic":["TestItemInfo","BioTestInfo"], + //检查报告列表入参路径 + "bgtsParam":["Request","Msg","EMPI_ID"], + //检查报告列表响应信息根路径 + "bgtsRespon":["MsgInfo","Msg"], + //检查报告key + "examNo":"EXAM_NO", + //文件标题key + "examItemName":"EXAM_ITEM_NAME", + //文件路径 + "pdfUrl":"IMAGE_URL", + //检查报告明細列表响应信息根路径 + "bgtsDetailParam":["Request","Msg","EXAM_NO"], + //检查报告明細列表响应信息根路径 + "bgtsDetailRespon":["MsgInfo","Msg","ReportInfo"], + //批量按需采集开始时间 + "collectStartDate": "2022-09-03", + //批量按需采集结束时间 + "collectEndDate": "2022-09-03", + //批量按需采集开关 1:开启 0:关闭 + "collectOpen": "1", + //0点重新采集前几天数据 1:开启 0:关闭 + "intervalDayOpen": "1", + //配置pacs补偿采集间隔天数 + "intervalDay":3 + + +} \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e07fdae --- /dev/null +++ b/pom.xml @@ -0,0 +1,177 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.5.6 + + + com.docus + demo + 0.0.1-SNAPSHOT + docus-active-query-service + Demo project for Spring Boot + + 1.8 + + + + org.springframework.boot + spring-boot-starter + + + + org.dom4j + dom4j + 2.1.1 + + + + jaxen + jaxen + 1.1.1 + + + com.alibaba + fastjson + 1.2.75 + + + mysql + mysql-connector-java + 8.0.15 + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + 1.16.14 + + + com.spring4all + swagger-spring-boot-starter + 1.9.0.RELEASE + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.baomidou + mybatis-plus-boot-starter + 3.3.0 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.apache.httpcomponents + httpcore + 4.4.5 + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + org.apache.httpcomponents + httpmime + 4.4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.apache.cxf + cxf-rt-transports-http + 3.1.8 + + + com.alibaba + druid-spring-boot-starter + 1.1.10 + + + + + com.oracle.database.jdbc + ojdbc6 + 11.2.0.4 + + + org.apache.cxf + cxf-rt-frontend-jaxws + 3.1.8 + + + xerces + xercesImpl + 2.11.0 + + + cn.hutool + hutool-all + 4.0.9 + + + junit + junit + test + + + + org.apache.commons + commons-collections4 + 4.4 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/com/docus/bgts/DemoApplication.java b/src/main/java/com/docus/bgts/DemoApplication.java new file mode 100644 index 0000000..cbbc327 --- /dev/null +++ b/src/main/java/com/docus/bgts/DemoApplication.java @@ -0,0 +1,32 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts; + +import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.TaskScheduler; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; + +@EnableScheduling +@SpringBootApplication( + exclude = {MybatisPlusAutoConfiguration.class} +) +public class DemoApplication { + public static void main(String[] args) { + System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(DemoApplication.class, args); + } + + @Bean + public TaskScheduler taskScheduler() { + ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); + taskScheduler.setPoolSize(3); + return taskScheduler; + } +} diff --git a/src/main/java/com/docus/bgts/config/DbMysqlConfig.java b/src/main/java/com/docus/bgts/config/DbMysqlConfig.java new file mode 100644 index 0000000..88dac75 --- /dev/null +++ b/src/main/java/com/docus/bgts/config/DbMysqlConfig.java @@ -0,0 +1,65 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import com.alibaba.druid.pool.DruidDataSource; +import com.baomidou.mybatisplus.core.MybatisConfiguration; +import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.type.JdbcType; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + +@Configuration +@MapperScan( + basePackages = {"com.docus.bgts.mapper.dbmysql"}, + sqlSessionFactoryRef = "dbmysqlSqlSessionFactory" +) +public class DbMysqlConfig { + static final String PACKAGE = "com.docus.bgts.mapper.dbmysql"; + static final String MAPPER_LOCATION = "classpath:mapper/dbmysql/*.xml"; + + @Bean( + name = {"dbmysqlDataSource"} + ) + @ConfigurationProperties( + prefix = "spring.datasource.mysql-docus" + ) + public DataSource secondDataSource() { + return new DruidDataSource(); + } + + @Bean( + name = {"dbmysqlTransactionManager"} + ) + public DataSourceTransactionManager secondTransactionManager() { + return new DataSourceTransactionManager(this.secondDataSource()); + } + + @Bean( + name = {"dbmysqlSqlSessionFactory"} + ) + public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dbmysqlDataSource") DataSource dataSource) throws Exception { + MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean(); + ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + bean.setMapperLocations(resolver.getResources("classpath:mapper/dbmysql/*.xml")); + bean.setTypeAliasesPackage("com.docus.bgts.entity.*"); + MybatisConfiguration configuration = new MybatisConfiguration(); + configuration.setMapUnderscoreToCamelCase(true); + configuration.setJdbcTypeForNull(JdbcType.NULL); + bean.setDataSource(dataSource); + bean.setConfiguration(configuration); + return bean.getObject(); + } +} diff --git a/src/main/java/com/docus/bgts/config/DbOracleConfig.java b/src/main/java/com/docus/bgts/config/DbOracleConfig.java new file mode 100644 index 0000000..381324a --- /dev/null +++ b/src/main/java/com/docus/bgts/config/DbOracleConfig.java @@ -0,0 +1,56 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import com.alibaba.druid.pool.DruidDataSource; +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + +@Configuration +@MapperScan( + basePackages = {"com.docus.bgts.mapper.dboracle"}, + sqlSessionFactoryRef = "dboracleSqlSessionFactory" +) +public class DbOracleConfig { + static final String PACKAGE = "com.docus.bgts.mapper.dboracle"; + static final String MAPPER_LOCATION = "classpath:mapper/dboracle/*.xml"; + + @Bean( + name = {"dboracleDataSource"} + ) + @ConfigurationProperties( + prefix = "spring.datasource.oracle-docus" + ) + public DataSource secondDataSource() { + return new DruidDataSource(); + } + + @Bean( + name = {"dboracleTransactionManager"} + ) + public DataSourceTransactionManager secondTransactionManager() { + return new DataSourceTransactionManager(this.secondDataSource()); + } + + @Bean( + name = {"dboracleSqlSessionFactory"} + ) + public SqlSessionFactory secondSqlSessionFactory(@Qualifier("dboracleDataSource") DataSource secondDataSource) throws Exception { + SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); + sessionFactory.setDataSource(secondDataSource); + sessionFactory.setMapperLocations((new PathMatchingResourcePatternResolver()).getResources("classpath:mapper/dboracle/*.xml")); + return sessionFactory.getObject(); + } +} diff --git a/src/main/java/com/docus/bgts/config/LocalBusFactory.java b/src/main/java/com/docus/bgts/config/LocalBusFactory.java new file mode 100644 index 0000000..ebf7d90 --- /dev/null +++ b/src/main/java/com/docus/bgts/config/LocalBusFactory.java @@ -0,0 +1,23 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import org.apache.cxf.Bus; +import org.apache.cxf.BusFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class LocalBusFactory extends BusFactory { + private static Logger logger = LoggerFactory.getLogger(LocalBusFactory.class); + + public Bus createBus() { + return null; + } + + public static void printTHREAD_BUSSES() { + logger.info("THREAD_BUSSES SIZE {}", THREAD_BUSSES.size()); + } +} diff --git a/src/main/java/com/docus/bgts/config/MyConstruct.java b/src/main/java/com/docus/bgts/config/MyConstruct.java new file mode 100644 index 0000000..5ed9a75 --- /dev/null +++ b/src/main/java/com/docus/bgts/config/MyConstruct.java @@ -0,0 +1,24 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import com.docus.bgts.facade.IBgtsService; +import javax.annotation.PreDestroy; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class MyConstruct { + @Autowired + IBgtsService bgtsService; + private Logger logger = LogManager.getLogger(MyConstruct.class); + + @PreDestroy + public void destroy() { + } +} diff --git a/src/main/java/com/docus/bgts/config/MyScheduling.java b/src/main/java/com/docus/bgts/config/MyScheduling.java new file mode 100644 index 0000000..a4dd8ea --- /dev/null +++ b/src/main/java/com/docus/bgts/config/MyScheduling.java @@ -0,0 +1,87 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import com.docus.bgts.facade.IBgtsService; +import com.docus.bgts.service.CheckIntegrityService; +import com.docus.bgts.utils.FileUtils; +import com.docus.bgts.utils.HttpUtils; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ThreadPoolExecutor; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class MyScheduling { + @Value("${beat.url}") + private String beatUrl; + public static String syncFlag; + private final String tempfilePrefix = "dataConfig\\temp"; + private final String tempDataFileName = "collectTimeTemp"; + private final String lastTimeStr = "lastTime"; + @Autowired + IBgtsService bgtsService; + @Autowired + CheckIntegrityService checkIntegrityService; + private Logger logger = LogManager.getLogger(MyScheduling.class); + @Autowired + private ThreadPoolExecutor threadPoolExecutor; + + @Scheduled( + fixedRate = 5000L + ) + public void beat() { + Map params = new HashMap(); + params.put("code", String.valueOf(FileUtils.getJsonByName("collectorid"))); + + try { + HttpUtils.get(this.beatUrl, params); + } catch (Exception e) { + e.printStackTrace(); + this.logger.info("心跳推送出错,可能是住院服务没有开启"); + } + + } + + @Scheduled( + cron = "0 0 0 * * ?" + ) + public void collect() { + String intervalDayOpen = String.valueOf(FileUtils.getJsonByName("intervalDayOpen")); + if (intervalDayOpen.equals("1")) { + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + int day = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("intervalDay"))); + this.logger.info("0点采集前" + day + "天出院数据"); + Map dateCollectionTime = getDateCollectionTime(new Date(), day); + this.logger.info("采集" + (String)dateCollectionTime.get("startDate") + "至-------" + (String)dateCollectionTime.get("endDate") + "数据"); + this.bgtsService.collectByDate((String)dateCollectionTime.get("startDate"), (String)dateCollectionTime.get("endDate"), collectorid); + } + + } + + public static Map getDateCollectionTime(Date date, int day) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(5, -day); + Date dBefore = calendar.getTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String defaultStartDate = sdf.format(dBefore); + defaultStartDate = defaultStartDate + " 00:00:00"; + String defaultEndDate = defaultStartDate.substring(0, 10) + " 23:59:59"; + Map map = new HashMap(); + map.put("startDate", defaultStartDate); + map.put("endDate", defaultEndDate); + return map; + } +} diff --git a/src/main/java/com/docus/bgts/config/ThreadPoolConfig.java b/src/main/java/com/docus/bgts/config/ThreadPoolConfig.java new file mode 100644 index 0000000..e8d3331 --- /dev/null +++ b/src/main/java/com/docus/bgts/config/ThreadPoolConfig.java @@ -0,0 +1,28 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@Configuration +public class ThreadPoolConfig { + @Bean + public ThreadPoolExecutor threadPoolExecutor() { + return new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), (int)((double)Runtime.getRuntime().availableProcessors() / 0.09999999999999998), 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(Runtime.getRuntime().availableProcessors()), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); + } + + @Bean + public ScheduledThreadPoolExecutor scheduledThreadPoolExecutor() { + return new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy()); + } +} diff --git a/src/main/java/com/docus/bgts/controller/BgtsController.java b/src/main/java/com/docus/bgts/controller/BgtsController.java new file mode 100644 index 0000000..239d316 --- /dev/null +++ b/src/main/java/com/docus/bgts/controller/BgtsController.java @@ -0,0 +1,248 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.controller; + +import com.docus.bgts.config.MyScheduling; +import com.docus.bgts.entity.CommonResult; +import com.docus.bgts.facade.IAfCollectTaskService; +import com.docus.bgts.facade.IBgtsService; +import com.docus.bgts.service.CheckIntegrityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@Api( + value = "采集接口", + tags = {"采集接口"} +) +@RestController +public class BgtsController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + CheckIntegrityService checkIntegrityService; + @Autowired + IBgtsService bgtsService; + @Autowired + IAfCollectTaskService afCollectTaskService; + + @ApiOperation("完整性同步程序开关0:关闭 1:开启") + @GetMapping({"/onOffSync"}) + public void onOffSync(@RequestParam(value = "flag",defaultValue = "0") String flag) { + MyScheduling.syncFlag = flag; + } + + @GetMapping({"/addSyncIntegrality"}) + public void addSyncIntegrality(@RequestParam("startDate") String startDate, String endDate) { + this.checkIntegrityService.addSyncIntegrality(startDate, endDate); + } + + @GetMapping({"/addSyncIntegralityByJzhs"}) + public CommonResult addSyncIntegrality(@RequestParam("jzhs") String jzhs) { + if (jzhs.split(",").length > 100) { + return CommonResult.failed("jzh个数不能超过100个"); + } else { + this.checkIntegrityService.addSyncIntegralityByJzhs(jzhs); + return CommonResult.success("完成"); + } + } + + @ApiOperation("采集接口") + @ApiImplicitParams({@ApiImplicitParam( + name = "empId", + value = "患者主索引号", + required = true, + dataTypeClass = String.class +), @ApiImplicitParam( + name = "collectSubId", + value = "af_interface_collect_sub表id", + required = true +)}) + @GetMapping({"/collect"}) + public CommonResult collect(@RequestParam("collectSubId") String collectSubId, @RequestParam("empId") String empId) { + try { + this.logger.info("采集接口接收到参数:\nempId--" + empId + "\ncollectSubId--" + collectSubId); + this.bgtsService.collect(empId); + this.logger.info("采集完成"); + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 1); + this.logger.info("------------采集结束-----------"); + } catch (RuntimeException e) { + e.printStackTrace(); + + try { + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 0); + } catch (Exception e1) { + this.logger.info(e1.getMessage()); + return CommonResult.failed(e1.getMessage()); + } + + return CommonResult.failed(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } catch (Throwable t) { + t.printStackTrace(); + this.logger.error("throwable,{}", t.getMessage()); + } + + return CommonResult.success("ok"); + } + + @ApiOperation("Pacs采集接口") + @ApiImplicitParams({@ApiImplicitParam( + name = "empId", + value = "患者主索引号", + required = true, + dataTypeClass = String.class +), @ApiImplicitParam( + name = "collectSubId", + value = "af_interface_collect_sub表id", + required = true +), @ApiImplicitParam( + name = "admissDate", + value = "入院时间", + required = true +), @ApiImplicitParam( + name = "disDate", + value = "出院时间", + required = true +), @ApiImplicitParam( + name = "times", + value = "住院次数", + required = true +)}) + @GetMapping({"/collectPacs"}) + public CommonResult collect(@RequestParam("collectSubId") String collectSubId, @RequestParam("empId") String empId, @RequestParam("admissDate") String admissDate, @RequestParam("disDate") String disDate, @RequestParam("times") String times) { + try { + this.logger.info("采集接口接收到参数:\nempId--" + empId + "\ncollectSubId--" + collectSubId); + this.bgtsService.collectPacs(empId, admissDate, disDate, times); + this.logger.info("采集完成"); + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 1); + this.logger.info("------------采集结束-----------"); + } catch (RuntimeException e) { + e.printStackTrace(); + + try { + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 0); + } catch (Exception e1) { + this.logger.info(e1.getMessage()); + return CommonResult.failed(e1.getMessage()); + } + + return CommonResult.failed(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } + + return CommonResult.success("ok"); + } + + @ApiOperation("动态心电采集接口") + @ApiImplicitParams({@ApiImplicitParam( + name = "empId", + value = "患者主索引号", + required = true, + dataTypeClass = String.class +), @ApiImplicitParam( + name = "collectSubId", + value = "af_interface_collect_sub表id", + required = true +), @ApiImplicitParam( + name = "admissDate", + value = "入院时间", + required = true +), @ApiImplicitParam( + name = "disDate", + value = "出院时间", + required = true +), @ApiImplicitParam( + name = "times", + value = "住院次数", + required = true +)}) + @GetMapping({"/collectEcg"}) + public CommonResult collectEcg(@RequestParam("collectSubId") String collectSubId, @RequestParam("empId") String empId, @RequestParam("admissDate") String admissDate, @RequestParam("disDate") String disDate, @RequestParam("times") String times) { + try { + this.logger.info("采集接口接收到参数:\nempId--" + empId + "\ncollectSubId--" + collectSubId); + this.bgtsService.collectEcg(empId, admissDate, disDate, times); + this.logger.info("采集完成"); + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 1); + this.logger.info("------------采集结束-----------"); + } catch (RuntimeException e) { + e.printStackTrace(); + + try { + this.afCollectTaskService.updateInterfaceCollect(collectSubId, 0); + } catch (Exception e1) { + this.logger.info(e1.getMessage()); + return CommonResult.failed(e1.getMessage()); + } + + return CommonResult.failed(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } + + return CommonResult.success("ok"); + } + + @ApiOperation("按需采集接口") + @ApiImplicitParams({@ApiImplicitParam( + name = "emamNo", + value = "报告单号", + required = true, + dataTypeClass = String.class +), @ApiImplicitParam( + name = "empId", + value = "患者主索引号", + required = true, + dataTypeClass = String.class +)}) + @GetMapping({"/collectByExamNo"}) + public CommonResult collectByExamNo(@RequestParam("emamNo") String emamNo, @RequestParam("empId") String empId) { + try { + this.logger.info("按需采集接口接受参数:\nempId--" + empId + "\nemamNo--" + emamNo); + this.bgtsService.collectByExamNo(emamNo, empId); + } catch (RuntimeException e) { + e.printStackTrace(); + return CommonResult.failed(e.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + } + + return CommonResult.success("ok"); + } + + @GetMapping({"/collectByEx"}) + public CommonResult collectByEx(@RequestParam("empId") String empId) { + try { + this.bgtsService.collect(empId); + } catch (Exception e) { + e.printStackTrace(); + return CommonResult.failed(e.getMessage()); + } + + return CommonResult.success("ok"); + } + + @ApiOperation("pacs按需采集接口") + @GetMapping({"/collectByPacs"}) + public CommonResult collectByPacs() { + try { + this.bgtsService.collectPacss(); + } catch (Exception e) { + e.printStackTrace(); + return CommonResult.failed(e.getMessage()); + } + + return CommonResult.success("ok"); + } +} diff --git a/src/main/java/com/docus/bgts/entity/AfCollectAdd.java b/src/main/java/com/docus/bgts/entity/AfCollectAdd.java new file mode 100644 index 0000000..630fe44 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/AfCollectAdd.java @@ -0,0 +1,115 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +@ApiModel("采集日志") +public class AfCollectAdd { + @ApiModelProperty("id") + @TableId( + value = "id", + type = IdType.ASSIGN_ID + ) + private Long id; + @ApiModelProperty("上次更新时间") + private Date beginStageDate; + @ApiModelProperty("分类") + private Integer classify; + + public Long getId() { + return this.id; + } + + public Date getBeginStageDate() { + return this.beginStageDate; + } + + public Integer getClassify() { + return this.classify; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setBeginStageDate(final Date beginStageDate) { + this.beginStageDate = beginStageDate; + } + + public void setClassify(final Integer classify) { + this.classify = classify; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof AfCollectAdd)) { + return false; + } else { + AfCollectAdd other = (AfCollectAdd)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$beginStageDate = this.getBeginStageDate(); + Object other$beginStageDate = other.getBeginStageDate(); + if (this$beginStageDate == null) { + if (other$beginStageDate != null) { + return false; + } + } else if (!this$beginStageDate.equals(other$beginStageDate)) { + return false; + } + + Object this$classify = this.getClassify(); + Object other$classify = other.getClassify(); + if (this$classify == null) { + if (other$classify != null) { + return false; + } + } else if (!this$classify.equals(other$classify)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof AfCollectAdd; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $beginStageDate = this.getBeginStageDate(); + result = result * 59 + ($beginStageDate == null ? 43 : $beginStageDate.hashCode()); + Object $classify = this.getClassify(); + result = result * 59 + ($classify == null ? 43 : $classify.hashCode()); + return result; + } + + public String toString() { + return "AfCollectAdd(id=" + this.getId() + ", beginStageDate=" + this.getBeginStageDate() + ", classify=" + this.getClassify() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/AfCollectTask.java b/src/main/java/com/docus/bgts/entity/AfCollectTask.java new file mode 100644 index 0000000..775e385 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/AfCollectTask.java @@ -0,0 +1,362 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; + +@ApiModel( + value = "AfCollectTask对象", + description = "病案采集任务" +) +public class AfCollectTask implements Serializable { + private static final long serialVersionUID = 1L; + @ApiModelProperty("id 雪花算法") + @TableId( + value = "id", + type = IdType.ASSIGN_ID + ) + private Long id; + @ApiModelProperty("病案主键") + private String patientId; + @ApiModelProperty("af_archive_detail表id") + private Long afArchiveDetailId; + @ApiModelProperty("来源 1护理文书,2 电子病历,3 Pacs检查,4心电图,5手麻系统,6 Lis检验,7病案首页,8长临医嘱") + private String sysflag; + @ApiModelProperty("开始时间") + private Date startTime; + @ApiModelProperty("结束时间") + private Date endTime; + @ApiModelProperty("任务状态 0:未开始,1:完成,2:重新采集") + private String state; + @ApiModelProperty("同步时间") + private Date syncTime; + @ApiModelProperty("最新重新采集时间") + private Date recollectTime; + @ApiModelProperty("最新重新采集人") + private String recollectName; + @ApiModelProperty("备注") + private String remark; + @ApiModelProperty("报告唯一单号") + private String c1; + @ApiModelProperty("文件标题") + private String c2; + @ApiModelProperty("记账号") + private String c3; + + public Long getId() { + return this.id; + } + + public String getPatientId() { + return this.patientId; + } + + public Long getAfArchiveDetailId() { + return this.afArchiveDetailId; + } + + public String getSysflag() { + return this.sysflag; + } + + public Date getStartTime() { + return this.startTime; + } + + public Date getEndTime() { + return this.endTime; + } + + public String getState() { + return this.state; + } + + public Date getSyncTime() { + return this.syncTime; + } + + public Date getRecollectTime() { + return this.recollectTime; + } + + public String getRecollectName() { + return this.recollectName; + } + + public String getRemark() { + return this.remark; + } + + public String getC1() { + return this.c1; + } + + public String getC2() { + return this.c2; + } + + public String getC3() { + return this.c3; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setPatientId(final String patientId) { + this.patientId = patientId; + } + + public void setAfArchiveDetailId(final Long afArchiveDetailId) { + this.afArchiveDetailId = afArchiveDetailId; + } + + public void setSysflag(final String sysflag) { + this.sysflag = sysflag; + } + + public void setStartTime(final Date startTime) { + this.startTime = startTime; + } + + public void setEndTime(final Date endTime) { + this.endTime = endTime; + } + + public void setState(final String state) { + this.state = state; + } + + public void setSyncTime(final Date syncTime) { + this.syncTime = syncTime; + } + + public void setRecollectTime(final Date recollectTime) { + this.recollectTime = recollectTime; + } + + public void setRecollectName(final String recollectName) { + this.recollectName = recollectName; + } + + public void setRemark(final String remark) { + this.remark = remark; + } + + public void setC1(final String c1) { + this.c1 = c1; + } + + public void setC2(final String c2) { + this.c2 = c2; + } + + public void setC3(final String c3) { + this.c3 = c3; + } + + public String toString() { + return "AfCollectTask(id=" + this.getId() + ", patientId=" + this.getPatientId() + ", afArchiveDetailId=" + this.getAfArchiveDetailId() + ", sysflag=" + this.getSysflag() + ", startTime=" + this.getStartTime() + ", endTime=" + this.getEndTime() + ", state=" + this.getState() + ", syncTime=" + this.getSyncTime() + ", recollectTime=" + this.getRecollectTime() + ", recollectName=" + this.getRecollectName() + ", remark=" + this.getRemark() + ", c1=" + this.getC1() + ", c2=" + this.getC2() + ", c3=" + this.getC3() + ")"; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof AfCollectTask)) { + return false; + } else { + AfCollectTask other = (AfCollectTask)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$patientId = this.getPatientId(); + Object other$patientId = other.getPatientId(); + if (this$patientId == null) { + if (other$patientId != null) { + return false; + } + } else if (!this$patientId.equals(other$patientId)) { + return false; + } + + Object this$afArchiveDetailId = this.getAfArchiveDetailId(); + Object other$afArchiveDetailId = other.getAfArchiveDetailId(); + if (this$afArchiveDetailId == null) { + if (other$afArchiveDetailId != null) { + return false; + } + } else if (!this$afArchiveDetailId.equals(other$afArchiveDetailId)) { + return false; + } + + Object this$sysflag = this.getSysflag(); + Object other$sysflag = other.getSysflag(); + if (this$sysflag == null) { + if (other$sysflag != null) { + return false; + } + } else if (!this$sysflag.equals(other$sysflag)) { + return false; + } + + Object this$startTime = this.getStartTime(); + Object other$startTime = other.getStartTime(); + if (this$startTime == null) { + if (other$startTime != null) { + return false; + } + } else if (!this$startTime.equals(other$startTime)) { + return false; + } + + Object this$endTime = this.getEndTime(); + Object other$endTime = other.getEndTime(); + if (this$endTime == null) { + if (other$endTime != null) { + return false; + } + } else if (!this$endTime.equals(other$endTime)) { + return false; + } + + Object this$state = this.getState(); + Object other$state = other.getState(); + if (this$state == null) { + if (other$state != null) { + return false; + } + } else if (!this$state.equals(other$state)) { + return false; + } + + Object this$syncTime = this.getSyncTime(); + Object other$syncTime = other.getSyncTime(); + if (this$syncTime == null) { + if (other$syncTime != null) { + return false; + } + } else if (!this$syncTime.equals(other$syncTime)) { + return false; + } + + Object this$recollectTime = this.getRecollectTime(); + Object other$recollectTime = other.getRecollectTime(); + if (this$recollectTime == null) { + if (other$recollectTime != null) { + return false; + } + } else if (!this$recollectTime.equals(other$recollectTime)) { + return false; + } + + Object this$recollectName = this.getRecollectName(); + Object other$recollectName = other.getRecollectName(); + if (this$recollectName == null) { + if (other$recollectName != null) { + return false; + } + } else if (!this$recollectName.equals(other$recollectName)) { + return false; + } + + Object this$remark = this.getRemark(); + Object other$remark = other.getRemark(); + if (this$remark == null) { + if (other$remark != null) { + return false; + } + } else if (!this$remark.equals(other$remark)) { + return false; + } + + Object this$c1 = this.getC1(); + Object other$c1 = other.getC1(); + if (this$c1 == null) { + if (other$c1 != null) { + return false; + } + } else if (!this$c1.equals(other$c1)) { + return false; + } + + Object this$c2 = this.getC2(); + Object other$c2 = other.getC2(); + if (this$c2 == null) { + if (other$c2 != null) { + return false; + } + } else if (!this$c2.equals(other$c2)) { + return false; + } + + Object this$c3 = this.getC3(); + Object other$c3 = other.getC3(); + if (this$c3 == null) { + if (other$c3 != null) { + return false; + } + } else if (!this$c3.equals(other$c3)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof AfCollectTask; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $patientId = this.getPatientId(); + result = result * 59 + ($patientId == null ? 43 : $patientId.hashCode()); + Object $afArchiveDetailId = this.getAfArchiveDetailId(); + result = result * 59 + ($afArchiveDetailId == null ? 43 : $afArchiveDetailId.hashCode()); + Object $sysflag = this.getSysflag(); + result = result * 59 + ($sysflag == null ? 43 : $sysflag.hashCode()); + Object $startTime = this.getStartTime(); + result = result * 59 + ($startTime == null ? 43 : $startTime.hashCode()); + Object $endTime = this.getEndTime(); + result = result * 59 + ($endTime == null ? 43 : $endTime.hashCode()); + Object $state = this.getState(); + result = result * 59 + ($state == null ? 43 : $state.hashCode()); + Object $syncTime = this.getSyncTime(); + result = result * 59 + ($syncTime == null ? 43 : $syncTime.hashCode()); + Object $recollectTime = this.getRecollectTime(); + result = result * 59 + ($recollectTime == null ? 43 : $recollectTime.hashCode()); + Object $recollectName = this.getRecollectName(); + result = result * 59 + ($recollectName == null ? 43 : $recollectName.hashCode()); + Object $remark = this.getRemark(); + result = result * 59 + ($remark == null ? 43 : $remark.hashCode()); + Object $c1 = this.getC1(); + result = result * 59 + ($c1 == null ? 43 : $c1.hashCode()); + Object $c2 = this.getC2(); + result = result * 59 + ($c2 == null ? 43 : $c2.hashCode()); + Object $c3 = this.getC3(); + result = result * 59 + ($c3 == null ? 43 : $c3.hashCode()); + return result; + } +} diff --git a/src/main/java/com/docus/bgts/entity/AfInterfaceCollect.java b/src/main/java/com/docus/bgts/entity/AfInterfaceCollect.java new file mode 100644 index 0000000..5ca13f8 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/AfInterfaceCollect.java @@ -0,0 +1,175 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; + +@ApiModel("文件库中的省中医病案采集表") +public class AfInterfaceCollect implements Serializable { + private Long id; + @ApiModelProperty("任务流水号") + private String serialnum; + @ApiModelProperty("记账号") + private String jzh; + @ApiModelProperty("任务数") + private Integer taskCount; + @ApiModelProperty("完成数") + private Integer completeCount; + @ApiModelProperty("创建时间") + private Date createTime; + + public Long getId() { + return this.id; + } + + public String getSerialnum() { + return this.serialnum; + } + + public String getJzh() { + return this.jzh; + } + + public Integer getTaskCount() { + return this.taskCount; + } + + public Integer getCompleteCount() { + return this.completeCount; + } + + public Date getCreateTime() { + return this.createTime; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setSerialnum(final String serialnum) { + this.serialnum = serialnum; + } + + public void setJzh(final String jzh) { + this.jzh = jzh; + } + + public void setTaskCount(final Integer taskCount) { + this.taskCount = taskCount; + } + + public void setCompleteCount(final Integer completeCount) { + this.completeCount = completeCount; + } + + public void setCreateTime(final Date createTime) { + this.createTime = createTime; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof AfInterfaceCollect)) { + return false; + } else { + AfInterfaceCollect other = (AfInterfaceCollect)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$serialnum = this.getSerialnum(); + Object other$serialnum = other.getSerialnum(); + if (this$serialnum == null) { + if (other$serialnum != null) { + return false; + } + } else if (!this$serialnum.equals(other$serialnum)) { + return false; + } + + Object this$jzh = this.getJzh(); + Object other$jzh = other.getJzh(); + if (this$jzh == null) { + if (other$jzh != null) { + return false; + } + } else if (!this$jzh.equals(other$jzh)) { + return false; + } + + Object this$taskCount = this.getTaskCount(); + Object other$taskCount = other.getTaskCount(); + if (this$taskCount == null) { + if (other$taskCount != null) { + return false; + } + } else if (!this$taskCount.equals(other$taskCount)) { + return false; + } + + Object this$completeCount = this.getCompleteCount(); + Object other$completeCount = other.getCompleteCount(); + if (this$completeCount == null) { + if (other$completeCount != null) { + return false; + } + } else if (!this$completeCount.equals(other$completeCount)) { + return false; + } + + Object this$createTime = this.getCreateTime(); + Object other$createTime = other.getCreateTime(); + if (this$createTime == null) { + if (other$createTime != null) { + return false; + } + } else if (!this$createTime.equals(other$createTime)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof AfInterfaceCollect; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $serialnum = this.getSerialnum(); + result = result * 59 + ($serialnum == null ? 43 : $serialnum.hashCode()); + Object $jzh = this.getJzh(); + result = result * 59 + ($jzh == null ? 43 : $jzh.hashCode()); + Object $taskCount = this.getTaskCount(); + result = result * 59 + ($taskCount == null ? 43 : $taskCount.hashCode()); + Object $completeCount = this.getCompleteCount(); + result = result * 59 + ($completeCount == null ? 43 : $completeCount.hashCode()); + Object $createTime = this.getCreateTime(); + result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode()); + return result; + } + + public String toString() { + return "AfInterfaceCollect(id=" + this.getId() + ", serialnum=" + this.getSerialnum() + ", jzh=" + this.getJzh() + ", taskCount=" + this.getTaskCount() + ", completeCount=" + this.getCompleteCount() + ", createTime=" + this.getCreateTime() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/AfInterfaceCollectSub.java b/src/main/java/com/docus/bgts/entity/AfInterfaceCollectSub.java new file mode 100644 index 0000000..d7708fc --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/AfInterfaceCollectSub.java @@ -0,0 +1,224 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; + +@ApiModel("文件库中的省中医病案采集-子任务表") +public class AfInterfaceCollectSub implements Serializable { + @TableId( + value = "id", + type = IdType.ASSIGN_ID + ) + private Long id; + @ApiModelProperty("af_interface_collect表id") + private Long afInterfaceCollectId; + @ApiModelProperty("采集器id") + private String collectsysCode; + @ApiModelProperty("子任务流水号 同一份文件子任务需一致") + private String serialnumSub; + @ApiModelProperty("记账号") + private String jzh; + @ApiModelProperty("分类名称") + private String assortName; + @ApiModelProperty("状态 0:未发起,1:成功,2:失败") + private Integer state; + @ApiModelProperty("请求信息") + private String requestMessage; + + public Long getId() { + return this.id; + } + + public Long getAfInterfaceCollectId() { + return this.afInterfaceCollectId; + } + + public String getCollectsysCode() { + return this.collectsysCode; + } + + public String getSerialnumSub() { + return this.serialnumSub; + } + + public String getJzh() { + return this.jzh; + } + + public String getAssortName() { + return this.assortName; + } + + public Integer getState() { + return this.state; + } + + public String getRequestMessage() { + return this.requestMessage; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setAfInterfaceCollectId(final Long afInterfaceCollectId) { + this.afInterfaceCollectId = afInterfaceCollectId; + } + + public void setCollectsysCode(final String collectsysCode) { + this.collectsysCode = collectsysCode; + } + + public void setSerialnumSub(final String serialnumSub) { + this.serialnumSub = serialnumSub; + } + + public void setJzh(final String jzh) { + this.jzh = jzh; + } + + public void setAssortName(final String assortName) { + this.assortName = assortName; + } + + public void setState(final Integer state) { + this.state = state; + } + + public void setRequestMessage(final String requestMessage) { + this.requestMessage = requestMessage; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof AfInterfaceCollectSub)) { + return false; + } else { + AfInterfaceCollectSub other = (AfInterfaceCollectSub)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$afInterfaceCollectId = this.getAfInterfaceCollectId(); + Object other$afInterfaceCollectId = other.getAfInterfaceCollectId(); + if (this$afInterfaceCollectId == null) { + if (other$afInterfaceCollectId != null) { + return false; + } + } else if (!this$afInterfaceCollectId.equals(other$afInterfaceCollectId)) { + return false; + } + + Object this$collectsysCode = this.getCollectsysCode(); + Object other$collectsysCode = other.getCollectsysCode(); + if (this$collectsysCode == null) { + if (other$collectsysCode != null) { + return false; + } + } else if (!this$collectsysCode.equals(other$collectsysCode)) { + return false; + } + + Object this$serialnumSub = this.getSerialnumSub(); + Object other$serialnumSub = other.getSerialnumSub(); + if (this$serialnumSub == null) { + if (other$serialnumSub != null) { + return false; + } + } else if (!this$serialnumSub.equals(other$serialnumSub)) { + return false; + } + + Object this$jzh = this.getJzh(); + Object other$jzh = other.getJzh(); + if (this$jzh == null) { + if (other$jzh != null) { + return false; + } + } else if (!this$jzh.equals(other$jzh)) { + return false; + } + + Object this$assortName = this.getAssortName(); + Object other$assortName = other.getAssortName(); + if (this$assortName == null) { + if (other$assortName != null) { + return false; + } + } else if (!this$assortName.equals(other$assortName)) { + return false; + } + + Object this$state = this.getState(); + Object other$state = other.getState(); + if (this$state == null) { + if (other$state != null) { + return false; + } + } else if (!this$state.equals(other$state)) { + return false; + } + + Object this$requestMessage = this.getRequestMessage(); + Object other$requestMessage = other.getRequestMessage(); + if (this$requestMessage == null) { + if (other$requestMessage != null) { + return false; + } + } else if (!this$requestMessage.equals(other$requestMessage)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof AfInterfaceCollectSub; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $afInterfaceCollectId = this.getAfInterfaceCollectId(); + result = result * 59 + ($afInterfaceCollectId == null ? 43 : $afInterfaceCollectId.hashCode()); + Object $collectsysCode = this.getCollectsysCode(); + result = result * 59 + ($collectsysCode == null ? 43 : $collectsysCode.hashCode()); + Object $serialnumSub = this.getSerialnumSub(); + result = result * 59 + ($serialnumSub == null ? 43 : $serialnumSub.hashCode()); + Object $jzh = this.getJzh(); + result = result * 59 + ($jzh == null ? 43 : $jzh.hashCode()); + Object $assortName = this.getAssortName(); + result = result * 59 + ($assortName == null ? 43 : $assortName.hashCode()); + Object $state = this.getState(); + result = result * 59 + ($state == null ? 43 : $state.hashCode()); + Object $requestMessage = this.getRequestMessage(); + result = result * 59 + ($requestMessage == null ? 43 : $requestMessage.hashCode()); + return result; + } + + public String toString() { + return "AfInterfaceCollectSub(id=" + this.getId() + ", afInterfaceCollectId=" + this.getAfInterfaceCollectId() + ", collectsysCode=" + this.getCollectsysCode() + ", serialnumSub=" + this.getSerialnumSub() + ", jzh=" + this.getJzh() + ", assortName=" + this.getAssortName() + ", state=" + this.getState() + ", requestMessage=" + this.getRequestMessage() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/CommonResult.java b/src/main/java/com/docus/bgts/entity/CommonResult.java new file mode 100644 index 0000000..a09ae5b --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/CommonResult.java @@ -0,0 +1,170 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.beans.ConstructorProperties; + +@ApiModel("响应") +public class CommonResult { + @ApiModelProperty("响应码") + private Integer code; + @ApiModelProperty("响应消息") + private String msg; + @ApiModelProperty("响应实体") + private T data; + + public CommonResult(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + public static CommonResult success(T data) { + return new CommonResult(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data); + } + + public static CommonResult success(T data, String message) { + return new CommonResult(ResultCode.SUCCESS.getCode(), message, data); + } + + public static CommonResult failed(IErrorCode errorCode) { + return new CommonResult(errorCode.getCode(), errorCode.getMessage(),null); + } + + public static CommonResult failed(IErrorCode errorCode, String message) { + return new CommonResult(errorCode.getCode(), message,null); + } + + public static CommonResult failed(String message) { + return new CommonResult(ResultCode.FAILED.getCode(), message,null); + } + + public static CommonResult failed() { + return failed((IErrorCode)ResultCode.FAILED); + } + + public static CommonResult validateFailed() { + return failed((IErrorCode)ResultCode.VALIDATE_FAILED); + } + + public static CommonResult validateFailed(String message) { + return new CommonResult(ResultCode.VALIDATE_FAILED.getCode(), message,null); + } + + public static CommonResult unauthorized(T data) { + return new CommonResult(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMessage(), data); + } + + public static CommonResult preventreplay(T data) { + return new CommonResult(ResultCode.PREVENT_REPLAY.getCode(), ResultCode.PREVENT_REPLAY.getMessage(), data); + } + + public static CommonResult forbidden(T data) { + return new CommonResult(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getMessage(), data); + } + + public Integer getCode() { + return this.code; + } + + public String getMsg() { + return this.msg; + } + + public T getData() { + return this.data; + } + + public void setCode(final Integer code) { + this.code = code; + } + + public void setMsg(final String msg) { + this.msg = msg; + } + + public void setData(final T data) { + this.data = data; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof CommonResult)) { + return false; + } else { + CommonResult other = (CommonResult)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$code = this.getCode(); + Object other$code = other.getCode(); + if (this$code == null) { + if (other$code != null) { + return false; + } + } else if (!this$code.equals(other$code)) { + return false; + } + + Object this$msg = this.getMsg(); + Object other$msg = other.getMsg(); + if (this$msg == null) { + if (other$msg != null) { + return false; + } + } else if (!this$msg.equals(other$msg)) { + return false; + } + + Object this$data = this.getData(); + Object other$data = other.getData(); + if (this$data == null) { + if (other$data != null) { + return false; + } + } else if (!this$data.equals(other$data)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof CommonResult; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $code = this.getCode(); + result = result * 59 + ($code == null ? 43 : $code.hashCode()); + Object $msg = this.getMsg(); + result = result * 59 + ($msg == null ? 43 : $msg.hashCode()); + Object $data = this.getData(); + result = result * 59 + ($data == null ? 43 : $data.hashCode()); + return result; + } + + public String toString() { + return "CommonResult(code=" + this.getCode() + ", msg=" + this.getMsg() + ", data=" + this.getData() + ")"; + } + + @ConstructorProperties({"code", "msg", "data"}) + public CommonResult(final Integer code, final String msg, final T data) { + this.code = code; + this.msg = msg; + this.data = data; + } + + public CommonResult() { + } +} diff --git a/src/main/java/com/docus/bgts/entity/IErrorCode.java b/src/main/java/com/docus/bgts/entity/IErrorCode.java new file mode 100644 index 0000000..86559d7 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/IErrorCode.java @@ -0,0 +1,12 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +public interface IErrorCode { + Integer getCode(); + + String getMessage(); +} diff --git a/src/main/java/com/docus/bgts/entity/JzhListSync.java b/src/main/java/com/docus/bgts/entity/JzhListSync.java new file mode 100644 index 0000000..3d8df20 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/JzhListSync.java @@ -0,0 +1,82 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import java.util.List; + +public class JzhListSync { + private String jzh; + private List taskDetails; + + public String getJzh() { + return this.jzh; + } + + public List getTaskDetails() { + return this.taskDetails; + } + + public void setJzh(final String jzh) { + this.jzh = jzh; + } + + public void setTaskDetails(final List taskDetails) { + this.taskDetails = taskDetails; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof JzhListSync)) { + return false; + } else { + JzhListSync other = (JzhListSync)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$jzh = this.getJzh(); + Object other$jzh = other.getJzh(); + if (this$jzh == null) { + if (other$jzh != null) { + return false; + } + } else if (!this$jzh.equals(other$jzh)) { + return false; + } + + Object this$taskDetails = this.getTaskDetails(); + Object other$taskDetails = other.getTaskDetails(); + if (this$taskDetails == null) { + if (other$taskDetails != null) { + return false; + } + } else if (!this$taskDetails.equals(other$taskDetails)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof JzhListSync; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $jzh = this.getJzh(); + result = result * 59 + ($jzh == null ? 43 : $jzh.hashCode()); + Object $taskDetails = this.getTaskDetails(); + result = result * 59 + ($taskDetails == null ? 43 : $taskDetails.hashCode()); + return result; + } + + public String toString() { + return "JzhListSync(jzh=" + this.getJzh() + ", taskDetails=" + this.getTaskDetails() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/MrReportError.java b/src/main/java/com/docus/bgts/entity/MrReportError.java new file mode 100644 index 0000000..6071474 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/MrReportError.java @@ -0,0 +1,137 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +@ApiModel("错误日志表") +public class MrReportError { + @ApiModelProperty("id") + @TableId( + value = "id", + type = IdType.ASSIGN_ID + ) + private Long id; + @ApiModelProperty("上报信息") + private String xml; + @ApiModelProperty("上报类型") + private Integer reportType; + @ApiModelProperty("上报时间") + private Date createTime; + + public Long getId() { + return this.id; + } + + public String getXml() { + return this.xml; + } + + public Integer getReportType() { + return this.reportType; + } + + public Date getCreateTime() { + return this.createTime; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setXml(final String xml) { + this.xml = xml; + } + + public void setReportType(final Integer reportType) { + this.reportType = reportType; + } + + public void setCreateTime(final Date createTime) { + this.createTime = createTime; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof MrReportError)) { + return false; + } else { + MrReportError other = (MrReportError)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$xml = this.getXml(); + Object other$xml = other.getXml(); + if (this$xml == null) { + if (other$xml != null) { + return false; + } + } else if (!this$xml.equals(other$xml)) { + return false; + } + + Object this$reportType = this.getReportType(); + Object other$reportType = other.getReportType(); + if (this$reportType == null) { + if (other$reportType != null) { + return false; + } + } else if (!this$reportType.equals(other$reportType)) { + return false; + } + + Object this$createTime = this.getCreateTime(); + Object other$createTime = other.getCreateTime(); + if (this$createTime == null) { + if (other$createTime != null) { + return false; + } + } else if (!this$createTime.equals(other$createTime)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof MrReportError; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $xml = this.getXml(); + result = result * 59 + ($xml == null ? 43 : $xml.hashCode()); + Object $reportType = this.getReportType(); + result = result * 59 + ($reportType == null ? 43 : $reportType.hashCode()); + Object $createTime = this.getCreateTime(); + result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode()); + return result; + } + + public String toString() { + return "MrReportError(id=" + this.getId() + ", xml=" + this.getXml() + ", reportType=" + this.getReportType() + ", createTime=" + this.getCreateTime() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/MzSync.java b/src/main/java/com/docus/bgts/entity/MzSync.java new file mode 100644 index 0000000..4144f4f --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/MzSync.java @@ -0,0 +1,87 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.List; + +@ApiModel("梅州完整性校验同步类") +public class MzSync { + @ApiModelProperty("记账号") + private String jzh; + @ApiModelProperty("文件详情列表") + private List mzSyncDetails; + + public String getJzh() { + return this.jzh; + } + + public List getMzSyncDetails() { + return this.mzSyncDetails; + } + + public void setJzh(final String jzh) { + this.jzh = jzh; + } + + public void setMzSyncDetails(final List mzSyncDetails) { + this.mzSyncDetails = mzSyncDetails; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof MzSync)) { + return false; + } else { + MzSync other = (MzSync)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$jzh = this.getJzh(); + Object other$jzh = other.getJzh(); + if (this$jzh == null) { + if (other$jzh != null) { + return false; + } + } else if (!this$jzh.equals(other$jzh)) { + return false; + } + + Object this$mzSyncDetails = this.getMzSyncDetails(); + Object other$mzSyncDetails = other.getMzSyncDetails(); + if (this$mzSyncDetails == null) { + if (other$mzSyncDetails != null) { + return false; + } + } else if (!this$mzSyncDetails.equals(other$mzSyncDetails)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof MzSync; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $jzh = this.getJzh(); + result = result * 59 + ($jzh == null ? 43 : $jzh.hashCode()); + Object $mzSyncDetails = this.getMzSyncDetails(); + result = result * 59 + ($mzSyncDetails == null ? 43 : $mzSyncDetails.hashCode()); + return result; + } + + public String toString() { + return "MzSync(jzh=" + this.getJzh() + ", mzSyncDetails=" + this.getMzSyncDetails() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/MzSyncDetails.java b/src/main/java/com/docus/bgts/entity/MzSyncDetails.java new file mode 100644 index 0000000..a1a9edc --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/MzSyncDetails.java @@ -0,0 +1,175 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; + +@ApiModel("文件详情") +public class MzSyncDetails { + @ApiModelProperty("采集流水号") + private String serialnum; + @ApiModelProperty("文件标题") + private String fileTitle; + @ApiModelProperty("文件url") + private String fileUrl; + @ApiModelProperty("分类名称") + private String assortName; + @ApiModelProperty("采集器标识") + private String collectid; + @ApiModelProperty("创建时间") + private Date createTime; + + public String getSerialnum() { + return this.serialnum; + } + + public String getFileTitle() { + return this.fileTitle; + } + + public String getFileUrl() { + return this.fileUrl; + } + + public String getAssortName() { + return this.assortName; + } + + public String getCollectid() { + return this.collectid; + } + + public Date getCreateTime() { + return this.createTime; + } + + public void setSerialnum(final String serialnum) { + this.serialnum = serialnum; + } + + public void setFileTitle(final String fileTitle) { + this.fileTitle = fileTitle; + } + + public void setFileUrl(final String fileUrl) { + this.fileUrl = fileUrl; + } + + public void setAssortName(final String assortName) { + this.assortName = assortName; + } + + public void setCollectid(final String collectid) { + this.collectid = collectid; + } + + public void setCreateTime(final Date createTime) { + this.createTime = createTime; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof MzSyncDetails)) { + return false; + } else { + MzSyncDetails other = (MzSyncDetails)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$serialnum = this.getSerialnum(); + Object other$serialnum = other.getSerialnum(); + if (this$serialnum == null) { + if (other$serialnum != null) { + return false; + } + } else if (!this$serialnum.equals(other$serialnum)) { + return false; + } + + Object this$fileTitle = this.getFileTitle(); + Object other$fileTitle = other.getFileTitle(); + if (this$fileTitle == null) { + if (other$fileTitle != null) { + return false; + } + } else if (!this$fileTitle.equals(other$fileTitle)) { + return false; + } + + Object this$fileUrl = this.getFileUrl(); + Object other$fileUrl = other.getFileUrl(); + if (this$fileUrl == null) { + if (other$fileUrl != null) { + return false; + } + } else if (!this$fileUrl.equals(other$fileUrl)) { + return false; + } + + Object this$assortName = this.getAssortName(); + Object other$assortName = other.getAssortName(); + if (this$assortName == null) { + if (other$assortName != null) { + return false; + } + } else if (!this$assortName.equals(other$assortName)) { + return false; + } + + Object this$collectid = this.getCollectid(); + Object other$collectid = other.getCollectid(); + if (this$collectid == null) { + if (other$collectid != null) { + return false; + } + } else if (!this$collectid.equals(other$collectid)) { + return false; + } + + Object this$createTime = this.getCreateTime(); + Object other$createTime = other.getCreateTime(); + if (this$createTime == null) { + if (other$createTime != null) { + return false; + } + } else if (!this$createTime.equals(other$createTime)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof MzSyncDetails; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $serialnum = this.getSerialnum(); + result = result * 59 + ($serialnum == null ? 43 : $serialnum.hashCode()); + Object $fileTitle = this.getFileTitle(); + result = result * 59 + ($fileTitle == null ? 43 : $fileTitle.hashCode()); + Object $fileUrl = this.getFileUrl(); + result = result * 59 + ($fileUrl == null ? 43 : $fileUrl.hashCode()); + Object $assortName = this.getAssortName(); + result = result * 59 + ($assortName == null ? 43 : $assortName.hashCode()); + Object $collectid = this.getCollectid(); + result = result * 59 + ($collectid == null ? 43 : $collectid.hashCode()); + Object $createTime = this.getCreateTime(); + result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode()); + return result; + } + + public String toString() { + return "MzSyncDetails(serialnum=" + this.getSerialnum() + ", fileTitle=" + this.getFileTitle() + ", fileUrl=" + this.getFileUrl() + ", assortName=" + this.getAssortName() + ", collectid=" + this.getCollectid() + ", createTime=" + this.getCreateTime() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/ReportDownDto.java b/src/main/java/com/docus/bgts/entity/ReportDownDto.java new file mode 100644 index 0000000..aa6d0b2 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/ReportDownDto.java @@ -0,0 +1,150 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModelProperty; +import java.util.List; + +public class ReportDownDto { + @ApiModelProperty("采集器id") + private String collectorid; + @ApiModelProperty("采集器ip") + private String ip; + @ApiModelProperty("文件信息") + private List scanfiles; + private ReportDownPatientDto patient; + @ApiModelProperty("分类id") + private String assortid; + + public String getCollectorid() { + return this.collectorid; + } + + public String getIp() { + return this.ip; + } + + public List getScanfiles() { + return this.scanfiles; + } + + public ReportDownPatientDto getPatient() { + return this.patient; + } + + public String getAssortid() { + return this.assortid; + } + + public void setCollectorid(final String collectorid) { + this.collectorid = collectorid; + } + + public void setIp(final String ip) { + this.ip = ip; + } + + public void setScanfiles(final List scanfiles) { + this.scanfiles = scanfiles; + } + + public void setPatient(final ReportDownPatientDto patient) { + this.patient = patient; + } + + public void setAssortid(final String assortid) { + this.assortid = assortid; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ReportDownDto)) { + return false; + } else { + ReportDownDto other = (ReportDownDto)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$collectorid = this.getCollectorid(); + Object other$collectorid = other.getCollectorid(); + if (this$collectorid == null) { + if (other$collectorid != null) { + return false; + } + } else if (!this$collectorid.equals(other$collectorid)) { + return false; + } + + Object this$ip = this.getIp(); + Object other$ip = other.getIp(); + if (this$ip == null) { + if (other$ip != null) { + return false; + } + } else if (!this$ip.equals(other$ip)) { + return false; + } + + Object this$scanfiles = this.getScanfiles(); + Object other$scanfiles = other.getScanfiles(); + if (this$scanfiles == null) { + if (other$scanfiles != null) { + return false; + } + } else if (!this$scanfiles.equals(other$scanfiles)) { + return false; + } + + Object this$patient = this.getPatient(); + Object other$patient = other.getPatient(); + if (this$patient == null) { + if (other$patient != null) { + return false; + } + } else if (!this$patient.equals(other$patient)) { + return false; + } + + Object this$assortid = this.getAssortid(); + Object other$assortid = other.getAssortid(); + if (this$assortid == null) { + if (other$assortid != null) { + return false; + } + } else if (!this$assortid.equals(other$assortid)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof ReportDownDto; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $collectorid = this.getCollectorid(); + result = result * 59 + ($collectorid == null ? 43 : $collectorid.hashCode()); + Object $ip = this.getIp(); + result = result * 59 + ($ip == null ? 43 : $ip.hashCode()); + Object $scanfiles = this.getScanfiles(); + result = result * 59 + ($scanfiles == null ? 43 : $scanfiles.hashCode()); + Object $patient = this.getPatient(); + result = result * 59 + ($patient == null ? 43 : $patient.hashCode()); + Object $assortid = this.getAssortid(); + result = result * 59 + ($assortid == null ? 43 : $assortid.hashCode()); + return result; + } + + public String toString() { + return "ReportDownDto(collectorid=" + this.getCollectorid() + ", ip=" + this.getIp() + ", scanfiles=" + this.getScanfiles() + ", patient=" + this.getPatient() + ", assortid=" + this.getAssortid() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/ReportDownPatientDto.java b/src/main/java/com/docus/bgts/entity/ReportDownPatientDto.java new file mode 100644 index 0000000..30e0436 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/ReportDownPatientDto.java @@ -0,0 +1,106 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModelProperty; + +public class ReportDownPatientDto { + @ApiModelProperty("记帐号") + private String jzh; + @ApiModelProperty("住院号") + private String inPatientNo; + @ApiModelProperty("住院次数") + private String visitId; + + public String getJzh() { + return this.jzh; + } + + public String getInPatientNo() { + return this.inPatientNo; + } + + public String getVisitId() { + return this.visitId; + } + + public void setJzh(final String jzh) { + this.jzh = jzh; + } + + public void setInPatientNo(final String inPatientNo) { + this.inPatientNo = inPatientNo; + } + + public void setVisitId(final String visitId) { + this.visitId = visitId; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ReportDownPatientDto)) { + return false; + } else { + ReportDownPatientDto other = (ReportDownPatientDto)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$jzh = this.getJzh(); + Object other$jzh = other.getJzh(); + if (this$jzh == null) { + if (other$jzh != null) { + return false; + } + } else if (!this$jzh.equals(other$jzh)) { + return false; + } + + Object this$inPatientNo = this.getInPatientNo(); + Object other$inPatientNo = other.getInPatientNo(); + if (this$inPatientNo == null) { + if (other$inPatientNo != null) { + return false; + } + } else if (!this$inPatientNo.equals(other$inPatientNo)) { + return false; + } + + Object this$visitId = this.getVisitId(); + Object other$visitId = other.getVisitId(); + if (this$visitId == null) { + if (other$visitId != null) { + return false; + } + } else if (!this$visitId.equals(other$visitId)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof ReportDownPatientDto; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $jzh = this.getJzh(); + result = result * 59 + ($jzh == null ? 43 : $jzh.hashCode()); + Object $inPatientNo = this.getInPatientNo(); + result = result * 59 + ($inPatientNo == null ? 43 : $inPatientNo.hashCode()); + Object $visitId = this.getVisitId(); + result = result * 59 + ($visitId == null ? 43 : $visitId.hashCode()); + return result; + } + + public String toString() { + return "ReportDownPatientDto(jzh=" + this.getJzh() + ", inPatientNo=" + this.getInPatientNo() + ", visitId=" + this.getVisitId() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java b/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java new file mode 100644 index 0000000..10dfb09 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/ReportDownScanFileDto.java @@ -0,0 +1,178 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModelProperty; + +public class ReportDownScanFileDto { + @ApiModelProperty("文件标题") + private String filetitle; + @ApiModelProperty("采集类型(文件来源 1:采集器;2:扫描生产软件)") + private int filesource; + @ApiModelProperty("下载类型(1:服务器本地;2:ftp服务器;3:共享文件夹)") + private int filestoragetype; + @ApiModelProperty("下载地址") + private String downurl; + @ApiModelProperty("档案信息") + private String recordid; + @ApiModelProperty("采集流水号") + private String serialnum; + @ApiModelProperty("任务id") + private Long taskid; + + public String getFiletitle() { + return this.filetitle; + } + + public int getFilesource() { + return this.filesource; + } + + public int getFilestoragetype() { + return this.filestoragetype; + } + + public String getDownurl() { + return this.downurl; + } + + public String getRecordid() { + return this.recordid; + } + + public String getSerialnum() { + return this.serialnum; + } + + public Long getTaskid() { + return this.taskid; + } + + public void setFiletitle(final String filetitle) { + this.filetitle = filetitle; + } + + public void setFilesource(final int filesource) { + this.filesource = filesource; + } + + public void setFilestoragetype(final int filestoragetype) { + this.filestoragetype = filestoragetype; + } + + public void setDownurl(final String downurl) { + this.downurl = downurl; + } + + public void setRecordid(final String recordid) { + this.recordid = recordid; + } + + public void setSerialnum(final String serialnum) { + this.serialnum = serialnum; + } + + public void setTaskid(final Long taskid) { + this.taskid = taskid; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ReportDownScanFileDto)) { + return false; + } else { + ReportDownScanFileDto other = (ReportDownScanFileDto)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$filetitle = this.getFiletitle(); + Object other$filetitle = other.getFiletitle(); + if (this$filetitle == null) { + if (other$filetitle != null) { + return false; + } + } else if (!this$filetitle.equals(other$filetitle)) { + return false; + } + + if (this.getFilesource() != other.getFilesource()) { + return false; + } else if (this.getFilestoragetype() != other.getFilestoragetype()) { + return false; + } else { + Object this$downurl = this.getDownurl(); + Object other$downurl = other.getDownurl(); + if (this$downurl == null) { + if (other$downurl != null) { + return false; + } + } else if (!this$downurl.equals(other$downurl)) { + return false; + } + + Object this$recordid = this.getRecordid(); + Object other$recordid = other.getRecordid(); + if (this$recordid == null) { + if (other$recordid != null) { + return false; + } + } else if (!this$recordid.equals(other$recordid)) { + return false; + } + + Object this$serialnum = this.getSerialnum(); + Object other$serialnum = other.getSerialnum(); + if (this$serialnum == null) { + if (other$serialnum != null) { + return false; + } + } else if (!this$serialnum.equals(other$serialnum)) { + return false; + } + + Object this$taskid = this.getTaskid(); + Object other$taskid = other.getTaskid(); + if (this$taskid == null) { + if (other$taskid != null) { + return false; + } + } else if (!this$taskid.equals(other$taskid)) { + return false; + } + + return true; + } + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof ReportDownScanFileDto; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $filetitle = this.getFiletitle(); + result = result * 59 + ($filetitle == null ? 43 : $filetitle.hashCode()); + result = result * 59 + this.getFilesource(); + result = result * 59 + this.getFilestoragetype(); + Object $downurl = this.getDownurl(); + result = result * 59 + ($downurl == null ? 43 : $downurl.hashCode()); + Object $recordid = this.getRecordid(); + result = result * 59 + ($recordid == null ? 43 : $recordid.hashCode()); + Object $serialnum = this.getSerialnum(); + result = result * 59 + ($serialnum == null ? 43 : $serialnum.hashCode()); + Object $taskid = this.getTaskid(); + result = result * 59 + ($taskid == null ? 43 : $taskid.hashCode()); + return result; + } + + public String toString() { + return "ReportDownScanFileDto(filetitle=" + this.getFiletitle() + ", filesource=" + this.getFilesource() + ", filestoragetype=" + this.getFilestoragetype() + ", downurl=" + this.getDownurl() + ", recordid=" + this.getRecordid() + ", serialnum=" + this.getSerialnum() + ", taskid=" + this.getTaskid() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/ResultCode.java b/src/main/java/com/docus/bgts/entity/ResultCode.java new file mode 100644 index 0000000..3f65c81 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/ResultCode.java @@ -0,0 +1,33 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +public enum ResultCode implements IErrorCode { + SUCCESS(0, "操作成功"), + FAILED(500, "操作失败"), + VALIDATE_FAILED(404, "参数检验失败"), + UNAUTHORIZED(401, "暂未登录或token已经过期"), + FORBIDDEN(403, "没有相关权限"), + PREVENT_REPLAY(405, "重复请求"), + NOT_EXIST(601, "数据不存在"), + NOT_ENABLE(600, "数据未启用"); + + private Integer code; + private String message; + + private ResultCode(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return this.code; + } + + public String getMessage() { + return this.message; + } +} diff --git a/src/main/java/com/docus/bgts/entity/TableJsonRead.java b/src/main/java/com/docus/bgts/entity/TableJsonRead.java new file mode 100644 index 0000000..4ec758c --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/TableJsonRead.java @@ -0,0 +1,90 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import org.springframework.util.StringUtils; + +public class TableJsonRead { + public T Read(String path, String fileName, Class clazz) { + String currentPath = this.CurrentPath(); + path = currentPath + "\\" + path; + StringBuilder sb = new StringBuilder(); + T dto = null; + File file = new File(path + "\\" + fileName); + + try { + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + 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)objectMapper.readValue(sb.toString(), clazz); + } + + bufferedReader.close(); + } + + return dto; + } catch (Exception ex) { + ex.printStackTrace(); + return null; + } + } + + private String CurrentPath() { + File dir = new File("."); + String currentpath = ""; + + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException e) { + e.printStackTrace(); + } + + return currentpath; + } + + public void Save(String path, String fileName, String data) { + String currentPath = this.CurrentPath(); + path = currentPath + "\\" + path; + FileWriter fwriter = null; + + try { + 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/bgts/entity/TaskDetail.java b/src/main/java/com/docus/bgts/entity/TaskDetail.java new file mode 100644 index 0000000..dc7975c --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/TaskDetail.java @@ -0,0 +1,101 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +public class TaskDetail { + private Long id; + private String fileTitle; + private String state; + + public Long getId() { + return this.id; + } + + public String getFileTitle() { + return this.fileTitle; + } + + public String getState() { + return this.state; + } + + public void setId(final Long id) { + this.id = id; + } + + public void setFileTitle(final String fileTitle) { + this.fileTitle = fileTitle; + } + + public void setState(final String state) { + this.state = state; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof TaskDetail)) { + return false; + } else { + TaskDetail other = (TaskDetail)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$id = this.getId(); + Object other$id = other.getId(); + if (this$id == null) { + if (other$id != null) { + return false; + } + } else if (!this$id.equals(other$id)) { + return false; + } + + Object this$fileTitle = this.getFileTitle(); + Object other$fileTitle = other.getFileTitle(); + if (this$fileTitle == null) { + if (other$fileTitle != null) { + return false; + } + } else if (!this$fileTitle.equals(other$fileTitle)) { + return false; + } + + Object this$state = this.getState(); + Object other$state = other.getState(); + if (this$state == null) { + if (other$state != null) { + return false; + } + } else if (!this$state.equals(other$state)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof TaskDetail; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $id = this.getId(); + result = result * 59 + ($id == null ? 43 : $id.hashCode()); + Object $fileTitle = this.getFileTitle(); + result = result * 59 + ($fileTitle == null ? 43 : $fileTitle.hashCode()); + Object $state = this.getState(); + result = result * 59 + ($state == null ? 43 : $state.hashCode()); + return result; + } + + public String toString() { + return "TaskDetail(id=" + this.getId() + ", fileTitle=" + this.getFileTitle() + ", state=" + this.getState() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/VDocumentPdf.java b/src/main/java/com/docus/bgts/entity/VDocumentPdf.java new file mode 100644 index 0000000..55ede40 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/VDocumentPdf.java @@ -0,0 +1,147 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import io.swagger.annotations.ApiModel; +import java.util.Date; + +@ApiModel("手麻采集器") +public class VDocumentPdf { + private String 手术申请单号; + private String 文书名; + private String WEB_ADDRESS; + private String PATIENT_ID; + private Date ARCHIVE_DATE_TIME; + + public String get手术申请单号() { + return this.手术申请单号; + } + + public String get文书名() { + return this.文书名; + } + + public String getWEB_ADDRESS() { + return this.WEB_ADDRESS; + } + + public String getPATIENT_ID() { + return this.PATIENT_ID; + } + + public Date getARCHIVE_DATE_TIME() { + return this.ARCHIVE_DATE_TIME; + } + + public void set手术申请单号(final String 手术申请单号) { + this.手术申请单号 = 手术申请单号; + } + + public void set文书名(final String 文书名) { + this.文书名 = 文书名; + } + + public void setWEB_ADDRESS(final String WEB_ADDRESS) { + this.WEB_ADDRESS = WEB_ADDRESS; + } + + public void setPATIENT_ID(final String PATIENT_ID) { + this.PATIENT_ID = PATIENT_ID; + } + + public void setARCHIVE_DATE_TIME(final Date ARCHIVE_DATE_TIME) { + this.ARCHIVE_DATE_TIME = ARCHIVE_DATE_TIME; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof VDocumentPdf)) { + return false; + } else { + VDocumentPdf other = (VDocumentPdf)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$手术申请单号 = this.get手术申请单号(); + Object other$手术申请单号 = other.get手术申请单号(); + if (this$手术申请单号 == null) { + if (other$手术申请单号 != null) { + return false; + } + } else if (!this$手术申请单号.equals(other$手术申请单号)) { + return false; + } + + Object this$文书名 = this.get文书名(); + Object other$文书名 = other.get文书名(); + if (this$文书名 == null) { + if (other$文书名 != null) { + return false; + } + } else if (!this$文书名.equals(other$文书名)) { + return false; + } + + Object this$WEB_ADDRESS = this.getWEB_ADDRESS(); + Object other$WEB_ADDRESS = other.getWEB_ADDRESS(); + if (this$WEB_ADDRESS == null) { + if (other$WEB_ADDRESS != null) { + return false; + } + } else if (!this$WEB_ADDRESS.equals(other$WEB_ADDRESS)) { + return false; + } + + Object this$PATIENT_ID = this.getPATIENT_ID(); + Object other$PATIENT_ID = other.getPATIENT_ID(); + if (this$PATIENT_ID == null) { + if (other$PATIENT_ID != null) { + return false; + } + } else if (!this$PATIENT_ID.equals(other$PATIENT_ID)) { + return false; + } + + Object this$ARCHIVE_DATE_TIME = this.getARCHIVE_DATE_TIME(); + Object other$ARCHIVE_DATE_TIME = other.getARCHIVE_DATE_TIME(); + if (this$ARCHIVE_DATE_TIME == null) { + if (other$ARCHIVE_DATE_TIME != null) { + return false; + } + } else if (!this$ARCHIVE_DATE_TIME.equals(other$ARCHIVE_DATE_TIME)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof VDocumentPdf; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $手术申请单号 = this.get手术申请单号(); + result = result * 59 + ($手术申请单号 == null ? 43 : $手术申请单号.hashCode()); + Object $文书名 = this.get文书名(); + result = result * 59 + ($文书名 == null ? 43 : $文书名.hashCode()); + Object $WEB_ADDRESS = this.getWEB_ADDRESS(); + result = result * 59 + ($WEB_ADDRESS == null ? 43 : $WEB_ADDRESS.hashCode()); + Object $PATIENT_ID = this.getPATIENT_ID(); + result = result * 59 + ($PATIENT_ID == null ? 43 : $PATIENT_ID.hashCode()); + Object $ARCHIVE_DATE_TIME = this.getARCHIVE_DATE_TIME(); + result = result * 59 + ($ARCHIVE_DATE_TIME == null ? 43 : $ARCHIVE_DATE_TIME.hashCode()); + return result; + } + + public String toString() { + return "VDocumentPdf(手术申请单号=" + this.get手术申请单号() + ", 文书名=" + this.get文书名() + ", WEB_ADDRESS=" + this.getWEB_ADDRESS() + ", PATIENT_ID=" + this.getPATIENT_ID() + ", ARCHIVE_DATE_TIME=" + this.getARCHIVE_DATE_TIME() + ")"; + } +} diff --git a/src/main/java/com/docus/bgts/entity/ZdAssort.java b/src/main/java/com/docus/bgts/entity/ZdAssort.java new file mode 100644 index 0000000..3e52bd3 --- /dev/null +++ b/src/main/java/com/docus/bgts/entity/ZdAssort.java @@ -0,0 +1,203 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; + +@ApiModel( + value = "ZdAssort对象", + description = "病案分类" +) +public class ZdAssort implements Serializable { + private static final long serialVersionUID = 1L; + @TableId + @ApiModelProperty("分类id") + private String assortId; + @ApiModelProperty("分类名称") + private String assortName; + @ApiModelProperty("分类排序") + private Integer assortSort; + @ApiModelProperty("是否启用 1是,0否") + private Integer effective; + @ApiModelProperty("是否校验 1是,0否") + private Integer isCheck; + @ApiModelProperty("代码分类") + private String assortCode; + @ApiModelProperty("等级") + private Integer level; + + public String getAssortId() { + return this.assortId; + } + + public String getAssortName() { + return this.assortName; + } + + public Integer getAssortSort() { + return this.assortSort; + } + + public Integer getEffective() { + return this.effective; + } + + public Integer getIsCheck() { + return this.isCheck; + } + + public String getAssortCode() { + return this.assortCode; + } + + public Integer getLevel() { + return this.level; + } + + public void setAssortId(final String assortId) { + this.assortId = assortId; + } + + public void setAssortName(final String assortName) { + this.assortName = assortName; + } + + public void setAssortSort(final Integer assortSort) { + this.assortSort = assortSort; + } + + public void setEffective(final Integer effective) { + this.effective = effective; + } + + public void setIsCheck(final Integer isCheck) { + this.isCheck = isCheck; + } + + public void setAssortCode(final String assortCode) { + this.assortCode = assortCode; + } + + public void setLevel(final Integer level) { + this.level = level; + } + + public String toString() { + return "ZdAssort(assortId=" + this.getAssortId() + ", assortName=" + this.getAssortName() + ", assortSort=" + this.getAssortSort() + ", effective=" + this.getEffective() + ", isCheck=" + this.getIsCheck() + ", assortCode=" + this.getAssortCode() + ", level=" + this.getLevel() + ")"; + } + + public boolean equals(final Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ZdAssort)) { + return false; + } else { + ZdAssort other = (ZdAssort)o; + if (!other.canEqual(this)) { + return false; + } else { + Object this$assortId = this.getAssortId(); + Object other$assortId = other.getAssortId(); + if (this$assortId == null) { + if (other$assortId != null) { + return false; + } + } else if (!this$assortId.equals(other$assortId)) { + return false; + } + + Object this$assortName = this.getAssortName(); + Object other$assortName = other.getAssortName(); + if (this$assortName == null) { + if (other$assortName != null) { + return false; + } + } else if (!this$assortName.equals(other$assortName)) { + return false; + } + + Object this$assortSort = this.getAssortSort(); + Object other$assortSort = other.getAssortSort(); + if (this$assortSort == null) { + if (other$assortSort != null) { + return false; + } + } else if (!this$assortSort.equals(other$assortSort)) { + return false; + } + + Object this$effective = this.getEffective(); + Object other$effective = other.getEffective(); + if (this$effective == null) { + if (other$effective != null) { + return false; + } + } else if (!this$effective.equals(other$effective)) { + return false; + } + + Object this$isCheck = this.getIsCheck(); + Object other$isCheck = other.getIsCheck(); + if (this$isCheck == null) { + if (other$isCheck != null) { + return false; + } + } else if (!this$isCheck.equals(other$isCheck)) { + return false; + } + + Object this$assortCode = this.getAssortCode(); + Object other$assortCode = other.getAssortCode(); + if (this$assortCode == null) { + if (other$assortCode != null) { + return false; + } + } else if (!this$assortCode.equals(other$assortCode)) { + return false; + } + + Object this$level = this.getLevel(); + Object other$level = other.getLevel(); + if (this$level == null) { + if (other$level != null) { + return false; + } + } else if (!this$level.equals(other$level)) { + return false; + } + + return true; + } + } + } + + protected boolean canEqual(final Object other) { + return other instanceof ZdAssort; + } + + public int hashCode() { + int PRIME = 59; + int result = 1; + Object $assortId = this.getAssortId(); + result = result * 59 + ($assortId == null ? 43 : $assortId.hashCode()); + Object $assortName = this.getAssortName(); + result = result * 59 + ($assortName == null ? 43 : $assortName.hashCode()); + Object $assortSort = this.getAssortSort(); + result = result * 59 + ($assortSort == null ? 43 : $assortSort.hashCode()); + Object $effective = this.getEffective(); + result = result * 59 + ($effective == null ? 43 : $effective.hashCode()); + Object $isCheck = this.getIsCheck(); + result = result * 59 + ($isCheck == null ? 43 : $isCheck.hashCode()); + Object $assortCode = this.getAssortCode(); + result = result * 59 + ($assortCode == null ? 43 : $assortCode.hashCode()); + Object $level = this.getLevel(); + result = result * 59 + ($level == null ? 43 : $level.hashCode()); + return result; + } +} diff --git a/src/main/java/com/docus/bgts/enums/Codes.java b/src/main/java/com/docus/bgts/enums/Codes.java new file mode 100644 index 0000000..4805dbb --- /dev/null +++ b/src/main/java/com/docus/bgts/enums/Codes.java @@ -0,0 +1,43 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.enums; + +public enum Codes { + SUCCESS("0", "成功"), + ERROR("1", "失败"), + RESPONSE("100", "Response"), + RET_INFO("101", "RetInfo"), + RET_CODE("102", "RetCode"), + RET_CON("103", "RetCon"), + EXTERNAL("9202", "201_P_WS_JYBGTS"), + JSON_ADDRESS("999", "\\dataConfig\\homeQualitySet.json"), + MSG("201", "Msg"), + DIRECTORY("1000", "directory"), + UPLOAD("0", "uploadConnector"), + SMCODE("5", "手麻代码"), + ZZCODE("15", "重症代码"), + REQUEST_XML("0", "\\dataConfig\\RequestParams.xml"), + REQUEST_details_XML("0", "\\dataConfig\\RequestDetailsParams.xml"), + EMP_ID("0", "indexFlag"), + ERROR_CODE("500", "12"), + SELECT_COLUMNS("10000", "selectColumns"); + + private String code; + private String message; + + private Codes(String code, String messgae) { + this.code = code; + this.message = messgae; + } + + public String getCode() { + return this.code; + } + + public String getMessage() { + return this.message; + } +} diff --git a/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java b/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java new file mode 100644 index 0000000..575061a --- /dev/null +++ b/src/main/java/com/docus/bgts/facade/IAfCollectTaskService.java @@ -0,0 +1,38 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.facade; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.docus.bgts.entity.AfCollectTask; +import com.docus.bgts.entity.ReportDownDto; +import java.util.List; +import java.util.Map; + +public interface IAfCollectTaskService extends IService { + String getpatientIdByEmpId(String empId); + + void insert(ReportDownDto reportDownDto); + + String getJzhByInpatientNo(String inPatientNo, String visitId); + + String getJzhByJzh(String jzh); + + void insertServer(ReportDownDto reportDownDto); + + void updateInterfaceCollect(String collectSubId, int state); + + List getjzhByDate(String startDate, String endDate, int size, int current); + + List getC1ByPatientId(List patientIds, String collectorId); + + List getPatientIdByC1(List C1s); + + List getJzhByPatientId(List patientIds); + + String getPatientIdByInpatientNo(String inPatientNo, String visitId); + + List getCompleteIntegrity(List jzhs); +} diff --git a/src/main/java/com/docus/bgts/facade/IBgtsService.java b/src/main/java/com/docus/bgts/facade/IBgtsService.java new file mode 100644 index 0000000..e057b3f --- /dev/null +++ b/src/main/java/com/docus/bgts/facade/IBgtsService.java @@ -0,0 +1,24 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.facade; + +public interface IBgtsService { + void collect(String empId) throws Exception; + + void collectPacs(String empId, String admissDate, String disDate, String times) throws Exception; + + void collectEcg(String empId, String admissDate, String disDate, String times) throws Exception; + + void collectPacss(); + + void collectByExamNo(String emamNo, String empId) throws Exception; + + void collectByDate(String startDate, String endDate, String collectorId); + + void collectAll(); + + void timerCollect(); +} diff --git a/src/main/java/com/docus/bgts/facade/IMzSyncService.java b/src/main/java/com/docus/bgts/facade/IMzSyncService.java new file mode 100644 index 0000000..bb794fc --- /dev/null +++ b/src/main/java/com/docus/bgts/facade/IMzSyncService.java @@ -0,0 +1,13 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.facade; + +import java.util.List; +import java.util.Map; + +public interface IMzSyncService { + List getCompleteIntegrity(List jzhs); +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectAddMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectAddMapper.java new file mode 100644 index 0000000..1725c3e --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectAddMapper.java @@ -0,0 +1,32 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.bgts.entity.AfCollectAdd; +import com.docus.bgts.entity.MzSync; +import java.util.Date; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +public interface AfCollectAddMapper extends BaseMapper { + Date getTimeByAdd(Integer classIfy); + + List listJzh(@Param("pageNumber") int pageNumber, @Param("pageSize") Integer pageSize); + + Map selectDate(@Param("jzh") String jzh); + + List integrality(@Param("mzSyncs") List mzSyncs); + + @Select({"${sqlStr}"}) + void dynamicSql(@Param("sqlStr") String sql); + + void updateTBasic(@Param("result") String result, @Param("jzh") String jzh); + + List listJzhAndAdd(@Param("front") int front, @Param("later") int later, @Param("startDate") String startDate, @Param("endDate") String endDate); +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectTaskMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectTaskMapper.java new file mode 100644 index 0000000..c5341e5 --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/AfCollectTaskMapper.java @@ -0,0 +1,34 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.bgts.entity.AfCollectTask; +import com.docus.bgts.entity.JzhListSync; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.RequestParam; + +public interface AfCollectTaskMapper extends BaseMapper { + String getpatientIdByEmpId(@Param("jzh") String empId); + + String getPatientIdByInpatientNo(@Param("inPatientNo") String inPatientNo, @Param("visitId") String visitId); + + String getJzhByInpatientNo(@Param("inPatientNo") String inPatientNo, @Param("visitId") String visitId); + + String getJzhByJzh(@Param("jzh") String jzh); + + List getjzhByDate(@Param("startDate") String startDate, @Param("endDate") String endDate, @RequestParam("size") int size, @RequestParam("current") int current); + + List getC1ByPatientId(@Param("patientIds") List patientIds, @Param("collectorId") String collectorId); + + List getPatientIdByC1(@Param("C1s") List C1s); + + List getJzhByPatientId(@Param("patientIds") List patientIds); + + List selectListByJzhs(@Param("jzhs") List jzhs); +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectMapper.java new file mode 100644 index 0000000..a999c5b --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectMapper.java @@ -0,0 +1,12 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.bgts.entity.AfInterfaceCollect; + +public interface AfInterfaceCollectMapper extends BaseMapper { +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectSubMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectSubMapper.java new file mode 100644 index 0000000..65cdfef --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/AfInterfaceCollectSubMapper.java @@ -0,0 +1,12 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.bgts.entity.AfInterfaceCollectSub; + +public interface AfInterfaceCollectSubMapper extends BaseMapper { +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/MrReportErrorMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/MrReportErrorMapper.java new file mode 100644 index 0000000..5e4666a --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/MrReportErrorMapper.java @@ -0,0 +1,13 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.docus.bgts.entity.MrReportError; +import org.apache.ibatis.annotations.Param; + +public interface MrReportErrorMapper { + void insert(@Param("mrReportError") MrReportError mrReportError); +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/TScanAssortMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/TScanAssortMapper.java new file mode 100644 index 0000000..87c9254 --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/TScanAssortMapper.java @@ -0,0 +1,14 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.docus.bgts.entity.MzSync; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface TScanAssortMapper { + List selectFilesByJzhs(@Param("jzhs") List jzhs); +} diff --git a/src/main/java/com/docus/bgts/mapper/dbmysql/ZdAssortMapper.java b/src/main/java/com/docus/bgts/mapper/dbmysql/ZdAssortMapper.java new file mode 100644 index 0000000..ea3731f --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dbmysql/ZdAssortMapper.java @@ -0,0 +1,17 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dbmysql; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.docus.bgts.entity.ZdAssort; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface ZdAssortMapper extends BaseMapper { + List selectAll(@Param("assortName") String assortName); + + void insertZdAssort(@Param("zdAssort") ZdAssort zdAssort); +} diff --git a/src/main/java/com/docus/bgts/mapper/dboracle/MzSyncMapper.java b/src/main/java/com/docus/bgts/mapper/dboracle/MzSyncMapper.java new file mode 100644 index 0000000..184f31f --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dboracle/MzSyncMapper.java @@ -0,0 +1,14 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dboracle; + +import com.docus.bgts.entity.MzSync; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface MzSyncMapper { + List listMzSync(@Param("jzhs") List jzhs, @Param("tableName") String tableName, @Param("tableNamespace") String tableNamespace); +} diff --git a/src/main/java/com/docus/bgts/mapper/dboracle/TestMapper.java b/src/main/java/com/docus/bgts/mapper/dboracle/TestMapper.java new file mode 100644 index 0000000..5aa57e4 --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dboracle/TestMapper.java @@ -0,0 +1,12 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dboracle; + +import java.util.List; + +public interface TestMapper { + List getA(); +} diff --git a/src/main/java/com/docus/bgts/mapper/dboracle/VDocumentPdfMapper.java b/src/main/java/com/docus/bgts/mapper/dboracle/VDocumentPdfMapper.java new file mode 100644 index 0000000..cf5d5c2 --- /dev/null +++ b/src/main/java/com/docus/bgts/mapper/dboracle/VDocumentPdfMapper.java @@ -0,0 +1,15 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.mapper.dboracle; + +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +public interface VDocumentPdfMapper { + List listCollectPage(@Param("current") int current, @Param("size") int size, @Param("startTime") String startCollectTime, @Param("endTime") String date, @Param("namespace") String namespace, @Param("tableName") String tableName, @Param("fieldArr") List fieldArr, @Param("collectTimeName") String collectTimeName); +} diff --git a/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java b/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java new file mode 100644 index 0000000..a606856 --- /dev/null +++ b/src/main/java/com/docus/bgts/service/AfCollectTaskServiceImpl.java @@ -0,0 +1,275 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.docus.bgts.entity.AfCollectTask; +import com.docus.bgts.entity.AfInterfaceCollect; +import com.docus.bgts.entity.AfInterfaceCollectSub; +import com.docus.bgts.entity.JzhListSync; +import com.docus.bgts.entity.ReportDownDto; +import com.docus.bgts.entity.ReportDownScanFileDto; +import com.docus.bgts.entity.TaskDetail; +import com.docus.bgts.facade.IAfCollectTaskService; +import com.docus.bgts.mapper.dbmysql.AfCollectTaskMapper; +import com.docus.bgts.mapper.dbmysql.AfInterfaceCollectMapper; +import com.docus.bgts.mapper.dbmysql.AfInterfaceCollectSubMapper; +import com.docus.bgts.mapper.dboracle.TestMapper; +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +@Service +public class AfCollectTaskServiceImpl extends ServiceImpl implements IAfCollectTaskService { + public static int MAX_SIZE_PER_TIME = 10; + @Autowired + TestMapper testMapper; + @Autowired + AfCollectTaskMapper afCollectTaskMapper; + @Autowired + AfInterfaceCollectMapper afInterfaceCollectMapper; + @Autowired + AfInterfaceCollectSubMapper afInterfaceCollectSubMapper; + + public String getpatientIdByEmpId(String empId) { + String patientId = this.afCollectTaskMapper.getpatientIdByEmpId(empId); + return patientId; + } + + public void insert(ReportDownDto reportDownDto) { + try { + String patientId = this.getpatientIdByEmpId(reportDownDto.getPatient().getJzh()); + if (StringUtils.isBlank(patientId)) { + throw new RuntimeException("操作的病案信息不存在"); + } + + Date date = new Date(); + Integer save = null; + List scanfiles = reportDownDto.getScanfiles(); + + for(ReportDownScanFileDto scanfile : scanfiles) { + AfCollectTask afCollectTask = (AfCollectTask)this.afCollectTaskMapper.selectOne((Wrapper)((QueryWrapper)(new QueryWrapper()).eq("C1", scanfile.getSerialnum())).eq("sysflag", reportDownDto.getCollectorid())); + if (afCollectTask == null) { + afCollectTask = new AfCollectTask(); + afCollectTask.setPatientId(patientId); + afCollectTask.setSysflag(reportDownDto.getCollectorid()); + afCollectTask.setState("0"); + afCollectTask.setSyncTime(date); + afCollectTask.setC1(scanfile.getSerialnum()); + afCollectTask.setC2(scanfile.getFiletitle()); + afCollectTask.setC3(reportDownDto.getPatient().getJzh()); + save = this.afCollectTaskMapper.insert(afCollectTask); + if (save <= 0) { + throw new RuntimeException("插入病案任务表数据出错"); + } + + this.log.warn("插入病案成功"); + } else { + afCollectTask.setPatientId(patientId); + afCollectTask.setSysflag(reportDownDto.getCollectorid()); + afCollectTask.setState("0"); + afCollectTask.setSyncTime(date); + afCollectTask.setC1(scanfile.getSerialnum()); + afCollectTask.setC2(scanfile.getFiletitle()); + save = this.afCollectTaskMapper.updateById(afCollectTask); + this.log.warn("修改病案成功"); + } + + scanfile.setTaskid(afCollectTask.getId()); + } + + reportDownDto.setScanfiles(scanfiles); + } catch (Exception e) { + this.log.error(reportDownDto.getPatient().getJzh() + "插入任务表出错! " + e.getMessage()); + } + + } + + public String getJzhByInpatientNo(String inPatientNo, String visitId) { + return this.afCollectTaskMapper.getJzhByInpatientNo(inPatientNo, visitId); + } + + public String getJzhByJzh(String jzh) { + return this.afCollectTaskMapper.getJzhByJzh(jzh); + } + + public void insertServer(ReportDownDto reportDownDto) { + String patientId; + if (StringUtils.isBlank(reportDownDto.getPatient().getJzh())) { + patientId = this.getPatientIdByInpatientNo(reportDownDto.getPatient().getInPatientNo(), reportDownDto.getPatient().getVisitId()); + } else { + patientId = this.getpatientIdByEmpId(reportDownDto.getPatient().getJzh()); + } + + if (StringUtils.isBlank(patientId)) { + throw new RuntimeException("操作的病案信息不存在"); + } else { + Date date = new Date(); + Integer save = null; + List scanfiles = reportDownDto.getScanfiles(); + + for(ReportDownScanFileDto scanfile : scanfiles) { + AfCollectTask afCollectTask = (AfCollectTask)this.afCollectTaskMapper.selectOne((Wrapper)((QueryWrapper)(new QueryWrapper()).eq("C1", scanfile.getSerialnum())).eq("sysflag", reportDownDto.getCollectorid())); + if (afCollectTask == null) { + afCollectTask = new AfCollectTask(); + afCollectTask.setPatientId(patientId); + afCollectTask.setSysflag(reportDownDto.getCollectorid()); + afCollectTask.setState("0"); + afCollectTask.setSyncTime(date); + afCollectTask.setC1(scanfile.getSerialnum()); + afCollectTask.setC2(scanfile.getFiletitle()); + afCollectTask.setC3(reportDownDto.getPatient().getJzh()); + save = this.afCollectTaskMapper.insert(afCollectTask); + if (save <= 0) { + throw new RuntimeException("插入病案任务表数据出错"); + } + + this.log.warn("插入病案成功"); + } else { + afCollectTask.setPatientId(patientId); + afCollectTask.setSysflag(reportDownDto.getCollectorid()); + afCollectTask.setState("0"); + afCollectTask.setSyncTime(date); + afCollectTask.setC1(scanfile.getSerialnum()); + afCollectTask.setC2(scanfile.getFiletitle()); + save = this.afCollectTaskMapper.updateById(afCollectTask); + this.log.warn("修改病案成功"); + } + + scanfile.setTaskid(afCollectTask.getId()); + } + + reportDownDto.setScanfiles(scanfiles); + } + } + + public void updateInterfaceCollect(String collectSubId, int state) { + this.log.warn("开始记录采集"); + AfInterfaceCollectSub afInterfaceCollectSub = (AfInterfaceCollectSub)this.afInterfaceCollectSubMapper.selectById(collectSubId); + this.log.warn("操作记录:" + afInterfaceCollectSub); + if (afInterfaceCollectSub == null) { + throw new RuntimeException("afInterfaceCollectSub表数据为空"); + } else { + afInterfaceCollectSub.setState(state); + int i = this.afInterfaceCollectSubMapper.updateById(afInterfaceCollectSub); + if (i <= 0) { + throw new RuntimeException("记录任务数时出错"); + } else { + if (state == 1) { + AfInterfaceCollect afInterfaceCollect = (AfInterfaceCollect)this.afInterfaceCollectMapper.selectById(afInterfaceCollectSub.getAfInterfaceCollectId()); + afInterfaceCollect.setCompleteCount(afInterfaceCollect.getCompleteCount() + 1); + i = this.afInterfaceCollectMapper.updateById(afInterfaceCollect); + if (i <= 0) { + throw new RuntimeException("记录任务数时出错"); + } + } + + } + } + } + + public List getjzhByDate(String startDate, String endDate, int size, int current) { + List patientIds = this.afCollectTaskMapper.getjzhByDate(startDate, endDate, size, current); + return patientIds; + } + + public List getC1ByPatientId(List patientIds, String collectorId) { + List> batchPatientIds = Lists.partition(patientIds, MAX_SIZE_PER_TIME); + List c1s = new ArrayList(); + + for(List batchPatientId : batchPatientIds) { + List c1 = this.afCollectTaskMapper.getC1ByPatientId(batchPatientId, collectorId); + if (c1 != null && c1.size() != 0) { + for(String s : c1) { + c1s.add(s); + } + } + } + + return c1s; + } + + public List getPatientIdByC1(List C1s) { + List> batchPatientIds = Lists.partition(C1s, MAX_SIZE_PER_TIME); + List patientIds = new ArrayList(); + + for(List batchC1s : batchPatientIds) { + List patientId = this.afCollectTaskMapper.getPatientIdByC1(batchC1s); + if (patientId != null && patientId.size() != 0) { + for(String s : patientId) { + patientIds.add(s); + } + } + } + + return patientIds; + } + + public List getJzhByPatientId(List patientIds) { + List jzhs = new ArrayList(); + + for(List batchPatientId : Lists.partition(patientIds, MAX_SIZE_PER_TIME)) { + List jzh = this.afCollectTaskMapper.getJzhByPatientId(batchPatientId); + if (jzh != null && jzh.size() != 0) { + for(String s : jzh) { + jzhs.add(s); + } + } + } + + return jzhs; + } + + public String getPatientIdByInpatientNo(String inPatientNo, String visitId) { + return this.afCollectTaskMapper.getPatientIdByInpatientNo(inPatientNo, visitId); + } + + public List getCompleteIntegrity(List jzhs) { + List taskList = this.afCollectTaskMapper.selectListByJzhs(jzhs); + List maps = new ArrayList(); + if (!CollectionUtils.isEmpty(taskList)) { + for(String jzh : jzhs) { + StringBuilder integrity = new StringBuilder(); + + for(JzhListSync jzhListSync : taskList) { + if (jzhListSync.getJzh().equals(jzh)) { + for(TaskDetail taskDetail : jzhListSync.getTaskDetails()) { + String state = taskDetail.getState(); + if (StringUtils.isBlank(state) || !"3".equals(state)) { + if (StringUtils.isNotBlank(integrity)) { + integrity.append(","); + } + + integrity.append(taskDetail.getFileTitle()).append("缺失"); + } + } + break; + } + } + + Map map = new HashMap(); + if (StringUtils.isBlank(integrity)) { + integrity = new StringBuilder("完整"); + } + + map.put("jzh", jzh); + map.put("file_title", integrity.toString()); + maps.add(map); + } + } + + return maps; + } +} diff --git a/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java b/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java new file mode 100644 index 0000000..74cae4d --- /dev/null +++ b/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java @@ -0,0 +1,706 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.service; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.docus.bgts.entity.AfCollectAdd; +import com.docus.bgts.entity.AfCollectTask; +import com.docus.bgts.entity.MrReportError; +import com.docus.bgts.entity.ReportDownDto; +import com.docus.bgts.entity.ReportDownPatientDto; +import com.docus.bgts.entity.ReportDownScanFileDto; +import com.docus.bgts.enums.Codes; +import com.docus.bgts.facade.IAfCollectTaskService; +import com.docus.bgts.facade.IBgtsService; +import com.docus.bgts.mapper.dbmysql.AfCollectAddMapper; +import com.docus.bgts.mapper.dbmysql.AfCollectTaskMapper; +import com.docus.bgts.mapper.dbmysql.AfInterfaceCollectSubMapper; +import com.docus.bgts.mapper.dbmysql.MrReportErrorMapper; +import com.docus.bgts.mapper.dboracle.VDocumentPdfMapper; +import com.docus.bgts.utils.FileUtils; +import com.docus.bgts.utils.HttpUtils; +import com.docus.bgts.utils.SnowflakeIdWorker; +import com.docus.bgts.utils.XmlUtils; +import java.io.ByteArrayInputStream; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ThreadPoolExecutor; +import org.apache.commons.lang3.StringUtils; +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.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.dom4j.Element; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +@Service +public class BgtsServiceImpl implements IBgtsService { + @Value("${ws.url}") + private String wsUrl; + @Value("${ws.localMethod}") + private String wsLocalMethod; + @Value("${ws.LocalMethodNj:null}") + private String wsLocalMethodNj; + private Logger logger = LogManager.getLogger(BgtsServiceImpl.class); + @Autowired + IAfCollectTaskService afCollectTaskService; + @Autowired + VDocumentPdfMapper vDocumentPdfMapper; + @Autowired + AfInterfaceCollectSubMapper afInterfaceCollectSubMapper; + @Autowired + MrReportErrorMapper mrReportErrorMapper; + @Autowired + AfCollectAddMapper afCollectAddMapper; + @Autowired + AfCollectTaskMapper afCollectTaskMapper; + @Autowired + private ThreadPoolExecutor threadPoolExecutor; + private static List date = new ArrayList(); + private static int currentIndex = 0; + private static JaxWsDynamicClientFactory wsDynamicClientFactory = JaxWsDynamicClientFactory.newInstance(); + private static volatile Client client = null; + + public void collect(String empId) throws Exception { + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + new ArrayList(); + List exams; + if (collectorid.equals("14")) { + exams = this.getExamNoNj(empId); + } else { + exams = this.getExamNo(empId); + } + + ReportDownDto reportDownDto = this.getUrlCreateReportDto(exams, empId); + this.afCollectTaskService.insert(reportDownDto); + this.collectExams(exams, empId, reportDownDto); + } + + public void collectPacs(String empId, String admissDate, String disDate, String times) throws Exception { + SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd"); + Date ad = sim.parse(admissDate); + Date di = sim.parse(disDate); + String admiss = sim.format(ad); + String dis = sim.format(di); + List exams = this.getExamNo(empId, admiss, dis); + String jzh = this.afCollectTaskService.getJzhByInpatientNo(empId, times); + if (null == jzh) { + this.logger.info("通过住院号与住院次数未匹配到患者"); + } else { + ReportDownDto reportDownDto = this.getUrlCreateReportDto(exams, jzh); + this.afCollectTaskService.insert(reportDownDto); + this.collectExams(exams, empId, reportDownDto); + } + } + + public void collectEcg(String empId, String admissDate, String disDate, String times) throws Exception { + Map smCollectionTime = getSmCollectionTimeEcg(admissDate, disDate); + List exams = this.getExamNoEcg(empId, (String)smCollectionTime.get("admissDate"), (String)smCollectionTime.get("disDate")); + String jzh = this.afCollectTaskService.getpatientIdByEmpId(empId); + if (null == jzh) { + this.logger.info(empId + " 通过jzh未匹配到患者"); + } else { + ReportDownDto reportDownDto = this.getUrlCreateReportDto(exams, empId); + this.afCollectTaskService.insert(reportDownDto); + this.collectExams(exams, empId, reportDownDto); + } + } + + public void collectByExamNo(String emamNo, String empId) throws Exception { + String[] strings = new String[2]; + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + AfCollectTask afCollectTask = (AfCollectTask)this.afCollectTaskService.getOne((Wrapper)((QueryWrapper)(new QueryWrapper()).eq("C1", emamNo)).eq("sysflag", collectorid)); + strings[0] = emamNo; + strings[1] = afCollectTask.getC2(); + List exams = new ArrayList(); + exams.add(strings); + ReportDownDto reportDownDto = this.getUrlCreateReportDto(exams, empId); + this.collectExams(exams, empId, reportDownDto); + } + + public void collectAll() { + this.logger.info("----------全量采集开始-----------"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String startCollectTime = null; + startCollectTime = String.valueOf(FileUtils.getJsonByName("startCollectTime")); + this.logger.info("----------采集初始时间:" + startCollectTime + " -------------------"); + Date date = new Date(); + String dateStr = simpleDateFormat.format(date); + this.collectByDates(startCollectTime, dateStr); + this.addAfCollectAdd(date); + this.logger.info("--------------全量采集结束------------------"); + } + + private static void initDate() throws Exception { + String configStart = String.valueOf(FileUtils.getJsonByName("collectStartDate")); + String configEnd = String.valueOf(FileUtils.getJsonByName("collectEndDate")); + if (!StrUtil.isBlank(configStart) && !StrUtil.isBlank(configEnd)) { + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate localDate = LocalDate.parse(configStart, dtf); + + for(LocalDate end = LocalDate.parse(configEnd); !localDate.isAfter(end); localDate = localDate.plusDays(1L)) { + date.add(localDate.toString()); + } + + } else { + throw new RuntimeException("check homeQualitySet.json collectStartDate AND collectEndDate confg!"); + } + } + + public void collectPacss() { + this.logger.info("按需采集任务执行----"); + this.logger.info("index:{},Thread {}", currentIndex, Thread.currentThread().getName()); + String collectStartDate = FileUtils.getJsonByName("collectStartDate") + "\t00:00:00"; + String collectEndDate = FileUtils.getJsonByName("collectEndDate") + "\t23:59:59"; + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + CountDownLatch countDownLatch = new CountDownLatch(1); + this.threadPoolExecutor.execute(() -> { + try { + this.collectByDate(collectStartDate, collectEndDate, collectorid); + } catch (Exception e) { + this.logger.info("按需采集出错{}", e.getMessage()); + } + + countDownLatch.countDown(); + }); + + try { + countDownLatch.await(); + } catch (Exception e) { + this.logger.error("JUC countDownLatch error {}", e.getMessage()); + } + + this.logger.info("{},采集结束----", collectStartDate); + System.gc(); + } + + private void collectByDates(String startDate, String endDate) { + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + String assortid = String.valueOf(FileUtils.getJsonByName("assortid")); + int filesource = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))); + int filestoragetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))); + Map headMap = new HashMap(); + headMap.put("Content-Type", "application/json"); + SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0L, 0L); + String indexFlag = String.valueOf(FileUtils.getJsonByName("indexFlag")); + String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum")); + String downurl = String.valueOf(FileUtils.getJsonByName("downurl")); + String inPatientNo = String.valueOf(FileUtils.getJsonByName("inPatientNo")); + String visitId = String.valueOf(FileUtils.getJsonByName("visitId")); + String inJzh = String.valueOf(FileUtils.getJsonByName("jzh")); + List fieldArr = new ArrayList(); + fieldArr.add(indexFlag); + fieldArr.add(serialnum); + fieldArr.add(inPatientNo); + fieldArr.add(visitId); + fieldArr.add(inJzh); + fieldArr.add(downurl); + String namespace = String.valueOf(FileUtils.getJsonByName("namespace")); + String tableName = String.valueOf(FileUtils.getJsonByName("tableName")); + String collectTimeName = String.valueOf(FileUtils.getJsonByName("collectTimeName")); + this.logger.info("开始时间-----" + startDate + "结束时间-----\n" + endDate); + int current = 1; + + while(true) { + int size = 10 * current; + List maps = this.vDocumentPdfMapper.listCollectPage(size - 10, size, startDate, endDate, namespace, tableName, fieldArr, collectTimeName); + this.logger.info("处理采集数据:" + maps); + if (null == maps || maps.size() <= 0) { + return; + } + + maps.stream().forEach((map) -> { + ReportDownDto reportDownDto = new ReportDownDto(); + reportDownDto.setCollectorid(collectorid); + reportDownDto.setAssortid(assortid); + ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto(); + if (collectorid.equals("15")) { + reportDownPatientDto.setJzh(String.valueOf(map.get(inJzh))); + } else { + reportDownPatientDto.setInPatientNo(String.valueOf(map.get(inPatientNo))); + reportDownPatientDto.setVisitId(String.valueOf(map.get(visitId))); + } + + reportDownDto.setPatient(reportDownPatientDto); + List reportDownScanFileDtos = new ArrayList(); + ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto(); + reportDownScanFileDto.setDownurl(String.valueOf(map.get(downurl))); + reportDownScanFileDto.setFilestoragetype(filestoragetype); + reportDownScanFileDto.setFilesource(filesource); + reportDownScanFileDto.setFiletitle(StringUtils.isNotBlank(String.valueOf(map.get(serialnum))) ? String.valueOf(map.get(serialnum)) : String.valueOf(idWorker.nextId())); + reportDownScanFileDto.setSerialnum(StringUtils.isNotBlank(String.valueOf(map.get(serialnum))) ? String.valueOf(map.get(serialnum)) : String.valueOf(idWorker.nextId())); + reportDownScanFileDtos.add(reportDownScanFileDto); + reportDownDto.setScanfiles(reportDownScanFileDtos); + + try { + this.afCollectTaskService.insertServer(reportDownDto); + String jzh = this.afCollectTaskService.getJzhByJzh(reportDownDto.getPatient().getJzh()); + if (null != jzh && !"".equals(jzh)) { + reportDownPatientDto.setJzh(jzh); + reportDownDto.setPatient(reportDownPatientDto); + String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, (Map)JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class)); + Map resMap = (Map)JSON.parseObject(post, Map.class); + this.logger.info(reportDownDto.getPatient().getJzh() + " 调用下载参数:--\n" + JSON.parseObject(JSON.toJSONString(reportDownDto))); + if (String.valueOf(resMap.get("code")).equals("500")) { + this.logger.info(reportDownDto.getPatient().getJzh() + " 下载失败!"); + throw new RuntimeException(String.valueOf(resMap.get("msg"))); + } + + this.logger.info(reportDownDto.getPatient().getJzh() + " 下载成功!"); + } + } catch (Exception e) { + this.logger.info(reportDownDto.getPatient().getJzh() + " 采集出错:" + reportDownDto + e.getMessage()); + this.addMrReportErrorLog(reportDownDto); + e.printStackTrace(); + } + + }); + ++current; + } + } + + public void timerCollect() { + this.logger.info("------采集器开始采集---------"); + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + Date time; + if (collectorid.equals("5")) { + time = this.afCollectAddMapper.getTimeByAdd(5); + } else { + time = this.afCollectAddMapper.getTimeByAdd(15); + } + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String startDate = simpleDateFormat.format(time); + Date date = new Date(); + String endDate = simpleDateFormat.format(date); + this.collectByDates(startDate, endDate); + this.addAfCollectAdd(date); + this.logger.info("--------采集器结束采集------"); + } + + private void addAfCollectAdd(Date date) { + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + AfCollectAdd afCollectAdd = new AfCollectAdd(); + afCollectAdd.setBeginStageDate(date); + this.afCollectAddMapper.update(afCollectAdd, (Wrapper)(new QueryWrapper()).eq("classify", collectorid)); + } + + private void addMrReportErrorLog(ReportDownDto reportDownDto) { + MrReportError mrReportError = new MrReportError(); + mrReportError.setCreateTime(new Date()); + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + mrReportError.setReportType(Integer.parseInt(collectorid)); + mrReportError.setXml(JSON.toJSONString(reportDownDto)); + this.mrReportErrorMapper.insert(mrReportError); + } + + private void collectExams(List exams, String empId, ReportDownDto reportDownDto) throws Exception { + Map headMap = new HashMap(); + headMap.put("Content-Type", "application/json"); + String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, (Map)JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class)); + Map resMap = (Map)JSON.parseObject(post, Map.class); + this.logger.info(empId + ": 调用下载Map参数{}", JSON.toJSONString(reportDownDto)); + if (String.valueOf(resMap.get("code")).equals("500")) { + this.logger.info(empId + "调用下载服务错误: " + resMap.get("msg")); + throw new RuntimeException(String.valueOf(resMap.get("msg"))); + } + } + + private ReportDownDto getUrlCreateReportDto(List exams, String empId) throws Exception { + ReportDownDto reportDownDto = new ReportDownDto(); + ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto(); + reportDownPatientDto.setJzh(empId); + reportDownDto.setPatient(reportDownPatientDto); + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + String assortid = String.valueOf(FileUtils.getJsonByName("assortid")); + reportDownDto.setAssortid(assortid); + reportDownDto.setCollectorid(collectorid); + List reportDownScanFileDtos = new ArrayList(); + int filesource = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))); + int filestoragetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))); + + for(String[] exam : exams) { + try { + ReportDownScanFileDto reportDownScanFileDto = this.getScanByExam(exam); + reportDownScanFileDto.setFilesource(filesource); + reportDownScanFileDto.setFilestoragetype(filestoragetype); + if (collectorid.equals("3")) { + if (!reportDownScanFileDto.getDownurl().contains("病理") && !reportDownScanFileDto.getDownurl().contains("胃肠镜") && !reportDownScanFileDto.getDownurl().contains("心电")) { + reportDownScanFileDtos.add(reportDownScanFileDto); + } + } else { + reportDownScanFileDtos.add(reportDownScanFileDto); + } + } catch (Exception e) { + this.logger.error(exam[0] + "调用明细错误信息-----" + e.getMessage()); + } + } + + reportDownDto.setScanfiles(reportDownScanFileDtos); + return reportDownDto; + } + + private ReportDownScanFileDto getScanByExam(String[] exam) throws Exception { + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto(); + reportDownScanFileDto.setSerialnum(exam[0]); + reportDownScanFileDto.setFiletitle(exam[1]); + XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlDetailsPath()); + Element esbEntry = reqXmlUtils.getMsgElement(); + esbEntry.element("EXAM_NO").setText(exam[0]); + this.logger.info("明细入参------------" + reqXmlUtils.getDocument().asXML()); + String resXml; + if (collectorid.equals("14")) { + resXml = this.invokeWsNj(reqXmlUtils.getDocument().asXML()); + } else { + resXml = this.invokeWs(reqXmlUtils.getDocument().asXML()); + } + + XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8"))); + String success = xmlUtils.isSuccess(); + if (!success.equals("ok")) { + this.logger.info("发送错误:" + success); + throw new RuntimeException("发送错误:" + success); + } else { + List dis = (List)FileUtils.getJsonByName("bgtsDetailRespon"); + Element element = xmlUtils.getElement(dis); + reportDownScanFileDto.setDownurl(element.element(String.valueOf(FileUtils.getJsonByName("pdfUrl"))) == null ? "" : element.element(String.valueOf(FileUtils.getJsonByName("pdfUrl"))).getText()); + return reportDownScanFileDto; + } + } + + private List getExamNo(String empId) throws Exception { + List exams = new ArrayList(); + XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath()); + Element reqElement = reqXmlUtils.getMsgElement(); + Map map = this.afCollectAddMapper.selectDate(empId); + reqElement.element("INHOSP_NO").setText(empId); + reqElement.element("BEGIN_DATE").setText((new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString())).format((Date)map.get("admiss_date"))); + reqElement.element("END_DATE").setText((new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString())).format((Date)map.get("dis_date"))); + this.logger.info("-------根据患者主索引号查询多个报告单号,地址:" + this.wsUrl + ",方法:" + this.wsLocalMethod + "---------"); + String xml = reqXmlUtils.getDocument().asXML(); + this.logger.info("---------------------------"); + this.logger.info(xml); + this.logger.info("----------------------------"); + String resXml = this.invokeWs(xml); + this.logger.info("---------返回值-------------"); + this.logger.info(resXml); + this.logger.info("-----------------------------"); + XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8"))); + String success = xmlUtils.isSuccess(); + if (!success.equals("ok")) { + this.logger.info("发送错误:" + success); + throw new RuntimeException(success); + } else { + List dis = (List)FileUtils.getJsonByName("bgtsRespon"); + Element element = xmlUtils.getElement(dis); + + for(Element examInfo : element.elements("ExamInfo")) { + String[] key = new String[2]; + Element examNo = examInfo.element(String.valueOf(FileUtils.getJsonByName("examNo"))); + if (examNo != null) { + key[0] = examNo.getText(); + } + + Element examItemInfo = examInfo.element("ExamItemInfo"); + if (examItemInfo != null) { + key[1] = examItemInfo.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText(); + } + + exams.add(key); + } + + return exams; + } + } + + private List getExamNoNj(String empId) throws Exception { + List exams = new ArrayList(); + XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath()); + Element reqElement = reqXmlUtils.getMsgElement(); + Map map = this.afCollectAddMapper.selectDate(empId); + reqElement.element("INHOSP_NO").setText(empId); + reqElement.element("BEGIN_DATE").setText((new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString())).format((Date)map.get("admiss_date"))); + reqElement.element("END_DATE").setText((new SimpleDateFormat(FileUtils.getJsonByName("dateFormat").toString())).format((Date)map.get("dis_date"))); + this.logger.info("-------根据患者主索引号查询多个报告单号,地址:" + this.wsUrl + ",方法:" + this.wsLocalMethod + "---------"); + String xml = reqXmlUtils.getDocument().asXML(); + this.logger.info("---------------------------"); + this.logger.info(xml); + this.logger.info("----------------------------"); + String resXml = this.invokeWs(xml); + this.logger.info("---------返回值-------------"); + this.logger.info(resXml); + this.logger.info("-----------------------------"); + XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8"))); + String success = xmlUtils.isSuccess(); + if (!success.equals("ok")) { + this.logger.info("发送错误:" + success); + throw new RuntimeException(success); + } else { + List dis = (List)FileUtils.getJsonByName("bgtsRespon"); + Element element = xmlUtils.getElement(dis); + List elements = element.elements("Msg"); + + for(int i = 0; i < elements.size(); ++i) { + List examInfo = ((Element)elements.get(i)).elements("ExamInfo"); + + for(int j = 0; j < examInfo.size(); ++j) { + String examNo = ((Element)examInfo.get(j)).element(String.valueOf(FileUtils.getJsonByName("examNo"))).getText(); + String[] key = new String[2]; + if (examNo != null) { + key[0] = examNo; + } + + Element examItemInfo = ((Element)examInfo.get(j)).element("ExamItemInfo"); + if (examItemInfo != null) { + key[1] = examItemInfo.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText(); + } + + exams.add(key); + this.logger.info("报告单号---{}", examNo); + } + } + + return exams; + } + } + + public static Map getSmCollectionTime(String admissDate, String disDate) { + Calendar calendar = Calendar.getInstance(); + Map map = new HashMap(); + + try { + calendar.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(admissDate)); + calendar.add(10, -6); + Date dBefore = calendar.getTime(); + Calendar calendar1 = Calendar.getInstance(); + calendar1.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(disDate)); + calendar1.add(10, 6); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String defaultStartDate = sdf.format(dBefore); + String defaultEndDate = sdf.format(calendar1.getTime()); + map.put("admissDate", defaultStartDate); + map.put("disDate", defaultEndDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + return map; + } + + public static Map getSmCollectionTimeEcg(String admissDate, String disDate) { + Calendar calendar = Calendar.getInstance(); + Map map = new HashMap(); + + try { + calendar.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(admissDate)); + calendar.add(10, -6); + Date dBefore = calendar.getTime(); + Calendar calendar1 = Calendar.getInstance(); + calendar1.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(disDate)); + calendar1.add(10, 30); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String defaultStartDate = sdf.format(dBefore); + String defaultEndDate = sdf.format(calendar1.getTime()); + map.put("admissDate", defaultStartDate); + map.put("disDate", defaultEndDate); + } catch (ParseException e) { + e.printStackTrace(); + } + + return map; + } + + private List getExamNo(String empId, String admissDate, String disDate) throws Exception { + List exams = new ArrayList(); + XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath()); + Element reqElement = reqXmlUtils.getMsgElement(); + reqElement.element("INHOSP_INDEX_NO").setText(empId); + reqElement.element("BEGIN_DATE").setText(String.valueOf(admissDate)); + reqElement.element("END_DATE").setText(String.valueOf(disDate)); + this.logger.info("-------根据患者主索引号查询多个报告单号,地址:" + this.wsUrl + ",方法:" + this.wsLocalMethod + "---------"); + String xml = reqXmlUtils.getDocument().asXML(); + this.logger.info("---------------------------"); + this.logger.info(xml); + this.logger.info("----------------------------"); + String resXml = this.invokeWs(xml); + this.logger.info("---------返回值-------------"); + this.logger.info(resXml); + this.logger.info("-----------------------------"); + XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8"))); + String success = xmlUtils.isSuccess(); + if (!success.equals("ok")) { + this.logger.info("发送错误:" + success); + throw new RuntimeException(success); + } else { + List dis = (List)FileUtils.getJsonByName("bgtsRespon"); + Element element = xmlUtils.getElement(dis); + + for(Element examInfo : element.elements("ExamInfo")) { + String[] key = new String[2]; + Element examNo = examInfo.element(String.valueOf(FileUtils.getJsonByName("examNo"))); + + for(Element element1 : examInfo.elements("ExamItemInfo")) { + if (examNo != null) { + key[0] = examNo.getText(); + } + + key[1] = element1.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText(); + } + + exams.add(key); + } + + return exams; + } + } + + private List getExamNoEcg(String empId, String admissDate, String disDate) throws Exception { + List exams = new ArrayList(); + XmlUtils reqXmlUtils = new XmlUtils(FileUtils.getXmlPath()); + Element reqElement = reqXmlUtils.getMsgElement(); + reqElement.element("INHOSP_NO").setText(empId); + reqElement.element("BEGIN_DATE").setText(String.valueOf(admissDate)); + reqElement.element("END_DATE").setText(String.valueOf(disDate)); + this.logger.info("-------根据患者主索引号查询多个报告单号,地址:" + this.wsUrl + ",方法:" + this.wsLocalMethod + "---------"); + String xml = reqXmlUtils.getDocument().asXML(); + this.logger.info("---------------------------"); + this.logger.info(xml); + this.logger.info("----------------------------"); + String resXml = this.invokeWs(xml); + this.logger.info("---------返回值-------------"); + this.logger.info(resXml); + this.logger.info("-----------------------------"); + XmlUtils xmlUtils = new XmlUtils(new ByteArrayInputStream(resXml.getBytes("UTF-8"))); + String success = xmlUtils.isSuccess(); + if (!success.equals("ok")) { + this.logger.info("发送错误:" + success); + throw new RuntimeException(success); + } else { + List dis = (List)FileUtils.getJsonByName("bgtsRespon"); + Element element = xmlUtils.getElement(dis); + + for(Element examInfo : element.elements("ExamInfo")) { + String[] key = new String[2]; + Element examNo = examInfo.element(String.valueOf(FileUtils.getJsonByName("examNo"))); + if (examNo != null) { + key[0] = examNo.getText(); + } + + Element examItemInfo = examInfo.element("ExamItemInfo"); + if (examItemInfo != null) { + key[1] = examItemInfo.element(String.valueOf(FileUtils.getJsonByName("examItemName"))).getText(); + } + + exams.add(key); + } + + return exams; + } + } + + public void collectByDate(String startDate, String endDate, String collectorId) { + this.logger.info("按需采集开始----------开始时间---" + startDate + "------结束时间---" + endDate); + int endrow = 10; + + try { + int startrow = 0; + + while(true) { + List patientIds = this.afCollectTaskService.getjzhByDate(startDate, endDate, startrow, endrow); + if (null == patientIds || patientIds.size() <= 0) { + this.logger.info("未查询到按需采集患者!"); + break; + } + + for(Map patientId : patientIds) { + if (patientId != null) { + try { + this.logger.info("按需采集------患者" + patientId.get("inpatient_no")); + this.logger.info("处理按需采集第" + startrow + "条数据----"); + if (collectorId.equals("3")) { + this.collectPacs(String.valueOf(patientId.get("inpatient_no")), String.valueOf(patientId.get("admiss_date")), String.valueOf(patientId.get("dis_date")), String.valueOf(patientId.get("admiss_times"))); + } else if (!collectorId.equals("4") && !collectorId.equals("23")) { + this.collect(String.valueOf(patientId.get("jzh"))); + } else { + this.collectEcg(String.valueOf(patientId.get("jzh")), String.valueOf(patientId.get("admiss_date")), String.valueOf(patientId.get("dis_date")), String.valueOf(patientId.get("admiss_times"))); + } + } catch (Exception e) { + this.logger.error("按需采集-患者inpatient_no:{},collectPacs() Error:{}", patientId.get("inpatient_no"), e.getMessage()); + } + } + } + + patientIds.clear(); + startrow += 10; + } + } catch (Exception e) { + this.logger.error(e.getMessage()); + } catch (Throwable t) { + t.printStackTrace(); + this.logger.error("throwable,{}", t.getMessage()); + } + + } + + private Client getClient() { + if (client == null) { + synchronized(this.getClass()) { + client = wsDynamicClientFactory.createClient(this.wsUrl); + } + } + + return client; + } + + public String invokeWs(String xml) throws Exception { + this.logger.info("-----\n客户端调用服务端:" + this.wsUrl + "方法:" + this.wsLocalMethod + "\n------------"); + Client client = this.getClient(); + HTTPConduit conduit = (HTTPConduit)client.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + policy.setConnectionTimeout(10000L); + policy.setReceiveTimeout(10000L); + conduit.setClient(policy); + this.logger.info("Client started!"); + Object[] objects = client.invoke(this.wsLocalMethod, new Object[]{xml}); + this.logger.info("Client invoke after!"); + String str = objects[0].toString(); + this.logger.info("----------结果---------\n{}", str); + return str; + } + + public String invokeWsNj(String xml) throws Exception { + this.logger.info("-----\n客户端调用服务端:" + this.wsUrl + "方法:" + this.wsLocalMethodNj + "\n------------"); + Client client = this.getClient(); + HTTPConduit conduit = (HTTPConduit)client.getConduit(); + HTTPClientPolicy policy = new HTTPClientPolicy(); + policy.setConnectionTimeout(10000L); + policy.setReceiveTimeout(10000L); + conduit.setClient(policy); + this.logger.info("Client started!"); + Object[] objects = client.invoke(this.wsLocalMethodNj, new Object[]{xml}); + this.logger.info("Client invoke after!"); + String str = objects[0].toString(); + this.logger.info("----------结果---------\n{}", str); + return str; + } +} diff --git a/src/main/java/com/docus/bgts/service/CheckIntegrityService.java b/src/main/java/com/docus/bgts/service/CheckIntegrityService.java new file mode 100644 index 0000000..8edcd7f --- /dev/null +++ b/src/main/java/com/docus/bgts/service/CheckIntegrityService.java @@ -0,0 +1,105 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.service; + +import com.docus.bgts.facade.IAfCollectTaskService; +import com.docus.bgts.facade.IMzSyncService; +import com.docus.bgts.mapper.dbmysql.AfCollectAddMapper; +import com.docus.bgts.utils.FileUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +@Service +public class CheckIntegrityService { + private final Logger log = LoggerFactory.getLogger(this.getClass()); + @Autowired + AfCollectAddMapper afCollectAddMapper; + @Autowired + IMzSyncService iMzSyncService; + @Autowired + IAfCollectTaskService afCollectTaskService; + + public boolean addSyncIntegrality(String startDate, String endDate) { + boolean flag = true; + this.log.info("增量完整性同步开始"); + long startTime = System.currentTimeMillis(); + Integer pageSize = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("pageSize"))); + int i = 0; + + while(true) { + int front = i * pageSize; + List jzhs = this.afCollectAddMapper.listJzhAndAdd(front, pageSize, startDate, endDate); + if (jzhs.size() == 0) { + if (i == 0) { + flag = false; + } + + long endTime = System.currentTimeMillis(); + this.log.info("增量完整性同步结束,程序执行时间为:" + (endTime - startTime) + "毫秒"); + return flag; + } + + this.addSyncIntegralityByJzhsMethod(jzhs); + ++i; + } + } + + public void addSyncIntegralityByJzhsMethod(List jzhs) { + List maps = this.getCompleteInegruty(jzhs); + this.integralityBySyncs(maps); + this.log.info("本次成功同步数:" + maps.size()); + } + + private List getCompleteInegruty(List jzhs) { + Integer checkIntegrityType = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("checkIntegrityType"))); + if (null == checkIntegrityType) { + throw new RuntimeException("homeQualitySet文件中校验方式checkIntegrityType需要配置"); + } else { + List maps = new ArrayList(); + if (checkIntegrityType == 1) { + maps = this.afCollectTaskService.getCompleteIntegrity(jzhs); + } else if (checkIntegrityType == 2) { + maps = this.iMzSyncService.getCompleteIntegrity(jzhs); + } + + return maps; + } + } + + private void integralityBySyncs(List maps) { + if (!CollectionUtils.isEmpty(maps)) { + StringBuilder sql = new StringBuilder(); + + for(Map map : maps) { + sql.append("update docus_medicalrecord.t_basic set integrity_desc="); + sql.append("'"); + sql.append(map.get("file_title")); + sql.append("',update_time=now()"); + sql.append(" where jzh="); + sql.append("'"); + sql.append(map.get("jzh")); + sql.append("'"); + sql.append(";"); + } + + System.out.println(sql); + this.afCollectAddMapper.dynamicSql(sql.toString()); + } + + } + + public void addSyncIntegralityByJzhs(String jzhs) { + List jzhList = Arrays.asList(jzhs.split(",")); + this.addSyncIntegralityByJzhsMethod(jzhList); + } +} diff --git a/src/main/java/com/docus/bgts/service/MzSyncService.java b/src/main/java/com/docus/bgts/service/MzSyncService.java new file mode 100644 index 0000000..bbd13d4 --- /dev/null +++ b/src/main/java/com/docus/bgts/service/MzSyncService.java @@ -0,0 +1,119 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.service; + +import com.docus.bgts.entity.MzSync; +import com.docus.bgts.entity.MzSyncDetails; +import com.docus.bgts.facade.IMzSyncService; +import com.docus.bgts.mapper.dbmysql.AfCollectAddMapper; +import com.docus.bgts.mapper.dbmysql.TScanAssortMapper; +import com.docus.bgts.mapper.dboracle.MzSyncMapper; +import com.docus.bgts.utils.FileUtils; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +@Service +public class MzSyncService implements IMzSyncService { + private String tableName = String.valueOf(FileUtils.getJsonByName("syncTableName")); + private String tableNamespaces = String.valueOf(FileUtils.getJsonByName("syncTableNamespaces")); + private String newSyncTime; + @Autowired + AfCollectAddMapper afCollectAddMapper; + @Autowired + MzSyncMapper mzSyncMapper; + @Autowired + TScanAssortMapper tScanAssortMapper; + @Autowired + UpdateFileService updateFileService; + + public MzSyncService() { + DateTimeFormatter isoDate = DateTimeFormatter.ISO_DATE; + this.newSyncTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).minusDays(1L).format(isoDate); + } + + public List getCompleteIntegrity(List jzhs) { + List mzSyncs = this.mzSyncMapper.listMzSync(jzhs, this.tableName, this.tableNamespaces); + List maps = this.verifyIntegrity(mzSyncs, jzhs); + return maps; + } + + private List verifyIntegrity(List mzSyncs, List jzhs) { + List maps = new ArrayList(); + List fileList = this.tScanAssortMapper.selectFilesByJzhs(jzhs); + + for(MzSync mzSync : mzSyncs) { + Map map = new HashMap(); + String jzh = mzSync.getJzh(); + List mzSyncDetails = mzSync.getMzSyncDetails(); + boolean recordFlag = false; + StringBuilder faultFileTitles = new StringBuilder(); + + for(MzSyncDetails mzSyncDetail : mzSyncDetails) { + String fileTitle = mzSyncDetail.getFileTitle(); + if (StringUtils.isNotBlank(fileTitle) && fileTitle.contains("急诊病历")) { + recordFlag = true; + } + + String serialnum = mzSyncDetail.getSerialnum(); + String collectid = mzSyncDetail.getCollectid(); + boolean flag = false; + if (!CollectionUtils.isEmpty(fileList)) { + for(MzSync obj : fileList) { + String jzh1 = obj.getJzh(); + if (jzh1.equals(jzh)) { + for(MzSyncDetails vo : obj.getMzSyncDetails()) { + String serialnum1 = vo.getSerialnum(); + String collectid1 = vo.getCollectid(); + if (serialnum.equals(serialnum1) && collectid.equals(collectid1)) { + flag = true; + mzSyncDetail.setCollectid(vo.getCollectid()); + break; + } + } + } + } + } + + if (!flag) { + if (StringUtils.isNotBlank(faultFileTitles)) { + faultFileTitles.append(","); + } + + faultFileTitles.append(fileTitle + "缺失"); + this.updateFileService.updateFile(jzh, mzSyncDetail); + } + } + + if (!recordFlag) { + if (StringUtils.isNotBlank(faultFileTitles)) { + faultFileTitles.append(","); + } + + faultFileTitles.append("急诊病历缺失"); + } + + if (StringUtils.isBlank(faultFileTitles)) { + faultFileTitles = new StringBuilder("完整"); + } + + map.put("jzh", jzh); + map.put("file_title", faultFileTitles.toString()); + maps.add(map); + } + + return maps; + } +} diff --git a/src/main/java/com/docus/bgts/service/UpdateFileService.java b/src/main/java/com/docus/bgts/service/UpdateFileService.java new file mode 100644 index 0000000..24c4c65 --- /dev/null +++ b/src/main/java/com/docus/bgts/service/UpdateFileService.java @@ -0,0 +1,124 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.service; + +import com.alibaba.fastjson.JSON; +import com.docus.bgts.entity.MzSyncDetails; +import com.docus.bgts.entity.ReportDownDto; +import com.docus.bgts.entity.ReportDownPatientDto; +import com.docus.bgts.entity.ReportDownScanFileDto; +import com.docus.bgts.entity.ZdAssort; +import com.docus.bgts.enums.Codes; +import com.docus.bgts.facade.IAfCollectTaskService; +import com.docus.bgts.mapper.dbmysql.ZdAssortMapper; +import com.docus.bgts.utils.FileUtils; +import com.docus.bgts.utils.HttpUtils; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +@Service +public class UpdateFileService { + private final Logger log = LoggerFactory.getLogger(this.getClass()); + @Autowired + IAfCollectTaskService afCollectTaskService; + @Autowired + ZdAssortMapper zdAssortMapper; + + public void updateFile(String jzh, MzSyncDetails mzSyncDetail) { + String collectorid = ""; + String assortid = this.getAssortid(mzSyncDetail.getAssortName()); + ReportDownDto reportDownDto = new ReportDownDto(); + reportDownDto.setAssortid(assortid); + List reportDownDtoArr = new ArrayList(); + ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto(); + reportDownPatientDto.setJzh(jzh); + this.log.info("患者主索引号:" + jzh); + reportDownDto.setPatient(reportDownPatientDto); + String filetitle = mzSyncDetail.getFileTitle(); + String downurl = mzSyncDetail.getFileUrl(); + if (!StringUtils.isBlank(downurl)) { + downurl = this.subStrUrl(downurl); + if (!StringUtils.isBlank(downurl)) { + String serialnum = mzSyncDetail.getSerialnum(); + collectorid = mzSyncDetail.getCollectid(); + ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto(); + reportDownScanFileDto.setDownurl(downurl); + reportDownScanFileDto.setFiletitle(filetitle); + reportDownScanFileDto.setSerialnum(serialnum); + reportDownScanFileDto.setFilesource(1); + reportDownScanFileDto.setFilestoragetype(1); + reportDownDtoArr.add(reportDownScanFileDto); + reportDownDto.setCollectorid(collectorid); + reportDownDto.setScanfiles(reportDownDtoArr); + this.afCollectTaskService.insert(reportDownDto); + String post = ""; + this.log.info("--------执行上传功能----------"); + Map params = (Map)JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class); + Map headMap = new HashMap(); + headMap.put("Content-Type", "application/json"); + + try { + post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + if (StringUtils.isBlank(post)) { + this.log.info("--------上传时出现错误,可能是文件服务没有启动----------"); + throw new RuntimeException("上传时出现错误,可能是文件服务没有启动"); + } else { + Map resMap = (Map)JSON.parseObject(post, Map.class); + if (String.valueOf(resMap.get("code")).equals("500")) { + throw new RuntimeException(String.valueOf(resMap.get("msg"))); + } else { + this.log.info("----------执行成功-----------"); + } + } + } + } + } + + private String getAssortid(String assortName) { + String assortId = String.valueOf(FileUtils.getJsonByName("assortid")); + if (StringUtils.isBlank(assortId)) { + List zdAssorts = this.zdAssortMapper.selectAll(assortName); + if (CollectionUtils.isEmpty(zdAssorts)) { + String uuid = UUID.randomUUID().toString().replaceAll("-", ""); + ZdAssort zdAssort = new ZdAssort(); + zdAssort.setAssortName(assortName); + zdAssort.setAssortId(uuid); + zdAssort.setEffective(1); + this.zdAssortMapper.insertZdAssort(zdAssort); + assortId = uuid; + } else { + assortId = ((ZdAssort)zdAssorts.get(0)).getAssortId(); + } + } + + return assortId; + } + + private String subStrUrl(String str) { + List replaceUrls = (List)FileUtils.getJsonByName("replaceUrl"); + if (null != replaceUrls) { + for(String replaceUrl : replaceUrls) { + str = str.replaceAll(replaceUrl, ""); + } + } + + return str; + } +} diff --git a/src/main/java/com/docus/bgts/utils/FileUtils.java b/src/main/java/com/docus/bgts/utils/FileUtils.java new file mode 100644 index 0000000..810c35e --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/FileUtils.java @@ -0,0 +1,44 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +import com.alibaba.fastjson.JSON; +import com.docus.bgts.enums.Codes; +import java.io.File; +import java.io.IOException; +import java.util.Map; + +public class FileUtils { + public static String currentPath() { + File dir = new File("."); + String currentpath = ""; + + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException e) { + e.printStackTrace(); + } + + return currentpath; + } + + public static String getXmlPath() { + String path = currentPath(); + return path + Codes.REQUEST_XML.getMessage(); + } + + public static String getXmlDetailsPath() { + String path = currentPath(); + return path + Codes.REQUEST_details_XML.getMessage(); + } + + public static Object getJsonByName(String name) { + String path = currentPath(); + String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage()); + Map jsonMap = (Map)JSON.parseObject(json, Map.class); + return jsonMap.get(name); + } +} diff --git a/src/main/java/com/docus/bgts/utils/HttpUtils.java b/src/main/java/com/docus/bgts/utils/HttpUtils.java new file mode 100644 index 0000000..d8f47f4 --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/HttpUtils.java @@ -0,0 +1,219 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +import com.alibaba.fastjson.JSON; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Map; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.methods.RequestBuilder; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.dom4j.Element; + +public class HttpUtils { + private static PoolingHttpClientConnectionManager cm; + private static String EMPTY_STR = ""; + private static String UTF_8 = "UTF-8"; + + private static void init() { + if (cm == null) { + cm = new PoolingHttpClientConnectionManager(); + cm.setMaxTotal(50); + cm.setDefaultMaxPerRoute(5); + } + + } + + private static CloseableHttpClient getHttpClient() { + init(); + return HttpClients.custom().setConnectionManager(cm).build(); + } + + public static String get(String url) { + HttpGet httpGet = new HttpGet(url); + return getResult((HttpRequestBase)httpGet); + } + + public static String get(String url, Map params) throws URISyntaxException { + URIBuilder ub = new URIBuilder(); + ub.setPath(url); + ArrayList pairs = covertParams2NVPS(params); + ub.setParameters(pairs); + HttpGet httpGet = new HttpGet(ub.build()); + return getResult((HttpRequestBase)httpGet); + } + + public static String get(String url, Map headers, Map params) throws URISyntaxException { + URIBuilder ub = new URIBuilder(); + ub.setPath(url); + if (params != null) { + ArrayList pairs = covertParams2NVPS(params); + ub.setParameters(pairs); + } + + HttpGet httpGet = new HttpGet(ub.build()); + + for(Map.Entry param : headers.entrySet()) { + httpGet.addHeader((String)param.getKey(), String.valueOf(param.getValue())); + } + + return getResult((HttpRequestBase)httpGet); + } + + public static String post(String url) { + HttpPost httpPost = new HttpPost(url); + return getResult((HttpRequestBase)httpPost); + } + + public static String post(String url, Map params) throws UnsupportedEncodingException { + HttpPost httpPost = new HttpPost(url); + httpPost.setEntity(new UrlEncodedFormEntity(covertParams2NVPS(params), "utf-8")); + return getResult((HttpRequestBase)httpPost); + } + + public static String post(String url, Object params, Map head) throws UnsupportedEncodingException { + HttpPost httpPost = new HttpPost(url); + System.out.println(params); + httpPost.setEntity(new StringEntity(params.toString())); + if (params != null) { + for(Map.Entry param : head.entrySet()) { + httpPost.addHeader((String)param.getKey(), String.valueOf(param.getValue())); + } + } + + return getResult((HttpRequestBase)httpPost); + } + + private static ArrayList covertParams2NVPS(Map params) { + ArrayList pairs = new ArrayList(); + + for(Map.Entry param : params.entrySet()) { + if (param.getValue() != null) { + pairs.add(new BasicNameValuePair((String)param.getKey(), (String)param.getValue())); + } + } + + return pairs; + } + + public static String post(String url, Map headers, Map params) throws UnsupportedEncodingException { + HttpPost httpPost = new HttpPost(url); + System.out.println(params); + if (params != null) { + for(Map.Entry param : headers.entrySet()) { + httpPost.addHeader((String)param.getKey(), String.valueOf(param.getValue())); + } + } + + httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON)); + return getResult((HttpRequestBase)httpPost); + } + + private static String getResult(HttpRequestBase request) { + CloseableHttpClient httpClient = getHttpClient(); + + try { + CloseableHttpResponse response = httpClient.execute(request); + HttpEntity entity = response.getEntity(); + if (entity != null) { + String result = EntityUtils.toString(entity, UTF_8); + response.close(); + return result; + } + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + ; + } + + return EMPTY_STR; + } + + private static String getResult(RequestBuilder requestBuilder) { + CloseableHttpClient httpClient = getHttpClient(); + + try { + CloseableHttpResponse response = httpClient.execute(requestBuilder.build()); + HttpEntity entity = response.getEntity(); + if (entity != null) { + String result = EntityUtils.toString(entity, UTF_8); + response.close(); + return result; + } + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + ; + } + + return EMPTY_STR; + } + + public static Element reqElement(Element esbEntry, Integer code) { + Element accessControl = esbEntry.addElement("AccessControl"); + accessControl.addElement("SysFlag").setText("1"); + accessControl.addElement("UserName").setText("WZHBAGL"); + accessControl.addElement("Password").setText("WZHBAGL_1127"); + accessControl.addElement("Fid").setText("BS04102"); + accessControl.addElement("OrderNo").setText("BS04102S51001"); + accessControl.addElement("SUBOR_HOSPITAL_DISTRICT").setText("GZ"); + Element messageHeader = esbEntry.addElement("MessageHeader"); + messageHeader.addElement("Fid").setText("BS04102"); + messageHeader.addElement("OrderNo").setText("BS04102S51001"); + messageHeader.addElement("SourceSysCode").setText("S51"); + messageHeader.addElement("TargetSysCode").setText("S00"); + messageHeader.addElement("MsgDate").setText("2021-10-27 17:05:19"); + Element requestOption = esbEntry.addElement("RequestOption"); + requestOption.addElement("triggerData").setText("0"); + requestOption.addElement("dataAmount").setText("500"); + Element msgInfo = esbEntry.addElement("MsgInfo"); + msgInfo.addAttribute("flag", "1"); + msgInfo.addElement("Msg"); + Element distinct = msgInfo.addElement("distinct"); + distinct.addAttribute("value", "0"); + Element query = msgInfo.addElement("query"); + query.addAttribute("item", "WS_INPUT"); + query.addAttribute("compy", " = "); + query.addAttribute("value", " 1 "); + query.addAttribute("splice", "AND"); + Element queryWs = msgInfo.addElement("query_ws"); + if (code == 1) { + queryWs.addAttribute("action", "queueReportList"); + } else { + queryWs.addAttribute("action", "queueReportInfo"); + } + + Element res = queryWs.addElement("content").addElement("Request").addElement("Msg"); + Element groupInfo = esbEntry.addElement("GroupInfo"); + groupInfo.addAttribute("flag", "0"); + Element as = groupInfo.addElement("AS"); + as.addAttribute("ID", ""); + as.addAttribute("linkField", ""); + System.out.println(esbEntry.asXML()); + return res; + } +} diff --git a/src/main/java/com/docus/bgts/utils/JAXDynamicClientFactory.java b/src/main/java/com/docus/bgts/utils/JAXDynamicClientFactory.java new file mode 100644 index 0000000..8f3cdbe --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/JAXDynamicClientFactory.java @@ -0,0 +1,43 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +import org.apache.cxf.Bus; +import org.apache.cxf.bus.CXFBusFactory; +import org.apache.cxf.common.util.Compiler; +import org.apache.cxf.endpoint.EndpointImplFactory; +import org.apache.cxf.endpoint.dynamic.DynamicClientFactory; +import org.apache.cxf.jaxws.support.JaxWsEndpointImplFactory; + +import java.util.List; + +public class JAXDynamicClientFactory extends DynamicClientFactory { + protected JAXDynamicClientFactory(Bus bus) { + super(bus); + } + + protected EndpointImplFactory getEndpointImplFactory() { + return JaxWsEndpointImplFactory.getSingleton(); + } + + protected boolean allowWrapperOps() { + return true; + } + + public static JAXDynamicClientFactory newInstance() { + Bus bus = CXFBusFactory.getThreadDefaultBus(); + return new JAXDynamicClientFactory(bus); + } + + public boolean compileJavaSrc(String classPath, List srcList, String dest) { + Compiler javaCompiler = new Compiler(); + javaCompiler.setEncoding("UTF-8"); + javaCompiler.setClassPath(classPath); + javaCompiler.setOutputDir(dest); + javaCompiler.setTarget("1.8"); + return javaCompiler.compileFiles(srcList); + } +} diff --git a/src/main/java/com/docus/bgts/utils/JsonUtils.java b/src/main/java/com/docus/bgts/utils/JsonUtils.java new file mode 100644 index 0000000..28e35bf --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/JsonUtils.java @@ -0,0 +1,50 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; + +public class JsonUtils { + public static String readJsonFile(String fileName) { + String jsonStr = ""; + Reader reader = null; + FileReader fileReader = null; + + try { + File jsonFile = new File(fileName); + fileReader = new FileReader(jsonFile); + reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8"); + int ch = 0; + StringBuffer sb = new StringBuffer(); + + while((ch = reader.read()) != -1) { + sb.append((char)ch); + } + + fileReader.close(); + reader.close(); + jsonStr = sb.toString(); + String var7 = jsonStr; + return var7; + } catch (IOException e) { + e.printStackTrace(); + return null; + } finally { + try { + reader.close(); + fileReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + } +} diff --git a/src/main/java/com/docus/bgts/utils/SnowflakeIdWorker.java b/src/main/java/com/docus/bgts/utils/SnowflakeIdWorker.java new file mode 100644 index 0000000..9651ef4 --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/SnowflakeIdWorker.java @@ -0,0 +1,78 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +public class SnowflakeIdWorker { + private final long twepoch = 1420041600000L; + private final long workerIdBits = 5L; + private final long datacenterIdBits = 5L; + private final long maxWorkerId = 31L; + private final long maxDatacenterId = 31L; + private final long sequenceBits = 12L; + private final long workerIdShift = 12L; + private final long datacenterIdShift = 17L; + private final long timestampLeftShift = 22L; + private final long sequenceMask = 4095L; + private long workerId; + private long datacenterId; + private long sequence = 0L; + private long lastTimestamp = -1L; + + public SnowflakeIdWorker(long workerId, long datacenterId) { + if (workerId <= 31L && workerId >= 0L) { + if (datacenterId <= 31L && datacenterId >= 0L) { + this.workerId = workerId; + this.datacenterId = datacenterId; + } else { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", 31L)); + } + } else { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", 31L)); + } + } + + public synchronized long nextId() { + long timestamp = this.timeGen(); + if (timestamp < this.lastTimestamp) { + throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", this.lastTimestamp - timestamp)); + } else { + if (this.lastTimestamp == timestamp) { + this.sequence = this.sequence + 1L & 4095L; + if (this.sequence == 0L) { + timestamp = this.tilNextMillis(this.lastTimestamp); + } + } else { + this.sequence = 0L; + } + + this.lastTimestamp = timestamp; + return timestamp - 1420041600000L << 22 | this.datacenterId << 17 | this.workerId << 12 | this.sequence; + } + } + + protected long tilNextMillis(long lastTimestamp) { + long timestamp; + for(timestamp = this.timeGen(); timestamp <= lastTimestamp; timestamp = this.timeGen()) { + } + + return timestamp; + } + + protected long timeGen() { + return System.currentTimeMillis(); + } + + public static void main(String[] args) throws InterruptedException { + SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0L, 0L); + + for(int i = 0; i < 10; ++i) { + long id = idWorker.nextId(); + Thread.sleep(1L); + System.out.println(id); + } + + } +} diff --git a/src/main/java/com/docus/bgts/utils/XmlUtils.java b/src/main/java/com/docus/bgts/utils/XmlUtils.java new file mode 100644 index 0000000..3262065 --- /dev/null +++ b/src/main/java/com/docus/bgts/utils/XmlUtils.java @@ -0,0 +1,132 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.utils; + +import com.alibaba.fastjson.JSON; +import com.docus.bgts.enums.Codes; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class XmlUtils { + private SAXReader saxReader = new SAXReader(); + private Document document; + + public Element getDocument() { + return this.document.getRootElement(); + } + + public XmlUtils(String path) { + try { + this.document = this.saxReader.read(path); + } catch (DocumentException e) { + e.printStackTrace(); + } + + } + + public XmlUtils(InputStream path) { + try { + this.document = this.saxReader.read(path); + } catch (DocumentException e) { + e.printStackTrace(); + } + + } + + public String isSuccess() { + Element root = this.document.getRootElement(); + Element retInfo = root.element("RetInfo"); + Element retCode = retInfo.element("RetCode"); + String code = retCode.getText(); + return code.equals("0") ? "ok" : retInfo.element("RetCon").getText(); + } + + public String getElement(String name) { + Element root = this.document.getRootElement(); + Object directory = FileUtils.getJsonByName(Codes.DIRECTORY.getMessage()); + Element current = root; + if (directory == null) { + throw new RuntimeException("没有定义目录结构"); + } else { + List directorys = JSON.parseArray(JSON.toJSONString(directory), String.class); + for(String dire :directorys) { + current = current.element(dire); + } + + return current.element(name) == null ? "" : current.element(name).getText(); + } + } + + public Element getMsgElement() { + List argsArr = new ArrayList(); + argsArr.add("MsgInfo"); + argsArr.add("query_ws"); + argsArr.add("content"); + argsArr.add("Request"); + argsArr.add("Msg"); + Element element = this.getElement(argsArr); + return element; + } + + public Element getElement(List directory) { + Element root = this.document.getRootElement(); + Element current = root; + + for(String dire : directory) { + current = current.element(dire); + } + + if (current == null) { + throw new RuntimeException("未找到对应节点"); + } else { + return current; + } + } + + public List getJsonByName() { + String path = FileUtils.currentPath(); + String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage()); + Map jsonMap = (Map)JSON.parseObject(json, Map.class); + List basicArr = (List)jsonMap.get("doubleBasic"); + List directory = (List)jsonMap.get("basicDirectory"); + List elements = null; + Element root = this.getElement(directory); + + for(String basic : basicArr) { + elements = root.elements(basic); + if (elements != null && elements.size() > 0) { + break; + } + } + + if (elements == null || elements.size() == 0) { + List rootDirectory = (List)jsonMap.get("directory"); + root = this.getElement(rootDirectory); + elements = new ArrayList(); + elements.add(root); + } + + return elements; + } + + public String getElementText(String name) { + Element root = this.document.getRootElement(); + Element msg = root.element(Codes.MSG.getMessage()); + if (msg == null) { + throw new RuntimeException("没有" + Codes.MSG.getMessage() + "节点"); + } else { + Element element = msg.element(name); + return element == null ? null : element.getText(); + } + } +} diff --git a/src/main/java/com/docus/bgts/web/FilterConfig.java b/src/main/java/com/docus/bgts/web/FilterConfig.java new file mode 100644 index 0000000..12de75b --- /dev/null +++ b/src/main/java/com/docus/bgts/web/FilterConfig.java @@ -0,0 +1,20 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.web; + +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FilterConfig { + @Bean + public FilterRegistrationBean getFilter() { + FilterRegistrationBean bean = new FilterRegistrationBean(new MyFilter(), new ServletRegistrationBean[0]); + return bean; + } +} diff --git a/src/main/java/com/docus/bgts/web/MyFilter.java b/src/main/java/com/docus/bgts/web/MyFilter.java new file mode 100644 index 0000000..d9c953b --- /dev/null +++ b/src/main/java/com/docus/bgts/web/MyFilter.java @@ -0,0 +1,39 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package com.docus.bgts.web; + +import com.docus.bgts.enums.Codes; +import com.docus.bgts.utils.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import java.io.IOException; + +public class MyFilter implements Filter { + private Logger logger = LogManager.getLogger(); + + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + this.logger.info("------拦截开始------"); + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + if (collectorid.equals(Codes.SMCODE.getCode())) { + this.logger.info("-----当前请求已被拦截...------"); + } else if (collectorid.equals(Codes.ZZCODE.getCode())) { + this.logger.info("-----当前请求已被拦截...------"); + } else { + this.logger.info("----已放行----"); + filterChain.doFilter(servletRequest, servletResponse); + } + + } + + public void destroy() { + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..a0138af --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,37 @@ +server: + port: 9308 +# http +docus: + downloadPlatformAddress: http://192.9.100.171:9291 + +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 + +beat: + url: http://localhost:9399/beat + +ws: + #url: http://localhost:8010/ws_server/weather?wsdl + #url: http://192.9.200.89:7827/Ewell_WS_S51?wsdl + url: http://192.9.200.89:7828/Ewell_WS_S51?wsdl + localMethod: OperationA + +spring: + datasource: + mysql-docus: + driver-class-name: com.mysql.cj.jdbc.Driver + username: docus + password: docus702 + url: jdbc:mysql://db.docus.cn:3306/docus_archivefile?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true + oracle-docus: + driver-class-name: oracle.jdbc.driver.OracleDriver + url: jdbc:oracle:thin:@192.168.117.100:1521:helowin + username: docus + password: docus702 \ No newline at end of file diff --git a/src/main/resources/mapper/dbmysql/AfCollectAddMapper.xml b/src/main/resources/mapper/dbmysql/AfCollectAddMapper.xml new file mode 100644 index 0000000..bf495ea --- /dev/null +++ b/src/main/resources/mapper/dbmysql/AfCollectAddMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + update docus_medicalrecord.t_basic + set integrity_desc=#{result} + where jzh=#{jzh} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/dbmysql/AfCollectTaskMapper.xml b/src/main/resources/mapper/dbmysql/AfCollectTaskMapper.xml new file mode 100644 index 0000000..6ce4889 --- /dev/null +++ b/src/main/resources/mapper/dbmysql/AfCollectTaskMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/dbmysql/MrReportErrorMapper.xml b/src/main/resources/mapper/dbmysql/MrReportErrorMapper.xml new file mode 100644 index 0000000..53802d5 --- /dev/null +++ b/src/main/resources/mapper/dbmysql/MrReportErrorMapper.xml @@ -0,0 +1,10 @@ + + + + + insert into docus_medicalrecord.mr_report_error(xml,report_type,create_time) + values(#{mrReportError.xml},#{mrReportError.reportType},#{mrReportError.createTime}) + + \ No newline at end of file diff --git a/src/main/resources/mapper/dbmysql/TScanAssortMapper.xml b/src/main/resources/mapper/dbmysql/TScanAssortMapper.xml new file mode 100644 index 0000000..fc09aa6 --- /dev/null +++ b/src/main/resources/mapper/dbmysql/TScanAssortMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/dbmysql/ZdAssortMapper.xml b/src/main/resources/mapper/dbmysql/ZdAssortMapper.xml new file mode 100644 index 0000000..72b200e --- /dev/null +++ b/src/main/resources/mapper/dbmysql/ZdAssortMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + insert into zd_assort(assort_id,assort_name,effective) values(#{zdAssort.assortId},#{zdAssort.assortName},#{zdAssort.effective}) + + diff --git a/src/main/resources/mapper/dboracle/MzSyncMapper.xml b/src/main/resources/mapper/dboracle/MzSyncMapper.xml new file mode 100644 index 0000000..011429b --- /dev/null +++ b/src/main/resources/mapper/dboracle/MzSyncMapper.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/dboracle/TestMapper.xml b/src/main/resources/mapper/dboracle/TestMapper.xml new file mode 100644 index 0000000..3b7d4a6 --- /dev/null +++ b/src/main/resources/mapper/dboracle/TestMapper.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/dboracle/VDocumentPdfMapper.xml b/src/main/resources/mapper/dboracle/VDocumentPdfMapper.xml new file mode 100644 index 0000000..634e479 --- /dev/null +++ b/src/main/resources/mapper/dboracle/VDocumentPdfMapper.xml @@ -0,0 +1,33 @@ + + + + + + \ No newline at end of file