Browse Source

feat:【数据对接】提交

master
zhangjing 2 months ago
parent
commit
205a0f44d1
56 changed files with 3627 additions and 0 deletions
  1. +130
    -0
      hxhq-modules/hxhq-integration/pom.xml
  2. +25
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java
  3. +44
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java
  4. +46
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java
  5. +46
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java
  6. +47
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java
  7. +115
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java
  8. +633
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java
  9. +79
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java
  10. +100
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java
  11. +137
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java
  12. +158
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java
  13. +349
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java
  14. +77
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java
  15. +148
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java
  16. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java
  17. +114
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java
  18. +95
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java
  19. +129
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java
  20. +19
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java
  21. +21
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java
  22. +20
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java
  23. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java
  24. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java
  25. +19
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java
  26. +23
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java
  27. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java
  28. +21
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java
  29. +15
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java
  30. +15
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java
  31. +10
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java
  32. +15
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java
  33. +10
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java
  34. +15
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java
  35. +14
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java
  36. +10
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java
  37. +21
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java
  38. +108
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java
  39. +30
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java
  40. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java
  41. +164
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java
  42. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java
  43. +118
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java
  44. +30
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java
  45. +18
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java
  46. +50
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java
  47. +49
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java
  48. +45
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java
  49. +21
    -0
      hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java
  50. +38
    -0
      hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml
  51. +15
    -0
      hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml
  52. +15
    -0
      hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml
  53. +15
    -0
      hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml
  54. +25
    -0
      hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java
  55. +57
    -0
      hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java
  56. +1
    -0
      hxhq-modules/pom.xml

+ 130
- 0
hxhq-modules/hxhq-integration/pom.xml View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.hxhq</groupId>
<artifactId>hxhq-modules</artifactId>
<version>3.6.6</version>
</parent>
<artifactId>hxhq-modules-integration</artifactId>
<description>
hxhq-modules-system系统模块
</description>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Mysql Connector -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
</dependency>
<!-- hxhq Common DataSource -->
<dependency>
<groupId>com.hxhq</groupId>
<artifactId>hxhq-common-datasource</artifactId>
</dependency>
<!-- hxhq Common DataScope -->
<dependency>
<groupId>com.hxhq</groupId>
<artifactId>hxhq-common-datascope</artifactId>
</dependency>
<!-- hxhq Common Log -->
<dependency>
<groupId>com.hxhq</groupId>
<artifactId>hxhq-common-log</artifactId>
</dependency>
<!-- hxhq Common Swagger -->
<dependency>
<groupId>com.hxhq</groupId>
<artifactId>hxhq-common-swagger</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- pdf:start -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.11</version>
</dependency>
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>5.5.11</version>
</dependency>
<!-- 支持中文 -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.16</version>
</dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

+ 25
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/HxhqIntegrationApplication.java View File

@ -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("数据对接模块启动成功");
}
}

+ 44
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/common/EntityConstants.java View File

@ -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";
}

+ 46
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ContainerController.java View File

@ -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("同步成功");
}
}

+ 46
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/InstrumentController.java View File

@ -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("同步成功");
}
}

+ 47
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/controller/ReagentStockController.java View File

@ -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("同步成功");
}
}

+ 115
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Container.java View File

@ -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;
}

+ 633
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Gsp.java View File

@ -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;
}
}

+ 79
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Instrument.java View File

@ -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;
}

+ 100
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/InstrumentPush.java View File

@ -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;
}

+ 137
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStock.java View File

@ -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;
/**
*库存单位 mgmLg
**/
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;
}

+ 158
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/ReagentStockPush.java View File

@ -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;
/**
* 库存单位 mgmLg
**/
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;
}

+ 349
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Sj.java View File

@ -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;
}
}

+ 77
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/SyncLog.java View File

@ -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;
}

+ 148
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/Yq.java View File

@ -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;
}
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/domain/vo/TestVO.java View File

@ -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;
}

+ 114
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ContainerDTO.java View File

@ -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;
}

+ 95
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/InstrumentPushDTO.java View File

@ -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;
}

+ 129
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/dto/ReagentStockPushDTO.java View File

@ -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;
/**
* 库存单位 mgmLg
**/
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;
}

+ 19
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ContainerMapper.java View File

@ -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<Container>
{
List<Container> notSync();
}

+ 21
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/GspMapper.java View File

@ -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<Gsp>
{
}

+ 20
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentMapper.java View File

