From ae38b5d21757ca636f227ccf6aa4167ee49b205b Mon Sep 17 00:00:00 2001 From: linjj <850658129@qq.com> Date: Mon, 22 Jul 2024 11:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 186 +++++++++++++++++ src/main/java/com/example/QuartzConfig.java | 34 +++ .../example/SpringbootDemoApplication.java | 27 +++ src/main/java/com/example/TestQuartz.java | 38 ++++ .../example/duplicate/common/CommonUtil.java | 7 + .../example/duplicate/common/ResultBody.java | 41 ++++ .../example/duplicate/config/ConfigOne.java | 64 ++++++ .../example/duplicate/config/ConfigTwo.java | 70 +++++++ .../duplicate/config/SwaggerConfig.java | 72 +++++++ .../controller/DuplicateController.java | 73 +++++++ .../duplicate/controller/LzRmController.java | 39 ++++ .../duplicate/controller/ZJYYController.java | 85 ++++++++ .../duplicate/controller/param/Package.java | 0 .../controller/vo/AddArchiveDetail.java | 32 +++ .../controller/vo/AddArchiveMasterVo.java | 45 ++++ .../controller/vo/AddLzRmCommVo.java | 36 ++++ .../controller/vo/AddMessageLogVo.java | 50 +++++ .../controller/vo/ArchiveMasterVo.java | 16 ++ .../controller/vo/CommomtableCopyVo.java | 28 +++ .../controller/vo/CommomtableVo.java | 32 +++ .../duplicate/controller/vo/DuplicateVo.java | 30 +++ .../duplicate/controller/vo/FliePath.java | 24 +++ .../duplicate/controller/vo/MessageLog.java | 82 ++++++++ .../duplicate/controller/vo/MessageLogVo.java | 15 ++ .../controller/vo/MessageSubordinate.java | 45 ++++ .../controller/vo/MessageSubordinateVo.java | 14 ++ .../duplicate/controller/vo/PageCountVo.java | 30 +++ .../example/duplicate/controller/vo/PhVo.java | 16 ++ .../duplicate/controller/vo/TscanAssort.java | 21 ++ .../duplicate/controller/vo/ZdAssortVo.java | 33 +++ .../infrastructure/cache/Package.java | 0 .../infrastructure/client/Package.java | 0 .../configOneDao/ArchiveDetailMapper.java | 17 ++ .../configOneDao/ArchiveMasterMapper.java | 29 +++ .../configOneDao/CommomtableMapper.java | 35 ++++ .../configOneDao/LzRmMapper.java | 28 +++ .../configOneDao/MessageLogMapper.java | 33 +++ .../MessageSubordinateMapper.java | 38 ++++ .../configOneDao/MidMapper.java | 14 ++ .../configOneDao/QualityMapper.java | 37 ++++ .../configTwoDao/MessageLogTwoMapper.java | 23 +++ .../MessageSubordinateTwoMapper.java | 24 +++ .../duplicate/service/DuplicateService.java | 22 ++ .../duplicate/service/LzRmService.java | 13 ++ .../duplicate/service/MessageLogService.java | 15 ++ .../service/MessageLogTwoService.java | 13 ++ .../service/MessageSubordinateService.java | 20 ++ .../service/impl/DuplicateServiceImpl.java | 183 +++++++++++++++++ .../service/impl/LzRmServiceImpl.java | 193 ++++++++++++++++++ .../service/impl/MessageLogServiceImpl.java | 47 +++++ .../impl/MessageLogTwoServiceImpl.java | 52 +++++ .../impl/MessageSubordinateServiceImpl.java | 143 +++++++++++++ .../java/com/example/utils/FieldSelector.java | 12 ++ src/main/java/com/example/utils/IpUtil.java | 0 .../java/com/example/utils/ListUtilsNew.java | 73 +++++++ src/main/java/com/example/utils/Md5Util.java | 21 ++ .../com/example/utils/SnowflakeIdWorker.java | 139 +++++++++++++ .../com/example/utils/SplitDataProcessor.java | 0 .../java/com/example/utils/StopWatch.java | 0 src/main/resources/application.yml | 81 ++++++++ src/main/resources/logback-spring.xml | 51 +++++ .../resources/mapper/ArchiveDetailMapper.xml | 11 + .../resources/mapper/ArchiveMasterMapper.xml | 31 +++ .../resources/mapper/CommomtableMapper.xml | 53 +++++ src/main/resources/mapper/LzRmMapper.xml | 45 ++++ .../resources/mapper/MessageLogMapper.xml | 74 +++++++ .../mapper/MessageSubordinateMapper.xml | 72 +++++++ src/main/resources/mapper/MidMapper.xml | 10 + src/main/resources/mapper/QualityMapper.xml | 108 ++++++++++ .../resources/mapper2/MessageLogTwoMapper.xml | 18 ++ .../mapper2/MessageSubordinateTwoMapper.xml | 16 ++ src/main/resources/rebel.xml | 16 ++ .../com/example/DemoApplicationTests.java | 141 +++++++++++++ 73 files changed, 3236 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/java/com/example/QuartzConfig.java create mode 100644 src/main/java/com/example/SpringbootDemoApplication.java create mode 100644 src/main/java/com/example/TestQuartz.java create mode 100644 src/main/java/com/example/duplicate/common/CommonUtil.java create mode 100644 src/main/java/com/example/duplicate/common/ResultBody.java create mode 100644 src/main/java/com/example/duplicate/config/ConfigOne.java create mode 100644 src/main/java/com/example/duplicate/config/ConfigTwo.java create mode 100644 src/main/java/com/example/duplicate/config/SwaggerConfig.java create mode 100644 src/main/java/com/example/duplicate/controller/DuplicateController.java create mode 100644 src/main/java/com/example/duplicate/controller/LzRmController.java create mode 100644 src/main/java/com/example/duplicate/controller/ZJYYController.java create mode 100644 src/main/java/com/example/duplicate/controller/param/Package.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/AddArchiveDetail.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/AddArchiveMasterVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/AddLzRmCommVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/AddMessageLogVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/ArchiveMasterVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/CommomtableCopyVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/CommomtableVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/DuplicateVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/FliePath.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/MessageLog.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/MessageLogVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/MessageSubordinate.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/MessageSubordinateVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/PageCountVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/PhVo.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/TscanAssort.java create mode 100644 src/main/java/com/example/duplicate/controller/vo/ZdAssortVo.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/cache/Package.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/client/Package.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveDetailMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveMasterMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/CommomtableMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/LzRmMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageLogMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageSubordinateMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/MidMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configOneDao/QualityMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageLogTwoMapper.java create mode 100644 src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageSubordinateTwoMapper.java create mode 100644 src/main/java/com/example/duplicate/service/DuplicateService.java create mode 100644 src/main/java/com/example/duplicate/service/LzRmService.java create mode 100644 src/main/java/com/example/duplicate/service/MessageLogService.java create mode 100644 src/main/java/com/example/duplicate/service/MessageLogTwoService.java create mode 100644 src/main/java/com/example/duplicate/service/MessageSubordinateService.java create mode 100644 src/main/java/com/example/duplicate/service/impl/DuplicateServiceImpl.java create mode 100644 src/main/java/com/example/duplicate/service/impl/LzRmServiceImpl.java create mode 100644 src/main/java/com/example/duplicate/service/impl/MessageLogServiceImpl.java create mode 100644 src/main/java/com/example/duplicate/service/impl/MessageLogTwoServiceImpl.java create mode 100644 src/main/java/com/example/duplicate/service/impl/MessageSubordinateServiceImpl.java create mode 100644 src/main/java/com/example/utils/FieldSelector.java create mode 100644 src/main/java/com/example/utils/IpUtil.java create mode 100644 src/main/java/com/example/utils/ListUtilsNew.java create mode 100644 src/main/java/com/example/utils/Md5Util.java create mode 100644 src/main/java/com/example/utils/SnowflakeIdWorker.java create mode 100644 src/main/java/com/example/utils/SplitDataProcessor.java create mode 100644 src/main/java/com/example/utils/StopWatch.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/logback-spring.xml create mode 100644 src/main/resources/mapper/ArchiveDetailMapper.xml create mode 100644 src/main/resources/mapper/ArchiveMasterMapper.xml create mode 100644 src/main/resources/mapper/CommomtableMapper.xml create mode 100644 src/main/resources/mapper/LzRmMapper.xml create mode 100644 src/main/resources/mapper/MessageLogMapper.xml create mode 100644 src/main/resources/mapper/MessageSubordinateMapper.xml create mode 100644 src/main/resources/mapper/MidMapper.xml create mode 100644 src/main/resources/mapper/QualityMapper.xml create mode 100644 src/main/resources/mapper2/MessageLogTwoMapper.xml create mode 100644 src/main/resources/mapper2/MessageSubordinateTwoMapper.xml create mode 100644 src/main/resources/rebel.xml create mode 100644 src/test/java/com/example/DemoApplicationTests.java diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7c04ee9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,186 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.3.8.RELEASE + + + com.example + springbootDemo + 0.0.1-SNAPSHOT + springbootDemo + springbootDemo + + 1.8 + true + 3.4.1 + 1.2.1 + 2.0.9 + 2.0.11 + 2.6.0 + 2.1.7 + + + + org.springframework.boot + spring-boot-starter-web + + + + + io.springfox + springfox-swagger-ui + 2.9.2 + + + io.springfox + springfox-swagger2 + 2.9.2 + + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.projectlombok + lombok + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatisPlus.version} + + + com.baomidou + mybatis-plus-generator + ${mybatisPlus.version} + + + mysql + mysql-connector-java + + + + com.alibaba + druid-spring-boot-starter + ${alibabadruid.version} + + + org.apache.commons + commons-collections4 + 4.4 + + + + com.github.xiaoymin + knife4j-spring-boot-starter + ${knife4j.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.apache.commons + commons-pool2 + ${commons-pool2.version} + + + + + + org.ofdrw + ofdrw-full + 2.3.0 + + + + + org.springframework + spring-test + + + + org.apache.pdfbox + pdfbox + 2.0.24 + + + com.lowagie + itext + 2.1.7 + + + org.eclipse.birt.runtime.3_7_1 + com.lowagie.text + 2.1.7 + + + + + org.springframework.boot + spring-boot-starter-quartz + + + + + com.microsoft.sqlserver + sqljdbc4 + 4.0 + + + org.apache.commons + commons-lang3 + 3.10 + + + + + wsjz-releases + Releases Repository + http://localhost:8081/nexus/content/repositories/releases/ + + + wsjz-snapshots + Snapshot Repository + http://localhost:8081/nexus/content/repositories/snapshots/ + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + diff --git a/src/main/java/com/example/QuartzConfig.java b/src/main/java/com/example/QuartzConfig.java new file mode 100644 index 0000000..993dfd2 --- /dev/null +++ b/src/main/java/com/example/QuartzConfig.java @@ -0,0 +1,34 @@ +package com.example; + +import org.quartz.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @ClassName QuartzConfig + * @Description + * @Author linjj + * @Date 2023/8/14 15:47 + * @Version 1.0 + */ +@Configuration +public class QuartzConfig { + + @Bean + public JobDetail teatQuartzDetail(){ + + return JobBuilder.newJob(TestQuartz.class).withIdentity("testQuartz").storeDurably().build(); + + } + + @Bean + public Trigger testQuartzTrigger(){ + + return TriggerBuilder.newTrigger().forJob(teatQuartzDetail()) + + .withIdentity("testQuartz") + .withSchedule(CronScheduleBuilder.cronSchedule("0 0 1 * * ?")) + .build(); + + } +} diff --git a/src/main/java/com/example/SpringbootDemoApplication.java b/src/main/java/com/example/SpringbootDemoApplication.java new file mode 100644 index 0000000..5dc3e33 --- /dev/null +++ b/src/main/java/com/example/SpringbootDemoApplication.java @@ -0,0 +1,27 @@ +package com.example; + +import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.util.FileSystemUtils; + +import java.io.File; + +/** + * @author 曾文和 + */ + +@SpringBootApplication +@MapperScan("com.example.duplicate.infrastructure.dao") +public class SpringbootDemoApplication { + public static void main(String[] args) { + SpringApplication.run(SpringbootDemoApplication.class, args); + + } + + +} diff --git a/src/main/java/com/example/TestQuartz.java b/src/main/java/com/example/TestQuartz.java new file mode 100644 index 0000000..782cd98 --- /dev/null +++ b/src/main/java/com/example/TestQuartz.java @@ -0,0 +1,38 @@ +package com.example; + + +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.quartz.QuartzJobBean; + +import java.io.File; + + +public class TestQuartz extends QuartzJobBean { + + + @Value("${waterPicPath}") + private String waterPicPath; + + @Value("${waterPicPathFlag}") + private String waterPicPathFlag; + + + + + @Override + protected void executeInternal(JobExecutionContext jobExecutionContext) { + if (waterPicPathFlag == "0") { + return; + } + String filePath = waterPicPath; + File file = new File(filePath); + if (file.isDirectory()) { + for (File f : file.listFiles()) { + f.delete(); + } + } + } +} diff --git a/src/main/java/com/example/duplicate/common/CommonUtil.java b/src/main/java/com/example/duplicate/common/CommonUtil.java new file mode 100644 index 0000000..28b7687 --- /dev/null +++ b/src/main/java/com/example/duplicate/common/CommonUtil.java @@ -0,0 +1,7 @@ +package com.example.duplicate.common; + +public class CommonUtil { + public static final String USERKEY = "hj:mr:user"; + + public static final int DEFAULTPAGESIZE = 1000; +} diff --git a/src/main/java/com/example/duplicate/common/ResultBody.java b/src/main/java/com/example/duplicate/common/ResultBody.java new file mode 100644 index 0000000..52c09ec --- /dev/null +++ b/src/main/java/com/example/duplicate/common/ResultBody.java @@ -0,0 +1,41 @@ +package com.example.duplicate.common; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author 曾文和 + * @description: XXX类 + * @createTime 2023/5/9 15:25 + */ +@Data +@ApiModel("响应") +public class ResultBody { + @ApiModelProperty("响应码") + private Integer code; + @ApiModelProperty("响应消息") + private String msg; + @ApiModelProperty("响应实体") + private T data; + + private ResultBody(Integer code, String msg,T data) { + this.code = code; + this.msg = msg; + this.data = data; + } + private ResultBody(Integer code, String msg) { + this.code = code; + this.msg = msg; + } + + public static ResultBody success(T data) { + ResultBody result = new ResultBody(200, "success",data); + return result; + } + + public static ResultBody failed(String msg) { + ResultBody result = new ResultBody(500,msg); + return result; + } +} diff --git a/src/main/java/com/example/duplicate/config/ConfigOne.java b/src/main/java/com/example/duplicate/config/ConfigOne.java new file mode 100644 index 0000000..491fffc --- /dev/null +++ b/src/main/java/com/example/duplicate/config/ConfigOne.java @@ -0,0 +1,64 @@ +package com.example.duplicate.config; + +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.boot.jdbc.DataSourceBuilder; +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 org.springframework.transaction.PlatformTransactionManager; + +import javax.sql.DataSource; + +/** + * @ClassName RecordConfig + * @Description Pacs数据数据源配置 + * @Author linjj + * @Date 2023/8/2 16:48 + * @Version 1.0 + */ +@Configuration +// 指定主数据库扫描对应的Mapper文件,生成代理对象 +@MapperScan(basePackages ="com.example.duplicate.infrastructure.configOneDao" ,sqlSessionFactoryRef = "configOneSqlSessionFactory") +public class ConfigOne { + + // mapper.xml所在地址 + private static final String MAPPER_LOCATION = "classpath*:mapper/*.xml"; + + + /** + * 主数据源,Primary注解必须增加,它表示该数据源为默认数据源 + * 项目中还可能存在其他的数据源,如获取时不指定名称,则默认获取这个数据源,如果不添加,则启动时候回报错 + */ + @Bean(name = "configOneDataSource") + // 读取spring.datasource.master前缀的配置文件映射成对应的配置对象 + @ConfigurationProperties(prefix = "spring.datasource.db1") + public DataSource dataSource() { + DataSource build = DataSourceBuilder.create().build(); + return build; + } + + /** + * 事务管理器,Primary注解作用同上 + */ + @Bean(name = "configOneTransactionManager") + public PlatformTransactionManager dataSourceTransactionManager(@Qualifier("configOneDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + /** + * session工厂,Primary注解作用同上 + */ + + @Bean(name = "configOneSqlSessionFactory") + public SqlSessionFactory sqlSessionFactory(@Qualifier("configOneDataSource") DataSource dataSource) throws Exception { + final SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean(); + sessionFactoryBean.setDataSource(dataSource); + sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(ConfigOne.MAPPER_LOCATION)); + return sessionFactoryBean.getObject(); + } +} diff --git a/src/main/java/com/example/duplicate/config/ConfigTwo.java b/src/main/java/com/example/duplicate/config/ConfigTwo.java new file mode 100644 index 0000000..f33b7d4 --- /dev/null +++ b/src/main/java/com/example/duplicate/config/ConfigTwo.java @@ -0,0 +1,70 @@ +package com.example.duplicate.config; + +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.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.transaction.PlatformTransactionManager; + +import javax.sql.DataSource; + +/** + * @ClassName RecordConfig + * @Description 归档数据数据源配置 + * @Author linjj + * @Date 2023/8/2 16:48 + * @Version 1.0 + */ +@Configuration +// 指定主数据库扫描对应的Mapper文件,生成代理对象 +@MapperScan(basePackages ="com.example.duplicate.infrastructure.configTwoDao" ,sqlSessionFactoryRef = "configTwoSqlSessionFactory") +public class ConfigTwo { + + // mapper.xml所在地址 + private static final String MAPPER_LOCATION = "classpath*:mapper2/*.xml"; + + + /** + * 主数据源,Primary注解必须增加,它表示该数据源为默认数据源 + * 项目中还可能存在其他的数据源,如获取时不指定名称,则默认获取这个数据源,如果不添加,则启动时候回报错 + */ + @Primary + @Bean(name = "configTwoDataSource") + // 读取spring.datasource.master前缀的配置文件映射成对应的配置对象 + @ConfigurationProperties(prefix = "spring.datasource.db2") + public DataSource dataSource() { + DataSource build = DataSourceBuilder.create().build(); + return build; + } + + /** + * 事务管理器,Primary注解作用同上 + */ + @Bean(name = "configTwoTransactionManager") + @Primary + public PlatformTransactionManager dataSourceTransactionManager(@Qualifier("configTwoDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + /** + * session工厂,Primary注解作用同上 + */ + + @Bean(name = "configTwoSqlSessionFactory") + @Primary + public SqlSessionFactory sqlSessionFactory(@Qualifier("configTwoDataSource") DataSource dataSource) throws Exception { + final SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean(); + sessionFactoryBean.setDataSource(dataSource); + sessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(ConfigTwo.MAPPER_LOCATION)); + return sessionFactoryBean.getObject(); + } + + +} diff --git a/src/main/java/com/example/duplicate/config/SwaggerConfig.java b/src/main/java/com/example/duplicate/config/SwaggerConfig.java new file mode 100644 index 0000000..b2074f0 --- /dev/null +++ b/src/main/java/com/example/duplicate/config/SwaggerConfig.java @@ -0,0 +1,72 @@ +package com.example.duplicate.config; + + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.util.ResourceUtils; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** + * @ClassName SwaggerConfig + * @Description swagger配置类 + * @Author linjj + * @Date 2023/11/13 10:02 + * @Version 1.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig extends WebMvcConfigurationSupport { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + //是否开启 (true 开启 false隐藏。生产环境建议隐藏) + //.enable(false) + .select() + //扫描的路径包,设置basePackage会将包下的所有被@Api标记类的所有方法作为api + .apis(RequestHandlerSelectors.basePackage("com.example.duplicate.controller")) + //指定路径处理PathSelectors.any()代表所有的路径 + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() +// .title("明阳HR集成AD接口") +// .description("使用RestFul风格, 创建人:白领说事") +// .version("1.0") +// .build(); + //设置文档标题(API名称) + .title("接口测试") + //文档描述 + .description("接口说明") +// //服务条款URL +// .termsOfServiceUrl("http://localhost:8089/") + //版本号 + .version("1.0.0") + .build(); + } + + @Override + protected void addResourceHandlers(ResourceHandlerRegistry registry) { + // 解决静态资源无法访问 + registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); + // 解决swagger无法访问 + registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); + // 解决swagger的js文件无法访问 + registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); + } + + + + +} diff --git a/src/main/java/com/example/duplicate/controller/DuplicateController.java b/src/main/java/com/example/duplicate/controller/DuplicateController.java new file mode 100644 index 0000000..45e2110 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/DuplicateController.java @@ -0,0 +1,73 @@ +package com.example.duplicate.controller; + + +import com.alibaba.fastjson.JSON; + +import com.example.duplicate.common.ResultBody; +import com.example.duplicate.service.DuplicateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @ClassName DuplicateController + * @Description 医院复印预约接口 + * @Author linjj + * @Date 2023/5/12 11:22 + * @Version 1.0 + */ +@RestController +@RequestMapping("/duplicate") +@Api(value="测试",tags = "对外接口") +public class DuplicateController { + + + + @Autowired + DuplicateService duplicateService; + + @RequestMapping(value = "getFilePath", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value="微信接口") + public ResultBody getFilePath(String inpatientNo, Integer admissTimes) { + if (StringUtils.isEmpty(inpatientNo)) { + return ResultBody.failed("住院号不得为空"); + } + if (null == admissTimes) { + return ResultBody.failed("住院次数不得为空"); + } + return ResultBody.success(duplicateService.getFilePath(inpatientNo, admissTimes)); + } + + + /** + * @description: 高级检查 + * @params: startRange + * @params: endRange + * @return: String + * @author linjj + * @date: 2023/4/14 9:32 + */ + @RequestMapping(value = "SeniorExamine", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value="文件质检接口") + public String SeniorExamine(String startRange, String endRange) { + if (StringUtils.isEmpty(startRange) && StringUtils.isEmpty(endRange)) { + return "开始范围,结束范围不能全部为空"; + } + if (StringUtils.isNotEmpty(startRange) && StringUtils.isNotEmpty(endRange)) { + if (startRange.compareTo(endRange) > 0) { + return "开始范围不能小于结束范围"; + } + } + String s = duplicateService.SeniorExamine(startRange, endRange); + return JSON.toJSONString(s); + } + + + +} diff --git a/src/main/java/com/example/duplicate/controller/LzRmController.java b/src/main/java/com/example/duplicate/controller/LzRmController.java new file mode 100644 index 0000000..7642349 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/LzRmController.java @@ -0,0 +1,39 @@ +package com.example.duplicate.controller; + + +import com.example.duplicate.common.ResultBody; +import com.example.duplicate.service.LzRmService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +/** + * @ClassName LzRmController + * @Description 连州人民接口 + * @Author linjj + * @Date 2023/11/10 15:38 + * @Version 1.0 + */ +@RestController +@RequestMapping("/LzRm") +@Api(value = "连州人民接口", tags = "连州人民相关接口", description = "连州人民相关接口") +public class LzRmController { + @Autowired + private LzRmService lzRmService; + @ResponseBody + @RequestMapping(value = "splitFile", method = RequestMethod.POST) + @ApiOperation(value = "拆分影像信息", notes = "拆分影像信息") + public ResultBody LzRmSplit(){ + int i = lzRmService.LzRmSplit(); + if (i==1){ + return ResultBody.success("完成"); + } + return ResultBody.success("失败"); + } + +} diff --git a/src/main/java/com/example/duplicate/controller/ZJYYController.java b/src/main/java/com/example/duplicate/controller/ZJYYController.java new file mode 100644 index 0000000..362588e --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/ZJYYController.java @@ -0,0 +1,85 @@ +package com.example.duplicate.controller; + +import com.example.duplicate.controller.vo.CommomtableCopyVo; +import com.example.duplicate.infrastructure.configOneDao.CommomtableMapper; +import com.example.duplicate.service.MessageLogService; +import com.example.duplicate.service.MessageLogTwoService; +import com.example.duplicate.service.MessageSubordinateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @ClassName ZJYYController + * @Description 湛江医院接口 + * @Author linjj + * @Date 2023/10/13 13:49 + * @Version 1.0 + */ +@RestController +@Api(value = "湛江医院接口", tags = "湛江医院相关接口", description = "湛江医院相关接口") +@RequestMapping("/ZJYY") +@Slf4j +public class ZJYYController { + + @Autowired + MessageSubordinateService messageSubordinateService; + @Autowired + MessageLogService messageLogService; + @Autowired + MessageLogTwoService messageLogTwoService; + @Autowired + CommomtableMapper commomtableMapper; + @RequestMapping(value = "delMessage" , method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除messageSubordinate内容" , notes = "删除messageSubordinate内容") + public int delMessage() { + return messageSubordinateService.delMessage(); + } + + + + @RequestMapping(value = "delMessageLog" , method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除messageLog内容" , notes = "删除messageLog内容") + public int delMessageLog() { + return messageLogService.delMessageLog(); + } + + @RequestMapping(value = "addMessageLog" , method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "移动messageLog内容" , notes = "移动messageLog内容") + public int addMessageLog(){ + return messageLogTwoService.addMessageLog(); + } + + + @RequestMapping(value = "addMessage" , method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "移动messageScanning表数据" , notes = "移动messageScanning表数据") + public int addMessage(){ + return messageSubordinateService.addMessage(); + } + + + @RequestMapping(value = "com" , method = RequestMethod.POST) + @ResponseBody + public String com(String mid){ + List com = commomtableMapper.com(); + for (CommomtableCopyVo list:com){ + StringBuffer sb=new StringBuffer(); + sb.append("(inp_no =' "+list.getInpatientNo()+" 'and visit_id = '"+list.getAdmissTimes()+" ' ) or"); + log.info(sb.toString()); + } + return""; + } + + +} diff --git a/src/main/java/com/example/duplicate/controller/param/Package.java b/src/main/java/com/example/duplicate/controller/param/Package.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/example/duplicate/controller/vo/AddArchiveDetail.java b/src/main/java/com/example/duplicate/controller/vo/AddArchiveDetail.java new file mode 100644 index 0000000..2161780 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/AddArchiveDetail.java @@ -0,0 +1,32 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +/** + * @ClassName addArchiveDetail + * @Description 连州人员文件表新增实体 + * @Author linjj + * @Date 2023/11/13 15:57 + * @Version 1.0 + */ +@Data +public class AddArchiveDetail { + private static final long serialVersionUID = 1L; + + @TableId(value = "ID", type = IdType.ASSIGN_UUID) + private String ID; + + private String PDFPATH; + + private String MasterID; + private String UpLoadDateTime; + private String AssortID; + private String Source; + private String flag; + + private String Sys; + + private String splitName; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/AddArchiveMasterVo.java b/src/main/java/com/example/duplicate/controller/vo/AddArchiveMasterVo.java new file mode 100644 index 0000000..9f42d62 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/AddArchiveMasterVo.java @@ -0,0 +1,45 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +/** + * @ClassName AddArchiveMasterVo + * @Description 连州人民医院Archive_Master表实体 + * @Author linjj + * @Date 2023/11/13 14:48 + * @Version 1.0 + */ +@Data +public class AddArchiveMasterVo { + + + + private String ID; + + private String patientId; + + private String inpNo; + + private String visitId; + + private String name; + + private String deptName; + + private String dischargeDateTime; + + private String ArchiveState; + + private String admissionDateTime; + + private String LockInfo; + + private String DISCHARGEDISPOSITION; + + + private String splitName; + + +} diff --git a/src/main/java/com/example/duplicate/controller/vo/AddLzRmCommVo.java b/src/main/java/com/example/duplicate/controller/vo/AddLzRmCommVo.java new file mode 100644 index 0000000..a695d02 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/AddLzRmCommVo.java @@ -0,0 +1,36 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName addLzRmCommVo + * @Description 连州人民新增commomtableVo + * @Author linjj + * @Date 2023/11/17 9:14 + * @Version 1.0 + */ +@Data +public class AddLzRmCommVo { + + private String patientId; + + private String admissId; + + private String admissTimes; + + private String inpatientNo; + + private String name; + + private String disDate; + + private String disDeptName; + + private String ph; + + private String gdh; + + private String splitName; + + +} diff --git a/src/main/java/com/example/duplicate/controller/vo/AddMessageLogVo.java b/src/main/java/com/example/duplicate/controller/vo/AddMessageLogVo.java new file mode 100644 index 0000000..1bf0705 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/AddMessageLogVo.java @@ -0,0 +1,50 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @ClassName MessageLog + * @Description + * @Author linjj + * @Date 2023/10/13 15:15 + * @Version 1.0 + */ +@Data +@TableName("message_log") +public class AddMessageLogVo { + + @TableField("id") + private String id; + @TableField("create_time") + private String createTime; + @TableField("end_time") + private String endTime; + @TableField("execution_time") + private int executionTime; + @TableField("input_content") + private String inputContent; + @TableField("interface_name") + private String interfaceName; + @TableField("out_content") + private String outContent; + @TableField("out_json") + private String outJson; + @TableField("remark") + private String remark; + @TableField("result") + private int result; + @TableField("type") + private String type; + @TableField("xml_create_time") + private String xmlCreateTime; + @TableField("xml_execution_time") + private int xml_execution_time; + @TableField("master_id") + private String masterId; + @TableField("webservice_info") + private String webserviceInfo; + @TableField("discharge_date_time") + private String dischargeDateTime; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/ArchiveMasterVo.java b/src/main/java/com/example/duplicate/controller/vo/ArchiveMasterVo.java new file mode 100644 index 0000000..9349a4c --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/ArchiveMasterVo.java @@ -0,0 +1,16 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName ArchiveMasterVo + * @Description + * @Author linjj + * @Date 2023/10/17 10:15 + * @Version 1.0 + */ +@Data +public class ArchiveMasterVo { + + private String id; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/CommomtableCopyVo.java b/src/main/java/com/example/duplicate/controller/vo/CommomtableCopyVo.java new file mode 100644 index 0000000..8fbe0fb --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/CommomtableCopyVo.java @@ -0,0 +1,28 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName CommomtableCopy + * @Author linjj + * @Date 2023/11/10 16:01 + * @Version 1.0 + */ +@Data +public class CommomtableCopyVo { + + private String id; + private String name; + private String inpatientNo; + private String admissTimes; + private String disDate; + private String pageNumber; + private String inpatientNoPast; + private String disDept; + private String ph; + + private String phString; + + private int spilStatic; + +} diff --git a/src/main/java/com/example/duplicate/controller/vo/CommomtableVo.java b/src/main/java/com/example/duplicate/controller/vo/CommomtableVo.java new file mode 100644 index 0000000..e0351f5 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/CommomtableVo.java @@ -0,0 +1,32 @@ +package com.example.duplicate.controller.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * @ClassName commomtableVo + * @Description commomtable表 + * @Author linjj + * @Date 2023/5/12 15:57 + * @Version 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="commomtable表对象", description="查询路径返回参数实体") +public class CommomtableVo { + + @ApiModelProperty(value = "文件保存目录地址") + private String filePath; + @ApiModelProperty(value = "图片类型") + private String assortName; + @ApiModelProperty(value = "文件类型id") + private String assortId; + + +} diff --git a/src/main/java/com/example/duplicate/controller/vo/DuplicateVo.java b/src/main/java/com/example/duplicate/controller/vo/DuplicateVo.java new file mode 100644 index 0000000..46fa2e2 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/DuplicateVo.java @@ -0,0 +1,30 @@ +package com.example.duplicate.controller.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * @ClassName commomtableVo + * @Description 返回给第三方路径参数 + * @Author linjj + * @Date 2023/5/12 15:57 + * @Version 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = false) +public class DuplicateVo { + + @ApiModelProperty(value = "标题") + private String title; + @ApiModelProperty(value = "文件分类") + private String assortName; + @ApiModelProperty(value = "页数") + private String pageCount; + @ApiModelProperty(value = "路径") + private String pdfUrl; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/FliePath.java b/src/main/java/com/example/duplicate/controller/vo/FliePath.java new file mode 100644 index 0000000..427a1c5 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/FliePath.java @@ -0,0 +1,24 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @ClassName fliePath + * @Description + * @Author linjj + * @Date 2023/6/6 15:45 + * @Version 1.0 + */ + +@Data +@TableName("fliePath") +public class FliePath { + + @TableField("ph") + private String patientId; + + @TableField("fliePath") + private String fliePath; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/MessageLog.java b/src/main/java/com/example/duplicate/controller/vo/MessageLog.java new file mode 100644 index 0000000..b073ee7 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/MessageLog.java @@ -0,0 +1,82 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @ClassName MessageLog + * @Description + * @Author linjj + * @Date 2023/10/13 15:15 + * @Version 1.0 + */ +@Data +public class MessageLog { + +// @TableField("id") +// private String id; +// @TableField("create_time") +// private String createTime; +// @TableField("end_time") +// private String endTime; +// @TableField("execution_time") +// private int executionTime; +// @TableField("input_content") +// private String inputContent; +// @TableField("interface_name") +// private String interfaceName; +// @TableField("out_content") +// private String outContent; +// @TableField("out_json") +// private String outJson; +// @TableField("remark") +// private String remark; +// @TableField("result") +// private int result; +// @TableField("type") +// private String type; +// @TableField("xml_create_time") +// private String xmlCreateTime; +// @TableField("xml_execution_time") +// private int xmlExecutionTime; +// @TableField("master_id") +// private String masterId; +// @TableField("webservice_info") +// private String webserviceInfo; +// @TableField(exist = false) +// private String dischargeDateTime; + + + + + private String id; + + private String createTime; + + private String endTime; + + private int executionTime; + + private String inputContent; + + private String interfaceName; + + private String outContent; + + private String outJson; + + private String remark; + + private int result; + + private String type; + + private String xmlCreateTime; + + private int xmlExecutionTime; + + private String masterId; + private String webserviceInfo; + private String dischargeDateTime; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/MessageLogVo.java b/src/main/java/com/example/duplicate/controller/vo/MessageLogVo.java new file mode 100644 index 0000000..566f759 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/MessageLogVo.java @@ -0,0 +1,15 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName MessageLogVo + * @Description 返回实体 + * @Author linjj + * @Date 2023/10/13 15:25 + * @Version 1.0 + */ +@Data +public class MessageLogVo { + private String id; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/MessageSubordinate.java b/src/main/java/com/example/duplicate/controller/vo/MessageSubordinate.java new file mode 100644 index 0000000..524ec5c --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/MessageSubordinate.java @@ -0,0 +1,45 @@ +package com.example.duplicate.controller.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * @ClassName MessageSubordinate + * @Description + * @Author linjj + * @Date 2023/10/13 15:00 + * @Version 1.0 + */ +@Data +public class MessageSubordinate { +// @TableField("id") +// private String id; +// @TableField("content_json") +// private String contentJson; +// @TableField("message_id") +// private String messageId; +// @TableField("patient_main") +// private String patientMain; +// @TableField("status") +// private int status; +// @TableField("remark") +// private String remark; +// @TableField("runs") +// private int runs; + + + private String id; + + private String contentJson; + + private String messageId; + + private String patientMain; + + private int status; + + private String remark; + private int runs; + private String dischargeDateTime; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/MessageSubordinateVo.java b/src/main/java/com/example/duplicate/controller/vo/MessageSubordinateVo.java new file mode 100644 index 0000000..97aa5f0 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/MessageSubordinateVo.java @@ -0,0 +1,14 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName MessageSubordinateVo + * @Author linjj + * @Date 2023/10/13 14:03 + * @Version 1.0 + */ +@Data +public class MessageSubordinateVo { + private String id; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/PageCountVo.java b/src/main/java/com/example/duplicate/controller/vo/PageCountVo.java new file mode 100644 index 0000000..2bc2a6c --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/PageCountVo.java @@ -0,0 +1,30 @@ +package com.example.duplicate.controller.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +/** + * @ClassName commomtableVo + * @Description commomtable表 + * @Author linjj + * @Date 2023/5/12 15:57 + * @Version 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="commomtable表对象", description="查询路径返回参数实体") +public class PageCountVo { + + @ApiModelProperty(value = "文件类型") + private String assortName; + @ApiModelProperty(value = "文件数量") + private String pageCount; + + +} diff --git a/src/main/java/com/example/duplicate/controller/vo/PhVo.java b/src/main/java/com/example/duplicate/controller/vo/PhVo.java new file mode 100644 index 0000000..4f72fae --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/PhVo.java @@ -0,0 +1,16 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName phVo + * @Description + * @Author linjj + * @Date 2023/6/5 16:21 + * @Version 1.0 + */ +@Data +public class PhVo { + + private String ph; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/TscanAssort.java b/src/main/java/com/example/duplicate/controller/vo/TscanAssort.java new file mode 100644 index 0000000..00b8958 --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/TscanAssort.java @@ -0,0 +1,21 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName TscanAssort + * @Description + * @Author linjj + * @Date 2023/6/6 13:43 + * @Version 1.0 + */ +@Data +public class TscanAssort { + private String patientId; + private String assortId; + private String scanPage; + + private Integer source; + + private Integer isDel; +} diff --git a/src/main/java/com/example/duplicate/controller/vo/ZdAssortVo.java b/src/main/java/com/example/duplicate/controller/vo/ZdAssortVo.java new file mode 100644 index 0000000..822b70c --- /dev/null +++ b/src/main/java/com/example/duplicate/controller/vo/ZdAssortVo.java @@ -0,0 +1,33 @@ +package com.example.duplicate.controller.vo; + +import lombok.Data; + +/** + * @ClassName ZdAssortVo + * @Author linjj + * @Date 2023/11/13 9:31 + * @Version 1.0 + */ +@Data +public class ZdAssortVo { + + private String assortId; + private String assortName; + + private String assortSort; + + private String printFlag; + + private String patientId; + + + private String DISCHARGEDISPOSITION; + + private String PDFPATH; + + private String flag; + + private String Sys; + + private String UpLoadDateTime; +} diff --git a/src/main/java/com/example/duplicate/infrastructure/cache/Package.java b/src/main/java/com/example/duplicate/infrastructure/cache/Package.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/example/duplicate/infrastructure/client/Package.java b/src/main/java/com/example/duplicate/infrastructure/client/Package.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveDetailMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveDetailMapper.java new file mode 100644 index 0000000..5fa8842 --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveDetailMapper.java @@ -0,0 +1,17 @@ +package com.example.duplicate.infrastructure.configOneDao; + +import com.example.duplicate.controller.vo.AddArchiveDetail; +import org.apache.ibatis.annotations.Mapper; + +/** + * @InterfaceName ArchiveDetailMapper + * @Description 文件表实体 + * @Author linjj + * @Date 2023/11/13 16:04 + * @Version 1.0 + */ +@Mapper +public interface ArchiveDetailMapper { + + int addArchiveDetail(AddArchiveDetail addArchiveDetail); +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveMasterMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveMasterMapper.java new file mode 100644 index 0000000..9860e6d --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/ArchiveMasterMapper.java @@ -0,0 +1,29 @@ +package com.example.duplicate.infrastructure.configOneDao; + +import com.example.duplicate.controller.vo.AddArchiveMasterVo; +import com.example.duplicate.controller.vo.ArchiveMasterVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @InterfaceName ArchiveMasterMapper + * @Author linjj + * @Date 2023/10/16 19:36 + * @Version 1.0 + */ +@Mapper +public interface ArchiveMasterMapper { + + List getMasterId(String dateTime); + + int masterIdNum(String dateTime); + + int add(@Param("idList") List idList); + + + int addArchiveMaster(AddArchiveMasterVo addArchiveMasterVo); + + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/CommomtableMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/CommomtableMapper.java new file mode 100644 index 0000000..9af54ed --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/CommomtableMapper.java @@ -0,0 +1,35 @@ +package com.example.duplicate.infrastructure.configOneDao; + + +import com.example.duplicate.controller.vo.AddLzRmCommVo; +import com.example.duplicate.controller.vo.CommomtableCopyVo; +import com.example.duplicate.controller.vo.CommomtableVo; +import com.example.duplicate.controller.vo.PageCountVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @InterfaceName CommomtableMapper + * @Description 路径信息Mapper接口 + * @Author linjj + * @Date 2023/5/12 16:30 + * @Version 1.0 + */ +@Mapper +public interface CommomtableMapper { + + List getCommomtable(@Param("inpatientNo")String inpatientNo, @Param("admissTimes")Integer admissTimes,@Param("assortId") String assortId); + + + List getZdAssort(@Param("inpatientNo")String inpatientNo, @Param("admissTimes")Integer admissTimes); + + + PageCountVo getPageCount(@Param("inpatientNo")String inpatientNo, @Param("admissTimes")Integer admissTimes, @Param("assortId") String assortId); + + int addAddLzRmComm(AddLzRmCommVo addLzRmCommVo); + + Listcom(); + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/LzRmMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/LzRmMapper.java new file mode 100644 index 0000000..c15eb33 --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/LzRmMapper.java @@ -0,0 +1,28 @@ +package com.example.duplicate.infrastructure.configOneDao; + +import com.example.duplicate.controller.vo.CommomtableCopyVo; +import com.example.duplicate.controller.vo.ZdAssortVo; +import org.apache.ibatis.annotations.Param; +import org.mapstruct.Mapper; + +import java.util.List; + +/** + * @InterfaceName LzRmMapper + * @Description + * @Author linjj + * @Date 2023/11/10 15:59 + * @Version 1.0 + */ +@Mapper +public interface LzRmMapper { + + List getCommomtableCopyInfo(); + + int updateSynchronousTime(@Param("spilStatic") int spilStatic,@Param("inpatientNoPast") String inpatientNoPast,@Param("phString") String phString,@Param("pageNumber") String pageNumber); + + + List getZdAssortInfo(@Param("inpNo") String inpNo, @Param("LockInfo") String LockInfo,@Param("assortName")String assortName); + + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageLogMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageLogMapper.java new file mode 100644 index 0000000..357a3bc --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageLogMapper.java @@ -0,0 +1,33 @@ +package com.example.duplicate.infrastructure.configOneDao; + + +import com.example.duplicate.controller.vo.MessageLog; +import com.example.duplicate.controller.vo.MessageLogVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName MessageLogMapper + * @Description + * @Author linjj + * @Date 2023/10/13 13:58 + * @Version 1.0 + */ +@Mapper +public interface MessageLogMapper { + + int getMessageLogNum(String dateTime); + + ListgetAllByIds(String dateTime); + + String getSynchronousTime(); + + int updateSynchronousTime(String dischargeDateTime); + + ListgetAllBy(String synchronousTime); + int del(@Param(value = "messageLogIds")String messageLogIds); + + ListgetAllByMasterId(@Param(value = "masterIds")String masterIds); +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageSubordinateMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageSubordinateMapper.java new file mode 100644 index 0000000..f01871b --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MessageSubordinateMapper.java @@ -0,0 +1,38 @@ +package com.example.duplicate.infrastructure.configOneDao; + + +import com.example.duplicate.controller.vo.MessageSubordinate; +import com.example.duplicate.controller.vo.MessageSubordinateVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName messageSubordinateMapper + * @Description + * @Author linjj + * @Date 2023/10/13 13:58 + * @Version 1.0 + */ +@Mapper +public interface MessageSubordinateMapper { + + int getMessageNum(String dateTime); + + + ListgetAllByIds(); + + int del(@Param(value = "messageLogIds")String messageLogIds); + + String getSynchronousTime(); + + int updateSynchronousTime(String dischargeDateTime); + + + ListgetAllByTime(String synchronousTime); + + ListgetAllByMessageLogId(@Param(value = "messageLogIds")String messageLogIds); + + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/MidMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MidMapper.java new file mode 100644 index 0000000..848b36c --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/MidMapper.java @@ -0,0 +1,14 @@ +package com.example.duplicate.infrastructure.configOneDao; + +import com.example.duplicate.controller.vo.AddArchiveDetail; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + + +@Mapper +public interface MidMapper { + + List getMid(); + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configOneDao/QualityMapper.java b/src/main/java/com/example/duplicate/infrastructure/configOneDao/QualityMapper.java new file mode 100644 index 0000000..713ca32 --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configOneDao/QualityMapper.java @@ -0,0 +1,37 @@ +package com.example.duplicate.infrastructure.configOneDao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.duplicate.controller.vo.FliePath; +import com.example.duplicate.controller.vo.PhVo; +import com.example.duplicate.controller.vo.TscanAssort; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName QualityMapper + * @Description 文件质检 + * @Author linjj + * @Date 2023/4/13 15:29 + * @Version 1.0 + */ +@Mapper +public interface QualityMapper extends BaseMapper { + + Integer getPhNum(@Param("startRange")String startRange, @Param("endRange")String endRange); + + Integer getFileNum(@Param("startRange")String startRange, @Param("endRange")String endRange); + + List getFliePath(@Param("ph")String ph); + List getFliePaths(@Param("phs")List phs); + ListgetPh(@Param("startRange")String startRange, @Param("endRange")String endRange); + + ListgetPhAndFliePath(@Param("startRange")String startRange, @Param("endRange")String endRange); + + int addPh(@Param("list")Listlist); + + int addFliePath(@Param("ph")String ph,@Param("fliePath")String fliePath); + + int addTscanAssort(TscanAssort tscanAssort); +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageLogTwoMapper.java b/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageLogTwoMapper.java new file mode 100644 index 0000000..8e7140f --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageLogTwoMapper.java @@ -0,0 +1,23 @@ +package com.example.duplicate.infrastructure.configTwoDao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.duplicate.controller.vo.MessageLog; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName MessageLogMapper + * @Description + * @Author linjj + * @Date 2023/10/13 13:58 + * @Version 1.0 + */ +@Mapper +public interface MessageLogTwoMapper { + + int addAll(@Param("list")List list); + +} diff --git a/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageSubordinateTwoMapper.java b/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageSubordinateTwoMapper.java new file mode 100644 index 0000000..c2d9f70 --- /dev/null +++ b/src/main/java/com/example/duplicate/infrastructure/configTwoDao/MessageSubordinateTwoMapper.java @@ -0,0 +1,24 @@ +package com.example.duplicate.infrastructure.configTwoDao; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.duplicate.controller.vo.MessageLog; +import com.example.duplicate.controller.vo.MessageSubordinate; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @ClassName MessageLogMapper + * @Description + * @Author linjj + * @Date 2023/10/13 13:58 + * @Version 1.0 + */ +@Mapper +public interface MessageSubordinateTwoMapper { + + int addAll(@Param("list")List list); + +} diff --git a/src/main/java/com/example/duplicate/service/DuplicateService.java b/src/main/java/com/example/duplicate/service/DuplicateService.java new file mode 100644 index 0000000..66aa533 --- /dev/null +++ b/src/main/java/com/example/duplicate/service/DuplicateService.java @@ -0,0 +1,22 @@ +package com.example.duplicate.service; + + + +import com.example.duplicate.controller.vo.DuplicateVo; + +import java.util.List; + +/** + * @InterfaceName DuplicateService + * @Description 174查询影响图片地址 服务 + * @Author linjj + * @Date 2023/5/12 15:55 + * @Version 1.0 + */ +public interface DuplicateService { + + List getFilePath(String inpatientNo, Integer admissTimes); + + + String SeniorExamine(String startRange,String endRange); +} \ No newline at end of file diff --git a/src/main/java/com/example/duplicate/service/LzRmService.java b/src/main/java/com/example/duplicate/service/LzRmService.java new file mode 100644 index 0000000..8b20279 --- /dev/null +++ b/src/main/java/com/example/duplicate/service/LzRmService.java @@ -0,0 +1,13 @@ +package com.example.duplicate.service; + +/** + * @InterfaceName LzRmService + * @Description + * @Author linjj + * @Date 2023/11/10 15:42 + * @Version 1.0 + */ +public interface LzRmService { + + int LzRmSplit(); +} diff --git a/src/main/java/com/example/duplicate/service/MessageLogService.java b/src/main/java/com/example/duplicate/service/MessageLogService.java new file mode 100644 index 0000000..a6b87ec --- /dev/null +++ b/src/main/java/com/example/duplicate/service/MessageLogService.java @@ -0,0 +1,15 @@ +package com.example.duplicate.service; + +/** + * @ClassName MessageLogService + * @Description MessageLog接口 + * @Author linjj + * @Date 2023/10/13 15:19 + * @Version 1.0 + */ +public interface MessageLogService { + + int delMessageLog(); + + +} diff --git a/src/main/java/com/example/duplicate/service/MessageLogTwoService.java b/src/main/java/com/example/duplicate/service/MessageLogTwoService.java new file mode 100644 index 0000000..8d3ab8e --- /dev/null +++ b/src/main/java/com/example/duplicate/service/MessageLogTwoService.java @@ -0,0 +1,13 @@ +package com.example.duplicate.service; + +/** + * @ClassName MessageLogService + * @Description MessageLog接口 + * @Author linjj + * @Date 2023/10/13 15:19 + * @Version 1.0 + */ +public interface MessageLogTwoService { + + int addMessageLog(); +} diff --git a/src/main/java/com/example/duplicate/service/MessageSubordinateService.java b/src/main/java/com/example/duplicate/service/MessageSubordinateService.java new file mode 100644 index 0000000..716ba5d --- /dev/null +++ b/src/main/java/com/example/duplicate/service/MessageSubordinateService.java @@ -0,0 +1,20 @@ +package com.example.duplicate.service; + + + +/** + * @ClassName ZJYYService + * @Description 湛江医院接口 + * @Author linjj + * @Date 2023/10/13 13:49 + * @Version 1.0 + */ + +public interface MessageSubordinateService { + int delMessage(); + + int addMessage(); + + + +} diff --git a/src/main/java/com/example/duplicate/service/impl/DuplicateServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/DuplicateServiceImpl.java new file mode 100644 index 0000000..df90e29 --- /dev/null +++ b/src/main/java/com/example/duplicate/service/impl/DuplicateServiceImpl.java @@ -0,0 +1,183 @@ +package com.example.duplicate.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.example.duplicate.controller.vo.*; +import com.example.duplicate.infrastructure.configOneDao.CommomtableMapper; +import com.example.duplicate.infrastructure.configOneDao.QualityMapper; +import com.example.duplicate.service.DuplicateService; +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.Image; +import com.lowagie.text.PageSize; +import com.lowagie.text.pdf.PdfWriter; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.swing.*; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @ClassName DuplicateServiceImpl + * @Description 174查询影响图片地址实现类 + * @Author linjj + * @Date 2023/5/12 15:55 + * @Version 1.0 + */ +@Service +public class DuplicateServiceImpl extends ServiceImpl implements DuplicateService { + @Autowired + CommomtableMapper commomtableMapper; + @Value("${waterPicPath}") + private String waterPicPath; + + @Value("${EMR_RECORD_JSP}") + private String EMRRECORDJSP; + + @Autowired + QualityMapper qualityMapper; + + @Override + public List getFilePath(String inpatientNo, Integer admissTimes) { + //定义返回数据集合 + List list = new ArrayList<>(); + //根据住院号住院次数查询分段 + List zdAssort = commomtableMapper.getZdAssort(inpatientNo, admissTimes); + //根据分段查询路径 + for (CommomtableVo assortIdList : zdAssort) { + String assortId = assortIdList.getAssortId(); + //查询对应分类文件路径 + List commomtable = commomtableMapper.getCommomtable(inpatientNo, admissTimes, assortId); + //获取该分类标题、页数 + PageCountVo pageCount = commomtableMapper.getPageCount(inpatientNo, admissTimes, assortId); + String join = StringUtils.join(commomtable, ","); + List imageUrllist = Arrays.asList(join.split(",")); + //使用yyyyMMddHHmmssSSS格式作为文件名 + Date date = new Date(); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String newDate = format.format(date); + imageToPdf(imageUrllist, waterPicPath, newDate); + String outSrc = EMRRECORDJSP + newDate + ".pdf"; + DuplicateVo duplicateVo = new DuplicateVo(); + duplicateVo.setTitle(pageCount.getAssortName()); + duplicateVo.setAssortName(pageCount.getAssortName()); + duplicateVo.setPageCount(pageCount.getPageCount()); + duplicateVo.setPdfUrl(outSrc); + list.add(duplicateVo); + } + return list; + } + + + /** + * imageUrllist:图片路径集合, + * mOutputPdfFileName:pdf输出位置 + * + * @param imageUrllist + * @param waterPicPath + * @return + */ + public static File imageToPdf(List imageUrllist, String waterPicPath, String newDate) { + if (!new File(waterPicPath).isDirectory()) { + new File(waterPicPath).mkdirs(); + } + Document document = new Document(PageSize.A4, 0, 0, 0, 0); //创建文档容器 + try { + PdfWriter.getInstance(document, new FileOutputStream(waterPicPath + "\\" + newDate + ".pdf")); + document.open(); + for (int i = 0; i < imageUrllist.size(); i++) { + document.newPage(); +// doc.add(new Paragraph("简单使用iText")); + Image png1 = Image.getInstance(imageUrllist.get(i)); + float heigth = png1.getHeight(); + float width = png1.getWidth(); + int percent = getPercent2(heigth, width); + png1.setAlignment(Image.MIDDLE); + png1.scalePercent(percent + 3);// 表示是原来图像的比例; + document.add(png1); + } + + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (DocumentException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + document.close(); + } + File mOutputPdfFile = new File(waterPicPath); + if (!mOutputPdfFile.exists()) { + mOutputPdfFile.deleteOnExit(); + return null; + } + return mOutputPdfFile; + } + + private static int getPercent2(float h, float w) { + int p = 0; + float p2 = 0.0f; + p2 = 530 / w * 100; + p = Math.round(p2); + return p; + } + + private String selectRootByNotWater(String srcPath) { + //获取盘符 + String str = srcPath.substring(0, 1).toUpperCase(); + switch (str) { + case "C": + return "reloadC\\"; + case "D": + return "reloadD\\"; + case "E": + return "reloadE\\"; + case "F": + return "reloadF\\"; + case "G": + return "reloadG\\"; + case "H": + return "reloadH\\"; + case "I": + return "reloadI\\"; + case "J": + return "reloadJ\\"; + case "K": + return "reloadK\\"; + default: + ; + } + return null; + } + + + @Override + public String SeniorExamine(String startRange, String endRange) { + //获取时间段内的病例 + //查600w条 + List fliePaths = qualityMapper.getPhAndFliePath(startRange, endRange); + //将600w根据patientId进行分组,key=10w个 + Map> collect = fliePaths.stream().collect(Collectors.groupingBy(FliePath::getPatientId)); + //保存错误信息 + List errors = new ArrayList<>(); + for (String k : collect.keySet()) { + List v = collect.get(k);//总共600w图片路径 + v.forEach(p -> { + ImageIcon imageIcon = new ImageIcon(p.getFliePath()); + //获取图片宽度无法获取图片损坏 + if (imageIcon.getIconHeight() == -1) { + errors.add(p);//损坏的图片路径存放 + } + }); + } + super.saveBatch(errors, 1); + return "完成"; + } + + +} diff --git a/src/main/java/com/example/duplicate/service/impl/LzRmServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/LzRmServiceImpl.java new file mode 100644 index 0000000..c0c790d --- /dev/null +++ b/src/main/java/com/example/duplicate/service/impl/LzRmServiceImpl.java @@ -0,0 +1,193 @@ +package com.example.duplicate.service.impl; + +import com.example.duplicate.controller.vo.*; +import com.example.duplicate.infrastructure.configOneDao.ArchiveDetailMapper; +import com.example.duplicate.infrastructure.configOneDao.ArchiveMasterMapper; +import com.example.duplicate.infrastructure.configOneDao.CommomtableMapper; +import com.example.duplicate.infrastructure.configOneDao.LzRmMapper; +import com.example.duplicate.service.LzRmService; +import lombok.extern.slf4j.Slf4j; +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 javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @ClassName LzRmServiceImpl + * @Description + * @Author linjj + * @Date 2023/11/10 15:42 + * @Version 1.0 + */ +@Service +@Slf4j +public class LzRmServiceImpl implements LzRmService { + + + @Resource + private LzRmMapper lzRmMapper; + @Resource + private ArchiveMasterMapper archiveMasterMapper; + @Resource + private ArchiveDetailMapper archiveDetailMapper; + @Resource + private CommomtableMapper commomtableMapper; + + private static SimpleDateFormat inSDF = new SimpleDateFormat("yyyy.mm.dd"); + private static SimpleDateFormat outSDF = new SimpleDateFormat("yyyy-mm-dd"); + + @Override + public int LzRmSplit() { + //新增状态 + int addStatic = 0; + //查询需要处理记录 + List CommomtableCopyList = lzRmMapper.getCommomtableCopyInfo(); + //根据住院号盘号查询影像信息 + for (CommomtableCopyVo list : CommomtableCopyList) { + String LockInfo = list.getPh(); + String phString = list.getPhString(); + String pageNumber = list.getPageNumber(); + String inpatientNoPast = String.format("%010d", Integer.parseInt(list.getInpatientNoPast())); + //页码不存在跳出当前循环 + if (StringUtils.isBlank(pageNumber)) { + log.info("-------旧住院号:" + inpatientNoPast + "盘号:" + LockInfo + "新住院号:" + list.getInpatientNo() + "的病案页码为空-----------------"); + lzRmMapper.updateSynchronousTime(2,list.getInpatientNoPast(), phString, pageNumber); + continue; + } + //截取第一个数 + String assortName = intercept(list.getPageNumber()); + List zdAssorList = lzRmMapper.getZdAssortInfo(inpatientNoPast, LockInfo, assortName); + if (zdAssorList.isEmpty()) { + log.info("----------------旧住院号:" + inpatientNoPast + "盘号:" + LockInfo + "页码:" + assortName + "的病案不存在---------------------"); + lzRmMapper.updateSynchronousTime(3,list.getInpatientNoPast(), phString, pageNumber); + continue; + } + //插入一条数据到Archive_Master表跟Archive_Detail表 + addStatic = add(list, zdAssorList); + //修改状态 + lzRmMapper.updateSynchronousTime(1,list.getInpatientNoPast(), phString, pageNumber); + } + + return addStatic; + } + + /** + * @description: 插入一条数据到Archive_Master表 + * @params: commomtableCopyVo + * @params: zdAssorList + * @return: addArchiveMasterVo + * @author linjj + * @date: 2023/11/13 14:58 + */ + private int add(CommomtableCopyVo commomtableCopyVo, List zdAssorList) { + //新增文件表状态 + int addDetailStatic = 0; + //新增comm表状态 + int addAddLzRmCommStatic = 0; + //使用时间生成一个id + SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取今天日期 + String id = fmt.format(new Date()); + //转换不规则时间字符串 + String s = formatDate(commomtableCopyVo.getDisDate()); + ZdAssortVo zdAssortVo = zdAssorList.get(0); + AddArchiveMasterVo addArchiveMasterVo = new AddArchiveMasterVo(); + addArchiveMasterVo.setID(id); + addArchiveMasterVo.setPatientId(commomtableCopyVo.getInpatientNo()); + addArchiveMasterVo.setInpNo(commomtableCopyVo.getInpatientNo()); + addArchiveMasterVo.setVisitId(commomtableCopyVo.getAdmissTimes()); + addArchiveMasterVo.setName(commomtableCopyVo.getName()); + addArchiveMasterVo.setDeptName(commomtableCopyVo.getDisDept()); + addArchiveMasterVo.setDischargeDateTime(s); + addArchiveMasterVo.setArchiveState("缩微"); + addArchiveMasterVo.setAdmissionDateTime(s); + addArchiveMasterVo.setLockInfo(commomtableCopyVo.getPh()); + addArchiveMasterVo.setDISCHARGEDISPOSITION(zdAssortVo.getDISCHARGEDISPOSITION()); + addArchiveMasterVo.setSplitName("Ljj"); + int i = archiveMasterMapper.addArchiveMaster(addArchiveMasterVo); + //插入文件表数据 + if (i == 1) { + AddArchiveDetail addArchiveDetail = new AddArchiveDetail(); + //使用时间生成一个id + SimpleDateFormat detailFmt = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + //获取今天日期 + String detailId = detailFmt.format(new Date()); + addArchiveDetail.setID(detailId); + addArchiveDetail.setPDFPATH(zdAssortVo.getPDFPATH()); + addArchiveDetail.setMasterID(id); + addArchiveDetail.setUpLoadDateTime(zdAssortVo.getUpLoadDateTime()); + addArchiveDetail.setAssortID(zdAssortVo.getAssortId()); + addArchiveDetail.setSource("缩微"); + addArchiveDetail.setFlag(zdAssortVo.getFlag()); + addArchiveDetail.setSys(zdAssortVo.getSys()); + addArchiveDetail.setSplitName("Ljj"); + addDetailStatic = archiveDetailMapper.addArchiveDetail(addArchiveDetail); + //向commomtable表增加数据 + if (addDetailStatic == 1) { + AddLzRmCommVo addLzRmCommVo = new AddLzRmCommVo(); + addLzRmCommVo.setPatientId(id); + addLzRmCommVo.setAdmissId(commomtableCopyVo.getInpatientNo()); + addLzRmCommVo.setAdmissTimes(commomtableCopyVo.getAdmissTimes()); + addLzRmCommVo.setInpatientNo(commomtableCopyVo.getInpatientNo()); + addLzRmCommVo.setName(commomtableCopyVo.getName()); + addLzRmCommVo.setDisDate(s); + addLzRmCommVo.setDisDeptName(commomtableCopyVo.getDisDept()); + addLzRmCommVo.setPh(commomtableCopyVo.getPh()); + addLzRmCommVo.setGdh(commomtableCopyVo.getPh()); + addLzRmCommVo.setSplitName("Ljj"); + addAddLzRmCommStatic = commomtableMapper.addAddLzRmComm(addLzRmCommVo); + } + + } + return addAddLzRmCommStatic; + } + + /** + * @description: 按照规则截取 + * @params: pageNumber + * @return: assortName + * @author linjj + * @date: 2023/11/13 14:57 + */ + private String intercept(String pageNumber) { + //如果包含--就截取--前 + if (pageNumber.contains("--")) { + pageNumber = pageNumber.substring(0, pageNumber.indexOf("--")); + return pageNumber; + } + //如果包含-就截取-前 + if (pageNumber.contains("-")) { + pageNumber = pageNumber.substring(0, pageNumber.indexOf("-")); + return pageNumber; + } + return pageNumber; + } + + + /** + * @description: 转换不规则时间字符串 + * @params: inDate + * @return: outDate + * @author linjj + * @date: 2023/11/13 15:13 + */ + public static String formatDate(String inDate) { + String outDate = ""; + if (inDate != null) { + try { + Date date = inSDF.parse(inDate); + outDate = outSDF.format(date); + } catch (ParseException ex) { + } + } + return outDate; + } + +} diff --git a/src/main/java/com/example/duplicate/service/impl/MessageLogServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/MessageLogServiceImpl.java new file mode 100644 index 0000000..011a87e --- /dev/null +++ b/src/main/java/com/example/duplicate/service/impl/MessageLogServiceImpl.java @@ -0,0 +1,47 @@ +package com.example.duplicate.service.impl; + +import com.example.duplicate.controller.vo.MessageLogVo; +import com.example.duplicate.infrastructure.configOneDao.MessageLogMapper; +import com.example.duplicate.service.MessageLogService; +import com.example.utils.ListUtilsNew; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @ClassName MessageLogServiceImpl + * @Description 湛江医院接口 + * @Author linjj + * @Date 2023/10/13 15:19 + * @Version 1.0 + */ +@Service +public class MessageLogServiceImpl implements MessageLogService { + @Autowired + MessageLogMapper messageLogMapper; + @Value("${ZJ_DATE_TIME_LOG}") + private String dateTime; + @Override + public int delMessageLog() { + //查询需要删除数据条数 + int messageLogNum = messageLogMapper.getMessageLogNum(dateTime); + //需要次数 + double num = ((double) messageLogNum) / 100; + int circulateNum= (int) Math.ceil(num); + for (int i=0;i list = messageLogMapper.getAllByIds(dateTime); + //id集合 + List idList = ListUtilsNew.distinctSelect(list, MessageLogVo::getId); + //转成逗号拼接 + String ids = String.join(",", idList); + messageLogMapper.del(ids); + } + return 1; + } + + +} diff --git a/src/main/java/com/example/duplicate/service/impl/MessageLogTwoServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/MessageLogTwoServiceImpl.java new file mode 100644 index 0000000..bd8e489 --- /dev/null +++ b/src/main/java/com/example/duplicate/service/impl/MessageLogTwoServiceImpl.java @@ -0,0 +1,52 @@ +package com.example.duplicate.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.example.duplicate.controller.vo.MessageLog; +import com.example.duplicate.infrastructure.configOneDao.MessageLogMapper; +import com.example.duplicate.infrastructure.configTwoDao.MessageLogTwoMapper; +import com.example.duplicate.service.MessageLogTwoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @ClassName MessageLogServiceImpl + * @Description 湛江医院接口 + * @Author linjj + * @Date 2023/10/13 15:19 + * @Version 1.0 + */ +@Service +public class MessageLogTwoServiceImpl implements MessageLogTwoService { + @Autowired + private MessageLogMapper messageLogMapper; + @Autowired + private MessageLogTwoMapper messageLogTwoMapper; + @Value("${ZJ_DATE_TIME_LOG}") + private String dateTime; + + + @Override + public int addMessageLog() { + //查询需要移动数据条数 + int messageLogNum = messageLogMapper.getMessageLogNum(dateTime); + //需要次数 + double num = ((double) messageLogNum) / 100; + int circulateNum= (int) Math.ceil(num); + for (int i=0;i allBy = messageLogMapper.getAllBy(synchronousTime); + //插入新数据库 + messageLogTwoMapper.addAll(allBy); + //记录更新时间 + String dischargeDateTime = allBy.get(allBy.size() - 1).getDischargeDateTime(); + messageLogMapper.updateSynchronousTime(dischargeDateTime); + } + return 1; + } +} diff --git a/src/main/java/com/example/duplicate/service/impl/MessageSubordinateServiceImpl.java b/src/main/java/com/example/duplicate/service/impl/MessageSubordinateServiceImpl.java new file mode 100644 index 0000000..8d850fa --- /dev/null +++ b/src/main/java/com/example/duplicate/service/impl/MessageSubordinateServiceImpl.java @@ -0,0 +1,143 @@ +package com.example.duplicate.service.impl; + + +import com.example.duplicate.controller.vo.ArchiveMasterVo; +import com.example.duplicate.controller.vo.MessageLog; +import com.example.duplicate.controller.vo.MessageSubordinate; +import com.example.duplicate.controller.vo.MessageSubordinateVo; +import com.example.duplicate.infrastructure.configOneDao.ArchiveMasterMapper; +import com.example.duplicate.infrastructure.configOneDao.MessageLogMapper; +import com.example.duplicate.infrastructure.configOneDao.MessageSubordinateMapper; +import com.example.duplicate.infrastructure.configTwoDao.MessageLogTwoMapper; +import com.example.duplicate.infrastructure.configTwoDao.MessageSubordinateTwoMapper; +import com.example.duplicate.service.MessageSubordinateService; +import com.example.utils.ListUtilsNew; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + + +/** + * @ClassName ZJYYServiceImpl + * @Description 湛江医院接口实现类 + * @Author linjj + * @Date 2023/10/13 13:50 + * @Version 1.0 + */ +@Service +@Slf4j +public class MessageSubordinateServiceImpl implements MessageSubordinateService { + + static final Logger logger = LoggerFactory.getLogger(MessageSubordinateServiceImpl.class); + + @Value("${ZJ_DATE_TIME_MESSAGE}") + private String dateTime; + @Autowired + MessageSubordinateMapper messageSubordinateMapper; + @Autowired + MessageSubordinateTwoMapper messageSubordinateTwoMapper; + @Autowired + ArchiveMasterMapper archiveMasterMapper; + @Autowired + MessageLogMapper messageLogMapper; + @Autowired + MessageLogTwoMapper messageLogTwoMapper; + + + @Override + public int delMessage() { + //查询需要删除数据条数 + int messageNum = messageSubordinateMapper.getMessageNum(dateTime); + //需要次数 + double num = ((double) messageNum) / 100; + int circulateNum = (int) Math.ceil(num); + for (int i = 0; i < circulateNum; i++) { + //查询需要删除数据的id每次查100条 + List list = messageSubordinateMapper.getAllByIds(); + //id集合 + List idList = ListUtilsNew.distinctSelect(list, MessageSubordinateVo::getId); + //转成逗号拼接 + String ids = String.join(",", idList); + messageSubordinateMapper.del(ids); + } + return 1; + } + + @Override + public int addMessage() { + //查询一共有多少份病历需要同步 + int masterIdNum = archiveMasterMapper.masterIdNum(dateTime); + //需要次数 + double num = ((double) masterIdNum) / 100; + //少数往前进1确保不丢失数据 + int circulateNum = (int) Math.ceil(num); + for (int i = 0; i < circulateNum; i++) { + //每次查询100份病历 + List masterId = archiveMasterMapper.getMasterId(dateTime); + if (masterId.size() == 0) { + return 0; + } + //masterId集合 + List idList = ListUtilsNew.distinctSelect(masterId, ArchiveMasterVo::getId); + //转成逗号拼接 + String masterIds = String.join(",", idList); + //根据masterId查询message_log表 + List messageLogList = messageLogMapper.getAllByMasterId(masterIds); + //获取message_log表id集合 + List messageLogId = ListUtilsNew.distinctSelect(messageLogList, MessageLog::getId); + //如果档次100条记录没有messageLogId那么保存记录后结束本次循环 + if (messageLogId.size() == 0) { + //保存处理过的masterId + archiveMasterMapper.add(idList); + continue; + } + //根据message_log表id操作message_subordinate表 + messageSubordinate(messageLogId); + //操作完message_subordinate表操作message_log表 + messageLog(messageLogList); + //保存处理过的masterId + archiveMasterMapper.add(idList); + } + return 0; + } + + private void messageSubordinate(List messageLogId) { + //分批次 + List> newList = ListUtils.partition(messageLogId, 100); + for (List messageList : newList) { + //转成字符串类型逗号拼接 + String messageLogIds = String.join(",", messageList); + //查询100条 + List list = messageSubordinateMapper.getAllByMessageLogId(messageLogIds); + if (list.size()==0){ + continue; + } + //往新表插入 + messageSubordinateTwoMapper.addAll(list); + //新表插入完成删除旧表 + messageSubordinateMapper.del(messageLogIds); + } + } + + private void messageLog(List messageLogList) { + List> newList = ListUtils.partition(messageLogList, 100); + for (List messageList : newList) { + //往新表中拆入数据 + messageLogTwoMapper.addAll(messageList); + //获取这100条message_log表id集合 + List ids = ListUtilsNew.distinctSelect(messageList, MessageLog::getId); + //移除旧表数据 + String messageLogIds = String.join(",", ids); + messageLogMapper.del(messageLogIds); + } + + + } + +} diff --git a/src/main/java/com/example/utils/FieldSelector.java b/src/main/java/com/example/utils/FieldSelector.java new file mode 100644 index 0000000..5ca9623 --- /dev/null +++ b/src/main/java/com/example/utils/FieldSelector.java @@ -0,0 +1,12 @@ +package com.example.utils; + +/** + * @InterfaceName FieldSelector + * @Description + * @Author linjj + * @Date 2023/6/29 16:41 + * @Version 1.0 + */ +public interface FieldSelector { + FieldType select(Type type); +} diff --git a/src/main/java/com/example/utils/IpUtil.java b/src/main/java/com/example/utils/IpUtil.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/example/utils/ListUtilsNew.java b/src/main/java/com/example/utils/ListUtilsNew.java new file mode 100644 index 0000000..ac2798d --- /dev/null +++ b/src/main/java/com/example/utils/ListUtilsNew.java @@ -0,0 +1,73 @@ +package com.example.utils; + +import org.springframework.util.CollectionUtils; + +import java.util.*; + +public final class ListUtilsNew { + public static Map toMap(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyMap(); + Map map = new HashMap<>(list.size()); + for (T t : list) { + K key = selector.select(t); + if (key != null) map.put(key, t); + } + return map; + } + + public static Map> groupBy(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyMap(); + Map> map = new HashMap<>(); + for (T t : list) { + K key = selector.select(t); + if (key == null) continue; + if (!map.containsKey(key)) { + map.put(key, new ArrayList()); + } + map.get(key).add(t); + } + return map; + } + + public static List select(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + List filedList = new ArrayList<>(list.size()); + for (T t : list) { + K key = selector.select(t); + if (key != null) filedList.add(key); + } + return filedList; + } + + public static List distinctSelect(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + Set filedSet = new HashSet<>(); + for (T t : list) { + K key = selector.select(t); + if (key != null) filedSet.add(key); + } + return new ArrayList<>(filedSet); + } + + @SafeVarargs + public static List unionWithoutDuplicate(List... values) { + if (null == values || values.length <= 0) return Collections.emptyList(); + Set unionFiledSet = new HashSet<>(); + for (List value : values) { + if (!CollectionUtils.isEmpty(value)) { + unionFiledSet.addAll(value); + } + } + return new ArrayList<>(unionFiledSet); + } + + public static List skipDuplicateKey(List list, FieldSelector selector) { + if (CollectionUtils.isEmpty(list)) return Collections.emptyList(); + List filedList = new ArrayList<>(list.size()); + Map map = toMap(list, selector); + for (K key : map.keySet()) { + filedList.add(map.get(key)); + } + return filedList; + } +} diff --git a/src/main/java/com/example/utils/Md5Util.java b/src/main/java/com/example/utils/Md5Util.java new file mode 100644 index 0000000..a357057 --- /dev/null +++ b/src/main/java/com/example/utils/Md5Util.java @@ -0,0 +1,21 @@ +package com.example.utils; + +import java.security.MessageDigest; + +public class Md5Util { + public static String encrypt(String dataStr) { + try { + MessageDigest m = MessageDigest.getInstance("MD5"); + m.update(dataStr.getBytes("UTF8")); + byte[] s = m.digest(); + StringBuilder result = new StringBuilder(); + for (int i = 0; i < s.length; i++) { + result.append(Integer.toHexString((0x000000FF & s[i]) | 0xFFFFFF00).substring(6)); + } + return result.toString(); + } catch (Exception e) { + e.printStackTrace(); + } + return ""; + } +} diff --git a/src/main/java/com/example/utils/SnowflakeIdWorker.java b/src/main/java/com/example/utils/SnowflakeIdWorker.java new file mode 100644 index 0000000..fef3202 --- /dev/null +++ b/src/main/java/com/example/utils/SnowflakeIdWorker.java @@ -0,0 +1,139 @@ +package com.example.utils; + +public class SnowflakeIdWorker { + /** + * 开始时间截 (2015-01-01) + */ + private final long twepoch = 1420041600000L; + /** + * 机器id所占的位数 + */ + private final long workerIdBits = 5L; + /** + * 数据标识id所占的位数 + */ + private final long datacenterIdBits = 5L; + /** + * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) + */ + private final long maxWorkerId = -1L ^ (-1L << workerIdBits); + /** + * 支持的最大数据标识id,结果是31 + */ + private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); + /** + * 序列在id中占的位数 + */ + private final long sequenceBits = 12L; + /** + * 机器ID向左移12位 + */ + private final long workerIdShift = sequenceBits; + /** + * 数据标识id向左移17位(12+5) + */ + private final long datacenterIdShift = sequenceBits + workerIdBits; + /** + * 时间截向左移22位(5+5+12) + */ + private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; + /** + * 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) + */ + private final long sequenceMask = -1L ^ (-1L << sequenceBits); + /** + * 工作机器ID(0~31) + */ + private long workerId; + /** + * 数据中心ID(0~31) + */ + private long datacenterId; + /** + * 毫秒内序列(0~4095) + */ + private long sequence = 0L; + /** + * 上次生成ID的时间截 + */ + private long lastTimestamp = -1L; + /** + * 构造函数 + * @param workerId 工作ID (0~31) + * @param datacenterId 数据中心ID (0~31) + */ + public SnowflakeIdWorker(long workerId, long datacenterId) { + if (workerId > maxWorkerId || workerId < 0) { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + } + if (datacenterId > maxDatacenterId || datacenterId < 0) { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + } + this.workerId = workerId; + this.datacenterId = datacenterId; + } + /** + * 获得下一个ID (该方法是线程安全的) + * @return SnowflakeId + */ + public synchronized long nextId() { + long timestamp = timeGen(); + // 如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常 + if (timestamp < lastTimestamp) { + throw new RuntimeException( + String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); + } + // 如果是同一时间生成的,则进行毫秒内序列 + if (lastTimestamp == timestamp) { + sequence = (sequence + 1) & sequenceMask; + // 毫秒内序列溢出 + if (sequence == 0) { + //阻塞到下一个毫秒,获得新的时间戳 + timestamp = tilNextMillis(lastTimestamp); + } + } + // 时间戳改变,毫秒内序列重置 + else { + sequence = 0L; + } + // 上次生成ID的时间截 + lastTimestamp = timestamp; + // 移位并通过或运算拼到一起组成64位的ID + return ((timestamp - twepoch) << timestampLeftShift) // + | (datacenterId << datacenterIdShift) // + | (workerId << workerIdShift) // + | sequence; + } + /** + * 阻塞到下一个毫秒,直到获得新的时间戳 + * @param lastTimestamp 上次生成ID的时间截 + * @return 当前时间戳 + */ + protected long tilNextMillis(long lastTimestamp) { + long timestamp = timeGen(); + while (timestamp <= lastTimestamp) { + timestamp = timeGen(); + } + return timestamp; + } + /** + * 返回以毫秒为单位的当前时间 + * @return 当前时间(毫秒) + */ + protected long timeGen() { + return System.currentTimeMillis(); + } + + public static void main(String[] args) throws InterruptedException { + SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0); + for (int i = 0; i < 10; i++) { + long id = idWorker.nextId(); + Thread.sleep(1); + System.out.println(id); + } + } + + +} + + diff --git a/src/main/java/com/example/utils/SplitDataProcessor.java b/src/main/java/com/example/utils/SplitDataProcessor.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/java/com/example/utils/StopWatch.java b/src/main/java/com/example/utils/StopWatch.java new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..dd955b2 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,81 @@ +server: + port: 3391 + + + +spring: + datasource: +# db1: #数据源1 +# jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DB_PrivilegeManagement_LZRMYY +# username: sa +# password: docus@904 +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# type: com.alibaba.druid.pool.DruidDataSource +# db2: #数据源2 +# jdbc-url: jdbc:sqlserver://10.6.1.125:1433;DatabaseName=beifen +# username: sa +# password: Sql@2012 +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# type: com.alibaba.druid.pool.DruidDataSource + db1: #数据源1 + jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=yd_record + username: sa + password: admin123 + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + type: com.alibaba.druid.pool.DruidDataSource + db2: #数据源2 + jdbc-url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=qf_record + username: sa + password: admin123 + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + type: com.alibaba.druid.pool.DruidDataSource + #加快springboot初始化,延缓初始化加载 + main: + lazy-initialization: true + #加快springboot初始化,关闭jmx监控 + jmx: + enabled: false +# redis: +# # Redis 服务器地址 +# host: localhost +# # 连接端口号 +# port: 6379 +# # 数据库索引(0 - 15) +# database: 0 +# # 连接超时时间(毫秒) +# timeout: 10000 +# # lettuce 参数 +# lettuce: +# pool: +# # 最大连接数(使用负值表示没有限制) 默认为 8 +# max-active: 10 +# # 最大阻塞等待时间(使用负值表示没有限制) 默认为 -1 ms +# max-wait: -1 +# # 最大空闲连接 默认为 8 +# max-idle: 5 +# # 最小空闲连接 默认为 0 +# min-idle: 0 + application: + name: service-swagger +mybatis: + mapper-locations: classpath:mapper*/*.xml + type-aliases-package: com.example.entity + # 控制台打印sql语句 + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl +logging: + config: classpath:logback-spring.xml + level: + com.example.mapper: debug + +waterPicPath: D:/jiashi/reload/ + +#厦门174医院清空文件及开发0.关闭 1.开启 +waterPicPathFlag: 0 + +EMR_RECORD_JSP: http://192.0.21.8:8887/ + +ZJ_DATE_TIME_LOG : 2022-12-31 23:59:59 + + +ZJ_DATE_TIME_MESSAGE : 2022-12-31 23:59:59 \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..2dd4c69 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,51 @@ + + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + UTF-8 + + + + + + + D:\logs\springbootDemo.log + + + + + + log/demo.%d.%i.log + + 15 + + + 10MB + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + + utf-8 + + UTF-8 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ArchiveDetailMapper.xml b/src/main/resources/mapper/ArchiveDetailMapper.xml new file mode 100644 index 0000000..7e1bde5 --- /dev/null +++ b/src/main/resources/mapper/ArchiveDetailMapper.xml @@ -0,0 +1,11 @@ + + + + + + + insert into Archive_Detail (ID, PDF_PATH, MasterID, UpLoadDateTime, AssortID, Source, flag, + Sys, splitName) + values (#{ID}, #{PDFPATH}, #{MasterID}, #{UpLoadDateTime}, #{AssortID}, #{Source}, #{flag}, #{Sys},#{splitName}) + + \ No newline at end of file diff --git a/src/main/resources/mapper/ArchiveMasterMapper.xml b/src/main/resources/mapper/ArchiveMasterMapper.xml new file mode 100644 index 0000000..657ee54 --- /dev/null +++ b/src/main/resources/mapper/ArchiveMasterMapper.xml @@ -0,0 +1,31 @@ + + + + + insert into master_id (masterId) + values + (#{item}) + + + + insert into Archive_Master (ID, patient_id, inp_no, visit_id, name, dept_name, discharge_date_time, + ArchiveState, admission_date_time, LockInfo, + DISCHARGE_DISPOSITION,split_name) + values (#{ID}, #{patientId}, #{inpNo}, #{visitId}, #{name}, #{deptName}, #{dischargeDateTime}, #{ArchiveState}, + #{admissionDateTime}, #{LockInfo}, #{DISCHARGEDISPOSITION}, #{splitName}) + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/CommomtableMapper.xml b/src/main/resources/mapper/CommomtableMapper.xml new file mode 100644 index 0000000..774a502 --- /dev/null +++ b/src/main/resources/mapper/CommomtableMapper.xml @@ -0,0 +1,53 @@ + + + + + insert into CommonTable (patient_id, admiss_id, admiss_times, inpatient_no, name, dis_date, dis_dept_name, + ph, gdh,splitName) + values (#{patientId}, #{admissId}, #{admissTimes}, #{inpatientNo}, #{name}, #{disDate}, #{disDeptName}, #{ph},#{gdh},#{splitName}) + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/LzRmMapper.xml b/src/main/resources/mapper/LzRmMapper.xml new file mode 100644 index 0000000..03f06b7 --- /dev/null +++ b/src/main/resources/mapper/LzRmMapper.xml @@ -0,0 +1,45 @@ + + + + + update commomtable_copy + set spilStatic=#{spilStatic} + where inpatientNoPast = #{inpatientNoPast} + and ph = #{phString} + and pageNumber=#{pageNumber} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/MessageLogMapper.xml b/src/main/resources/mapper/MessageLogMapper.xml new file mode 100644 index 0000000..1ec934e --- /dev/null +++ b/src/main/resources/mapper/MessageLogMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + update synchronous_time set addTime=#{dischargeDateTime} + + + delete from message_log where id in + + #{item} + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/MessageSubordinateMapper.xml b/src/main/resources/mapper/MessageSubordinateMapper.xml new file mode 100644 index 0000000..aee8bd8 --- /dev/null +++ b/src/main/resources/mapper/MessageSubordinateMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + update synchronous_time1 set addTime=#{dischargeDateTime} + + + + + delete from message_subordinate where message_id in + + #{item} + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/MidMapper.xml b/src/main/resources/mapper/MidMapper.xml new file mode 100644 index 0000000..91eba26 --- /dev/null +++ b/src/main/resources/mapper/MidMapper.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/QualityMapper.xml b/src/main/resources/mapper/QualityMapper.xml new file mode 100644 index 0000000..b4e789c --- /dev/null +++ b/src/main/resources/mapper/QualityMapper.xml @@ -0,0 +1,108 @@ + + + + + insert into ph (ph + ) + values (#{item.ph} + ) + + + insert into fliePath (ph,fliePath + ) + values (#{ph},#{fliePath} + ) + + + insert into t_scan_assort (patient_id,assort_id,scan_page,source,is_del + ) + values (#{patientId},#{assortId},#{scanPage},#{source},#{isDel} + ) + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper2/MessageLogTwoMapper.xml b/src/main/resources/mapper2/MessageLogTwoMapper.xml new file mode 100644 index 0000000..46caf55 --- /dev/null +++ b/src/main/resources/mapper2/MessageLogTwoMapper.xml @@ -0,0 +1,18 @@ + + + + + insert into message_log (id,create_time,end_time,execution_time,input_content, + interface_name,out_content,out_json,remark,result,type,xml_create_time,xml_execution_time, + master_id,webservice_info) + values + (#{item.id},#{item.createTime},#{item.endTime}, + #{item.executionTime},#{item.inputContent},#{item.interfaceName},#{item.outContent}, + #{item.outJson},#{item.remark},#{item.result},#{item.type},#{item.xmlCreateTime},#{item.xmlExecutionTime}, + #{item.masterId},#{item.webserviceInfo} + ) + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper2/MessageSubordinateTwoMapper.xml b/src/main/resources/mapper2/MessageSubordinateTwoMapper.xml new file mode 100644 index 0000000..e1a54cc --- /dev/null +++ b/src/main/resources/mapper2/MessageSubordinateTwoMapper.xml @@ -0,0 +1,16 @@ + + + + + + + insert into message_subordinate (id,content_json,message_id,patient_main,status,remark,runs) + values + (#{item.id},#{item.contentJson},#{item.messageId}, + #{item.patientMain},#{item.status},#{item.remark},#{item.runs} + ) + + + \ No newline at end of file diff --git a/src/main/resources/rebel.xml b/src/main/resources/rebel.xml new file mode 100644 index 0000000..aced2d6 --- /dev/null +++ b/src/main/resources/rebel.xml @@ -0,0 +1,16 @@ + + + + + + mr-file + + + + + + + diff --git a/src/test/java/com/example/DemoApplicationTests.java b/src/test/java/com/example/DemoApplicationTests.java new file mode 100644 index 0000000..b5758bf --- /dev/null +++ b/src/test/java/com/example/DemoApplicationTests.java @@ -0,0 +1,141 @@ +package com.example; + + + + +import com.example.duplicate.infrastructure.configOneDao.MidMapper; +import com.example.duplicate.infrastructure.configOneDao.QualityMapper; +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ofdrw.converter.ofdconverter.ImageConverter; +import org.ofdrw.layout.OFDDoc; +import org.ofdrw.layout.PageLayout; +import org.ofdrw.layout.element.Img; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +import javax.imageio.ImageIO; + + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = com.example.SpringbootDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@Slf4j +public class DemoApplicationTests { + + private static SimpleDateFormat inSDF = new SimpleDateFormat("yyyy.mm.dd"); + private static SimpleDateFormat outSDF = new SimpleDateFormat("yyyy-mm-dd"); + + @Autowired + QualityMapper qualityMapper; + @Autowired + MidMapper midMapper; + + + @Test + public void getPic() { + List mid = midMapper.getMid(); + String curl = " curl -X POST http://10.36.116.108:3391/makeUp/makeUpPacsByMasterId -d"; + String param = "masterId="; + for (String masterId:mid){ + log.info(curl+" "+param+masterId); + } + + } + + + @Test + public void ImageConverterTest() throws IOException { + String directoryPath = "D:\\tmp1\\004624"; // 替换为你的目录路径 + List imagePaths = findImageFiles(directoryPath); + for (int i=0;i findImageFiles(String directoryPath) { + List jpgPath = new ArrayList<>(); + List imgPaths=new ArrayList<>(); + File directory = new File(directoryPath); + + // 遍历目录 + File[] files = directory.listFiles((dir, name) -> name.toLowerCase().matches(".*\\.(jpg)$")); + if (files != null) { + for (File file : files) { + if (file.isFile()) { + jpgPath.add(file.getAbsolutePath()); + } + } + } + for (String path:jpgPath){ + imgPaths.add(Paths.get(path)); + } + return imgPaths; + } + + + + + + @Test + public void intercept() { + String pageNumber = "66"; + //如果包含--就截取--前 + if (pageNumber.contains("--")) { + pageNumber = pageNumber.substring(0, pageNumber.indexOf("--")); + } + //如果包含--就截取-前 + if (pageNumber.contains("-")) { + pageNumber = pageNumber.substring(0, pageNumber.indexOf("-")); + } + System.out.println("pageNumber:" + pageNumber); + } + + @Test + public void intercept1() { + String a = "0000000002"; + String s = String.format("%010d", Integer.parseInt(a)); + System.out.println("s:" + s); + } + + + public static String bytesToHexString(byte[] src) { + StringBuilder stringBuilder = new StringBuilder(); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + + +}