初始化
parent
d1f42eff87
commit
8ca06f01b7
@ -1,27 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
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;
|
||||
//扩展唯一标识
|
||||
private String SoleKey;
|
||||
|
||||
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
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;
|
||||
//唯一主键
|
||||
private String SoleKey;
|
||||
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
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 jzh;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//出院科室
|
||||
private String deptName;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
//住院时间
|
||||
private String admissionDateTime;
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package com.example.duplicate.controller.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class UploadBatchFileParam {
|
||||
|
||||
private String uploadFileParams;
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
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;
|
||||
|
||||
@ApiModelProperty(value="异常信息",name="errorInfo", required=false)
|
||||
private String errorInfo;
|
||||
|
||||
@ApiModelProperty(value="异常信息图片",name="errorImage",required=false)
|
||||
private String errorImage;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
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,19 @@
|
||||
package com.example.duplicate.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName TscanAssort
|
||||
* @Description 文件信息
|
||||
* @Author linjj
|
||||
* @Date 2025/9/25 15:40
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class TscanAssortVo {
|
||||
|
||||
//文件名
|
||||
private String scanPage;
|
||||
//分段id
|
||||
private String assortId;
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package com.example.duplicate.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName medicalCompensateVo
|
||||
* @Description 补偿返回
|
||||
* @Author linjj
|
||||
* @Date 2025/7/25 14:48
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class medicalCompensateVo {
|
||||
//采集器id
|
||||
private String sysFlag;
|
||||
//任务id
|
||||
private String otherId;
|
||||
private String id;
|
||||
//住院号
|
||||
private String inpNo;
|
||||
//住院次数
|
||||
private String visitId;
|
||||
//记帐号
|
||||
private String patientId;
|
||||
//出院科室
|
||||
private String deptName;
|
||||
//出院时间
|
||||
private String dischargeDateTime;
|
||||
//患者姓名
|
||||
private String name;
|
||||
//住院时间
|
||||
private String admissionDateTime;
|
||||
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
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);
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
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(@Param("startTime")String startTime, @Param("entTime")String entTime);
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
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 com.example.duplicate.controller.vo.medicalCompensateVo;
|
||||
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);
|
||||
|
||||
List<medicalCompensateVo> medicalCompensate(@Param("statusFlag")int statusFlag);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.example.duplicate.infrastructure.dao;
|
||||
|
||||
import com.example.duplicate.controller.vo.CommomtableVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CommomtableMapper
|
||||
* @Description commomtable患者基础数据
|
||||
* @Author linjj
|
||||
* @Date 2025/9/25 15:15
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommomtableMapper {
|
||||
|
||||
|
||||
//轮询根据时间获取患者信息
|
||||
List<CommomtableVo> getCommomtable(@Param("startTime")String startTime, @Param("entTime")String entTime);
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.example.duplicate.infrastructure.dao;
|
||||
|
||||
import com.example.duplicate.controller.vo.CommomtableVo;
|
||||
import com.example.duplicate.controller.vo.TscanAssortVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CommomtableMapper
|
||||
* @Description commomtable患者基础数据
|
||||
* @Author linjj
|
||||
* @Date 2025/9/25 15:15
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface TscanAssortMapper {
|
||||
/**
|
||||
* @Author: linjj
|
||||
* @Description: 查询患者的图像信息
|
||||
* @DateTime: 2025/9/25 15:51
|
||||
* @Params: [patientId, isDel]
|
||||
* @Return java.util.List<com.example.duplicate.controller.vo.TscanAssortVo>
|
||||
*/
|
||||
List<TscanAssortVo> getScanPage(@Param("patientId")String patientId,@Param("isDel")String isDel);
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
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(String startTime,String entTime,String collectId);
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
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 点 ------------------ */
|
||||
@Bean
|
||||
public JobDetail dailyJob() {
|
||||
return JobBuilder.newJob(DailyTaskQuartz.class)
|
||||
.withIdentity("DailyTaskQuartz")
|
||||
.storeDurably()
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Trigger dailyTrigger() {
|
||||
return TriggerBuilder.newTrigger()
|
||||
.forJob(dailyJob())
|
||||
.withIdentity("DailyTaskQuartzTrigger")
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule("0 0 0 * * ?")) // 每天 00:00:00
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.example.quartz;
|
||||
|
||||
import com.example.duplicate.service.MedicalAdviceService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @ClassName DailyTaskQuartz
|
||||
* @Description 补偿首页数据
|
||||
* @Author linjj
|
||||
* @Date 2025/7/25 14:24
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class DailyTaskQuartz extends QuartzJobBean {
|
||||
|
||||
@Resource
|
||||
private MedicalAdviceService medicalAdviceService;
|
||||
|
||||
/**
|
||||
* 每天补偿首页未完成的任务
|
||||
* @param jobExecutionContext
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
medicalAdviceService.medicalCompensate();
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
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,100 @@
|
||||
package com.example.utils;
|
||||
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.rendering.PDFRenderer;
|
||||
import org.ofdrw.layout.OFDDoc;
|
||||
import org.ofdrw.layout.PageLayout;
|
||||
import org.ofdrw.layout.element.*;
|
||||
import org.ofdrw.layout.element.canvas.Canvas;
|
||||
import org.ofdrw.core.basicStructure.pageObj.Page;
|
||||
import net.sourceforge.tess4j.ITesseract;
|
||||
import net.sourceforge.tess4j.Tesseract;
|
||||
import net.sourceforge.tess4j.Word;
|
||||
import org.ofdrw.layout.element.canvas.Drawer;
|
||||
import org.ofdrw.layout.element.canvas.FontSetting;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PdfToDoubleLayerOFD
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2025/8/4 14:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class PdfToDoubleLayerOFD {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String pdfPath = "E:\\work\\pdf\\1.pdf"; // 源 PDF
|
||||
String ofdPath = "E:\\work\\pdf\\2.ofd"; // 目标 OFD
|
||||
String tessPath = "E:\\work\\ocr"; // Tesseract 语言包目录
|
||||
|
||||
//加载 PDF
|
||||
PDDocument pdfDoc = PDDocument.load(new File(pdfPath));
|
||||
PDFRenderer renderer = new PDFRenderer(pdfDoc);
|
||||
//初始化 OCR
|
||||
ITesseract tesseract = new Tesseract();
|
||||
tesseract.setDatapath(tessPath);
|
||||
tesseract.setLanguage("chi_sim+eng");
|
||||
|
||||
try (OFDDoc ofdDoc = new OFDDoc(Paths.get(ofdPath))) {
|
||||
for (int i = 0; i < pdfDoc.getNumberOfPages(); i++) {
|
||||
try {
|
||||
BufferedImage image = renderer.renderImageWithDPI(i, 150);
|
||||
if (image == null) {
|
||||
System.err.println("警告: 第 " + (i+1) + " 页渲染失败");
|
||||
continue;
|
||||
}
|
||||
|
||||
File tempImage = File.createTempFile("page", ".png");
|
||||
ImageIO.write(image, "png", tempImage);
|
||||
|
||||
PageLayout layout = new PageLayout((double) image.getWidth(), (double) image.getHeight());
|
||||
ofdDoc.setDefaultPageLayout(layout);
|
||||
|
||||
// 添加图像层
|
||||
ofdDoc.add(new Img(tempImage.toPath())
|
||||
.setPosition(Position.Absolute)
|
||||
.setX(0d).setY(0d)
|
||||
.setWidth((double) image.getWidth())
|
||||
.setHeight((double) image.getHeight()));
|
||||
|
||||
// 添加文字层
|
||||
Canvas canvas = new Canvas((double) image.getWidth(), (double) image.getHeight());
|
||||
int finalI = i;
|
||||
canvas.setDrawer(ctx -> {
|
||||
try {
|
||||
List<Word> words = tesseract.getWords(image, ITesseract.RenderedFormat.HOCR.ordinal());
|
||||
if (words.isEmpty()) {
|
||||
System.err.println("警告: 第 " + (finalI +1) + " 页OCR未识别到文字");
|
||||
}
|
||||
for (Word word : words) {
|
||||
double x = word.getBoundingBox().getX();
|
||||
double y = image.getHeight() - word.getBoundingBox().getY() - word.getBoundingBox().getHeight();
|
||||
ctx.setFont(FontSetting.getInstance(8.0));
|
||||
ctx.setFillColor(0, 0, 0);
|
||||
ctx.fillText(word.getText(), x, y);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("OCR处理错误: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
ofdDoc.add(canvas);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("处理第 " + (i+1) + " 页时出错: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
pdfDoc.close();
|
||||
System.out.println("✅ 双层 OFD 完成:" + ofdPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,96 +0,0 @@
|
||||
<?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>
|
||||
<if test="SoleKey != null">
|
||||
SoleKey,
|
||||
</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>
|
||||
<if test="SoleKey != null">
|
||||
#{SoleKey,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 Source IN (#{collectId, jdbcType=NVARCHAR})
|
||||
</delete>
|
||||
|
||||
<select id="getDetailBySerialNumber" resultType="com.example.duplicate.controller.param.ArchiveDetailDto">
|
||||
select * from archive_detail where SoleKey=#{serialNumber}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,20 +0,0 @@
|
||||
<?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>=#{startTime} and discharge_date_time <=#{entTime}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,121 +0,0 @@
|
||||
<?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>
|
||||
<select id="medicalCompensate" resultType="com.example.duplicate.controller.vo.medicalCompensateVo">
|
||||
SELECT
|
||||
a.*,other.ID as otherId,other.sysFlag
|
||||
FROM
|
||||
archive_other_ext other
|
||||
LEFT JOIN archive_master a ON a.id = other.MID
|
||||
WHERE
|
||||
statusFlag = #{statusFlag}
|
||||
AND a.discharge_date_time >= DATEADD(DAY, -1, GETDATE()) -- 24小时前
|
||||
AND a.discharge_date_time < GETDATE() -- 不包含未来
|
||||
</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>
|
||||
<if test="errorInfo != null" >
|
||||
errorInfo = #{errorInfo},
|
||||
</if>
|
||||
<if test="errorImage != null" >
|
||||
errorImage = #{errorImage},
|
||||
</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,11 @@
|
||||
<?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.CommomtableMapper">
|
||||
|
||||
|
||||
<select id="getCommomtable" resultType="com.example.duplicate.controller.vo.CommomtableVo">
|
||||
select * from commomtable WHERE dis_date>=#{startTime} and dis_date <=#{entTime}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,11 @@
|
||||
<?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.TscanAssortMapper">
|
||||
|
||||
|
||||
<select id="getScanPage" resultType="com.example.duplicate.controller.vo.TscanAssortVo">
|
||||
SELECT * FROM t_scan_assort WHERE patient_id=#{patientId} AND is_del=#{isDel}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue