初始化
commit
2c35ee79f5
@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.8.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>collector-gm</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>springbootDemo</name>
|
||||
<description>springbootDemo</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<skipTests>true</skipTests>
|
||||
<mybatisPlus.version>3.4.1</mybatisPlus.version>
|
||||
<alibabadruid.version>1.2.1</alibabadruid.version>
|
||||
<knife4j.version>2.0.9</knife4j.version>
|
||||
<fastjson.version>2.0.11</fastjson.version>
|
||||
<commons-pool2.version>2.6.0</commons-pool2.version>
|
||||
<itext.version>2.1.7</itext.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!--mybatis-plus-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatisPlus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>${mybatisPlus.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||
</dependency>
|
||||
<!--druid监控-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${alibabadruid.version}</version>
|
||||
</dependency>
|
||||
<!-- swaggerui相关依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<!-- Jackson Json处理工具包 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<!-- redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<!-- spring2.X集成redis所需common-pool2-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>${commons-pool2.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.lowagie</groupId>
|
||||
<artifactId>itext</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.birt.runtime.3_7_1</groupId>
|
||||
<artifactId>com.lowagie.text</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc4</artifactId>
|
||||
<version>4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>wsjz-releases</id>
|
||||
<name>Releases Repository</name>
|
||||
<url>http://localhost:8081/nexus/content/repositories/releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>wsjz-snapshots</id>
|
||||
<name>Snapshot Repository</name>
|
||||
<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,19 @@
|
||||
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;
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.example.duplicate.infrastructure.dao")
|
||||
@Slf4j
|
||||
public class SpringbootDemoApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringbootDemoApplication.class, args);
|
||||
log.info("------------------启动完成----------------------");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.example.aother.annotation.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.ParameterBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.schema.ModelRef;
|
||||
import springfox.documentation.service.Parameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
public class Knife4jConfiguration {
|
||||
/**
|
||||
* 需要配置controller层包名
|
||||
*/
|
||||
String controllerPackagePath = "com.example";
|
||||
@Bean(value = "defaultApi2")
|
||||
public Docket defaultApi2() {
|
||||
List<Parameter> pars = new ArrayList<>();
|
||||
ParameterBuilder tokenPar = new ParameterBuilder();
|
||||
tokenPar.name("token")
|
||||
.description("用户token")
|
||||
.defaultValue("")
|
||||
.modelRef(new ModelRef("string"))
|
||||
.parameterType("header")
|
||||
.required(false)
|
||||
.build();
|
||||
pars.add(tokenPar.build());
|
||||
//添加head参数end
|
||||
|
||||
Docket docket=new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(new ApiInfoBuilder()
|
||||
//.title("swagger-bootstrap-ui-demo RESTful APIs")
|
||||
.description("# swagger-bootstrap-ui-demo RESTful APIs")
|
||||
.termsOfServiceUrl("www.codeleader.top")
|
||||
.version("1.0")
|
||||
.build())
|
||||
.globalOperationParameters(pars)
|
||||
//分组名称
|
||||
.groupName("2.X版本")
|
||||
.select()
|
||||
//这里指定Controller扫描包路径
|
||||
.apis(RequestHandlerSelectors.basePackage(controllerPackagePath))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
return docket;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.example.aother.annotation.config;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig{
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
||||
paginationInnerInterceptor.setOverflow(true);
|
||||
interceptor.addInnerInterceptor(paginationInnerInterceptor);
|
||||
OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor = new OptimisticLockerInnerInterceptor();
|
||||
interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor);
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.example.aother.annotation.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>();
|
||||
template.setConnectionFactory(redisConnectionFactory);
|
||||
//Json序列化器
|
||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
|
||||
jackson2JsonRedisSerializer.setObjectMapper(om);
|
||||
|
||||
//String序列化器
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
|
||||
//key采用String序列化器
|
||||
template.setKeySerializer(stringRedisSerializer);
|
||||
template.setHashKeySerializer(stringRedisSerializer);
|
||||
//value采用Json序列化器
|
||||
template.setValueSerializer(jackson2JsonRedisSerializer);
|
||||
template.setHashValueSerializer(jackson2JsonRedisSerializer);
|
||||
template.afterPropertiesSet();
|
||||
return template;
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.example.aother.annotation.exception;
|
||||
|
||||
public class Package {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.example.aother.common;
|
||||
|
||||
public class Package {
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ArchiveDetailDto {
|
||||
private String id;
|
||||
//文件路径
|
||||
private String pdfPath;
|
||||
//主键id
|
||||
private String masterid;
|
||||
//更新时间
|
||||
private String uploaddatetime;
|
||||
//更新时间
|
||||
private String assortid;
|
||||
//文件来源
|
||||
private String source;
|
||||
//分段信息
|
||||
private String subassort;
|
||||
//标题
|
||||
private String title;
|
||||
//标识
|
||||
private String flag;
|
||||
//标识
|
||||
private String sys;
|
||||
//文件唯一id
|
||||
private String serialNumber;
|
||||
//扩展字段
|
||||
private String C1;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: ArchiveOtherExtDto
|
||||
* @author linjj
|
||||
* @date: 2024/8/5 9:21
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveOtherExtDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty(value = "病案主键")
|
||||
@TableId(value = "patient_id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
//更新时间
|
||||
private String SycTime;
|
||||
//任务id
|
||||
private String otherID;
|
||||
//采集器标识
|
||||
private Integer sysFlag;
|
||||
//个更新时间
|
||||
private String sysUpdateTime;
|
||||
//记帐号
|
||||
private String jzh;
|
||||
//住院号
|
||||
private String zyh;
|
||||
//标识
|
||||
private Integer statusFlag;
|
||||
//主键id
|
||||
private String MID;
|
||||
//扩展字段
|
||||
private String C1;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 文件上传接口接收类
|
||||
* @author linjj
|
||||
* @date: 2024/8/6 14:17
|
||||
*/
|
||||
@Data
|
||||
public class FileUpload {
|
||||
//主键id
|
||||
private String masterid;
|
||||
//分类id
|
||||
private String assortid;
|
||||
//来源
|
||||
private String source;
|
||||
//文件MD5码
|
||||
private String subassort;
|
||||
//标题
|
||||
private String title;
|
||||
//文件名
|
||||
private String fileName;
|
||||
//文件MD5码
|
||||
private String SerialNumber;
|
||||
//采集器id标识
|
||||
private String C1;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import com.example.duplicate.controller.vo.ArchiveMasterVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description:队列内需要参数
|
||||
* @author linjj
|
||||
* @date: 2024/8/2 16:45
|
||||
*/
|
||||
@Data
|
||||
public class PrintParam {
|
||||
|
||||
private String id;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//出院科室
|
||||
private String deptName;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
//住院时间
|
||||
private String admissionDateTime;
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class UploadBatchFileParam {
|
||||
|
||||
private String uploadFileParams;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName updateTaskDto
|
||||
* @Description 维护任务表实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/3/8 11:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class updateTaskDto {
|
||||
|
||||
@ApiModelProperty(value="主键id",name="mid", required=true)
|
||||
private String mid;
|
||||
@ApiModelProperty(value="患者信息",name="sycObj", required=true)
|
||||
private String sycObj;
|
||||
@ApiModelProperty(value="任务状态",name="statusFlag", required=true)
|
||||
private int statusFlag;
|
||||
@ApiModelProperty(value="采集器id",name="sysFlag", required=true)
|
||||
private int sysFlag;
|
||||
@ApiModelProperty(value="开始时间",name="startTime", required=true)
|
||||
private String startTime;
|
||||
@ApiModelProperty(value="结束时间",name="endTime", required=true)
|
||||
private String endTime;
|
||||
@ApiModelProperty(value="备注",name="pinResult", required=true)
|
||||
private String pinResult;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.example.duplicate.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ArchiveMasterVo
|
||||
* @Description 基础表实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/8/2 15:59
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveMasterVo {
|
||||
|
||||
|
||||
private String id;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//记帐号
|
||||
private String patientId;
|
||||
//出院科室
|
||||
private String deptName;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//住院时间
|
||||
private String admissionDateTime;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.example.duplicate.controller.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 任务表参数
|
||||
* @author linjj
|
||||
* @date: 2024/8/5 9:09
|
||||
*/
|
||||
@Data
|
||||
public class ArchiveOtherExtVo {
|
||||
@ApiModelProperty(value = "病案主键")
|
||||
@TableId(value = "patient_id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
private Date syctime;
|
||||
|
||||
private String sycobj;
|
||||
|
||||
private Long otherid;
|
||||
|
||||
private Integer sysflag;
|
||||
|
||||
private Date sysupdatetime;
|
||||
|
||||
private String jzh;
|
||||
|
||||
private String zyh;
|
||||
|
||||
private Date stime;
|
||||
|
||||
private Date etime;
|
||||
|
||||
private Integer statusflag;
|
||||
|
||||
private String presult;
|
||||
|
||||
private String mid;
|
||||
|
||||
private String did;
|
||||
|
||||
private String c1;
|
||||
|
||||
private String c2;
|
||||
|
||||
private String c3;
|
||||
|
||||
private String c4;
|
||||
|
||||
private String c5;
|
||||
|
||||
private String c6;
|
||||
|
||||
private String c7;
|
||||
|
||||
private String c8;
|
||||
|
||||
private String c9;
|
||||
|
||||
private String c10;
|
||||
|
||||
private BigDecimal n1;
|
||||
|
||||
private BigDecimal n2;
|
||||
|
||||
private BigDecimal n3;
|
||||
|
||||
private Date t1;
|
||||
|
||||
private Date t2;
|
||||
|
||||
private Date t3;
|
||||
|
||||
private Date t4;
|
||||
|
||||
private Date t5;
|
||||
|
||||
private Date t6;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.example.duplicate.infrastructure;
|
||||
|
||||
public class Package {
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.example.duplicate.infrastructure.dao;
|
||||
|
||||
import com.example.duplicate.controller.param.ArchiveDetailDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveDetailMapper
|
||||
* @Description 文件保存接口
|
||||
* @Author linjj
|
||||
* @Date 2024/8/6 14:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveDetailMapper {
|
||||
|
||||
|
||||
List<ArchiveDetailDto> getDetailBySerialNumber(String serialNumber);
|
||||
|
||||
boolean deleteByPrimaryKey(String id);
|
||||
|
||||
boolean delFileBySource(@Param("masterId")String masterId,@Param("collectId")String collectId);
|
||||
|
||||
|
||||
|
||||
boolean insertSel(ArchiveDetailDto record);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.example.duplicate.infrastructure.dao;
|
||||
|
||||
import com.example.duplicate.controller.vo.ArchiveMasterVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName Archive_master
|
||||
* @Author linjj
|
||||
* @Date 2024/8/2 15:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveMasterMapper {
|
||||
//轮询根据时间获取患者信息
|
||||
List<ArchiveMasterVo> getMedicalAdviceTask();
|
||||
|
||||
//根据masterId获取患者信息
|
||||
List<ArchiveMasterVo> getArchiveMasterByMasterId(@Param("masterId")String masterId);
|
||||
List<String> getMasterid();
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.example.duplicate.infrastructure.dao;
|
||||
|
||||
import com.example.duplicate.controller.param.ArchiveOtherExtDto;
|
||||
import com.example.duplicate.controller.param.updateTaskDto;
|
||||
import com.example.duplicate.controller.vo.ArchiveOtherExtVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName ArchiveOtherExtMapper
|
||||
* @Description 任务表
|
||||
* @Author linjj
|
||||
* @Date 2024/8/5 8:52
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ArchiveOtherExtMapper {
|
||||
|
||||
List<ArchiveOtherExtVo> getOtherByMidAndFlag(@Param("mid")String mid, @Param("sysFlag")int sysFlag);
|
||||
|
||||
Boolean addOther(ArchiveOtherExtDto archiveOtherExtDto);
|
||||
|
||||
Boolean updateByMid(updateTaskDto dto);
|
||||
|
||||
Boolean updateStatic(@Param("mid")String mid, @Param("sysFlag")String sysFlag);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.duplicate.service;
|
||||
|
||||
import com.example.utils.CommonResult;
|
||||
|
||||
/**
|
||||
* @InterfaceName MedicalAdviceService
|
||||
* @Description 补偿接口
|
||||
* @Author linjj
|
||||
* @Date 2024/8/2 15:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface MedicalAdviceService {
|
||||
|
||||
/**
|
||||
* @description: 轮询基础表增加任务
|
||||
* @author linjj
|
||||
* @date: 2024/8/2 15:52
|
||||
*/
|
||||
CommonResult<?> pollingAddTask();
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.example.duplicate.service;
|
||||
|
||||
import com.example.duplicate.controller.param.updateTaskDto;
|
||||
import com.example.duplicate.controller.param.FileUpload;
|
||||
import com.example.utils.CommonResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @InterfaceName TaskService
|
||||
* @Description 任务接口
|
||||
* @Author linjj
|
||||
* @Date 2024/8/5 14:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface TaskService {
|
||||
|
||||
/**
|
||||
* @description: 获取任务
|
||||
* @params: collectId
|
||||
* @return: CommonResult
|
||||
* @author linjj
|
||||
* @date: 2024/8/5 14:41
|
||||
*/
|
||||
CommonResult GetTask(String collectId);
|
||||
/**
|
||||
* @description: 补偿患者所有采集任务
|
||||
* @params: masterId
|
||||
* @return: CommonResult
|
||||
* @author linjj
|
||||
* @date: 2024/8/5 15:32
|
||||
*/
|
||||
CommonResult repairTask(String masterId);
|
||||
/**
|
||||
* @description: 补偿患者单个采集器任务
|
||||
* @params: masterId
|
||||
* @params: collectId
|
||||
* @return: CommonResult
|
||||
* @author linjj
|
||||
* @date: 2024/8/5 17:25
|
||||
*/
|
||||
CommonResult repairTaskByCollectId(String masterId,String collectId);
|
||||
/**
|
||||
* @description: 根据采集器id患者id删除单据
|
||||
* @params: masterId
|
||||
* @params: collectId
|
||||
* @author linjj
|
||||
* @date: 2024/12/26 14:32
|
||||
*/
|
||||
CommonResult delFileBySource(String masterId,String collectId);
|
||||
/**
|
||||
* @description: 维护任务表接口
|
||||
* @params: updateTaskDto
|
||||
* @return: CommonResult
|
||||
* @author linjj
|
||||
* @date: 2024/8/6 9:27
|
||||
*/
|
||||
CommonResult updateTask(updateTaskDto dto);
|
||||
/**
|
||||
* @description: 文件上传接口
|
||||
* @params: file
|
||||
* @params: FileUpload
|
||||
* @return: Boolean
|
||||
* @author linjj
|
||||
* @date: 2024/8/6 14:22
|
||||
*/
|
||||
Boolean fileUpload(MultipartFile file, FileUpload dto);
|
||||
/**
|
||||
* @description: 补偿7月份后医嘱历史病历
|
||||
* @author linjj
|
||||
* @date: 2024/8/19 4:32
|
||||
*/
|
||||
CommonResult compensate();
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.example.duplicate.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.example.duplicate.controller.param.ArchiveOtherExtDto;
|
||||
import com.example.duplicate.controller.param.PrintParam;
|
||||
import com.example.duplicate.controller.vo.ArchiveMasterVo;
|
||||
import com.example.duplicate.controller.vo.ArchiveOtherExtVo;
|
||||
import com.example.duplicate.infrastructure.dao.ArchiveMasterMapper;
|
||||
import com.example.duplicate.infrastructure.dao.ArchiveOtherExtMapper;
|
||||
import com.example.duplicate.service.MedicalAdviceService;
|
||||
import com.example.utils.CommonResult;
|
||||
import com.example.utils.RedisMq;
|
||||
import com.example.utils.SnowflakeIdWorker;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName MedicalAdviceServiceImpl
|
||||
* @Description 医嘱任务实现类
|
||||
* @Author linjj
|
||||
* @Date 2024/8/2 15:48
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MedicalAdviceServiceImpl implements MedicalAdviceService {
|
||||
|
||||
@Value("${collectIdList}")
|
||||
private String collectIdList;
|
||||
@Autowired
|
||||
private ArchiveMasterMapper ArchiveMasterMapper;
|
||||
@Autowired
|
||||
private ArchiveOtherExtMapper archiveOtherExtMapper;
|
||||
@Autowired(required = false)
|
||||
private RedisMq redisMq;
|
||||
|
||||
private String redisKey = "docus:task:topic_collect_%s_queue:%s";
|
||||
|
||||
@Override
|
||||
public CommonResult<?> pollingAddTask() {
|
||||
//获取当前30分钟前出院病历生成医嘱任务
|
||||
List<ArchiveMasterVo> medicalAdviceTask = ArchiveMasterMapper.getMedicalAdviceTask();
|
||||
if (CollectionUtils.isEmpty(medicalAdviceTask)) {
|
||||
log.info("当前没有需要生成任务的病历");
|
||||
return CommonResult.failed("当前没有需要生成任务的病历");
|
||||
}
|
||||
PrintParam printParam = new PrintParam();
|
||||
//任务表入参
|
||||
ArchiveOtherExtDto dto = new ArchiveOtherExtDto();
|
||||
//任务生成时间
|
||||
Date date = new Date();
|
||||
SimpleDateFormat SycTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//补偿所有采集器id集合
|
||||
List<String> collectIds = Arrays.asList(collectIdList.split(","));
|
||||
//生成任务
|
||||
for (ArchiveMasterVo tasks : medicalAdviceTask) {
|
||||
//增加所有采集id的任务
|
||||
for (String collectId : collectIds) {
|
||||
try {
|
||||
//查询任务表是否存在,不存在新增
|
||||
List<ArchiveOtherExtVo> others = archiveOtherExtMapper.getOtherByMidAndFlag(tasks.getId(), Integer.parseInt(collectId));
|
||||
if (CollectionUtils.isEmpty(others)) {
|
||||
//任务表新增
|
||||
dto.setId(SnowflakeIdWorker.idWorker.nextId());
|
||||
dto.setSycTime(SycTime.format(date));
|
||||
dto.setOtherID("0");
|
||||
dto.setSysFlag(Integer.parseInt(collectId));
|
||||
dto.setSysUpdateTime(SycTime.format(date));
|
||||
dto.setJzh(tasks.getPatientId());
|
||||
dto.setZyh(tasks.getInpNo());
|
||||
dto.setStatusFlag(0);
|
||||
dto.setMID(tasks.getId());
|
||||
if (collectId.equals("8")){
|
||||
dto.setC1("长临医嘱");
|
||||
}
|
||||
if (collectId.equals("1")){
|
||||
dto.setC1("护理记录");
|
||||
}
|
||||
//任务表新增任务
|
||||
if (archiveOtherExtMapper.addOther(dto)) {
|
||||
//存放队列消息
|
||||
GenerateQueue(tasks, printParam, 5, collectId);
|
||||
log.info("轮询增加任务成功,id为:" + tasks.getId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("轮询增加任务失败,id为:" + tasks.getId(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return CommonResult.success("轮询完成已经增加任务");
|
||||
}
|
||||
|
||||
|
||||
//生成队列消息
|
||||
private void GenerateQueue(ArchiveMasterVo task, PrintParam data, Integer ispriority, String collectid) {
|
||||
data.setId(task.getId());
|
||||
data.setInpNo(task.getInpNo());
|
||||
data.setVisitId(task.getVisitId());
|
||||
data.setDeptName(task.getDeptName());
|
||||
data.setDischargeDateTime(task.getDischargeDateTime());
|
||||
data.setName(task.getName());
|
||||
data.setAdmissionDateTime(task.getAdmissionDateTime());
|
||||
String key = String.format(redisKey, collectid, ispriority);
|
||||
redisMq.push(key, JSON.toJSONString(data, SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteMapNullValue));
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.example.quartz;
|
||||
|
||||
import org.quartz.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @ClassName CollectorConfig
|
||||
* @Description 采集器轮询任务
|
||||
* @Author linjj
|
||||
* @Date 2024/8/2 14:45
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class CollectorConfig {
|
||||
|
||||
@Value("${medicalAdviceTime}")
|
||||
private String medicalAdviceTime;
|
||||
|
||||
@Bean
|
||||
public JobDetail MedicalAdvice() {
|
||||
return JobBuilder.newJob(MedicalAdviceQuartz.class).withIdentity("MedicalAdviceQuartz").storeDurably().build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Trigger pacsPushTrigger() {
|
||||
|
||||
return TriggerBuilder.newTrigger().forJob(MedicalAdvice())
|
||||
|
||||
.withIdentity("MedicalAdviceQuartz")
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(medicalAdviceTime))
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.example.quartz;
|
||||
|
||||
|
||||
import com.example.duplicate.service.MedicalAdviceService;
|
||||
import com.example.utils.CommonResult;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: 医嘱任务
|
||||
* @author linjj
|
||||
* @date: 2024/8/2 15:46
|
||||
*/
|
||||
public class MedicalAdviceQuartz extends QuartzJobBean {
|
||||
|
||||
@Resource
|
||||
private MedicalAdviceService medicalAdviceService;
|
||||
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
//每半小时轮询一次基础表增加任务
|
||||
medicalAdviceService.pollingAddTask();
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package com.example.utils;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author docus
|
||||
* @date 2020/3/28 16:23
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("响应")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CommonResult<T> {
|
||||
@ApiModelProperty("响应码")
|
||||
private Integer code;
|
||||
@ApiModelProperty("响应消息")
|
||||
private String msg;
|
||||
@ApiModelProperty("响应实体")
|
||||
private T data;
|
||||
|
||||
public CommonResult(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param errorCode 错误码
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode) {
|
||||
return new CommonResult<T>(errorCode.getCode(), errorCode.getMessage(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param errorCode 错误码
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(IErrorCode errorCode, String message) {
|
||||
return new CommonResult<T>(errorCode.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(String message) {
|
||||
return new CommonResult<T>(ResultCode.FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed() {
|
||||
return failed(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数验证失败返回结果
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed() {
|
||||
return failed(ResultCode.VALIDATE_FAILED);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*
|
||||
* @param message 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> validateFailed(String message) {
|
||||
return new CommonResult<T>(ResultCode.VALIDATE_FAILED.getCode(), message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未登录返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> unauthorized(T data) {
|
||||
return new CommonResult<T>(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重防及重复请求
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> preventreplay(T data) {
|
||||
return new CommonResult<T>(ResultCode.PREVENT_REPLAY.getCode(), ResultCode.PREVENT_REPLAY.getMessage(), data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未授权返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> forbidden(T data) {
|
||||
return new CommonResult<T>(ResultCode.FORBIDDEN.getCode(), ResultCode.FORBIDDEN.getMessage(), data);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.example.utils;
|
||||
|
||||
/**
|
||||
* @Description 封装API的错误码
|
||||
* @Author JacksonTu
|
||||
* @Date 2020/3/28 16:26
|
||||
*/
|
||||
public interface IErrorCode {
|
||||
Integer getCode();
|
||||
|
||||
String getMessage();
|
||||
}
|
@ -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 "";
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.example.utils;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 枚举一些常用API操作码
|
||||
* @Author JacksonTu
|
||||
* @Date 2020/3/28 16:26
|
||||
*/
|
||||
public enum ResultCode implements IErrorCode {
|
||||
|
||||
SUCCESS(0, "操作成功"),
|
||||
FAILED(500, "操作失败"),
|
||||
VALIDATE_FAILED(404, "参数检验失败"),
|
||||
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
||||
FORBIDDEN(403, "没有相关权限"),
|
||||
PREVENT_REPLAY(405,"重复请求"),
|
||||
NOT_EXIST(601,"数据不存在"),
|
||||
NOT_ENABLE(600,"数据未启用");
|
||||
|
||||
|
||||
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
|
||||
private ResultCode(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.duplicate.infrastructure.dao.ArchiveDetailMapper">
|
||||
<insert id="insertSel">
|
||||
insert into archive_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
<if test="pdfPath != null">
|
||||
PDF_PATH,
|
||||
</if>
|
||||
<if test="masterid != null">
|
||||
MasterID,
|
||||
</if>
|
||||
<if test="uploaddatetime != null">
|
||||
UpLoadDateTime,
|
||||
</if>
|
||||
<if test="assortid != null">
|
||||
AssortID,
|
||||
</if>
|
||||
<if test="source != null">
|
||||
Source,
|
||||
</if>
|
||||
<if test="subassort != null">
|
||||
SubAssort,
|
||||
</if>
|
||||
<if test="title != null">
|
||||
Title,
|
||||
</if>
|
||||
<if test="flag != null">
|
||||
flag,
|
||||
</if>
|
||||
<if test="sys != null">
|
||||
Sys,
|
||||
</if>
|
||||
<if test="C1 != null">
|
||||
C1,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<!--<if test="id != null and id!=''">-->
|
||||
(select replace(newid(),'-','')),
|
||||
<!--</if>-->
|
||||
<if test="pdfPath != null">
|
||||
#{pdfPath,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="masterid != null">
|
||||
#{masterid,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="uploaddatetime != null">
|
||||
#{uploaddatetime,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="assortid != null">
|
||||
#{assortid,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="source != null">
|
||||
#{source,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="subassort != null">
|
||||
#{subassort,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="title != null">
|
||||
#{title,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="flag != null">
|
||||
#{flag,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="sys != null">
|
||||
#{sys,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
<if test="C1 != null">
|
||||
#{C1,jdbcType=NVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<delete id="deleteByPrimaryKey">
|
||||
delete from archive_detail
|
||||
where id = #{id,jdbcType=NVARCHAR}
|
||||
</delete>
|
||||
<delete id="delFileBySource">
|
||||
delete from archive_detail
|
||||
where MasterID = #{MasterID} AND flag=#{collectId}
|
||||
</delete>
|
||||
|
||||
<select id="getDetailBySerialNumber" resultType="com.example.duplicate.controller.param.ArchiveDetailDto">
|
||||
select * from archive_detail where Subassort=#{serialNumber}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.duplicate.infrastructure.dao.ArchiveMasterMapper">
|
||||
|
||||
<select id="getMedicalAdviceTask" resultType="com.example.duplicate.controller.vo.ArchiveMasterVo">
|
||||
SELECT *
|
||||
from archive_master
|
||||
WHERE discharge_date_time >= dateadd(minute,-30, GETDATE())
|
||||
</select>
|
||||
<select id="getArchiveMasterByMasterId" resultType="com.example.duplicate.controller.vo.ArchiveMasterVo">
|
||||
select *
|
||||
from archive_master
|
||||
where id = #{masterId}
|
||||
</select>
|
||||
<select id="getMasterid" resultType="java.lang.String">
|
||||
select id from archive_master WHERE discharge_date_time>='2024-07-01 00:00:00' and discharge_date_time <='2024-08-10 23:59:59'
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.example.duplicate.infrastructure.dao.ArchiveOtherExtMapper">
|
||||
<insert id="addOther">
|
||||
insert into archive_other_ext
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
ID,
|
||||
</if>
|
||||
<if test="SycTime != null" >
|
||||
SycTime,
|
||||
</if>
|
||||
<if test="otherID != null" >
|
||||
otherID,
|
||||
</if>
|
||||
<if test="sysFlag != null" >
|
||||
sysFlag,
|
||||
</if>
|
||||
<if test="sysUpdateTime != null" >
|
||||
sysUpdateTime,
|
||||
</if>
|
||||
<if test="jzh != null" >
|
||||
jzh,
|
||||
</if>
|
||||
<if test="zyh != null" >
|
||||
zyh,
|
||||
</if>
|
||||
<if test="statusFlag != null" >
|
||||
statusFlag,
|
||||
</if>
|
||||
<if test="MID != null" >
|
||||
MID,
|
||||
</if>
|
||||
<if test="C1 != null" >
|
||||
C1,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id},
|
||||
</if>
|
||||
<if test="SycTime != null" >
|
||||
#{SycTime},
|
||||
</if>
|
||||
<if test="otherID != null" >
|
||||
#{otherID},
|
||||
</if>
|
||||
<if test="sysFlag != null" >
|
||||
#{sysFlag},
|
||||
</if>
|
||||
<if test="sysUpdateTime != null" >
|
||||
#{sysUpdateTime},
|
||||
</if>
|
||||
<if test="jzh != null" >
|
||||
#{jzh},
|
||||
</if>
|
||||
<if test="zyh != null" >
|
||||
#{zyh},
|
||||
</if>
|
||||
<if test="statusFlag != null" >
|
||||
#{statusFlag},
|
||||
</if>
|
||||
<if test="MID != null" >
|
||||
#{MID},
|
||||
</if>
|
||||
<if test="C1 != null" >
|
||||
#{C1},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="getOtherByMidAndFlag" resultType="com.example.duplicate.controller.vo.ArchiveOtherExtVo">
|
||||
select * from archive_other_ext where MID=#{mid} and sysFlag=#{sysFlag}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateByMid">
|
||||
update archive_other_ext
|
||||
<set >
|
||||
<if test="sycObj != null" >
|
||||
SycObj = #{sycObj},
|
||||
</if>
|
||||
<if test="startTime != null" >
|
||||
stime = #{startTime},
|
||||
</if>
|
||||
<if test="endTime != null" >
|
||||
eTime = #{endTime},
|
||||
</if>
|
||||
<if test="statusFlag != null" >
|
||||
statusFlag = #{statusFlag},
|
||||
</if>
|
||||
<if test="pinResult != null" >
|
||||
pResult = #{pinResult},
|
||||
</if>
|
||||
</set>
|
||||
where MID = #{mid} and sysFlag=#{sysFlag}
|
||||
</update>
|
||||
<update id="updateStatic">
|
||||
update archive_other_ext set statusFlag=0 where MID = #{mid} and sysFlag=#{sysFlag}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,38 @@
|
||||
package com.example;
|
||||
|
||||
import com.example.utils.Md5Util;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = com.example.SpringbootDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
Timer timer = new Timer();
|
||||
Date date = new Date();
|
||||
int a = 2;
|
||||
for (int i = 0; i < a; i++) {
|
||||
TimerTask task = new TimerTask() {
|
||||
public void run() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSSS");
|
||||
Long id = Long.valueOf(sdf.format(System.currentTimeMillis()));
|
||||
SimpleDateFormat SycTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
System.out.println("id" + id);
|
||||
System.out.println("SycTime" + SycTime.format(date));
|
||||
}
|
||||
};
|
||||
timer.schedule(task, 2000);//延迟2秒执行
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue