commit acacab53df5b1aa09e4ff9f033b7040e47afa8ce Author: wyb <1977763549@qq.com> Date: Sun Jan 19 19:20:56 2025 +0800 feat:init and 英德中医院lis任务同步与修复 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a8a1e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +docus-services/docus-services-system1/ + +### IntelliJ IDEA ### +*.log +.idea +*.iws +*.iml +*.ipr +mvnw* +*.cmd +*.mvn +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ +logs* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/assembly.xml b/assembly.xml new file mode 100644 index 0000000..b6fb827 --- /dev/null +++ b/assembly.xml @@ -0,0 +1,73 @@ + + + exe + + dir + + false + + + + + /lib + ${basedir}/target/lib + + + + /config + ${basedir}/target/resources + 0755 + + *.xml + *.yml + *.properties + + + + + /dataConfig + ${basedir}/target/dataConfig + 0755 + + *.json + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.bat + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.xml + + + + + / + ${basedir} + 0755 + + *.exe + + + + + ${basedir}/target + / + 0755 + + ${project.build.finalName}.jar + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f23dbf6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,360 @@ + + + + com.docus + docus-bom + 1.0-SNAPSHOT + + 4.0.0 + + docus-task-ydzyy + + + + com.docus + docus-knife4j-starter + + + + org.apache.cxf + cxf-spring-boot-starter-jaxws + 3.3.4 + + + + org.dom4j + dom4j + 2.1.1 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + checker-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + + + org.springframework.boot + spring-boot-starter-web + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.0 + + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.4.0 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + HdrHistogram + org.hdrhistogram + + + jsr305 + com.google.code.findbugs + + + + + mysql + mysql-connector-java + 8.0.28 + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + + + com.alibaba + druid + 1.2.4 + compile + + + com.baomidou + mybatis-plus-generator + 3.4.1 + compile + + + org.apache.velocity + velocity-engine-core + 2.0 + + + com.xuxueli + xxl-job-core + + + com.docus + docus-base-starter + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-tool-starter + + + + com.docus + docus-shiro-starter + + + + com.docus + docus-base-starter + + + springfox-core + io.springfox + + + springfox-schema + io.springfox + + + springfox-spi + io.springfox + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + junit + junit + test + + + + + com.microsoft.sqlserver + sqljdbc4 + 4.0 + + + + + com.oracle + ojdbc6 + 11.2.0.4.0 + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.4 + + ZIP + + + non-exists + non-exists + + + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + target/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + **/*.* + + + + ${project.build.directory}/resources + + + + copy-bin + package + + copy-resources + + + + + src/main/resources + true + + bin/*.xml + *.yml + bin/*.bat + + + + ${project.build.directory}/resources + + + + copy-data-config + package + + copy-resources + + + + + ../../dataConfig + true + + + ${project.build.directory}/dataConfig + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.yml + + + + + + maven-assembly-plugin + + + + ${project.artifactId} + false + + assembly.xml + + + make-assembly + package + + single + + + + + + + + + + + dev + + prod + + + true + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java new file mode 100644 index 0000000..e686995 --- /dev/null +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -0,0 +1,28 @@ +package com.docus.server; + + +import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; + +import java.util.Properties; + + +@Slf4j +@SpringBootApplication(scanBasePackages = {"com.docus"}) +@MapperScan("com.docus.server.**.mapper") +@EnableFeignClients(basePackages = {"com.docus"}) +@EnableAsync +public class AppRunBootstrap { + public static void main(String[] args) { + Properties props = System.getProperties(); + props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1"); + props.setProperty("UseSunHttpHandler", "true"); + System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(AppRunBootstrap.class, args); + } + +} diff --git a/src/main/java/com/docus/server/XxlJobConfig.java b/src/main/java/com/docus/server/XxlJobConfig.java new file mode 100644 index 0000000..ca82a44 --- /dev/null +++ b/src/main/java/com/docus/server/XxlJobConfig.java @@ -0,0 +1,69 @@ +package com.docus.server; +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/5/7 16:23 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/5/7 16:23 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ + + + +@Configuration +public class XxlJobConfig { + private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + + @Value("${xxl.job.accessToken}") + private String accessToken; + + @Value("${xxl.job.executor.appname}") + private String appname; + + @Value("${xxl.job.executor.address}") + private String address; + + @Value("${xxl.job.executor.ip}") + private String ip; + + @Value("${xxl.job.executor.port}") + private int port; + + @Value("${xxl.job.executor.logpath}") + private String logPath; + + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + + @Bean + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppname(appname); + xxlJobSpringExecutor.setAddress(address); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + +} diff --git a/src/main/java/com/docus/server/archive/entity/AfCollectTask.java b/src/main/java/com/docus/server/archive/entity/AfCollectTask.java new file mode 100644 index 0000000..737fff5 --- /dev/null +++ b/src/main/java/com/docus/server/archive/entity/AfCollectTask.java @@ -0,0 +1,102 @@ +package com.docus.server.archive.entity; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +@Data + +public class AfCollectTask implements Serializable { + + + @ApiModelProperty(value = "id 雪花算法") + private Long id; + + + @ApiModelProperty(value = "病案主键") + private String patientId; + + @ApiModelProperty(value = "af_archive_detail表id") + private Long afArchiveDetailId; + + @ApiModelProperty(value = "来源 1护理文书,2 (HIS)电子病历,3 Pacs检查,4心电系统,5手麻系统,6 Lis检验,7临床首页,8长期医嘱, 9临时医嘱,10 省病案统计系统首页,11 扫描首页;") + private String sysflag; + + @ApiModelProperty(value = "开始时间") + private Date startTime; + + @ApiModelProperty(value = "结束时间") + private Date endTime; + + + @ApiModelProperty(value = "任务状态 0:未开始,1:正在采集,2:采集错误,3采集完成") + private String state; + + + @ApiModelProperty(value = "同步时间") + private Date syncTime; + + + @ApiModelProperty(value = "最新重新采集时间") + private Date recollectTime; + + @ApiModelProperty(value = "最新重新采集人") + private String recollectName; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "presult") + private String presult; + + @ApiModelProperty(value = "报告唯一单号") + private String c1; + + @ApiModelProperty(value = "文件名称") + private String c2; + + + @ApiModelProperty(value = "记账号") + private String c3; + + + @ApiModelProperty(value = "c4") + private String c4; + + @ApiModelProperty(value = "c5") + private String c5; + + + @ApiModelProperty(value = "c6,英德中医院的fileTitle") + private String c6; + + + @ApiModelProperty(value = "c7") + private String c7; + + + @ApiModelProperty(value = "c8") + private String c8; + + @ApiModelProperty(value = "c9") + private String c9; + + + @ApiModelProperty(value = "c10 用作采集器完成任务时的采集器key") + private String c10; + + @ApiModelProperty(value = "c9") + private Date t1; + + @ApiModelProperty(value = "c9") + private Date t2; + + @ApiModelProperty(value = "任务耗时") + private Long consumingTime; + + @ApiModelProperty(value = "任务创建时间") + private Date createTime; +} diff --git a/src/main/java/com/docus/server/archive/entity/TBasic.java b/src/main/java/com/docus/server/archive/entity/TBasic.java new file mode 100644 index 0000000..9bece4f --- /dev/null +++ b/src/main/java/com/docus/server/archive/entity/TBasic.java @@ -0,0 +1,162 @@ +package com.docus.server.archive.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 病案基本信息 + *

