From 205a0f44d1a7aa51cd46d0b38a26ad6ca4f0a16e Mon Sep 17 00:00:00 2001 From: zhangjing <924187658@qq.com> Date: Tue, 3 Feb 2026 14:39:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E3=80=90=E6=95=B0=E6=8D=AE=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E3=80=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hxhq-modules/hxhq-integration/pom.xml | 130 +++++ .../java/com/hxhq/HxhqIntegrationApplication.java | 25 + .../main/java/com/hxhq/common/EntityConstants.java | 44 ++ .../com/hxhq/controller/ContainerController.java | 46 ++ .../com/hxhq/controller/InstrumentController.java | 46 ++ .../hxhq/controller/ReagentStockController.java | 47 ++ .../src/main/java/com/hxhq/domain/Container.java | 115 ++++ .../src/main/java/com/hxhq/domain/Gsp.java | 633 +++++++++++++++++++++ .../src/main/java/com/hxhq/domain/Instrument.java | 79 +++ .../main/java/com/hxhq/domain/InstrumentPush.java | 100 ++++ .../main/java/com/hxhq/domain/ReagentStock.java | 137 +++++ .../java/com/hxhq/domain/ReagentStockPush.java | 158 +++++ .../src/main/java/com/hxhq/domain/Sj.java | 349 ++++++++++++ .../src/main/java/com/hxhq/domain/SyncLog.java | 77 +++ .../src/main/java/com/hxhq/domain/Yq.java | 148 +++++ .../src/main/java/com/hxhq/domain/vo/TestVO.java | 18 + .../src/main/java/com/hxhq/dto/ContainerDTO.java | 114 ++++ .../main/java/com/hxhq/dto/InstrumentPushDTO.java | 95 ++++ .../java/com/hxhq/dto/ReagentStockPushDTO.java | 129 +++++ .../main/java/com/hxhq/mapper/ContainerMapper.java | 19 + .../src/main/java/com/hxhq/mapper/GspMapper.java | 21 + .../java/com/hxhq/mapper/InstrumentMapper.java | 20 + .../java/com/hxhq/mapper/InstrumentPushMapper.java | 18 + .../java/com/hxhq/mapper/ReagentStockMapper.java | 18 + .../com/hxhq/mapper/ReagentStockPushMapper.java | 19 + .../src/main/java/com/hxhq/mapper/SjMapper.java | 23 + .../main/java/com/hxhq/mapper/SyncLogMapper.java | 18 + .../src/main/java/com/hxhq/mapper/YqMapper.java | 21 + .../java/com/hxhq/service/ContainerService.java | 15 + .../src/main/java/com/hxhq/service/GspService.java | 15 + .../com/hxhq/service/InstrumentPushService.java | 10 + .../java/com/hxhq/service/InstrumentService.java | 15 + .../com/hxhq/service/ReagentStockPushService.java | 10 + .../java/com/hxhq/service/ReagentStockService.java | 15 + .../src/main/java/com/hxhq/service/SjService.java | 14 + .../main/java/com/hxhq/service/SyncLogService.java | 10 + .../src/main/java/com/hxhq/service/YqService.java | 21 + .../hxhq/service/impl/ContainerServiceImpl.java | 108 ++++ .../java/com/hxhq/service/impl/GspServiceImpl.java | 30 + .../service/impl/InstrumentPushServiceImpl.java | 18 + .../hxhq/service/impl/InstrumentServiceImpl.java | 164 ++++++ .../service/impl/ReagentStockPushServiceImpl.java | 18 + .../hxhq/service/impl/ReagentStockServiceImpl.java | 118 ++++ .../java/com/hxhq/service/impl/SjServiceImpl.java | 30 + .../com/hxhq/service/impl/SyncLogServiceImpl.java | 18 + .../java/com/hxhq/service/impl/YqServiceImpl.java | 50 ++ .../src/main/java/com/hxhq/util/BeanConvert.java | 49 ++ .../src/main/java/com/hxhq/util/DailyTask.java | 45 ++ .../src/main/java/com/hxhq/util/TimeUtil.java | 21 + .../src/main/resources/bootstrap.yml | 38 ++ .../src/main/resources/mapper/ContainerMapper.xml | 15 + .../src/main/resources/mapper/InstrumentMapper.xml | 15 + .../main/resources/mapper/ReagentStockMapper.xml | 15 + .../com/hxhq/job/service/DataSyncTaskService.java | 25 + .../main/java/com/hxhq/job/task/DataSyncTask.java | 57 ++ hxhq-modules/pom.xml | 1 + 56 files changed, 3627 insertions(+) create mode 100644 hxhq-modules/hxhq-integration/pom.xml create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java create mode 100644 hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java create mode 100644 hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml create mode 100644 hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml create mode 100644 hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml create mode 100644 hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml create mode 100644 hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java create mode 100644 hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java diff --git a/hxhq-modules/hxhq-integration/pom.xml b/hxhq-modules/hxhq-integration/pom.xml new file mode 100644 index 0000000..f0d650f --- /dev/null +++ b/hxhq-modules/hxhq-integration/pom.xml @@ -0,0 +1,130 @@ + + + 4.0.0 + + com.hxhq + hxhq-modules + 3.6.6 + + + hxhq-modules-integration + + + hxhq-modules-system系统模块 + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + com.mysql + mysql-connector-j + + + + + com.hxhq + hxhq-common-datasource + + + + + com.hxhq + hxhq-common-datascope + + + + + com.hxhq + hxhq-common-log + + + + + com.hxhq + hxhq-common-swagger + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + com.itextpdf + itextpdf + 5.5.11 + + + com.itextpdf.tool + xmlworker + 5.5.11 + + + + com.itextpdf + itext-asian + 5.2.0 + + + org.projectlombok + lombok + + + cn.hutool + hutool-all + 5.8.16 + + + com.belerweb + pinyin4j + 2.5.1 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java new file mode 100644 index 0000000..555dbcb --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java @@ -0,0 +1,25 @@ +package com.hxhq; + +import com.hxhq.common.security.annotation.EnableCustomConfig; +import com.hxhq.common.security.annotation.EnableRyFeignClients; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +/** + * 系统模块 + * + * @author hxhq + */ +@EnableCustomConfig +@EnableRyFeignClients +@SpringBootApplication +@ComponentScan({"com.hxhq.*"}) +public class HxhqIntegrationApplication +{ + public static void main(String[] args) + { + SpringApplication.run(HxhqIntegrationApplication.class, args); + System.out.println("数据对接模块启动成功"); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java new file mode 100644 index 0000000..2adfc36 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java @@ -0,0 +1,44 @@ +package com.hxhq.common; + +/** + * model参数常量常量 + * + * @author yuyantian + * @date + */ +public class EntityConstants { + + /** + * 数据同步状态状态(0-正常状态,1删除状态) + */ + public final static Integer NORMAL = 0; + + + /** + * 系统名称 + */ + public final static String SYS_HXHQ = "hxhq"; + + /** + * 日志同步类型 试剂 + */ + public final static String LOG_REAGENT = "reagent"; + /** + * 日志同步类型 仪器 + */ + public final static String LOG_INSTRUMENT = "instrument"; + + /** + * 日志同步类型 供试品 + */ + public final static String LOG_CONTAINER = "container"; + + /** + * 系统名称 中间库 + */ + public final static String SYS_STAGING_DATABASE = "stagingDatabase"; + + public static final String PENDING = "pending"; + public static final String SUCCESS = "success"; + public static final String FAILED = "failed"; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java new file mode 100644 index 0000000..078b822 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java @@ -0,0 +1,46 @@ +package com.hxhq.controller; + +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.dto.ContainerDTO; +import com.hxhq.service.ContainerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 供试品 + * + * @author hxhq + */ +@RestController +@RequestMapping("/container") +public class ContainerController extends BaseController +{ + @Autowired + private ContainerService containerService; + + /** + * + * 供试品数据推送至中间库 + * @param dto + * @create 2026/1/29 + **/ + @PostMapping("/dataPush") + public AjaxResult dataPush(ContainerDTO dto) { + containerService.dataPush(dto); + return AjaxResult.success("推送数据成功"); + } + /** + * + * 供试品数据同步 + * @create 2026/1/29 + **/ + @GetMapping("/dataSync") + public AjaxResult dataSync() { + containerService.dataSync(); + return AjaxResult.success("同步成功"); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java new file mode 100644 index 0000000..399e09d --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java @@ -0,0 +1,46 @@ +package com.hxhq.controller; + +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.dto.InstrumentPushDTO; +import com.hxhq.service.InstrumentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 仪器 + * + * @author hxhq + */ +@RestController +@RequestMapping("/instrument") +public class InstrumentController extends BaseController +{ + @Autowired + private InstrumentService instrumentService; + + /** + * + * 仪器数据推送至中间库 + * @param dto + * @create 2026/1/29 + **/ + @PostMapping("/dataPush") + public AjaxResult dataPush(InstrumentPushDTO dto) { + instrumentService.dataPush(dto); + return AjaxResult.success("推送数据成功"); + } + /** + * + * 仪器数据同步 + * @create 2026/1/29 + **/ + @GetMapping("/dataSync") + public AjaxResult dataSync() { + instrumentService.dataSync(); + return AjaxResult.success("同步成功"); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java new file mode 100644 index 0000000..e8990c0 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java @@ -0,0 +1,47 @@ +package com.hxhq.controller; + +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.dto.ReagentStockPushDTO; +import com.hxhq.service.ReagentStockService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 试剂 + * + * @author hxhq + */ +@RestController +@RequestMapping("/reagentStock") +public class ReagentStockController extends BaseController +{ + @Autowired + private ReagentStockService reagentStockService; + + + /** + * + * 试剂数据推送至中间库 + * @param dto + * @create 2026/1/29 + **/ + @PostMapping("/dataPush") + public AjaxResult dataPush(ReagentStockPushDTO dto) { + reagentStockService.dataPush(dto); + return AjaxResult.success("推送数据成功"); + } + /** + * + * 试剂数据同步 + * @create 2026/1/29 + **/ + @GetMapping("/dataSync") + public AjaxResult dataSync() { + reagentStockService.dataSync(); + return AjaxResult.success("同步成功"); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java new file mode 100644 index 0000000..10b2e13 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java @@ -0,0 +1,115 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/30 14:15 + * @description 供试品 + */ +@Data +@TableName("container") +public class Container { + /** + * 主键 ID(自增) + **/ + @TableId(value = "id",type = IdType.AUTO) + private Integer id; + + /** + * 容器ID + **/ + @TableField(value = "CONTAINER_ID") + private Integer containerId; + + /** + * 物质编码 + **/ + @TableField(value = "SUBSTANCE_CODE") + private String substanceCode; + + /** + * 物质名称 + **/ + @TableField(value = "SUBSTANCE_NAME") + private String substanceName; + + /** + * 备注 + **/ + @TableField(value = "COMMENTS") + private String comments; + + /** + * 当前净含量 + **/ + @TableField(value = "CURRENT_NET_AMOUNT") + private BigDecimal currentNetAmount; + + /** + * 当前净含量单位 + **/ + @TableField(value = "CURRENT_NET_AMOUNT_UNIT") + private String currentNetAmountUnit; + + /** + * 批号 + **/ + @TableField(value = "LOT_NUMBER") + private String lotNumber; + + /** + * 失效日期 + **/ + @TableField(value = "EXPIRATION_DATE") + private LocalDateTime expirationDate; + + /** + * 容器用途 + **/ + @TableField(value = "CONTAINER_USE") + private String containerUse; + + /** + * 药房接收时间 + **/ + @TableField(value = "DATE_TIME_PHARMACY_RECV") + private LocalDateTime dateTimePharmacyRecv; + + /** + * 交易日期(默认当前时间) + **/ + @TableField(value = "TRANS_DATE") + private LocalDateTime transDate; + + /** + * 存储位置 + **/ + @TableField(value = "STORAGE_LOCATION") + private String storageLocation; + + /** + * 录入人 + **/ + @TableField(value = "ENTERED_BY") + private String enteredBy; + + /** + * 研究编号 + **/ + @TableField(value = "STUDY_NUMBER") + private String studyNumber; + + /** + * 录入时间 + **/ + @TableField(value = "DATE_TIME_ENTERED") + private LocalDateTime dateTimeEntered; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java new file mode 100644 index 0000000..bbf3fd8 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java @@ -0,0 +1,633 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hxhq.common.core.annotation.Compare; +import com.hxhq.common.core.domain.MpBaseEntity; + +import java.util.Date; + + +/** + * 供试品管理对象 t_gsp + * + * @author HanLong + * @date 2025-12-30 + */ +@TableName("t_gsp") +public class Gsp extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 制剂状态 1:入库 3:已发放 5:已锁定 7:待归档 9:归档 11:待解档 */ + private Integer zjzt; + + /** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */ + private Integer jyzt; + + /** 编辑状态:1:未编辑 3:审核中 */ + private Integer bjzt; + + /** 库存编辑状态:1:未编辑 3:审核中 */ + private Integer kcbjzt; + + /** 名称 */ + @Compare(name = "名称", nameEn = "Name") + private String mc; + + /** 编号 */ + private String bh; + + /** 批号 */ + @Compare(name = "批号", nameEn = "Batch Number") + private String ph; + + /** 规格 */ + @Compare(name = "规格", nameEn = "Specification") + private String gg; + + /** 规格 */ + @Compare(name = "规格单位", nameEn = "Specification Unit") + private String ggdw; + + /** 库存数量 */ + private String kc; + + /** 库存单位 */ + private String kcdw; + + /** 有效期 */ + @Compare(name = "有效期", nameEn = "Validity Period") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date yxq; + + /** 接收日期 */ + @Compare(name = "接收日期", nameEn = "Date Received") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date jsrq; + + /** 存储条件 */ + @Compare(name = "存储条件", nameEn = "Storage Condition") + private String cctj; + + /** 注意事项 */ + @Compare(name = "注意事项", nameEn = "Notification") + private String zysx; + + /** 名称编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String mcbj; + + /** 批号编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String phbj; + + /** 规格编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String ggbj; + + /** 规格单位 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String ggdwbj; + + /** 有效期编辑 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private Date yxqbj; + + /** 接收日期编辑 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private Date jsrqbj; + + /** 存储条件编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String cctjbj; + + /** 注意事项编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String zysxbj; + + /** 库存编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String kcbj; + + /** 库存单位编辑 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String kcdwbj; + + /** 编辑备注 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String bjbz; + + /** 库存备注 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String kcbjbz; + + /** 编辑人id */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private Long bjrId; + + /** 编辑人名称 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String bjrMc; + + /** 库存编辑人id */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private Long kcbjrId; + + /** 库存编辑人名称 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String kcbjrMc; + + /** 发放转移条件 */ + private String ffzytj; + + /** 领取人1id */ + private Long lqr1Id; + + /** 领取人2id */ + private Long lqr2Id; + + /** 发放人1id */ + private Long ffr1Id; + + /** 发放人2id */ + private Long ffr2Id; + + /** 领取人1名称 */ + private String lqr1Mc; + + /** 领取人2名称 */ + private String lqr2Mc; + + /** 发放人1名称 */ + private String ffr1Mc; + + /** 发放人2名称 */ + private String ffr2Mc; + + /** 发放日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date ffrq; + + /** 发放备注 */ + private String ffbz; + + /** 发放目的ids */ + private String mdIds; + + /** 发放目的其他 */ + private String mdOther; + + /** 关联暂存柜id */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private Long zcgId; + + /** 借阅开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyksrq; + + /** 借阅结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyjsrq; + + /** 归档申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date gdsqsj; + + /** 档案申请人名称 */ + private String gdsqrMc; + + /** 档案申请人ID*/ + private Long gdsqrId; + + + public Date getGdsqsj() { + return gdsqsj; + } + + public void setGdsqsj(Date gdsqsj) { + this.gdsqsj = gdsqsj; + } + + public String getGdsqrMc() { + return gdsqrMc; + } + + public void setGdsqrMc(String gdsqrMc) { + this.gdsqrMc = gdsqrMc; + } + + public Long getGdsqrId() { + return gdsqrId; + } + + public void setGdsqrId(Long gdsqrId) { + this.gdsqrId = gdsqrId; + } + + public Date getJyksrq() { + return jyksrq; + } + + public void setJyksrq(Date jyksrq) { + this.jyksrq = jyksrq; + } + + public Date getJyjsrq() { + return jyjsrq; + } + + public void setJyjsrq(Date jyjsrq) { + this.jyjsrq = jyjsrq; + } + + public Long getZcgId() { + return zcgId; + } + + public void setZcgId(Long zcgId) { + this.zcgId = zcgId; + } + + public void setZjzt(Integer zjzt) + { + this.zjzt = zjzt; + } + + public Integer getZjzt() + { + return zjzt; + } + + public void setJyzt(Integer jyzt) + { + this.jyzt = jyzt; + } + + public Integer getJyzt() + { + return jyzt; + } + + public void setMc(String mc) + { + this.mc = mc; + } + + public String getMc() + { + return mc; + } + + public void setBh(String bh) + { + this.bh = bh; + } + + public String getBh() + { + return bh; + } + + public void setPh(String ph) + { + this.ph = ph; + } + + public String getPh() + { + return ph; + } + + public void setGg(String gg) + { + this.gg = gg; + } + + public String getGg() + { + return gg; + } + + public void setGgdw(String ggdw) + { + this.ggdw = ggdw; + } + + public String getGgdw() + { + return ggdw; + } + + public void setKc(String kc) + { + this.kc = kc; + } + + public String getKc() + { + return kc; + } + + public void setKcdw(String kcdw) + { + this.kcdw = kcdw; + } + + public String getKcdw() + { + return kcdw; + } + + public void setYxq(Date yxq) + { + this.yxq = yxq; + } + + public Date getYxq() + { + return yxq; + } + + public void setJsrq(Date jsrq) + { + this.jsrq = jsrq; + } + + public Date getJsrq() + { + return jsrq; + } + + public void setCctj(String cctj) + { + this.cctj = cctj; + } + + public String getCctj() + { + return cctj; + } + + public void setZysx(String zysx) + { + this.zysx = zysx; + } + + public String getZysx() + { + return zysx; + } + + public Integer getBjzt() { + return bjzt; + } + + public void setBjzt(Integer bjzt) { + this.bjzt = bjzt; + } + + public Integer getKcbjzt() { + return kcbjzt; + } + + public void setKcbjzt(Integer kcbjzt) { + this.kcbjzt = kcbjzt; + } + + public String getMcbj() { + return mcbj; + } + + public void setMcbj(String mcbj) { + this.mcbj = mcbj; + } + + public String getPhbj() { + return phbj; + } + + public void setPhbj(String phbj) { + this.phbj = phbj; + } + + public String getGgbj() { + return ggbj; + } + + public void setGgbj(String ggbj) { + this.ggbj = ggbj; + } + + public String getGgdwbj() { + return ggdwbj; + } + + public void setGgdwbj(String ggdwbj) { + this.ggdwbj = ggdwbj; + } + + public Date getYxqbj() { + return yxqbj; + } + + public void setYxqbj(Date yxqbj) { + this.yxqbj = yxqbj; + } + + public Date getJsrqbj() { + return jsrqbj; + } + + public void setJsrqbj(Date jsrqbj) { + this.jsrqbj = jsrqbj; + } + + public String getCctjbj() { + return cctjbj; + } + + public void setCctjbj(String cctjbj) { + this.cctjbj = cctjbj; + } + + public String getZysxbj() { + return zysxbj; + } + + public void setZysxbj(String zysxbj) { + this.zysxbj = zysxbj; + } + + public String getKcbj() { + return kcbj; + } + + public void setKcbj(String kcbj) { + this.kcbj = kcbj; + } + + public String getKcdwbj() { + return kcdwbj; + } + + public void setKcdwbj(String kcdwbj) { + this.kcdwbj = kcdwbj; + } + + public String getBjbz() { + return bjbz; + } + + public void setBjbz(String bjbz) { + this.bjbz = bjbz; + } + + public String getKcbjbz() { + return kcbjbz; + } + + public void setKcbjbz(String kcbjbz) { + this.kcbjbz = kcbjbz; + } + + public Long getBjrId() { + return bjrId; + } + + public void setBjrId(Long bjrId) { + this.bjrId = bjrId; + } + + public String getBjrMc() { + return bjrMc; + } + + public void setBjrMc(String bjrMc) { + this.bjrMc = bjrMc; + } + + public Long getKcbjrId() { + return kcbjrId; + } + + public void setKcbjrId(Long kcbjrId) { + this.kcbjrId = kcbjrId; + } + + public String getKcbjrMc() { + return kcbjrMc; + } + + public void setKcbjrMc(String kcbjrMc) { + this.kcbjrMc = kcbjrMc; + } + + public String getFfzytj() { + return ffzytj; + } + + public void setFfzytj(String ffzytj) { + this.ffzytj = ffzytj; + } + + public Long getLqr1Id() { + return lqr1Id; + } + + public void setLqr1Id(Long lqr1Id) { + this.lqr1Id = lqr1Id; + } + + public Long getLqr2Id() { + return lqr2Id; + } + + public void setLqr2Id(Long lqr2Id) { + this.lqr2Id = lqr2Id; + } + + public Long getFfr1Id() { + return ffr1Id; + } + + public void setFfr1Id(Long ffr1Id) { + this.ffr1Id = ffr1Id; + } + + public Long getFfr2Id() { + return ffr2Id; + } + + public void setFfr2Id(Long ffr2Id) { + this.ffr2Id = ffr2Id; + } + + public String getLqr1Mc() { + return lqr1Mc; + } + + public void setLqr1Mc(String lqr1Mc) { + this.lqr1Mc = lqr1Mc; + } + + public String getLqr2Mc() { + return lqr2Mc; + } + + public void setLqr2Mc(String lqr2Mc) { + this.lqr2Mc = lqr2Mc; + } + + public String getFfr1Mc() { + return ffr1Mc; + } + + public void setFfr1Mc(String ffr1Mc) { + this.ffr1Mc = ffr1Mc; + } + + public String getFfr2Mc() { + return ffr2Mc; + } + + public void setFfr2Mc(String ffr2Mc) { + this.ffr2Mc = ffr2Mc; + } + + public Date getFfrq() { + return ffrq; + } + + public void setFfrq(Date ffrq) { + this.ffrq = ffrq; + } + + public String getFfbz() { + return ffbz; + } + + public void setFfbz(String ffbz) { + this.ffbz = ffbz; + } + + public String getMdIds() { + return mdIds; + } + + public void setMdIds(String mdIds) { + this.mdIds = mdIds; + } + + public String getMdOther() { + return mdOther; + } + + public void setMdOther(String mdOther) { + this.mdOther = mdOther; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java new file mode 100644 index 0000000..fbf7116 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java @@ -0,0 +1,79 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/30 10:39 + * @description 仪器 + */ +@Data +@TableName("instrument") +public class Instrument { + /** + *仪器库存ID(主键,雪花ID) + **/ + @TableId(value = "instrument_id", type = IdType.ASSIGN_ID) + private String instrumentId; + + /** + * 名称 + **/ + @TableField(value = "name") + private String name; + + /** + * 编号 + **/ + @TableField(value = "sn") + private String sn; + + /** + * 型号 + **/ + @TableField(value = "model") + private String model; + + /** + * 所属部门 + **/ + @TableField(value = "department") + private String department; + + /** + * 下次校准日期 + **/ + @TableField(value = "calibration_date") + private LocalDateTime calibrationDate; + + /** + * 来源 + **/ + @TableField(value = "source") + private String source; + + /** + * 温层(存储条件) + **/ + @TableField(value = "storage_conditions") + private String storageConditions; + + /** + * 备注 + **/ + @TableField(value = "remark") + private String remark; + + /** + * 是否是历史数据。0否1是 + **/ + @TableField(value = "is_history") + private String isHistory; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java new file mode 100644 index 0000000..4fb35a2 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java @@ -0,0 +1,100 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/30 10:39 + * @description 仪器推送 + */ +@Data +@TableName("instrument_push") +public class InstrumentPush { + /** + *仪器推送ID(主键,雪花ID) + **/ + @TableId(value = "instrument_push_id", type = IdType.ASSIGN_ID) + private String instrumentPushId; + + /** + * 名称 + **/ + @TableField(value = "name") + private String name; + + /** + * 编号 + **/ + @TableField(value = "sn") + private String sn; + + /** + * 试验编号 + **/ + @TableField(value = "trial_number") + private String trialNumber; + + /** + * 试验名称 + **/ + @TableField(value = "trial_name") + private String trialName; + + /** + * 表单系统模板名 + **/ + @TableField(value = "form_template_name") + private String formTemplateName; + + /** + * 表单名 + **/ + @TableField(value = "form_name") + private String formName; + + + /** + * 使用时间(可理解为主记录时间或开始时间) + **/ + @TableField(value = "usage_time") + private LocalDateTime usageTime; + + /** + * 使用时长 + **/ + @TableField(value = "usage_duration") + private String usageDuration; + + /** + * 使用时长-单位 + **/ + @TableField(value = "usage_duration_unit") + private String usageDurationUnit; + + /** + * 使用人 + **/ + @TableField(value = "user_name") + private String userName; + + /** + * 开始使用时间 + **/ + @TableField(value = "start_time") + private LocalDateTime startTime; + + /** + * 结束使用时间 + **/ + @TableField(value = "end_time") + private LocalDateTime endTime; + + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java new file mode 100644 index 0000000..77e265f --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java @@ -0,0 +1,137 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/28 15:28 + * @description 试剂库存信息 + */ +@Data +@TableName("reagent_stock") +public class ReagentStock { + /** + *试剂库存ID(主键,雪花ID) + **/ + @TableId(value = "reagent_stock_id", type = IdType.ASSIGN_ID) + private String reagentStockId; + + /** + *名称 + **/ + private String name; + + /** + *编号(唯一标识,如批次+序列) + **/ + @TableField(value = "sn") + private String sn; + + /** + *浓度/含量/纯度(数值) + **/ + @TableField(value = "purity") + private BigDecimal purity; + + /** + *浓度/含量/纯度单位(如 mg/mL、%、mol/L) + **/ + private String purityUnit; + + /** + *库存数量(支持小数) + **/ + private BigDecimal stockCount; + + /** + *库存单位(如 mg、mL、g) + **/ + private String stockUnit; + + /** + *规格(如 100mL/瓶) + **/ + private String specs; + + /** + *来源(供应商或制备方式) + **/ + private String source; + + /** + *所属部门 + **/ + private String department; + + /** + *批号 + **/ + private String batchNumber; + + /** + *有效周期(数值,如 30) + **/ + private String validityPeriod; + + /** + *有效周期单位(hour/day/month/year) + **/ + private String validityPeriodUnit; + + /** + *失效日期(精确到秒) + **/ + private LocalDateTime expiryDate; + + /** + *存储位置(如 A-01-冰箱) + **/ + private String storageLocation; + + /** + *存储条件(如 -20℃避光) + **/ + private String storageConditions; + + /** + *配置日期(仅日期) + **/ + private LocalDateTime configurationDate; + + /** + *创建时间 + **/ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + *修改时间 + **/ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + *创建者(用户ID) + **/ + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + *修改者 + **/ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + + /** + *逻辑删除标记(0-未删除,1-已删除) + **/ + private Integer isDeleted; + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java new file mode 100644 index 0000000..6cd1cdb --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java @@ -0,0 +1,158 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/28 15:28 + * @description 试剂库存推送信息 + */ +@Data +@TableName("reagent_stock_push") +public class ReagentStockPush { + /** + * 试剂库存推送ID(主键,雪花ID) + **/ + @TableId(value = "reagent_stock_push_id", type = IdType.ASSIGN_ID) + private String reagentStockPushId; + + /** + * 名称 + **/ + private String name; + + /** + * 编号(唯一标识,如批次+序列) + **/ + @TableField(value = "sn") + private String sn; + + /** + * 浓度/含量/纯度(数值) + **/ + @TableField(value = "purity") + private BigDecimal purity; + + /** + * 浓度/含量/纯度单位(如 mg/mL、%、mol/L) + **/ + private String purityUnit; + + /** + * 库存数量(支持小数) + **/ + private BigDecimal stockCount; + + /** + * 库存单位(如 mg、mL、g) + **/ + private String stockUnit; + + /** + * 规格(如 100mL/瓶) + **/ + private String specs; + + /** + * 来源(供应商或制备方式) + **/ + private String source; + + /** + * 所属部门 + **/ + private String department; + + /** + * 批号 + **/ + private String batchNumber; + + /** + * 有效周期(数值,如 30) + **/ + private String validityPeriod; + + /** + * 有效周期单位(hour/day/month/year) + **/ + private String validityPeriodUnit; + + /** + * 失效日期(精确到秒) + **/ + private LocalDateTime expiryDate; + + /** + * 存储位置(如 A-01-冰箱) + **/ + private String storageLocation; + + /** + * 存储条件(如 -20℃避光) + **/ + private String storageConditions; + + /** + * 配置日期(仅日期) + **/ + private LocalDateTime configurationDate; + + /** + * 创建时间 + **/ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + + /** + * 修改时间 + **/ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + + /** + * 创建者(用户ID) + **/ + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 修改者 + **/ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + + /** + * 逻辑删除标记(0-未删除,1-已删除) + **/ + private Integer isDeleted; + + /** + * 试验编号 + **/ + @TableField(value = "trial_number") + private String trialNumber; + + /** + * 试验名称 + **/ + @TableField(value = "trial_name") + private String trialName; + + /** + * 表单系统模板名 + **/ + @TableField(value = "form_template_name") + private String formTemplateName; + + /** + * 表单名 + **/ + @TableField(value = "form_name") + private String formName; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java new file mode 100644 index 0000000..b093e31 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java @@ -0,0 +1,349 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hxhq.common.core.annotation.Compare; +import com.hxhq.common.core.domain.MpBaseEntity; + +import java.util.Date; + + +/** + * 试剂库存对象 t_sjkc + * + * @author HanLong + * @date 2025-12-22 + */ +@TableName("t_sj") +public class Sj extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 试验id */ + private Long studyId; + + /** 试验表单id */ + private Long studyFormId; + + /** 所属部门/学科 */ + private Long deptId; + + /** 制剂状态 1:入库 5:已锁定 7:待归档 9:归档 11:待解档 */ + private Integer zjzt; + + /** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */ + private Integer jyzt; + + /** 所属部门 */ + private String ssbm; + + /** 名称 */ + @Compare(name = "名称") + private String mc; + + /** 编号 */ + private String bh; + + /** 批号 */ + private String ph; + + /** 规格 */ + private String gg; + + /** 浓度/含量/纯度 */ + @Compare(name = "浓度/含量/纯度", nameEn = "Concentration/Purity") + private String nd; + + /** 浓度单位 */ + @Compare(name = "浓度/含量/纯度单位", nameEn = "Concentration/Purity Unit") + private String nddw; + + /** 库存数量 */ + @Compare(name = "库存数量", nameEn = "Inventory") + private String kc; + + /** 库存单位 */ + @Compare(name = "库存单位", nameEn = "Inventory Unit") + private String kcdw; + + /** 来源 */ + private String ly; + + /** 存储条件 */ + @Compare(name = "存储条件", nameEn = "Storage Condition") + private String cctj; + + /** 存储位置 */ + @Compare(name = "存储位置", nameEn = "Storage Location") + private String ccwz; + + /** 有效周期 */ + private String yxzq; + + /** 有效周期单位 */ + private String yxzqdw; + + /** 失效日 */ + @Compare(name = "失效日", nameEn = "Expiration") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sxr; + + /** 配置日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pzrq; + + /** 借阅开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyksrq; + + /** 借阅结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyjsrq; + + /** 归档申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date gdsqsj; + + /** 档案申请人id */ + private Long gdsqrId; + + /** 母液编号 */ + private String parentBh; + + public String getParentBh() { + return parentBh; + } + + public void setParentBh(String parentBh) { + this.parentBh = parentBh; + } + + public Date getGdsqsj() { + return gdsqsj; + } + + public void setGdsqsj(Date gdsqsj) { + this.gdsqsj = gdsqsj; + } + + public Long getStudyId() { + return studyId; + } + + public void setStudyId(Long studyId) { + this.studyId = studyId; + } + + public Long getStudyFormId() { + return studyFormId; + } + + public void setStudyFormId(Long studyFormId) { + this.studyFormId = studyFormId; + } + + public void setZjzt(Integer zjzt) + { + this.zjzt = zjzt; + } + + public Integer getZjzt() + { + return zjzt; + } + + public void setJyzt(Integer jyzt) + { + this.jyzt = jyzt; + } + + public Integer getJyzt() + { + return jyzt; + } + + public void setMc(String mc) + { + this.mc = mc; + } + + public String getMc() + { + return mc; + } + + public void setBh(String bh) + { + this.bh = bh; + } + + public String getBh() + { + return bh; + } + + public void setPh(String ph) + { + this.ph = ph; + } + + public String getPh() + { + return ph; + } + + public void setGg(String gg) + { + this.gg = gg; + } + + public String getGg() + { + return gg; + } + + public void setNd(String nd) + { + this.nd = nd; + } + + public String getNd() + { + return nd; + } + + public void setKc(String kc) + { + this.kc = kc; + } + + public String getKc() + { + return kc; + } + + public void setKcdw(String kcdw) + { + this.kcdw = kcdw; + } + + public String getKcdw() + { + return kcdw; + } + + public void setLy(String ly) + { + this.ly = ly; + } + + public String getLy() + { + return ly; + } + + public void setCctj(String cctj) + { + this.cctj = cctj; + } + + public String getCctj() + { + return cctj; + } + + public void setCcwz(String ccwz) + { + this.ccwz = ccwz; + } + + public String getCcwz() + { + return ccwz; + } + + + public void setSxr(Date sxr) + { + this.sxr = sxr; + } + + public Date getSxr() + { + return sxr; + } + + public void setPzrq(Date pzrq) + { + this.pzrq = pzrq; + } + + public Date getPzrq() + { + return pzrq; + } + + public String getNddw() { + return nddw; + } + + public void setNddw(String nddw) { + this.nddw = nddw; + } + + public void setYxzq(String yxzq) { + this.yxzq = yxzq; + } + + public String getYxzqdw() { + return yxzqdw; + } + + public void setYxzqdw(String yxzqdw) { + this.yxzqdw = yxzqdw; + } + + public String getSsbm() { + return ssbm; + } + + public void setSsbm(String ssbm) { + this.ssbm = ssbm; + } + + public String getYxzq() { + return yxzq; + } + + public Date getJyksrq() { + return jyksrq; + } + + public void setJyksrq(Date jyksrq) { + this.jyksrq = jyksrq; + } + + public Date getJyjsrq() { + return jyjsrq; + } + + public void setJyjsrq(Date jyjsrq) { + this.jyjsrq = jyjsrq; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Long getGdsqrId() { + return gdsqrId; + } + + public void setGdsqrId(Long gdsqrId) { + this.gdsqrId = gdsqrId; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java new file mode 100644 index 0000000..8ca424d --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java @@ -0,0 +1,77 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.hxhq.common.core.annotation.Excel; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/29 16:24 + * @description 数据同步日志 + */ +@Data +public class SyncLog { + /** + * 主键 ID + **/ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 源系统主键 + **/ + @TableField(value = "source_record_id") + private String sourceRecordId; + + /** + * 源数据类型:reagent(试剂) + **/ + @TableField(value = "source_type") + private String sourceType; + + /** + * 目标系统名称 + **/ + @TableField(value = "target_system") + private String targetSystem; + + /** + * 同步状态(pending / success / failed) + **/ + @TableField(value = "sync_status") + private String syncStatus; + + /** + * 上次同步时间 + **/ + @TableField(value = "last_sync_time") + private LocalDateTime lastSyncTime; + + /** + * 同步错误信息 + **/ + @TableField(value = "sync_error_message") + private String syncErrorMessage; + + /** + * 重试次数 + **/ + @TableField(value = "retry_count") + private Integer retryCount; + + /** + * 创建时间 + **/ + @TableField(value = "created_at") + private LocalDateTime createdAt; + + /** + * 更新时间 + **/ + @TableField(value = "updated_at") + private LocalDateTime updatedAt; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java new file mode 100644 index 0000000..aef2fdd --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java @@ -0,0 +1,148 @@ +package com.hxhq.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hxhq.common.core.annotation.Compare; +import com.hxhq.common.core.domain.MpBaseEntity; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; + + +/** + * 仪器管理对象 t_yq + * + * @author HanLong + * @date 2025-12-20 + */ +@TableName("t_yq") +public class Yq extends MpBaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 名称 + */ + @NotEmpty(message = "请输入仪器名称") + @Length(max = 50, message = "仪器名称不能超过50字") + @Compare(name = "仪器名称", nameEn = "Name") + private String mc; + + /** + * 编号 + */ + @NotEmpty(message = "请输入仪器编号") + @Length(max = 50, message = "仪器编号不能超过50字") + @Compare(name = "仪器编号", nameEn = "ID") + private String bh; + + /** + * 型号 + */ + @NotEmpty(message = "请输入仪器型号") + @Length(max = 50, message = "仪器型号不能超过50字") + @Compare(name = "仪器型号", nameEn = "Type") + private String xh; + + /** + * 来源 + */ + @NotEmpty(message = "请输入仪器来源") + @Length(max = 50, message = "仪器来源不能超过50字") + @Compare(name = "仪器来源", nameEn = "Source") + private String ly; + + /** + * 校准日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "请选择校准日期") + @Compare(name = "下次校准日期", nameEn = "Next Calibration") + private Date jzrq; + + /** + * 部门id + */ + @NotNull(message = "请选择所属部门") + private Long bmId; + + /** 部门名称 */ + @Compare(name = "所属部门") + @TableField(exist = false) + private String bmMc; + + + /** + * 温层 + */ + @NotNull(message = "请选择所温层") + @Compare(name = "温层") + private String wc; + + + public void setMc(String mc) { + this.mc = mc; + } + + public String getMc() { + return mc; + } + + public void setBh(String bh) { + this.bh = bh; + } + + public String getBh() { + return bh; + } + + public void setXh(String xh) { + this.xh = xh; + } + + public String getXh() { + return xh; + } + + public void setLy(String ly) { + this.ly = ly; + } + + public String getLy() { + return ly; + } + + public void setJzrq(Date jzrq) { + this.jzrq = jzrq; + } + + public Date getJzrq() { + return jzrq; + } + + public void setBmId(Long bmId) { + this.bmId = bmId; + } + + public Long getBmId() { + return bmId; + } + + public void setWc(String wc) { + this.wc = wc; + } + + public String getWc() { + return wc; + } + + public String getBmMc() { + return bmMc; + } + + public void setBmMc(String bmMc) { + this.bmMc = bmMc; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java new file mode 100644 index 0000000..f2277d8 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java @@ -0,0 +1,18 @@ +package com.hxhq.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.utils.StringUtils; + +/** + * + * + * @author hxhq + */ + +public class TestVO +{ + + private String code; + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java new file mode 100644 index 0000000..a246246 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java @@ -0,0 +1,114 @@ +package com.hxhq.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/30 14:15 + * @description 供试品 + */ +@Data +public class ContainerDTO { + /** + * 主键 ID(自增) + **/ + @TableId(value = "id",type = IdType.AUTO) + private Integer id; + + /** + * 容器ID + **/ + @TableField(value = "CONTAINER_ID") + private Integer containerId; + + /** + * 物质编码 + **/ + @TableField(value = "SUBSTANCE_CODE") + private String substanceCode; + + /** + * 物质名称 + **/ + @TableField(value = "SUBSTANCE_NAME") + private String substanceName; + + /** + * 备注 + **/ + @TableField(value = "COMMENTS") + private String comments; + + /** + * 当前净含量 + **/ + @TableField(value = "CURRENT_NET_AMOUNT") + private BigDecimal currentNetAmount; + + /** + * 当前净含量单位 + **/ + @TableField(value = "CURRENT_NET_AMOUNT_UNIT") + private String currentNetAmountUnit; + + /** + * 批号 + **/ + @TableField(value = "LOT_NUMBER") + private String lotNumber; + + /** + * 失效日期 + **/ + @TableField(value = "EXPIRATION_DATE") + private LocalDateTime expirationDate; + + /** + * 容器用途 + **/ + @TableField(value = "CONTAINER_USE") + private String containerUse; + + /** + * 药房接收时间 + **/ + @TableField(value = "DATE_TIME_PHARMACY_RECV") + private LocalDateTime dateTimePharmacyRecv; + + /** + * 交易日期(默认当前时间) + **/ + @TableField(value = "TRANS_DATE") + private LocalDateTime transDate; + + /** + * 存储位置 + **/ + @TableField(value = "STORAGE_LOCATION") + private String storageLocation; + + /** + * 录入人 + **/ + @TableField(value = "ENTERED_BY") + private String enteredBy; + + /** + * 研究编号 + **/ + @TableField(value = "STUDY_NUMBER") + private String studyNumber; + + /** + * 录入时间 + **/ + @TableField(value = "DATE_TIME_ENTERED") + private LocalDateTime dateTimeEntered; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java new file mode 100644 index 0000000..e05ee91 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java @@ -0,0 +1,95 @@ +package com.hxhq.dto; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/30 10:39 + * @description 仪器推送 + */ +@Data +public class InstrumentPushDTO { + + + /** + * 名称 + **/ + @TableField(value = "name") + private String name; + + /** + * 编号 + **/ + @TableField(value = "sn") + private String sn; + + /** + * 试验编号 + **/ + @TableField(value = "trial_number") + private String trialNumber; + + /** + * 试验名称 + **/ + @TableField(value = "trial_name") + private String trialName; + + /** + * 表单系统模板名 + **/ + @TableField(value = "form_template_name") + private String formTemplateName; + + /** + * 表单名 + **/ + @TableField(value = "form_name") + private String formName; + + + /** + * 使用时间(可理解为主记录时间或开始时间) + **/ + @TableField(value = "usage_time") + private LocalDateTime usageTime; + + /** + * 使用时长 + **/ + @TableField(value = "usage_duration") + private String usageDuration; + + /** + * 使用时长-单位 + **/ + @TableField(value = "usage_duration_unit") + private String usageDurationUnit; + + /** + * 使用人 + **/ + @TableField(value = "user_name") + private String userName; + + /** + * 开始使用时间 + **/ + @TableField(value = "start_time") + private LocalDateTime startTime; + + /** + * 结束使用时间 + **/ + @TableField(value = "end_time") + private LocalDateTime endTime; + + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java new file mode 100644 index 0000000..ca96397 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java @@ -0,0 +1,129 @@ +package com.hxhq.dto; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * @author zhangjing + * @date 2026/01/28 15:28 + * @description 试剂库存推送信息 + */ +@Data +public class ReagentStockPushDTO { + /** + * 试剂库存推送ID(主键,雪花ID) + **/ + @TableId(value = "reagent_stock_push_id", type = IdType.ASSIGN_ID) + private String reagentStockPushId; + + /** + * 名称 + **/ + private String name; + + /** + * 编号(唯一标识,如批次+序列) + **/ + @TableField(value = "sn") + private String sn; + + /** + * 浓度/含量/纯度(数值) + **/ + @TableField(value = "purity") + private BigDecimal purity; + + /** + * 浓度/含量/纯度单位(如 mg/mL、%、mol/L) + **/ + private String purityUnit; + + /** + * 库存数量(支持小数) + **/ + private BigDecimal stockCount; + + /** + * 库存单位(如 mg、mL、g) + **/ + private String stockUnit; + + /** + * 规格(如 100mL/瓶) + **/ + private String specs; + + /** + * 来源(供应商或制备方式) + **/ + private String source; + + /** + * 所属部门 + **/ + private String department; + + /** + * 批号 + **/ + private String batchNumber; + + /** + * 有效周期(数值,如 30) + **/ + private String validityPeriod; + + /** + * 有效周期单位(hour/day/month/year) + **/ + private String validityPeriodUnit; + + /** + * 失效日期(精确到秒) + **/ + private LocalDateTime expiryDate; + + /** + * 存储位置(如 A-01-冰箱) + **/ + private String storageLocation; + + /** + * 存储条件(如 -20℃避光) + **/ + private String storageConditions; + + /** + * 配置日期(仅日期) + **/ + private LocalDateTime configurationDate; + + + + /** + * 试验编号 + **/ + @TableField(value = "trial_number") + private String trialNumber; + + /** + * 试验名称 + **/ + @TableField(value = "trial_name") + private String trialName; + + /** + * 表单系统模板名 + **/ + @TableField(value = "form_template_name") + private String formTemplateName; + + /** + * 表单名 + **/ + @TableField(value = "form_name") + private String formName; +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java new file mode 100644 index 0000000..ea137df --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java @@ -0,0 +1,19 @@ +package com.hxhq.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.Container; + +import java.util.List; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +public interface ContainerMapper extends BaseMapper +{ + + + List notSync(); +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java new file mode 100644 index 0000000..3433aab --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java @@ -0,0 +1,21 @@ +package com.hxhq.mapper; + + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.Gsp; +import com.hxhq.domain.Sj; +import org.apache.ibatis.annotations.Mapper; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +@DS("hxhq") +@Mapper +public interface GspMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java new file mode 100644 index 0000000..c5c7b4d --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java @@ -0,0 +1,20 @@ +package com.hxhq.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.Instrument; +import com.hxhq.domain.ReagentStock; + +import java.util.List; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +public interface InstrumentMapper extends BaseMapper +{ + + + List notSync(); +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java new file mode 100644 index 0000000..2427c67 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java @@ -0,0 +1,18 @@ +package com.hxhq.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.InstrumentPush; +import org.apache.ibatis.annotations.Mapper; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +@Mapper +public interface InstrumentPushMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java new file mode 100644 index 0000000..01c12a0 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java @@ -0,0 +1,18 @@ +package com.hxhq.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.ReagentStock; + +import java.util.List; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +public interface ReagentStockMapper extends BaseMapper +{ + List notSync(); + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java new file mode 100644 index 0000000..746dcd1 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java @@ -0,0 +1,19 @@ +package com.hxhq.mapper; + + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.ReagentStockPush; +import org.apache.ibatis.annotations.Mapper; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +@Mapper +public interface ReagentStockPushMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java new file mode 100644 index 0000000..f3c97ab --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java @@ -0,0 +1,23 @@ +package com.hxhq.mapper; + + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.ReagentStock; +import com.hxhq.domain.Sj; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +@DS("hxhq") +@Mapper +public interface SjMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java new file mode 100644 index 0000000..d49bdd4 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java @@ -0,0 +1,18 @@ +package com.hxhq.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.SyncLog; + +import java.util.List; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +public interface SyncLogMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java new file mode 100644 index 0000000..ca2ee70 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java @@ -0,0 +1,21 @@ +package com.hxhq.mapper; + + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.domain.Sj; +import com.hxhq.domain.Yq; +import org.apache.ibatis.annotations.Mapper; + +/** + * 参数配置 数据层 + * + * @author hxhq + */ +@DS("hxhq") +@Mapper +public interface YqMapper extends BaseMapper +{ + + +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java new file mode 100644 index 0000000..1364240 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java @@ -0,0 +1,15 @@ +package com.hxhq.service; + +import com.hxhq.dto.ContainerDTO; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface ContainerService { + + void dataPush(ContainerDTO dto); + + void dataSync(); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java new file mode 100644 index 0000000..30a9ec2 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java @@ -0,0 +1,15 @@ +package com.hxhq.service; + +import com.hxhq.domain.Gsp; +import com.hxhq.domain.Sj; + +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface GspService { + void saveList(List sjList); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java new file mode 100644 index 0000000..5761c16 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java @@ -0,0 +1,10 @@ +package com.hxhq.service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface InstrumentPushService { + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java new file mode 100644 index 0000000..ed28b17 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java @@ -0,0 +1,15 @@ +package com.hxhq.service; + +import com.hxhq.dto.InstrumentPushDTO; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface InstrumentService { + + void dataPush(InstrumentPushDTO dto); + + void dataSync(); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java new file mode 100644 index 0000000..8d82d59 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java @@ -0,0 +1,10 @@ +package com.hxhq.service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface ReagentStockPushService { + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java new file mode 100644 index 0000000..5daada0 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java @@ -0,0 +1,15 @@ +package com.hxhq.service; + +import com.hxhq.dto.ReagentStockPushDTO; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface ReagentStockService { + + void dataPush(ReagentStockPushDTO dto); + + void dataSync(); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java new file mode 100644 index 0000000..52698f3 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java @@ -0,0 +1,14 @@ +package com.hxhq.service; + +import com.hxhq.domain.Sj; + +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface SjService { + void saveList(List sjList); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java new file mode 100644 index 0000000..2699a6a --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java @@ -0,0 +1,10 @@ +package com.hxhq.service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface SyncLogService { + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java new file mode 100644 index 0000000..38654cb --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java @@ -0,0 +1,21 @@ +package com.hxhq.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hxhq.domain.Sj; +import com.hxhq.domain.Yq; + +import java.util.List; +import java.util.Set; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +public interface YqService { + void saveList(List sjList); + + List listByBh(Set incomingBhSet); + + void updateList(List recordsToUpdate); +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java new file mode 100644 index 0000000..db715d6 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java @@ -0,0 +1,108 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.common.EntityConstants; +import com.hxhq.domain.Container; +import com.hxhq.domain.Gsp; +import com.hxhq.domain.SyncLog; +import com.hxhq.domain.Yq; +import com.hxhq.dto.ContainerDTO; +import com.hxhq.mapper.ContainerMapper; +import com.hxhq.service.ContainerService; +import com.hxhq.service.GspService; +import com.hxhq.service.YqService; +import com.hxhq.util.BeanConvert; +import com.hxhq.util.TimeUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class ContainerServiceImpl extends ServiceImpl implements ContainerService { + + @Resource + GspService gspService; + @Resource + SyncLogServiceImpl syncLogService; + @Override + public void dataPush(ContainerDTO dto) { + Container Container = BeanConvert.convert(dto, Container.class); + save(Container); + } + + @Override + public void dataSync() { + List list = baseMapper.notSync(); + if (list == null || list.isEmpty()) { + return ; + } + //供试品 + List gspList = changeToGsp(list); + gspService.saveList(gspList); + //日志 + List syncLogList = getLogList(list); + saveLogList(syncLogList); + } + @Transactional + public void saveLogList(List syncLogList) { + syncLogService.saveBatch(syncLogList); + } + + + private List getLogList(List list) { + List syncLogList = new ArrayList<>(); + LocalDateTime now = LocalDateTime.now(); + list.forEach(item ->{ + SyncLog syncLog = new SyncLog(); + syncLog.setSourceRecordId(item.getId().toString()); + syncLog.setTargetSystem(EntityConstants.SYS_HXHQ); + syncLog.setSourceType(EntityConstants.LOG_CONTAINER); + syncLog.setCreatedAt(now); + syncLog.setSyncStatus(EntityConstants.SUCCESS); + syncLogList.add(syncLog); + }); + + return syncLogList; + } +// + private List changeToGsp(List list) { + List gspList = new ArrayList<>(); + list.forEach(item ->{ + Gsp sj = new Gsp(); + sj.setMc(item.getSubstanceName()); + sj.setBh(item.getSubstanceCode()); + sj.setPh(item.getLotNumber()); + sj.setRemark(item.getComments()); + sj.setRemark(item.getComments()); + sj.setKc(item.getCurrentNetAmount().toString()); + sj.setKcdw(item.getCurrentNetAmountUnit()); + sj.setYxq(TimeUtil.getDate(item.getExpirationDate())); + //状态 开会讨论状态迁移都为1未入库 + sj.setZjzt(1); + sj.setJyzt(1); + //容器用途 +// sj.set(item.getContainerUse()); + sj.setJsrq(TimeUtil.getDate(item.getDateTimePharmacyRecv())); + //交易日期(默认当前时间) +// sj.set(item.getTransDate()); + //存储位置 +// sj.setCz(item.getStorageLocation()); + //研究编号 +// sj.setCz(item.getStudyNumber()); + //录入时间 +// sj.setLr(TimeUtil.getDate(item.getExpirationDate())); + + gspList.add(sj); + }); + return gspList; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java new file mode 100644 index 0000000..947e982 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java @@ -0,0 +1,30 @@ +package com.hxhq.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.Gsp; +import com.hxhq.mapper.GspMapper; +import com.hxhq.service.GspService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class GspServiceImpl extends ServiceImpl implements GspService { + + @DS("hxhq") + @Override + public void saveList(List GspList) { + saveGspList(GspList); + } + @Transactional + public void saveGspList(List GspList) { + this.saveBatch(GspList); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java new file mode 100644 index 0000000..118ed77 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java @@ -0,0 +1,18 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.InstrumentPush; +import com.hxhq.mapper.InstrumentPushMapper; +import com.hxhq.service.InstrumentPushService; +import org.springframework.stereotype.Service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class InstrumentPushServiceImpl extends ServiceImpl implements InstrumentPushService { + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java new file mode 100644 index 0000000..4dfb56a --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java @@ -0,0 +1,164 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.common.EntityConstants; +import com.hxhq.domain.Instrument; +import com.hxhq.domain.InstrumentPush; +import com.hxhq.domain.SyncLog; +import com.hxhq.domain.Yq; +import com.hxhq.dto.InstrumentPushDTO; +import com.hxhq.mapper.InstrumentMapper; +import com.hxhq.service.InstrumentService; +import com.hxhq.service.YqService; +import com.hxhq.util.BeanConvert; +import com.hxhq.util.TimeUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class InstrumentServiceImpl extends ServiceImpl implements InstrumentService { + + @Resource + YqService yqService; + @Resource + SyncLogServiceImpl syncLogService; + @Resource + InstrumentPushServiceImpl instrumentPushService; + @Override + public void dataPush(InstrumentPushDTO dto) { + InstrumentPush instrument = BeanConvert.convert(dto, InstrumentPush.class); + instrumentPushService.save(instrument); + } + + @Override + public void dataSync() { + List list = baseMapper.notSync(); + if (list == null || list.isEmpty()) { + return ; + } + //仪器 + List sjList = changeToYq(list); + //这里sjList 里 yq 里通过bh字段去更新已有数据,如果没有相同的就新增,该怎么处理。 + + performUpsertByBh(sjList); + //日志 + List syncLogList = getLogList(list); + saveLogList(syncLogList); + } + @Transactional + public void saveLogList(List syncLogList) { + syncLogService.saveBatch(syncLogList); + } + + /** + * 核心方法:根据 Yq 对象的 bh 字段执行新增或更新操作 + * @param sjList 待处理的 Yq 对象列表 + */ + @Transactional + public void performUpsertByBh(List sjList) { + // 1. 提取传入列表中的所有 bh 值 + Set incomingBhSet = sjList.stream() + .map(Yq::getBh) + .collect(Collectors.toSet()); + + // 2. 查询数据库中已存在的、与传入列表匹配的 Yq 记录 + List existingRecordsInDb = yqService.listByBh(incomingBhSet); + + // 3. 提取数据库中已存在的 bh 集合,用于快速判断 + Set existingBhSet = existingRecordsInDb.stream() + .map(Yq::getBh) + .collect(Collectors.toSet()); + + // 4. 区分新增和更新的记录 + List recordsToInsert = new ArrayList<>(); + List recordsToUpdate = new ArrayList<>(); + + for (Yq incomingRecord : sjList) { + String bh = incomingRecord.getBh(); + if (existingBhSet.contains(bh)) { + // 如果数据库中已存在此 bh,则标记为更新 + // 需要将现有记录的 ID 补充到 incomingRecord 上,以便 MP 知道更新哪一行 + Yq existingRecord = existingRecordsInDb.stream() + .filter(r -> r.getBh().equals(bh)) + .findFirst() + .orElse(null); // 理论上一定能找到,因为 existingBhSet.contains(bh) + + if (existingRecord != null) { + // 补全 ID + incomingRecord.setId(existingRecord.getId()); + recordsToUpdate.add(incomingRecord); + } else { + // 理论上不应该走到这里,除非并发问题。可以记录警告或抛异常。 + System.err.println("警告:逻辑错误,bh 为 " + bh + " 的记录在 existingBhSet 中,但在 existingRecordsInDb 中未找到。"); + } + + } else { + // 如果数据库中不存在此 bh,则标记为新增 + recordsToInsert.add(incomingRecord); + } + } + + // 5. 执行批量新增和更新操作 + if (!recordsToInsert.isEmpty()) { + // 批量新增 + yqService.saveList(recordsToInsert); + System.out.println("批量新增 Yq 记录: " + recordsToInsert.size() + " 条"); + } + + if (!recordsToUpdate.isEmpty()) { + // 批量更新 + // 使用 updateBatchById,它会根据 ID 进行更新 + yqService.updateList(recordsToUpdate); + System.out.println("批量更新 Yq 记录: " + recordsToUpdate.size() + " 条"); + } + } + private List getLogList(List list) { + List syncLogList = new ArrayList<>(); + LocalDateTime now = LocalDateTime.now(); + list.forEach(item ->{ + SyncLog syncLog = new SyncLog(); + syncLog.setSourceRecordId(item.getInstrumentId()); + syncLog.setTargetSystem(EntityConstants.SYS_HXHQ); + syncLog.setSourceType(EntityConstants.LOG_INSTRUMENT); + syncLog.setCreatedAt(now); + syncLog.setSyncStatus(EntityConstants.SUCCESS); + syncLogList.add(syncLog); + }); + + return syncLogList; + } +// + private List changeToYq(List list) { + List yqList = new ArrayList<>(); + list.forEach(item ->{ + Yq sj = new Yq(); + sj.setMc(item.getName()); + sj.setBh(item.getSn()); + sj.setXh(item.getModel()); + //部门名称 + sj.setBmMc(item.getDepartment()); + sj.setJzrq(TimeUtil.getDate(item.getCalibrationDate())); + //无来源默认为:中间库 + sj.setLy(item.getSource()!=null?item.getSource():EntityConstants.SYS_STAGING_DATABASE); + + + sj.setWc(item.getStorageConditions()); + sj.setRemark(item.getRemark()); + + yqList.add(sj); + }); + return yqList; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java new file mode 100644 index 0000000..27d7a3f --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java @@ -0,0 +1,18 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.ReagentStockPush; +import com.hxhq.mapper.ReagentStockPushMapper; +import com.hxhq.service.ReagentStockPushService; +import org.springframework.stereotype.Service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class ReagentStockPushServiceImpl extends ServiceImpl implements ReagentStockPushService { + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java new file mode 100644 index 0000000..93bdf8b --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java @@ -0,0 +1,118 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.common.EntityConstants; +import com.hxhq.domain.ReagentStock; +import com.hxhq.domain.ReagentStockPush; +import com.hxhq.domain.Sj; +import com.hxhq.domain.SyncLog; +import com.hxhq.dto.ReagentStockPushDTO; +import com.hxhq.mapper.ReagentStockMapper; +import com.hxhq.service.ReagentStockService; +import com.hxhq.service.SjService; +import com.hxhq.util.BeanConvert; +import com.hxhq.util.TimeUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class ReagentStockServiceImpl extends ServiceImpl implements ReagentStockService { + + @Resource + SjService sjService; + + @Resource + SyncLogServiceImpl syncLogService; + + @Resource + ReagentStockPushServiceImpl reagentStockPushService; + @Transactional + @Override + public void dataPush(ReagentStockPushDTO dto) { + ReagentStockPush reagentStock = BeanConvert.convert(dto, ReagentStockPush.class); + reagentStockPushService.save(reagentStock); + } + + + + @Override + public void dataSync() { + List list = baseMapper.notSync(); + if (list == null || list.isEmpty()) { + return ; + } + //试剂 + List sjList = changeToSj(list); + sjService.saveList(sjList); + //日志 + List syncLogList = getLogList(list); + saveLogList(syncLogList); + } + @Transactional + public void saveLogList(List syncLogList) { + syncLogService.saveBatch(syncLogList); + } + + + private List getLogList(List list) { + List syncLogList = new ArrayList<>(); + LocalDateTime now = LocalDateTime.now(); + list.forEach(item ->{ + SyncLog syncLog = new SyncLog(); + syncLog.setSourceRecordId(item.getReagentStockId()); + syncLog.setTargetSystem(EntityConstants.SYS_HXHQ); + syncLog.setSourceType(EntityConstants.LOG_REAGENT); + syncLog.setCreatedAt(now); + syncLog.setSyncStatus(EntityConstants.SUCCESS); + syncLogList.add(syncLog); + }); + + return syncLogList; + } + + private List changeToSj(List list) { + List sjList = new ArrayList<>(); + list.forEach(item ->{ + Sj sj = new Sj(); + /** 制剂状态 1:入库 5:已锁定 7:待归档 9:归档 11:待解档 */ + /** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */ + + sj.setMc(item.getName()); + sj.setBh(item.getSn()); + sj.setNd(item.getPurity()!=null?item.getPurity().toString():null); + sj.setNddw(item.getPurityUnit()); + sj.setKc(item.getStockCount().toString()); + sj.setKcdw(item.getStockUnit()); + sj.setGg(item.getSpecs()); + //无来源默认为:中间库 + sj.setLy(item.getSource()!=null?item.getSource():EntityConstants.SYS_STAGING_DATABASE); + //部门名称 + sj.setSsbm(item.getDepartment()); + //状态 开会讨论状态迁移都为1未入库 + sj.setZjzt(1); + sj.setJyzt(1); + + + sj.setPh(item.getBatchNumber()); + sj.setYxzq(item.getValidityPeriod()); + sj.setYxzqdw(item.getValidityPeriodUnit()); + sj.setSxr(TimeUtil.getDate(item.getExpiryDate())); + sj.setCcwz(item.getStorageLocation()); + sj.setCctj(item.getStorageConditions()); + sj.setPzrq(TimeUtil.getDate(item.getConfigurationDate())); + + sjList.add(sj); + }); + return sjList; + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java new file mode 100644 index 0000000..70cd54e --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java @@ -0,0 +1,30 @@ +package com.hxhq.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.Sj; +import com.hxhq.mapper.SjMapper; +import com.hxhq.service.SjService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class SjServiceImpl extends ServiceImpl implements SjService { + + @DS("hxhq") + @Override + public void saveList(List sjList) { + saveSjList(sjList); + } + @Transactional + public void saveSjList(List sjList) { + this.saveBatch(sjList); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java new file mode 100644 index 0000000..a42e000 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java @@ -0,0 +1,18 @@ +package com.hxhq.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.SyncLog; +import com.hxhq.mapper.SyncLogMapper; +import com.hxhq.service.SyncLogService; +import org.springframework.stereotype.Service; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class SyncLogServiceImpl extends ServiceImpl implements SyncLogService { + + +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java new file mode 100644 index 0000000..201c1cf --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java @@ -0,0 +1,50 @@ +package com.hxhq.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.domain.Sj; +import com.hxhq.domain.Yq; +import com.hxhq.mapper.SjMapper; +import com.hxhq.mapper.YqMapper; +import com.hxhq.service.SjService; +import com.hxhq.service.YqService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Set; + +/** + * @author zhangjing + * @date 2026/01/28 15:50 + * @description + */ +@Service +public class YqServiceImpl extends ServiceImpl implements YqService { + + @DS("hxhq") + @Override + public void saveList(List yqList) { + saveYqList(yqList); + } + + @DS("hxhq") + @Override + public List listByBh(Set incomingBhSet) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(Yq::getBh, incomingBhSet); + return list(queryWrapper); + } + @DS("hxhq") + @Override + public void updateList(List recordsToUpdate) { + updateBatchById(recordsToUpdate); + } + + + @Transactional + public void saveYqList(List yqList) { + this.saveBatch(yqList); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java new file mode 100644 index 0000000..cfc498c --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java @@ -0,0 +1,49 @@ +package com.hxhq.util; + +import org.springframework.beans.BeanUtils; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhangjing + * @date 2025/08/12 15:27 + * @description + */ +public class BeanConvert { + /** + * 将源对象转换为目标类的实例 + * @param source 源对象 + * @param targetClass 目标类 + * @param 目标类型 + * @return 转换后的对象 + */ + public static T convert(Object source, Class targetClass) { + if (source == null) { + return null; + } + try { + T target = targetClass.newInstance(); + BeanUtils.copyProperties(source, target); + return target; + } catch (Exception e) { + throw new RuntimeException("Bean转换失败", e); + } + } + /** + * 将源列表转换为目标类的实例列表 + * @param sourceList 源对象列表 + * @param targetClass 目标类 + * @param 目标类型 + * @return 转换后的对象列表 + */ + public static List convertList(List sourceList, Class targetClass) { + if (sourceList == null || sourceList.isEmpty()) { + return Collections.emptyList(); + } + return sourceList.stream() + .map(source -> convert(source, targetClass)) + .collect(Collectors.toList()); + } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java new file mode 100644 index 0000000..afa2db1 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java @@ -0,0 +1,45 @@ +package com.hxhq.util; + +/** + * @author zhangjing + * @date 2025/07/08 19:29 + * @description 元数据定时 + */ +import com.hxhq.service.ReagentStockService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.Date; + +@Component +public class DailyTask { + + @Autowired + ReagentStockService reagentStockService; + + +// 北京时间 +// @Scheduled(cron = "0 0 1 * * ?", zone = "Asia/Shanghai") +// public void executeAtOneAMInShanghai() { +// reagentStockService.dataSync(); +// System.out.println("【北京时间】每天凌晨1点执行:" + new Date()); +// } +// @Scheduled(cron = "0 0/5 * * * ?") +// public void executeEveryFiveMinutes() { +// metadataRecordService.uploadRecord(); +// System.out.println("【每5分钟执行】当前时间:" + new Date()); +// } + + @Scheduled(cron = "0 * * * * ?") + public void executeEveryMinute() { + reagentStockService.dataSync(); + System.out.println("【每分钟执行】当前时间:" + new Date()); + } + +// @Scheduled(cron = "0 */3 * * * ?") +// public void executeEveryThreeMinutes() { +// metadataRecordService.uploadRecord(); +// System.out.println("【每3分钟执行】当前时间:" + new Date()); +// } +} diff --git a/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java new file mode 100644 index 0000000..6d1efb5 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java @@ -0,0 +1,21 @@ +package com.hxhq.util; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; + +/** + * @author zhangjing + * @date 2026/01/30 14:50 + * @description + */ +public class TimeUtil { + public static Date getDate(LocalDateTime localDateTime){ + if (localDateTime==null){ + return null; + } + // 转换为 Date(使用系统默认时区) + Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); + return date; + }; +} diff --git a/hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml b/hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..f7bfedd --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml @@ -0,0 +1,38 @@ +# Tomcat +server: + port: 9210 + +# Spring +spring: + main: + allow-circular-references: true + application: + # 应用名称 + name: hxhq-integration + profiles: + # 环境配置 + active: dev + cloud: + nacos: + username: nacos + password: nacosHxhq + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application- $ {spring.profiles.active}. $ {spring.cloud.nacos.config.file-extension} + - hxhq-integration- $ {spring.profiles.active}. $ {spring.cloud.nacos.config.file-extension} +# token配置 +token: + # 是否允许账户多终端同时登录(true允许 false不允许) + soloLogin: false + +logging: + level: + com.alibaba.cloud.nacos: DEBUG \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml b/hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml new file mode 100644 index 0000000..a0cf3eb --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml b/hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml new file mode 100644 index 0000000..fa96040 --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml b/hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml new file mode 100644 index 0000000..46b1f1d --- /dev/null +++ b/hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java b/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java new file mode 100644 index 0000000..830f08d --- /dev/null +++ b/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java @@ -0,0 +1,25 @@ +package com.hxhq.job.service; + +import com.hxhq.common.core.web.domain.AjaxResult; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * 定时任务 + * + * @author hxhq + */ +@FeignClient(name = "hxhq-integration") +public interface DataSyncTaskService +{ + @GetMapping("/reagentStock/dataSync") + AjaxResult syncReagentStock(); + + + @GetMapping("/instrument/dataSync") + AjaxResult syncInstrument(); + + @GetMapping("/container/dataSync") + AjaxResult syncContainer(); +} diff --git a/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java b/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java new file mode 100644 index 0000000..01e8c41 --- /dev/null +++ b/hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java @@ -0,0 +1,57 @@ +package com.hxhq.job.task; + +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.job.service.DataSyncTaskService; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; + +/** + * @author zhangjing + * @date 2026/01/30 15:54 + * @description 数据对接定时 + */ + +@Component("DataSyncTask") +public class DataSyncTask { + @Resource + DataSyncTaskService dataSyncTaskService; + /** + * + * 试剂同步 + * @return void + **/ + public void syncReagentStock() { + try { + AjaxResult result = dataSyncTaskService.syncReagentStock(); + } catch (Exception e) { + log.printf("调用 syncReagentStock 失败", e); + } + } + /** + * + * 仪器同步 + * @return void + **/ + public void syncInstrument() { + try { + AjaxResult result = dataSyncTaskService.syncInstrument(); + } catch (Exception e) { + log.printf("调用 syncInstrument 失败", e); + } + } + /** + * + * 供试品同步 + * @return void + **/ + public void syncContainer() { + try { + AjaxResult result = dataSyncTaskService.syncContainer(); + } catch (Exception e) { + log.printf("调用 syncContainer 失败", e); + } + } +} diff --git a/hxhq-modules/pom.xml b/hxhq-modules/pom.xml index 2482f11..605fff1 100644 --- a/hxhq-modules/pom.xml +++ b/hxhq-modules/pom.xml @@ -13,6 +13,7 @@ hxhq-gen hxhq-job hxhq-file + hxhq-integration hxhq-modules