@ -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<Instrument>
{
List<Instrument> notSync();
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/InstrumentPushMapper.java View File

@ -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<InstrumentPush>
{
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockMapper.java View File

@ -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<ReagentStock>
{
List<ReagentStock> notSync();
}

+ 19
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/ReagentStockPushMapper.java View File

@ -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<ReagentStockPush>
{
}

+ 23
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SjMapper.java View File

@ -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<Sj>
{
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/SyncLogMapper.java View File

@ -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<SyncLog>
{
}

+ 21
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/mapper/YqMapper.java View File

@ -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<Yq>
{
}

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ContainerService.java View File

@ -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();
}

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/GspService.java View File

@ -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<Gsp> sjList);
}

+ 10
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentPushService.java View File

@ -0,0 +1,10 @@
package com.hxhq.service;
/**
* @author zhangjing
* @date 2026/01/28 15:50
* @description
*/
public interface InstrumentPushService {
}

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/InstrumentService.java View File

@ -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();
}

+ 10
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockPushService.java View File

@ -0,0 +1,10 @@
package com.hxhq.service;
/**
* @author zhangjing
* @date 2026/01/28 15:50
* @description
*/
public interface ReagentStockPushService {
}

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/ReagentStockService.java View File

@ -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();
}

+ 14
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SjService.java View File

@ -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<Sj> sjList);
}

+ 10
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/SyncLogService.java View File

@ -0,0 +1,10 @@
package com.hxhq.service;
/**
* @author zhangjing
* @date 2026/01/28 15:50
* @description
*/
public interface SyncLogService {
}

+ 21
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/YqService.java View File

@ -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<Yq> sjList);
List<Yq> listByBh(Set<String> incomingBhSet);
void updateList(List<Yq> recordsToUpdate);
}

+ 108
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ContainerServiceImpl.java View File

@ -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<ContainerMapper, Container> 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<Container> list = baseMapper.notSync();
if (list == null || list.isEmpty()) {
return ;
}
//供试品
List<Gsp> gspList = changeToGsp(list);
gspService.saveList(gspList);
//日志
List<SyncLog> syncLogList = getLogList(list);
saveLogList(syncLogList);
}
@Transactional
public void saveLogList(List<SyncLog> syncLogList) {
syncLogService.saveBatch(syncLogList);
}
private List<SyncLog> getLogList(List<Container> list) {
List<SyncLog> 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<Gsp> changeToGsp(List<Container> list) {
List<Gsp> 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;
}
}

+ 30
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/GspServiceImpl.java View File