+ * + * @author jiashi + * @since 2021-04-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TBasic对象", description = "病案基本信息") +public class TBasic implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "病案主键") + private String patientId; + + @ApiModelProperty(value = "住院次数") + private Integer admissTimes; + + @ApiModelProperty(value = "病案号") + private String inpatientNo; + + @ApiModelProperty(value = "住院ID号") + private String admissId; + + @ApiModelProperty(value = "患者姓名") + private String name; + + @ApiModelProperty(value = "盘号") + private String ph; + + @ApiModelProperty(value = "性别") + private String sex; + + @ApiModelProperty(value = "年龄_岁") + private Integer age; + + @ApiModelProperty(value = "年龄_月") + private Integer ageMonth; + + @ApiModelProperty(value = "年龄_天") + private Integer ageDay; + + @ApiModelProperty(value = "身份证") + private String idCard; + + @ApiModelProperty(value = "手机号码") + private String telphone; + + @ApiModelProperty(value = "住院日期") + private Date admissDate; + + @ApiModelProperty(value = "住院科室") + private String admissDept; + + @ApiModelProperty(value = "住院科室名称") + private String admissDeptName; + + @ApiModelProperty(value = "出院日期") + private Date disDate; + + @ApiModelProperty(value = "出院科室") + private String disDept; + + @ApiModelProperty(value = "出院科室名称") + private String disDeptName; + + @ApiModelProperty(value = "实际住院天数") + private Integer admissDays; + + @ApiModelProperty(value = "主管医生") + private String attending; + + @ApiModelProperty(value = "主管医生名称") + private String attendingName; + + @ApiModelProperty(value = "主要诊断编码") + private String mainDiagCode; + + @ApiModelProperty(value = "主要诊断名称") + private String mainDiagName; + + @ApiModelProperty(value = "主要手术编码") + private String mainOperateCode; + + @ApiModelProperty(value = "主要手术名称") + private String mainOperateName; + + @ApiModelProperty(value = "是否死亡") + private Integer isDead; + + @ApiModelProperty(value = "是否作废(0:否,1:是)") + private Integer isCancel; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "是否归档 1:已归档,0:未归档") + private Integer isArchive; + + @ApiModelProperty(value = "归档时间") + private Date archiveTime; + + @ApiModelProperty(value = "文件来源 1:af_archive_detail,2:t_scan_assort") + private Integer fileSource; + + @ApiModelProperty(value = "完整性描述") + private String integrityDesc; + + private String bColumn1; + + private String bColumn2; + + private String bColumn3; + + private String bColumn4; + + private String bColumn5; + + private Integer bColumn6; + + private Integer bColumn7; + + private Integer bColumn8; + + private Integer bColumn9; + + private Integer bColumn10; + + @ApiModelProperty(value = "姓名缩写(内部构成)") + private String nameSpell; + + @ApiModelProperty(value = "性别名称") + private String sexName; + + @ApiModelProperty(value = "记账号") + private String jzh; + + @ApiModelProperty(value = "外部id") + private String externalId; + + @ApiModelProperty(value = "档案文件存储类型,1:pdf(默认)2:图片") + private Integer archiveFileStorageType; + + @ApiModelProperty(value = "是否标记编码 0否,1是") + private Integer isCoder; +} diff --git a/src/main/java/com/docus/server/archive/enums/SysFlagType.java b/src/main/java/com/docus/server/archive/enums/SysFlagType.java new file mode 100644 index 0000000..2cfd1e8 --- /dev/null +++ b/src/main/java/com/docus/server/archive/enums/SysFlagType.java @@ -0,0 +1,24 @@ +package com.docus.server.archive.enums; + +import lombok.Getter; + +/** + * @author YongBin Wen + * @date 2025/1/16 14:38 + */ +@Getter +public enum SysFlagType { + /** + * 检验报告任务类型 + */ + LIS("6"); + + /** + * 采集任务类型 + */ + private final String type; + + SysFlagType(String type) { + this.type = type; + } +} diff --git a/src/main/java/com/docus/server/archive/mapper/AfCollectTaskMapper.java b/src/main/java/com/docus/server/archive/mapper/AfCollectTaskMapper.java new file mode 100644 index 0000000..c40b0a7 --- /dev/null +++ b/src/main/java/com/docus/server/archive/mapper/AfCollectTaskMapper.java @@ -0,0 +1,26 @@ +package com.docus.server.archive.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.docus.server.archive.entity.AfCollectTask; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 采集任务 表mapper + * + * @author wyb + */ +@DS("archive-mysql") +public interface AfCollectTaskMapper { + + int saveBatch(@Param("tasks") List collectTasks); + + int update(@Param("tasks") List collectTasks); + + List findByPatientIds(@Param("patientIdList") List patientIdList); + + int cancelTask(@Param("taskIds") List taskIds); + + int cancelFile(@Param("taskIds") List taskIds); +} diff --git a/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java b/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java new file mode 100644 index 0000000..ce9096b --- /dev/null +++ b/src/main/java/com/docus/server/archive/mapper/TBasicMapper.java @@ -0,0 +1,20 @@ +package com.docus.server.archive.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.docus.server.archive.entity.TBasic; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 患者基础信息表mapper + * + * @author wyb + */ +@DS("archive-mysql") +public interface TBasicMapper { + + List getByDisDate(@Param("start") String start,@Param("end") String end); + + List getByPatientIds(@Param("patientIdList") List patientIdList); +} diff --git a/src/main/java/com/docus/server/synclis/controller/LisTaskController.java b/src/main/java/com/docus/server/synclis/controller/LisTaskController.java new file mode 100644 index 0000000..98d5ee8 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/controller/LisTaskController.java @@ -0,0 +1,61 @@ +package com.docus.server.synclis.controller; + +import com.docus.core.util.Func; +import com.docus.infrastructure.web.api.CommonResult; +import com.docus.server.archive.entity.TBasic; +import com.docus.server.archive.mapper.TBasicMapper; +import com.docus.server.synclis.service.LisService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @author YongBin Wen + * @date 2025/1/16 17:10 + */ +@RestController +@Api(tags = "LIS检验报告视图任务") +@RequestMapping("/ydzyylistask") +@Slf4j +public class LisTaskController { + @Resource + private LisService lisService; + @Resource + private TBasicMapper basicMapper; + + @ApiOperation(value = "根据患者主键,同步") + @GetMapping("/syncFullLisByPatientIds") + public CommonResult syncFullLisByPatientIds(@RequestBody List patientIds){ + if(Func.isEmpty(patientIds)){ + return CommonResult.failed("请传入正确的患者病案主键!"); + } + List basicList = basicMapper.getByPatientIds(patientIds); + for (TBasic basic : basicList) { + lisService.syncFullTask(basic); + } + + return CommonResult.success("同步完成!"); + } + + + @ApiOperation(value = "修订门诊任务和文件") + @GetMapping("/revisionMzTaskAndFile") + public CommonResult revisionMzTaskAndFile() { + String start = "2022-10-01 00:00:00"; + String end = Func.formatDateTime(new Date()); + List tbasics = basicMapper.getByDisDate(start, end); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 修订门诊任务和文件。出院时间:{} 至 {} 共 {} 条数据!", start, end, tbasics.size()); + for (TBasic tbasic : tbasics) { + lisService.revisionMzTaskAndFile(tbasic); + } + return CommonResult.success("修订完成!"); + } +} diff --git a/src/main/java/com/docus/server/synclis/converter/LisViewConverter.java b/src/main/java/com/docus/server/synclis/converter/LisViewConverter.java new file mode 100644 index 0000000..6342344 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/converter/LisViewConverter.java @@ -0,0 +1,40 @@ +package com.docus.server.synclis.converter; + +import com.docus.core.util.Func; +import com.docus.server.archive.entity.AfCollectTask; +import com.docus.server.archive.entity.TBasic; +import com.docus.server.archive.enums.SysFlagType; +import com.docus.server.synclis.entity.LisView; + +import java.util.Date; + + +/** + * @author YongBin Wen + * @date 2025/1/16 14:33 + */ +public class LisViewConverter { + public static AfCollectTask convertTask(LisView view, TBasic basic) { + if (view == null) { + return null; + } + AfCollectTask task = new AfCollectTask(); + task.setPatientId(basic.getPatientId()); + task.setSysflag(SysFlagType.LIS.getType()); + task.setSyncTime(new Date()); + task.setState("0"); + task.setPresult(""); + task.setC1(view.getPatientId()); + task.setC2(view.getLabNum()); + task.setC3(view.getName()); + task.setC4(view.getLabNum()); + task.setC5(basic.getJzh()); + task.setC6(view.getCheckName()); + task.setC7(view.getPatSource()); + String pattern1 = "yyyy-MM-dd"; + String pattern2 = "yyyy-MM-dd HH:mm:ss"; + task.setT1(pattern1.length() == view.getReqDate().length() ? Func.parseDate(view.getAuditTime(), pattern1) : Func.parseDate(view.getAuditTime(), pattern2)); + task.setT2(Func.parseDate(view.getAuditTime(), pattern2)); + return task; + } +} diff --git a/src/main/java/com/docus/server/synclis/entity/LisView.java b/src/main/java/com/docus/server/synclis/entity/LisView.java new file mode 100644 index 0000000..6bcca3c --- /dev/null +++ b/src/main/java/com/docus/server/synclis/entity/LisView.java @@ -0,0 +1,52 @@ +package com.docus.server.synclis.entity; + +import lombok.Data; + +/** + * @author YongBin Wen + * @date 2025/1/16 11:05 + */ +@Data +public class LisView { + /** + * lis系统患者身份id + */ + private String patientId; + /** + * 检验报告号码 + */ + private String labNum; + /** + * 姓名 + */ + private String name; + /** + * 病案号 + */ + private String hstNum; + /** + * 申请号 + */ + private String reqNum; + /** + * 申请时间 ,格式目前发现了两种 yyyy-MM-dd 和 yyyy-MM-dd HH:mm:ss + */ + private String reqDate; + /** + * 审核时间 + */ + private String auditTime; + /** + * 检验名称 + */ + private String checkName; + /** + * 患者来源 + */ + private String patSource; + /** + * 身份证号码 + */ + private String idCard; + +} diff --git a/src/main/java/com/docus/server/synclis/job/LisTaskSyncJob.java b/src/main/java/com/docus/server/synclis/job/LisTaskSyncJob.java new file mode 100644 index 0000000..b15ceb6 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/job/LisTaskSyncJob.java @@ -0,0 +1,43 @@ +package com.docus.server.synclis.job; + +import com.docus.core.util.Func; +import com.docus.server.archive.entity.TBasic; +import com.docus.server.archive.mapper.TBasicMapper; +import com.docus.server.synclis.service.LisService; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @author YongBin Wen + * @date 2025/1/16 16:44 + */ +@Slf4j +@Component +public class LisTaskSyncJob { + @Resource + private LisService lisService; + @Resource + private TBasicMapper tBasicMapper; + + @XxlJob("lisTaskSyncJob") + private void lisTaskSyncJob() { + String start = "2022-10-01 00:00:00"; + String end = Func.formatDateTime(new Date()); + + try { + List tbasics = tBasicMapper.getByDisDate(start, end); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LIS视图任务同步开始。出院时间:{} 至 {} 共 {} 条数据!", start, end, tbasics.size()); + for (TBasic tbasic : tbasics) { + lisService.syncViewTask(tbasic); + } + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LIS视图任务结束同步。"); + } catch (Exception ex) { + log.error(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LIS视图任务同步出错了," + ex.getMessage(), ex); + } + } +} diff --git a/src/main/java/com/docus/server/synclis/mapper/LisViewMapper.java b/src/main/java/com/docus/server/synclis/mapper/LisViewMapper.java new file mode 100644 index 0000000..8407519 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/mapper/LisViewMapper.java @@ -0,0 +1,68 @@ +package com.docus.server.synclis.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.docus.server.synclis.entity.LisView; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * v_LISReport_YDZYView 视图的定义是,其中 限制了查询的数据范围 a.crt_time >= CONVERT(DATETIME,DATEADD(MONTH,-3,GETDATE())) , + * 如果要查询详细的数据,还是要从原始数据入手,getFullZyData()和 getFullMzData() 就是限制了这样的情况 + *

+ * SELECT a.patient_id,a.lab_num,b.name,a.hst_num,ISNULL(a.req_num,'') AS req_num, + * a.req_date,CONVERT(VARCHAR(19),a.audit_time,120) AS audit_time, + * dbo.fnGetChkTypeNameByLabNum(a.lab_num) AS CheckName,ISNULL(c.name,'') AS PatSource, + * ISNULL(b.id_card,'') as IDCARD + * FROM hylisdb..patient_register a WITH(NOLOCK) + * JOIN hylisdb..patient_baseinfo b WITH(NOLOCK) ON a.patient_id=b.patient_id + * JOIN hylisdb..ill_type c ON a.send_type=c.type_id + * WHERE a.crt_time >= CONVERT(DATETIME,DATEADD(MONTH,-3,GETDATE())) + * AND a.proc_flag = '8'; + * + * @author YongBin Wen + * @date 2025/1/16 11:21 + */ +@DS("ydzyy-lis-sqlserver") +public interface LisViewMapper { + /** + * 查询lis视图患者住院报告,根据住院号和出入院时间(报告申请时间在其范围内) + * + * @param inpatientNo 住院阿红 + * @param admissDate 入院日期 + * @param disDate 出院日期 + * @return 报告数据 + */ + List getZyDataFromView(@Param("inpatientNo") String inpatientNo, @Param("admissDate") String admissDate, @Param("disDate") String disDate); + + /** + * 查询lis视图患者门(急)诊报告,根据身份证号码和报告申请时间 + * + * @param idCard 身份证件号码 + * @param startDate 开始时间 + * @param endDate 结束时间 + * @return 报告数据 + */ + List getMzDataFromView(@Param("idCard") String idCard, @Param("startDate") String startDate, @Param("endDate") String endDate); + + + /** + * 查询lis患者住院报告,根据住院号和出入院时间(报告申请时间在其范围内) + * + * @param inpatientNo 住院阿红 + * @param admissDate 入院日期 + * @param disDate 出院日期 + * @return 报告数据 + */ + List getFullZyData(@Param("inpatientNo") String inpatientNo, @Param("admissDate") String admissDate, @Param("disDate") String disDate); + + /** + * 查询lis患者门(急)诊报告,根据身份证号码和报告申请时间 + * + * @param idCard 身份证件号码 + * @param startDate 开始时间 + * @param endDate 结束时间 + * @return 报告数据 + */ + List getFullMzData(@Param("idCard") String idCard, @Param("startDate") String startDate, @Param("endDate") String endDate); +} diff --git a/src/main/java/com/docus/server/synclis/service/LisService.java b/src/main/java/com/docus/server/synclis/service/LisService.java new file mode 100644 index 0000000..8161f01 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/service/LisService.java @@ -0,0 +1,29 @@ +package com.docus.server.synclis.service; + +import com.docus.server.archive.entity.TBasic; + +/** + * @author YongBin Wen + * @date 2025/1/16 15:06 + */ +public interface LisService { + /** + * 同步视图任务 + * + * @param tBasic 患者信息 + */ + void syncViewTask(TBasic tBasic); + + /** + * 同步完整任务 + * + * @param tBasic 患者信息 + */ + void syncFullTask(TBasic tBasic); + + /** + * 修订门诊任务,将任务和文件作废 + * @param tbasic 患者信息 + */ + void revisionMzTaskAndFile(TBasic tbasic); +} diff --git a/src/main/java/com/docus/server/synclis/service/impl/LisServiceImpl.java b/src/main/java/com/docus/server/synclis/service/impl/LisServiceImpl.java new file mode 100644 index 0000000..c6e45b9 --- /dev/null +++ b/src/main/java/com/docus/server/synclis/service/impl/LisServiceImpl.java @@ -0,0 +1,234 @@ +package com.docus.server.synclis.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.redis.service.IdService; +import com.docus.server.archive.entity.AfCollectTask; +import com.docus.server.archive.entity.TBasic; +import com.docus.server.archive.enums.SysFlagType; +import com.docus.server.archive.mapper.AfCollectTaskMapper; +import com.docus.server.synclis.converter.LisViewConverter; +import com.docus.server.synclis.entity.LisView; +import com.docus.server.synclis.mapper.LisViewMapper; +import com.docus.server.synclis.service.LisService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Collectors; + +/** + * @author YongBin Wen + * @date 2025/1/16 15:06 + */ +@Service +@Slf4j +public class LisServiceImpl implements LisService { + @Resource + private LisViewMapper lisViewMapper; + @Resource + private AfCollectTaskMapper afCollectTaskMapper; + @Resource + private IdService idService; + + private final static ReentrantLock SAVE_TASK_LOCK = new ReentrantLock(); + + @Override + public void syncViewTask(TBasic tBasic) { + syncViewZyTask(tBasic); + syncViewMzTask(tBasic); + } + + @Override + public void syncFullTask(TBasic tBasic) { + syncFullZyTask(tBasic); + syncFullMzTask(tBasic); + } + + @Override + public void revisionMzTaskAndFile(TBasic tbasic) { + String patientId = tbasic.getPatientId(); + List mzSource= Arrays.asList( "门诊","急诊"); + Date admissDate = tbasic.getAdmissDate(); + String admissDateStr = Func.formatDateTime(admissDate); + LocalDateTime admissLocalDateTime = Func.parseDateTime(admissDateStr); + LocalDateTime startLocalDateTime = admissLocalDateTime.plusDays(-3); + String start = startLocalDateTime.toLocalDate().toString() + " 00:00:00"; + Date startDateTime = Func.parseDate(start,"yyyy-MM-dd HH:mm:ss"); + + List collectTasks = afCollectTaskMapper.findByPatientIds(Collections.singletonList(patientId)); + List mzCollectTasks=collectTasks.stream().filter(tsk-> + SysFlagType.LIS.getType().equals(tsk.getSysflag()) && mzSource.contains(tsk.getC7()) + ).collect(Collectors.toList()); + if(Func.isEmpty(mzCollectTasks)){ + return; + } + List cancelTasks=new ArrayList<>(); + + for (AfCollectTask mzCollectTask : mzCollectTasks) { + Date reqDate = mzCollectTask.getT1(); + // 如果申请时间不在入院前三天范围内,则作废 + if(reqDate.after(admissDate) || reqDate.before(startDateTime)){ + cancelTasks.add(mzCollectTask); + } + + } + if(Func.isEmpty(cancelTasks)){ + return; + } + List cancelTaskIds = cancelTasks.stream().map(AfCollectTask::getId).collect(Collectors.toList()); + afCollectTaskMapper.cancelTask(cancelTaskIds); + afCollectTaskMapper.cancelFile(cancelTaskIds); + + } + + public static void main(String[] args) { + TBasic tBasic = new TBasic(); + tBasic.setAdmissDate(new Date()); + new LisServiceImpl().revisionMzTaskAndFile(tBasic); + } + + /** + * 同步视图住院期间报告任务 + */ + private void syncViewZyTask(TBasic tBasic) { + String inpatientNo = tBasic.getInpatientNo(); + Date admissDate = tBasic.getAdmissDate(); + Date disDate = tBasic.getDisDate(); + if (Func.isBlank(inpatientNo) || Objects.isNull(admissDate) || Objects.isNull(disDate)) { + log.warn("LIS同步视图住院任务失败,病案号、入院日期、出院日期 有空数据!患者主键:{}", tBasic.getPatientId()); + return; + } + String admissDateStr = Func.formatDateTime(admissDate); + String disDateStr = Func.formatDateTime(disDate); + List zyDataFromView = lisViewMapper.getZyDataFromView(inpatientNo, admissDateStr, disDateStr); + saveTask(zyDataFromView, tBasic); + } + + + /** + * 同步视图门急诊报告任务,入院前三天的报告 + */ + private void syncViewMzTask(TBasic tBasic) { + String idCard = tBasic.getIdCard(); + Date admissDate = tBasic.getAdmissDate(); + if (Func.isBlank(idCard) || Objects.isNull(admissDate)) { + log.warn("LIS同步视图门(急)诊任务失败,数据身份证号码 或者 入院日期 为空!患者主键:{}", tBasic.getPatientId()); + return; + } + String admissDateStr = Func.formatDateTime(admissDate); + LocalDateTime startLocalDateTime = Func.parseDateTime(admissDateStr).plusDays(-3); + String startLocalDateStr = startLocalDateTime.toLocalDate().toString(); + List mzDataFromView = lisViewMapper.getMzDataFromView(idCard, startLocalDateStr, admissDateStr); + saveTask(mzDataFromView, tBasic); + } + + + private void syncFullZyTask(TBasic tBasic) { + String inpatientNo = tBasic.getInpatientNo(); + Date admissDate = tBasic.getAdmissDate(); + Date disDate = tBasic.getDisDate(); + if (Func.isBlank(inpatientNo) || Objects.isNull(admissDate) || Objects.isNull(disDate)) { + log.warn("LIS同步完整住院任务失败,病案号、入院日期、出院日期 有空数据!患者主键:{}", tBasic.getPatientId()); + return; + } + String admissDateStr = Func.formatDateTime(admissDate); + String disDateStr = Func.formatDateTime(disDate); + List zyDataFromView = lisViewMapper.getFullZyData(inpatientNo, admissDateStr, disDateStr); + saveTask(zyDataFromView, tBasic); + } + + private void syncFullMzTask(TBasic tBasic) { + String idCard = tBasic.getIdCard(); + Date admissDate = tBasic.getAdmissDate(); + if (Func.isBlank(idCard) || Objects.isNull(admissDate)) { + log.warn("LIS同步完整门(急)诊任务失败,数据身份证号码 或者 入院日期 为空!患者主键:{}", tBasic.getPatientId()); + return; + } + String admissDateStr = Func.formatDateTime(admissDate); + LocalDateTime startLocalDateTime = Func.parseDateTime(admissDateStr).plusDays(-3); + String startLocalDateStr = startLocalDateTime.toLocalDate().toString(); + List mzDataFromView = lisViewMapper.getFullMzData(idCard, startLocalDateStr, admissDateStr); + saveTask(mzDataFromView, tBasic); + } + + private void saveTask(List mzDataFromView, TBasic tBasic) { + if (Func.isEmpty(mzDataFromView)) { + return; + } + SAVE_TASK_LOCK.lock(); + try { + List patientIds = Collections.singletonList(tBasic.getPatientId()); + List existsTasks = afCollectTaskMapper.findByPatientIds(patientIds); + List existsLisTasks = existsTasks.stream() + .filter(tsk -> SysFlagType.LIS.getType().equals(tsk.getSysflag())) + .collect(Collectors.toList()); + + List newTaskList = new ArrayList<>(); + List updateTaskList = new ArrayList<>(); + + for (LisView lisView : mzDataFromView) { + AfCollectTask convertTask = LisViewConverter.convertTask(lisView, tBasic); + AfCollectTask existsTask = findExistsTask(existsLisTasks, convertTask); + if (existsTask == null) { + convertTask.setId(idService.getDateSeq()); + convertTask.setCreateTime(new Date()); + newTaskList.add(convertTask); + continue; + } + // 如果任务还在进行 或者 视图审核时间没有增大,不进行更新 + if ("0".equals(existsTask.getState()) || !convertTask.getT2().after(existsTask.getT2())) { + continue; + } + // 更新 + existsTask.setT1(convertTask.getT1()); + existsTask.setT2(convertTask.getT2()); + existsTask.setPresult(""); + existsTask.setSyncTime(new Date()); + updateTaskList.add(existsTask); + } + + + if (Func.isNotEmpty(newTaskList)) { + afCollectTaskMapper.saveBatch(newTaskList); + } + if (Func.isNotEmpty(updateTaskList)) { + afCollectTaskMapper.update(updateTaskList); + } + } catch (Exception ex) { + log.error("保存/修改LIS任务出错了!" + ex.getMessage(), ex); + } finally { + SAVE_TASK_LOCK.unlock(); + } + + } + + /** + * 从已经存在的任务中,根据条件筛选出匹配的任务 + * + * @param existsLisTasks 存在的任务 + * @param convertTask 任务条件 + * @return 已经存在的采集任务 + */ + private AfCollectTask findExistsTask(List existsLisTasks, AfCollectTask convertTask) { + for (AfCollectTask existsLisTask : existsLisTasks) { + if (existsLisTask.getC1().equals(convertTask.getC1()) && + existsLisTask.getC2().equals(convertTask.getC2()) && + existsLisTask.getPatientId().equals(convertTask.getPatientId()) && + existsLisTask.getC3().equals(convertTask.getC3()) && + existsLisTask.getC4().equals(convertTask.getC4())) { + return existsLisTask; + } + } + return null; + } + + +} diff --git a/src/main/resources/bin/auto.bat b/src/main/resources/bin/auto.bat new file mode 100644 index 0000000..4b9678c --- /dev/null +++ b/src/main/resources/bin/auto.bat @@ -0,0 +1,6 @@ +@echo off + + +WinSW.exe status|findstr NonExistent && winsw install + +WinSW.exe status|findstr Stopped && winsw start diff --git a/src/main/resources/bin/install.bat b/src/main/resources/bin/install.bat new file mode 100644 index 0000000..7a651bc --- /dev/null +++ b/src/main/resources/bin/install.bat @@ -0,0 +1,33 @@ +@echo off + +for /f "delims=" %%t in ('winsw.exe status') do set str=%%t +echo %str% + + + +if %str%==Started ( +echo "restart....." +winsw stop +PING 127.0.0.1 -n 10 -w 30000 >NUL +winsw start +) + + + +if %str%==Stopped ( +echo "start....." +winsw start +) + + +if %str%==NonExistent ( +echo "deploy and start....." +winsw install +winsw start +echo c +) + + + + + diff --git a/src/main/resources/bin/jenkins-update.bat b/src/main/resources/bin/jenkins-update.bat new file mode 100644 index 0000000..bc87e74 --- /dev/null +++ b/src/main/resources/bin/jenkins-update.bat @@ -0,0 +1,23 @@ +@echo off + +set parentDir=%1 +echo %parentDir% +if ""==%parentDir% set parentDir=d:\webroot + +set deployDir=%parentDir%\@project.artifactId@ + +set curr_file=%cd% +cd /d %deployDir% +call stop.bat +sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul +cd %curr_file% +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\dataConfig +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar +xcopy /Y/E/I * %deployDir% + +cd /d %deployDir% +call auto.bat +cd %curr_file% + diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat new file mode 100644 index 0000000..58c25cb --- /dev/null +++ b/src/main/resources/bin/start.bat @@ -0,0 +1,21 @@ +set java_opts=-Xms512m -Xmx512m +set key="java_opts" + + +rem 文件不存在,就跳过 +if not exist java-ops.ini goto end + +for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do ( + if "%%i"==%key% set java_opts=%%j) +echo java_opts is : %java_opts% + +:end + +rem 启动java + +java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar + + + + + diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat new file mode 100644 index 0000000..98468a0 --- /dev/null +++ b/src/main/resources/bin/stop.bat @@ -0,0 +1,13 @@ +@echo off + +for /f "delims=" %%t in ('winsw.exe status') do set str=%%t +echo %str% + + + +if %str%==Started ( +winsw stop +@echo wait program stop ..... +PING 127.0.0.1 -n 30 -w 10000 >NUL +) + diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat new file mode 100644 index 0000000..ef249da --- /dev/null +++ b/src/main/resources/bin/update.bat @@ -0,0 +1,19 @@ +@echo off + +set deployDir=%1\docus-task-ydzyy +if %deployDir%=="" set deployDir=d:\webroot\docus-task-ydzyy + +set curr_file=%cd% +cd /d %deployDir% +call stop.bat +cd %curr_file% +sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\dataConfig +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar +xcopy /Y/E/I * %deployDir% + +cd /d %deployDir% +call install.bat + diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml new file mode 100644 index 0000000..01f7586 --- /dev/null +++ b/src/main/resources/bin/winsw.xml @@ -0,0 +1,8 @@ + + docus-task-ydzyy + 生产-嘉时病案无纸化-英德中医院视图任务同步 + 生产-嘉时病案无纸化-英德中医院视图任务同步 + Automatic + %BASE%\start.bat + + \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..12169e8 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,128 @@ +server: + port: 9294 +spring: + application: + name: @artifactId@ + datasource: + dynamic: + primary: archive-mysql + #是否用严格模式,如果启用在味匹配到指定数据源时抛出异常 + strict: false + datasource: + # 多数据源 + archive-mysql: + url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: docus + password: docus702 + driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + type: com.alibaba.druid.pool.DruidDataSource + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超 时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + + ydzyy-lis-sqlserver: + url: jdbc:sqlserver://199.168.91.211:1433;DatabaseName=GCRIS2 + username: wzh + password: Wzh@#2023 + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + type: com.alibaba.druid.pool.DruidDataSource + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超 时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + + ydzyy-hisdb-oracle: + url: jdbc:oracle:thin:@//10.10.100.02:1521/HISDB + username: WZHPL + password: 123456 + driver-class-name: oracle.jdbc.driver.OracleDriver + type: com.alibaba.druid.pool.DruidDataSource + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 5 + # 获取连接超 时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 from dual + + redis: + host: redis.docus.cn + password: JSdocus@702 + cloud: + nacos: + discovery: + server-addr: nacos.docus.cn + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + config: + server-addr: ${spring.cloud.nacos.discovery.server-addr} + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + file-extension: yml + shared-configs: + - comm.${spring.cloud.nacos.config.file-extension} + profiles: + active: dev + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + field-strategy: NOT_EMPTY + db-type: MYSQL +xxl: + job: + accessToken: + admin: + addresses: http://job.docus.cn:8180/xxl-job-admin + executor: + appname: docus-task-ydzyy + address: + ip: + port: 19999 + logretentiondays: 30 + logpath: D:/xxl-job/docus-task-ydzyy + + +docus: + dispose: + # 采集任务的方式(大写) 视图:VIEW 无视图:NO_VIEW,默认为 视图 VIEW + pattern: NO_VIEW + url: + downloadplatform: + makeupdown: http://127.0.0.1:9291/api/down/makeUpDownForDown diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..5cb6f99 --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,2 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..e421675 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,76 @@ + + + docus-task-ydzyy + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}%d.%i.log + + 500MB + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/AfCollectTaskMapper.xml b/src/main/resources/mapper/AfCollectTaskMapper.xml new file mode 100644 index 0000000..bbcc135 --- /dev/null +++ b/src/main/resources/mapper/AfCollectTaskMapper.xml @@ -0,0 +1,54 @@ + + + + + INSERT INTO docus_archivefile.af_collect_task + (id, patient_id, af_archive_detail_id, sysflag,state, sync_time, create_time, remark, pResult, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, T1, T2) + VALUES + + ( + #{task.id}, #{task.patientId},0, #{task.sysflag}, '0', #{task.syncTime}, #{task.createTime}, '', '', + #{task.c1}, #{task.c2}, #{task.c3}, #{task.c4}, #{task.c5}, #{task.c6}, #{task.c7}, #{task.c8}, #{task.c9}, #{task.c10}, #{task.t1}, #{task.t2} + ) + + + + + + + UPDATE docus_archivefile.af_collect_task + SET state=#{task.state}, sync_time=#{task.syncTime}, pResult=#{task.presult}, + C1=#{task.c1}, C2=#{task.c2}, C3=#{task.c3}, C4=#{task.c4}, C5=#{task.c5}, C6=#{task.c6}, C7=#{task.c7}, C8=#{task.c8}, C9=#{task.c9}, C10=#{task.c10}, + T1=#{task.t1}, T2=#{task.t2} + WHERE id=#{task.id} + + + + + UPDATE `docus_archivefile`.`af_collect_task` set state='4' + WHERE id IN + + #{taskId} + + + + UPDATE `docus_archivefile`.`t_scan_assort` SET is_del = '1' + WHERE taskid IN + + #{taskId} + + + + + diff --git a/src/main/resources/mapper/LisViewMapper.xml b/src/main/resources/mapper/LisViewMapper.xml new file mode 100644 index 0000000..31dd22b --- /dev/null +++ b/src/main/resources/mapper/LisViewMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + diff --git a/src/main/resources/mapper/TBasicMapper.xml b/src/main/resources/mapper/TBasicMapper.xml new file mode 100644 index 0000000..5ce16b7 --- /dev/null +++ b/src/main/resources/mapper/TBasicMapper.xml @@ -0,0 +1,43 @@ + + + + + patient_id AS patientId, + admiss_times AS admissTimes, + inpatient_no AS inpatientNo, + admiss_id AS admissId, + admiss_date AS admissDate, + dis_date AS disDate, + admiss_dept_name AS admissDeptName, + dis_dept_name AS disDeptName , + jzh, + name, + id_card AS idCard + + + + + diff --git a/winsw.exe b/winsw.exe new file mode 100644 index 0000000..ba27e3f Binary files /dev/null and b/winsw.exe differ