@ -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<GspMapper, Gsp> implements GspService {
@DS("hxhq")
@Override
public void saveList(List<Gsp> GspList) {
saveGspList(GspList);
}
@Transactional
public void saveGspList(List<Gsp> GspList) {
this.saveBatch(GspList);
}
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentPushServiceImpl.java View File

@ -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<InstrumentPushMapper, InstrumentPush> implements InstrumentPushService {
}

+ 164
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/InstrumentServiceImpl.java View File

@ -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<InstrumentMapper, Instrument> 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<Instrument> list = baseMapper.notSync();
if (list == null || list.isEmpty()) {
return ;
}
//仪器
List<Yq> sjList = changeToYq(list);
//这里sjList yq 里通过bh字段去更新已有数据如果没有相同的就新增该怎么处理
performUpsertByBh(sjList);
//日志
List<SyncLog> syncLogList = getLogList(list);
saveLogList(syncLogList);
}
@Transactional
public void saveLogList(List<SyncLog> syncLogList) {
syncLogService.saveBatch(syncLogList);
}
/**
* 核心方法根据 Yq 对象的 bh 字段执行新增或更新操作
* @param sjList 待处理的 Yq 对象列表
*/
@Transactional
public void performUpsertByBh(List<Yq> sjList) {
// 1. 提取传入列表中的所有 bh
Set<String> incomingBhSet = sjList.stream()
.map(Yq::getBh)
.collect(Collectors.toSet());
// 2. 查询数据库中已存在的与传入列表匹配的 Yq 记录
List<Yq> existingRecordsInDb = yqService.listByBh(incomingBhSet);
// 3. 提取数据库中已存在的 bh 集合用于快速判断
Set<String> existingBhSet = existingRecordsInDb.stream()
.map(Yq::getBh)
.collect(Collectors.toSet());
// 4. 区分新增和更新的记录
List<Yq> recordsToInsert = new ArrayList<>();
List<Yq> 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<SyncLog> getLogList(List<Instrument> list) {
List<SyncLog> 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<Yq> changeToYq(List<Instrument> list) {
List<Yq> 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;
}
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockPushServiceImpl.java View File

@ -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<ReagentStockPushMapper, ReagentStockPush> implements ReagentStockPushService {
}

+ 118
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/ReagentStockServiceImpl.java View File

@ -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<ReagentStockMapper, ReagentStock> 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<ReagentStock> list = baseMapper.notSync();
if (list == null || list.isEmpty()) {
return ;
}
//试剂
List<Sj> sjList = changeToSj(list);
sjService.saveList(sjList);
//日志
List<SyncLog> syncLogList = getLogList(list);
saveLogList(syncLogList);
}
@Transactional
public void saveLogList(List<SyncLog> syncLogList) {
syncLogService.saveBatch(syncLogList);
}
private List<SyncLog> getLogList(List<ReagentStock> list) {
List<SyncLog> 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<Sj> changeToSj(List<ReagentStock> list) {
List<Sj> 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;
}
}

+ 30
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SjServiceImpl.java View File

@ -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<SjMapper, Sj> implements SjService {
@DS("hxhq")
@Override
public void saveList(List<Sj> sjList) {
saveSjList(sjList);
}
@Transactional
public void saveSjList(List<Sj> sjList) {
this.saveBatch(sjList);
}
}

+ 18
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/SyncLogServiceImpl.java View File

@ -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<SyncLogMapper, SyncLog> implements SyncLogService {
}

+ 50
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/service/impl/YqServiceImpl.java View File

@ -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<YqMapper, Yq> implements YqService {
@DS("hxhq")
@Override
public void saveList(List<Yq> yqList) {
saveYqList(yqList);
}
@DS("hxhq")
@Override
public List<Yq> listByBh(Set<String> incomingBhSet) {
LambdaQueryWrapper<Yq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(Yq::getBh, incomingBhSet);
return list(queryWrapper);
}
@DS("hxhq")
@Override
public void updateList(List<Yq> recordsToUpdate) {
updateBatchById(recordsToUpdate);
}
@Transactional
public void saveYqList(List<Yq> yqList) {
this.saveBatch(yqList);
}
}

+ 49
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/BeanConvert.java View File

@ -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 <T> 目标类型
* @return 转换后的对象
*/
public static <T> T convert(Object source, Class<T> 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 <T> 目标类型
* @return 转换后的对象列表
*/
public static <T> List<T> convertList(List<?> sourceList, Class<T> targetClass) {
if (sourceList == null || sourceList.isEmpty()) {
return Collections.emptyList();
}
return sourceList.stream()
.map(source -> convert(source, targetClass))
.collect(Collectors.toList());
}
}

+ 45
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/DailyTask.java View File

@ -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());
// }
}

+ 21
- 0
hxhq-modules/hxhq-integration/src/main/java/com/hxhq/util/TimeUtil.java View File

@ -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;
};
}

+ 38
- 0
hxhq-modules/hxhq-integration/src/main/resources/bootstrap.yml View File

@ -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

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/resources/mapper/ContainerMapper.xml View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.mapper.ContainerMapper">
<select id="notSync" resultType="com.hxhq.domain.Container">
SELECT c.*
FROM container c
LEFT JOIN sync_log s
ON c.container_id = s.source_record_id
AND s.target_system = 'hxhq'
AND s.source_type = 'container'
WHERE s.source_record_id IS NULL;
</select>
</mapper>

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/resources/mapper/InstrumentMapper.xml View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.mapper.InstrumentMapper">
<select id="notSync" resultType="com.hxhq.domain.Instrument">
SELECT i.*
FROM instrument i
LEFT JOIN sync_log s
ON i.instrument_id = s.source_record_id
AND s.target_system = 'hxhq'
AND s.source_type = 'instrument'
WHERE s.source_record_id IS NULL;
</select>
</mapper>

+ 15
- 0
hxhq-modules/hxhq-integration/src/main/resources/mapper/ReagentStockMapper.xml View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.mapper.ReagentStockMapper">
<select id="notSync" resultType="com.hxhq.domain.ReagentStock">
SELECT rs.*
FROM reagent_stock rs
LEFT JOIN sync_log s
ON rs.reagent_stock_id = s.source_record_id
AND s.target_system = 'hxhq'
AND s.source_type = 'reagent'
WHERE s.source_record_id IS NULL;
</select>
</mapper>

+ 25
- 0
hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/service/DataSyncTaskService.java View File

@ -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();
}

+ 57
- 0
hxhq-modules/hxhq-job/src/main/java/com/hxhq/job/task/DataSyncTask.java View File

@ -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);
}
}
}

+ 1
- 0
hxhq-modules/pom.xml View File

@ -13,6 +13,7 @@
<module>hxhq-gen</module>
<module>hxhq-job</module>
<module>hxhq-file</module>
<module>hxhq-integration</module>
</modules>
<artifactId>hxhq-modules</artifactId>

Loading…
Cancel
Save