浏览代码

add
提交术后问卷
查看术后问卷

18339543638 4 月之前
父节点
当前提交
63a7424fad
共有 26 个文件被更改,包括 1060 次插入10 次删除
  1. 2 0
      tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/tenant/SysTenantApi.java
  2. 3 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/config/ContentListType.java
  3. 3 2
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/config/QuestionListType.java
  4. 47 6
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/config/PatientMonitorListener.java
  5. 80 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/controller/BizInfusionHistoryController.java
  6. 38 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionClinicDTO.java
  7. 19 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionClinicQueryDTO.java
  8. 144 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionHistoryDTO.java
  9. 19 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionHistoryQueryDTO.java
  10. 2 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/NbPumpInfusionDTO.java
  11. 28 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizInfusionClinicMapper.java
  12. 37 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizInfusionHistoryMapper.java
  13. 40 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizInfusionClinicPO.java
  14. 185 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizInfusionHistoryPO.java
  15. 16 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizInfusionClinicRepository.java
  16. 16 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizInfusionHistoryRepository.java
  17. 2 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizPatientRepository.java
  18. 54 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizInfusionClinicService.java
  19. 54 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizInfusionHistoryService.java
  20. 92 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizInfusionClinicServiceImpl.java
  21. 92 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizInfusionHistoryServiceImpl.java
  22. 2 0
      tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizPatientServiceImpl.java
  23. 7 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/mapper/SysTenantMapper.java
  24. 3 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/po/SysTenantPO.java
  25. 11 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/provider/SysTenantApiProvider.java
  26. 64 0
      tr-plugins/tr-spring-boot-starter-plugin-mybatis/src/main/java/cn/tr/plugin/mybatis/config/handler/JsonbListTypeHandler.java

+ 2 - 0
tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/tenant/SysTenantApi.java

@@ -10,4 +10,6 @@ import java.util.*;
 
 public interface SysTenantApi {
     List<SysTenantPojo> selectAll();
+
+    SysTenantPojo selectByHospitalCode(String hospitalCode);
 }

+ 3 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/config/ContentListType.java

@@ -2,6 +2,7 @@ package cn.tr.module.smart.app.config;
 
 import cn.tr.module.smart.common.entity.BizQuestionEntity;
 import cn.tr.module.smart.common.entity.BizWxAppletQuestionAnswerEntity;
+import cn.tr.plugin.mybatis.config.handler.JsonbListTypeHandler;
 import cn.tr.plugin.mybatis.config.handler.ListTypeHandler;
 
 /**
@@ -9,14 +10,14 @@ import cn.tr.plugin.mybatis.config.handler.ListTypeHandler;
  * @description: TODO
  * @date 2025/7/17 15:31
  */
-public class ContentListType extends ListTypeHandler<BizWxAppletQuestionAnswerEntity> {
+public class ContentListType extends JsonbListTypeHandler<BizWxAppletQuestionAnswerEntity> {
     /**
      * 具体类型,由子类提供
      *
      * @return 具体类型
      */
     @Override
-    protected Class specificType() {
+    public Class specificType() {
         return BizWxAppletQuestionAnswerEntity.class;
     }
 }

+ 3 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/config/QuestionListType.java

@@ -1,6 +1,7 @@
 package cn.tr.module.smart.app.config;
 
 import cn.tr.module.smart.common.entity.BizQuestionEntity;
+import cn.tr.plugin.mybatis.config.handler.JsonbListTypeHandler;
 import cn.tr.plugin.mybatis.config.handler.ListTypeHandler;
 
 /**
@@ -8,14 +9,14 @@ import cn.tr.plugin.mybatis.config.handler.ListTypeHandler;
  * @description: TODO
  * @date 2025/7/17 15:31
  */
-public class QuestionListType extends ListTypeHandler<BizQuestionEntity> {
+public class QuestionListType extends JsonbListTypeHandler<BizQuestionEntity> {
     /**
      * 具体类型,由子类提供
      *
      * @return 具体类型
      */
     @Override
-    protected Class specificType() {
+    public Class specificType() {
         return BizQuestionEntity.class;
     }
 }

+ 47 - 6
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/config/PatientMonitorListener.java

@@ -1,27 +1,68 @@
 package cn.tr.module.smart.common.config;
 
+import cn.hutool.core.util.ObjectUtil;
+import cn.tr.core.annotation.TenantIgnore;
 import cn.tr.core.utils.JsonUtils;
+import cn.tr.module.api.sys.tenant.SysTenantApi;
+import cn.tr.module.api.sys.tenant.SysTenantPojo;
 import cn.tr.module.smart.common.dto.NbPumpInfusionDTO;
 import cn.tr.module.smart.common.enums.RabbitMQConstant;
+import cn.tr.module.smart.common.mapper.BizInfusionHistoryMapper;
+import cn.tr.module.smart.common.po.BizInfusionHistoryPO;
+import cn.tr.module.smart.common.po.BizPatientPO;
+import cn.tr.module.smart.common.repository.BizClinicRoomRepository;
+import cn.tr.module.smart.common.repository.BizInfusionClinicRepository;
+import cn.tr.module.smart.common.repository.BizInfusionHistoryRepository;
+import cn.tr.module.smart.common.repository.BizPatientRepository;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.rabbit.annotation.RabbitListener;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 @Slf4j
 @Service
+@AllArgsConstructor
 public class PatientMonitorListener {
-
+    private final SysTenantApi sysTenantApi;
+    private final BizInfusionClinicRepository infusionClinicRepository;
+    private final BizInfusionHistoryRepository infusionHistoryRepository;
+    private final BizClinicRoomRepository clinicRoomRepository;
+    private final BizPatientRepository patientRepository;
     @RabbitListener(queues = RabbitMQConstant.QUEUE_PATIENT_MONITOR)
+    @TenantIgnore
+    @Transactional(rollbackFor = Exception.class)
     public void handlePatientMonitorMessage(String message) {
-        log.info("Received patient monitor message: {}", message);
+        log.debug("接收到网络泵消息: {}", message);
         // 在这里处理接收到的消息
         processPatientMonitorData(message);
     }
 
     private void processPatientMonitorData(String message) {
-        NbPumpInfusionDTO nbPumpInfusionDTO = JsonUtils.parseObject(message, NbPumpInfusionDTO.class);
-        // 实际处理患者监控数据的逻辑
-        log.info("Processing patient monitor data: {}", message);
-        // TODO: 根据业务需求实现具体的处理逻辑
+        NbPumpInfusionDTO source = JsonUtils.parseObject(message, NbPumpInfusionDTO.class);
+        if (ObjectUtil.isNull(source)) {
+            return;
+        }
+        //找到医院
+        SysTenantPojo tenant = sysTenantApi.selectByHospitalCode(source.getHospitalCode());
+        if(ObjectUtil.isNull(tenant)){
+            log.warn("未找到医院编码: {}", source.getHospitalCode());
+            return;
+        }
+        BizInfusionHistoryPO infusionHistory = BizInfusionHistoryMapper.INSTANCE.convertPO(source);
+        infusionHistory.setTenantId(tenant.getTenantId());
+        //精确查询住院号
+        BizPatientPO patientPO=patientRepository.selectOne(new LambdaQueryWrapper<BizPatientPO>()
+                .eq(BizPatientPO::getPatientCode, source.getPatientCode())
+                .eq(BizPatientPO::getTenantId,tenant.getTenantId())
+                .last("limit 1"));
+        if(ObjectUtil.isNull(patientPO)){
+            //模糊查询
+            patientPO=patientRepository.selectMayBeLinkedPatient(infusionHistory.getPatientCode(),infusionHistory.getTenantId());
+        }
+        if (ObjectUtil.isNull(patientPO)) {
+
+        }
     }
 }

+ 80 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/controller/BizInfusionHistoryController.java

@@ -0,0 +1,80 @@
+package cn.tr.module.smart.common.controller;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.tr.core.validation.Insert;
+import cn.tr.core.validation.Update;
+import cn.tr.core.pojo.CommonResult;
+import lombok.AllArgsConstructor;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryDTO;
+import cn.tr.module.smart.common.service.IBizInfusionHistoryService;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryQueryDTO;
+import java.util.*;
+import cn.tr.plugin.mybatis.base.BaseController;
+import org.springframework.web.bind.annotation.*;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
+import cn.tr.core.pojo.TableDataInfo;
+/**
+ * 输注-输注历史记录表控制器
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ */
+@Api(tags = "输注-输注历史记录表")
+@RestController
+@RequestMapping("/common/infusionHistory")
+@AllArgsConstructor
+public class BizInfusionHistoryController extends BaseController{
+
+    private final IBizInfusionHistoryService bizInfusionHistoryService;
+
+    @ApiOperationSupport(author = "lf",order = 1)
+    @ApiOperation(value="根据条件查询输注-输注历史记录表",notes = "权限: 无")
+    @PostMapping("/query/page")
+    public TableDataInfo<BizInfusionHistoryDTO> selectList(@RequestBody BizInfusionHistoryQueryDTO query) {
+        startPage();
+        return getDataTable(bizInfusionHistoryService.selectBizInfusionHistoryList(query));
+    }
+
+    @ApiOperationSupport(author = "lf",order = 2)
+    @ApiOperation(value = "根据id查询输注-输注历史记录表",notes = "权限: common:infusionHistory:query")
+    @GetMapping("/detail/{id}")
+    @SaCheckPermission("common:infusionHistory:query")
+    public CommonResult<BizInfusionHistoryDTO> findById(@PathVariable("id") String id){
+        return CommonResult.success(bizInfusionHistoryService.selectBizInfusionHistoryById(id));
+    }
+
+    @ApiOperationSupport(author = "lf",order = 3)
+    @ApiOperation(value="添加输注-输注历史记录表",notes = "权限: common:infusionHistory:add")
+    @PostMapping("/add")
+    @OperateLog
+    @SaCheckPermission("common:infusionHistory:add")
+    public CommonResult<Boolean> add(@RequestBody@Validated(Insert.class) BizInfusionHistoryDTO source) {
+        return CommonResult.success(bizInfusionHistoryService.insertBizInfusionHistory(source));
+    }
+
+    @ApiOperationSupport(author = "lf",order = 4)
+    @ApiOperation(value="通过主键id编辑输注-输注历史记录表",notes = "权限: common:infusionHistory:edit")
+    @PostMapping("/edit")
+    @OperateLog
+    @SaCheckPermission("common:infusionHistory:edit")
+    public CommonResult<Boolean> edit(@RequestBody@Validated(Update.class) BizInfusionHistoryDTO source) {
+        return CommonResult.success(bizInfusionHistoryService.updateBizInfusionHistoryById(source));
+    }
+
+    @ApiOperationSupport(author = "lf",order = 5)
+    @ApiOperation(value="删除输注-输注历史记录表",notes = "权限: common:infusionHistory:remove")
+    @PostMapping("/removeByIds")
+    @OperateLog
+    @SaCheckPermission("common:infusionHistory:remove")
+    public CommonResult<Integer> delete(@RequestBody Collection<String> ids) {
+        return CommonResult.success(bizInfusionHistoryService.removeBizInfusionHistoryByIds(ids));
+    }
+}

+ 38 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionClinicDTO.java

@@ -0,0 +1,38 @@
+package cn.tr.module.smart.common.dto;
+
+import cn.tr.plugin.mybatis.pojo.BaseDTO;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import cn.tr.core.validation.Insert;
+import cn.tr.core.validation.Update;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import javax.validation.constraints.*;
+import java.util.*;
+/**
+ * biz_infusion_clinic传输对象
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+@Data
+@ApiModel("biz_infusion_clinic传输对象")
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class BizInfusionClinicDTO extends BaseDTO  {
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "id", position = 1)
+     @NotBlank  (message = "主键不能为空",groups = {Update.class})
+    private String id;
+
+    @ApiModelProperty(value = "输注id", position = 2)
+    private String infusionId;
+
+    @ApiModelProperty(value = "手术id", position = 3)
+    private String clinicId;
+
+    @ApiModelProperty(value = "绑定类型", position = 4)
+    private String type;
+
+}

+ 19 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionClinicQueryDTO.java

@@ -0,0 +1,19 @@
+package cn.tr.module.smart.common.dto;
+
+import lombok.ToString;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.*;
+/**
+ * biz_infusion_clinic查询参数
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+@Data
+@ApiModel("biz_infusion_clinic查询参数")
+@ToString
+public class BizInfusionClinicQueryDTO  {
+    private static final long serialVersionUID = 1L;
+}

+ 144 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionHistoryDTO.java

@@ -0,0 +1,144 @@
+package cn.tr.module.smart.common.dto;
+
+import cn.tr.plugin.mybatis.pojo.BaseDTO;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import cn.tr.core.validation.Insert;
+import cn.tr.core.validation.Update;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import javax.validation.constraints.*;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.*;
+/**
+ * 输注-输注历史记录表传输对象
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+@Data
+@ApiModel("输注-输注历史记录表传输对象")
+@ToString
+public class BizInfusionHistoryDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "主键", position = 1)
+     @NotBlank  (message = "主键不能为空",groups = {Update.class})
+    private String id;
+
+    @ApiModelProperty(value = "设备唯一编码", position = 2)
+    private String deviceId;
+
+    @ApiModelProperty(value = "设备数据标识", position = 3)
+    private String classification;
+
+    @ApiModelProperty(value = "输注过程中的数据编号", position = 4)
+    private Integer dataNumber;
+
+    @ApiModelProperty(value = "住院号(设备上传的住院号)", position = 5)
+    private String patientCode;
+
+    @ApiModelProperty(value = "总量", position = 6)
+    private Integer totalDose;
+
+    @ApiModelProperty(value = "公共-首次量", position = 7)
+    private Integer firstDose;
+
+    @ApiModelProperty(value = "公共-剩余量", position = 8)
+    private BigDecimal remainDose;
+
+    @ApiModelProperty(value = "公共-已输入量", position = 9)
+    private BigDecimal inputDose;
+
+    @ApiModelProperty(value = "公共-追加量", position = 10)
+    private BigDecimal appendDose;
+
+    @ApiModelProperty(value = "公共-追加锁时", position = 11)
+    private BigDecimal appendLockTime;
+
+    @ApiModelProperty(value = "公共-极限量", position = 12)
+    private BigDecimal maxDose;
+
+    @ApiModelProperty(value = "公共-自控次数", position = 13)
+    private Integer selfControlCount;
+
+    @ApiModelProperty(value = "公共-自控锁时", position = 14)
+    private BigDecimal selfControlLockTime;
+
+    @ApiModelProperty(value = "公共-有效次数", position = 15)
+    private Integer pcaValidCount;
+
+    @ApiModelProperty(value = "公共-无效次数", position = 16)
+    private Integer pcaInvalidCount;
+
+    @ApiModelProperty(value = "公共-总按次数", position = 17)
+    private Integer pcaTotalCount;
+
+    @ApiModelProperty(value = "持续-持续量", position = 18)
+    private BigDecimal continueDose;
+
+    @ApiModelProperty(value = "脉冲-脉冲量", position = 19)
+    private Integer pulseDose;
+
+    @ApiModelProperty(value = "脉冲-脉冲锁时", position = 20)
+    private Integer pulseLockTime;
+
+    @ApiModelProperty(value = "脉冲-脉冲首次锁时", position = 21)
+    private Integer pulseFirstLockTime;
+
+    @ApiModelProperty(value = "智能-加档周期", position = 22)
+    private BigDecimal flowUpCycle;
+
+    @ApiModelProperty(value = "智能-减档周期", position = 23)
+    private BigDecimal flowDownCycle;
+
+    @ApiModelProperty(value = "智能-计次", position = 24)
+    private Integer flowCount;
+
+    @ApiModelProperty(value = "智能-上限", position = 25)
+    private BigDecimal flowUpLimit;
+
+    @ApiModelProperty(value = "智能-下限", position = 26)
+    private BigDecimal flowDownLimit;
+
+    @ApiModelProperty(value = "智能-自调比例", position = 27)
+    private BigDecimal flowAdjustRate;
+
+    @ApiModelProperty(value = "智能-输注过程中是否出现过加档受限", position = 28)
+    private String flowRestricted;
+
+    @ApiModelProperty(value = "智能-加减档提示", position = 29)
+    private Integer warnFlow;
+
+    @ApiModelProperty(value = "电量", position = 30)
+    private Integer electricQuantity;
+
+    @ApiModelProperty(value = "镇痛泵运行状态", position = 31)
+    private Integer deviceRunState;
+
+    @ApiModelProperty(value = "输液将结束(0:否,1:是)", position = 32)
+    private String warnWillFinished;
+
+    @ApiModelProperty(value = "镇痛不足(0:否,1:是)", position = 33)
+    private String warnAnalgesicPoor;
+
+    @ApiModelProperty(value = "电量偏低(0:否,1:是)", position = 34)
+    private String warnLowBattery;
+
+    @ApiModelProperty(value = "报警信息", position = 35)
+    private Integer deviceAlarm;
+
+    @ApiModelProperty(value = "开始时间", position = 36)
+    private Date infusionStartTime;
+
+    @ApiModelProperty(value = "一次输注最后上传时间", position = 37)
+    private Date lastUploadTime;
+
+    @ApiModelProperty(value = "设备类型", position = 38)
+    private Integer type;
+
+    @ApiModelProperty(value = "医院编码", position = 40)
+    private String hospitalCode;
+
+}

+ 19 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/BizInfusionHistoryQueryDTO.java

@@ -0,0 +1,19 @@
+package cn.tr.module.smart.common.dto;
+
+import lombok.ToString;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.*;
+/**
+ * 输注-输注历史记录表查询参数
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+@Data
+@ApiModel("输注-输注历史记录表查询参数")
+@ToString
+public class BizInfusionHistoryQueryDTO  {
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/dto/NbPumpInfusionDTO.java

@@ -34,8 +34,10 @@ public class NbPumpInfusionDTO implements Serializable {
     @ApiModelProperty(value = "病号")
     private String patientCode;
 
+    @ApiModelProperty("数据编号")
     private String classification;
 
+    @ApiModelProperty("数据标识")
     private Integer dataNum;
 
     @ApiModelProperty(value = "设备id")

+ 28 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizInfusionClinicMapper.java

@@ -0,0 +1,28 @@
+package cn.tr.module.smart.common.mapper;
+
+import cn.tr.module.smart.common.po.BizInfusionClinicPO;
+import cn.tr.module.smart.common.dto.BizInfusionClinicDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+/**
+* biz_infusion_clinic映射工具
+*
+* @author lf
+* @date  2025/08/05 10:28
+**/
+@Mapper
+public interface BizInfusionClinicMapper {
+    BizInfusionClinicMapper INSTANCE = Mappers.getMapper(BizInfusionClinicMapper.class);
+
+    BizInfusionClinicPO convertPO(BizInfusionClinicDTO source);
+
+    BizInfusionClinicDTO convertDto(BizInfusionClinicPO source);
+
+    List<BizInfusionClinicDTO> convertDtoList(List<BizInfusionClinicPO> source);
+
+    List<BizInfusionClinicPO> convertPOList(List<BizInfusionClinicDTO> source);
+
+}

+ 37 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/mapper/BizInfusionHistoryMapper.java

@@ -0,0 +1,37 @@
+package cn.tr.module.smart.common.mapper;
+
+import cn.tr.module.smart.common.dto.NbPumpInfusionDTO;
+import cn.tr.module.smart.common.po.BizInfusionHistoryPO;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.Mappings;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+/**
+* 输注-输注历史记录表映射工具
+*
+* @author lf
+* @date  2025/08/05 10:31
+**/
+@Mapper
+public interface BizInfusionHistoryMapper {
+    BizInfusionHistoryMapper INSTANCE = Mappers.getMapper(BizInfusionHistoryMapper.class);
+    @Mappings(
+            {
+                    @Mapping(target = "id",source = "infusionId")
+            }
+    )
+    BizInfusionHistoryPO convertPO(NbPumpInfusionDTO source);
+
+    BizInfusionHistoryPO convertPO(BizInfusionHistoryDTO source);
+
+    BizInfusionHistoryDTO convertDto(BizInfusionHistoryPO source);
+
+    List<BizInfusionHistoryDTO> convertDtoList(List<BizInfusionHistoryPO> source);
+
+    List<BizInfusionHistoryPO> convertPOList(List<BizInfusionHistoryDTO> source);
+
+}

+ 40 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizInfusionClinicPO.java

@@ -0,0 +1,40 @@
+package cn.tr.module.smart.common.po;
+
+
+import cn.tr.plugin.mybatis.pojo.BasePO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import java.util.*;
+/**
+ * biz_infusion_clinic实体
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+@Data
+@TableName(value="biz_infusion_clinic",autoResultMap = true)
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class BizInfusionClinicPO extends BasePO {
+
+    /** id */
+    @TableId
+    @ApiModelProperty(value = "id", position = 1)
+    private String id;
+
+    /** 输注id */
+    @ApiModelProperty(value = "输注id", position = 2)
+    private String infusionId;
+
+    /** 手术id */
+    @ApiModelProperty(value = "手术id", position = 3)
+    private String clinicId;
+
+    /** 绑定类型 */
+    @ApiModelProperty(value = "绑定类型", position = 4)
+    private String type;
+}

+ 185 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/po/BizInfusionHistoryPO.java

@@ -0,0 +1,185 @@
+package cn.tr.module.smart.common.po;
+
+import cn.tr.plugin.mybatis.pojo.TenantPO;   
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.math.BigDecimal;
+import java.util.*;
+/**
+ * 输注-输注历史记录表实体
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+@Data
+@TableName(value="biz_infusion_history",autoResultMap = true)
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class BizInfusionHistoryPO extends TenantPO {
+
+    /** 主键 */
+    @TableId
+    @ApiModelProperty(value = "主键", position = 1)
+    private String id;
+
+    /** 设备唯一编码 */
+    @ApiModelProperty(value = "设备唯一编码", position = 2)
+    private String deviceId;
+
+    /** 设备数据标识 */
+    @ApiModelProperty(value = "设备数据标识", position = 3)
+    private String classification;
+
+    /** 输注过程中的数据编号 */
+    @ApiModelProperty(value = "输注过程中的数据编号", position = 4)
+    private Integer dataNumber;
+
+    /** 住院号(设备上传的住院号) */
+    @ApiModelProperty(value = "住院号(设备上传的住院号)", position = 5)
+    private String patientCode;
+
+    /** 总量 */
+    @ApiModelProperty(value = "总量", position = 6)
+    private Integer totalDose;
+
+    /** 公共-首次量 */
+    @ApiModelProperty(value = "公共-首次量", position = 7)
+    private Integer firstDose;
+
+    /** 公共-剩余量 */
+    @ApiModelProperty(value = "公共-剩余量", position = 8)
+    private BigDecimal remainDose;
+
+    /** 公共-已输入量 */
+    @ApiModelProperty(value = "公共-已输入量", position = 9)
+    private BigDecimal inputDose;
+
+    /** 公共-追加量 */
+    @ApiModelProperty(value = "公共-追加量", position = 10)
+    private BigDecimal appendDose;
+
+    /** 公共-追加锁时 */
+    @ApiModelProperty(value = "公共-追加锁时", position = 11)
+    private BigDecimal appendLockTime;
+
+    /** 公共-极限量 */
+    @ApiModelProperty(value = "公共-极限量", position = 12)
+    private BigDecimal maxDose;
+
+    /** 公共-自控次数 */
+    @ApiModelProperty(value = "公共-自控次数", position = 13)
+    private Integer selfControlCount;
+
+    /** 公共-自控锁时 */
+    @ApiModelProperty(value = "公共-自控锁时", position = 14)
+    private BigDecimal selfControlLockTime;
+
+    /** 公共-有效次数 */
+    @ApiModelProperty(value = "公共-有效次数", position = 15)
+    private Integer pcaValidCount;
+
+    /** 公共-无效次数 */
+    @ApiModelProperty(value = "公共-无效次数", position = 16)
+    private Integer pcaInvalidCount;
+
+    /** 公共-总按次数 */
+    @ApiModelProperty(value = "公共-总按次数", position = 17)
+    private Integer pcaTotalCount;
+
+    /** 持续-持续量 */
+    @ApiModelProperty(value = "持续-持续量", position = 18)
+    private BigDecimal continueDose;
+
+    /** 脉冲-脉冲量 */
+    @ApiModelProperty(value = "脉冲-脉冲量", position = 19)
+    private Integer pulseDose;
+
+    /** 脉冲-脉冲锁时 */
+    @ApiModelProperty(value = "脉冲-脉冲锁时", position = 20)
+    private Integer pulseLockTime;
+
+    /** 脉冲-脉冲首次锁时 */
+    @ApiModelProperty(value = "脉冲-脉冲首次锁时", position = 21)
+    private Integer pulseFirstLockTime;
+
+    /** 智能-加档周期 */
+    @ApiModelProperty(value = "智能-加档周期", position = 22)
+    private BigDecimal flowUpCycle;
+
+    /** 智能-减档周期 */
+    @ApiModelProperty(value = "智能-减档周期", position = 23)
+    private BigDecimal flowDownCycle;
+
+    /** 智能-计次 */
+    @ApiModelProperty(value = "智能-计次", position = 24)
+    private Integer flowCount;
+
+    /** 智能-上限 */
+    @ApiModelProperty(value = "智能-上限", position = 25)
+    private BigDecimal flowUpLimit;
+
+    /** 智能-下限 */
+    @ApiModelProperty(value = "智能-下限", position = 26)
+    private BigDecimal flowDownLimit;
+
+    /** 智能-自调比例 */
+    @ApiModelProperty(value = "智能-自调比例", position = 27)
+    private BigDecimal flowAdjustRate;
+
+    /** 智能-输注过程中是否出现过加档受限 */
+    @ApiModelProperty(value = "智能-输注过程中是否出现过加档受限", position = 28)
+    private String flowRestricted;
+
+    /** 智能-加减档提示 */
+    @ApiModelProperty(value = "智能-加减档提示", position = 29)
+    private Integer warnFlow;
+
+    /** 电量 */
+    @ApiModelProperty(value = "电量", position = 30)
+    private Integer electricQuantity;
+
+    /** 镇痛泵运行状态 */
+    @ApiModelProperty(value = "镇痛泵运行状态", position = 31)
+    private Integer deviceRunState;
+
+    /** 输液将结束(0:否,1:是) */
+    @ApiModelProperty(value = "输液将结束(0:否,1:是)", position = 32)
+    private String warnWillFinished;
+
+    /** 镇痛不足(0:否,1:是) */
+    @ApiModelProperty(value = "镇痛不足(0:否,1:是)", position = 33)
+    private String warnAnalgesicPoor;
+
+    /** 电量偏低(0:否,1:是) */
+    @ApiModelProperty(value = "电量偏低(0:否,1:是)", position = 34)
+    private String warnLowBattery;
+
+    /** 报警信息 */
+    @ApiModelProperty(value = "报警信息", position = 35)
+    private Integer deviceAlarm;
+
+    /** 开始时间 */
+    @ApiModelProperty(value = "开始时间", position = 36)
+    private Date infusionStartTime;
+
+    /** 一次输注最后上传时间 */
+    @ApiModelProperty(value = "一次输注最后上传时间", position = 37)
+    private Date lastUploadTime;
+
+    /** 设备类型 */
+    @ApiModelProperty(value = "设备类型", position = 38)
+    private Integer type;
+
+    /** 医院编码 */
+    @ApiModelProperty(value = "医院编码", position = 39)
+    private String tenantId;
+
+    /** 医院编码 */
+    @ApiModelProperty(value = "医院编码", position = 40)
+    private String hospitalCode;
+}

+ 16 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizInfusionClinicRepository.java

@@ -0,0 +1,16 @@
+package cn.tr.module.smart.common.repository;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+import cn.tr.module.smart.common.po.BizInfusionClinicPO;
+/**
+ * biz_infusion_clinicMapper接口
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+@Repository
+@Mapper
+public interface BizInfusionClinicRepository extends BaseMapper<BizInfusionClinicPO> {
+}

+ 16 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizInfusionHistoryRepository.java

@@ -0,0 +1,16 @@
+package cn.tr.module.smart.common.repository;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+import cn.tr.module.smart.common.po.BizInfusionHistoryPO;
+/**
+ * 输注-输注历史记录表Mapper接口
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+@Repository
+@Mapper
+public interface BizInfusionHistoryRepository extends BaseMapper<BizInfusionHistoryPO> {
+}

+ 2 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/repository/BizPatientRepository.java

@@ -25,4 +25,6 @@ public interface BizPatientRepository extends BaseMapper<BizPatientPO> {
     List<WxDoctorPatientVO> selectPatientList(@Param("query") AppDoctorPatientInfoDTO query);
 
     List<BizPatientDTO> selectPatientByConditionList(@Param("query") BizPatientQueryDTO query);
+
+    BizPatientPO selectMayBeLinkedPatient(@Param("patientCode") String patientCode,@Param("tenantId") String tenantId);
 }

+ 54 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizInfusionClinicService.java

@@ -0,0 +1,54 @@
+package cn.tr.module.smart.common.service;
+
+import cn.tr.module.smart.common.dto.BizInfusionClinicDTO;
+import cn.tr.module.smart.common.dto.BizInfusionClinicQueryDTO;
+import java.util.*;
+
+/**
+ * biz_infusion_clinicService接口
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+public interface IBizInfusionClinicService{
+
+    /**
+     * 根据条件查询biz_infusion_clinic
+     * @param    query 查询参数
+     * @author   lf
+     * @date      2025/08/05 10:28
+     */
+    List<BizInfusionClinicDTO> selectBizInfusionClinicList(BizInfusionClinicQueryDTO query);
+
+    /**
+     * 根据id查询biz_infusion_clinic
+     * @param    id 主键id
+     * @author   lf
+     * @date      2025/08/05 10:28
+     */
+    BizInfusionClinicDTO selectBizInfusionClinicById(String id);
+
+    /**
+     * 编辑biz_infusion_clinic
+     * @param   source 编辑实体类
+     * @author  lf
+     * @date     2025/08/05 10:28
+     */
+    boolean updateBizInfusionClinicById(BizInfusionClinicDTO source);
+
+    /**
+     * 新增biz_infusion_clinic
+     * @param   source 新增实体类
+     * @author lf
+     * @date  2025/08/05 10:28
+     */
+    boolean insertBizInfusionClinic(BizInfusionClinicDTO source);
+
+    /**
+     * 删除biz_infusion_clinic详情
+     * @param  ids 删除主键集合
+     * @author lf
+     * @date    2025/08/05 10:28
+     */
+    int removeBizInfusionClinicByIds(Collection<String> ids);
+}

+ 54 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizInfusionHistoryService.java

@@ -0,0 +1,54 @@
+package cn.tr.module.smart.common.service;
+
+import cn.tr.module.smart.common.dto.BizInfusionHistoryDTO;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryQueryDTO;
+import java.util.*;
+
+/**
+ * 输注-输注历史记录表Service接口
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+public interface IBizInfusionHistoryService{
+
+    /**
+     * 根据条件查询输注-输注历史记录表
+     * @param    query 查询参数
+     * @author   lf
+     * @date      2025/08/05 10:31
+     */
+    List<BizInfusionHistoryDTO> selectBizInfusionHistoryList(BizInfusionHistoryQueryDTO query);
+
+    /**
+     * 根据id查询输注-输注历史记录表
+     * @param    id 主键id
+     * @author   lf
+     * @date      2025/08/05 10:31
+     */
+    BizInfusionHistoryDTO selectBizInfusionHistoryById(String id);
+
+    /**
+     * 编辑输注-输注历史记录表
+     * @param   source 编辑实体类
+     * @author  lf
+     * @date     2025/08/05 10:31
+     */
+    boolean updateBizInfusionHistoryById(BizInfusionHistoryDTO source);
+
+    /**
+     * 新增输注-输注历史记录表
+     * @param   source 新增实体类
+     * @author lf
+     * @date  2025/08/05 10:31
+     */
+    boolean insertBizInfusionHistory(BizInfusionHistoryDTO source);
+
+    /**
+     * 删除输注-输注历史记录表详情
+     * @param  ids 删除主键集合
+     * @author lf
+     * @date    2025/08/05 10:31
+     */
+    int removeBizInfusionHistoryByIds(Collection<String> ids);
+}

+ 92 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizInfusionClinicServiceImpl.java

@@ -0,0 +1,92 @@
+package cn.tr.module.smart.common.service.impl;
+
+import cn.tr.core.exception.TRExcCode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import cn.hutool.core.collection.CollectionUtil;
+import org.springframework.transaction.annotation.Transactional;
+import cn.tr.core.exception.ServiceException;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import cn.tr.module.smart.common.repository.BizInfusionClinicRepository;
+import cn.tr.module.smart.common.po.BizInfusionClinicPO;
+import cn.tr.module.smart.common.dto.BizInfusionClinicDTO;
+import cn.tr.module.smart.common.dto.BizInfusionClinicQueryDTO;
+import java.util.*;
+import cn.tr.module.smart.common.service.IBizInfusionClinicService;
+import cn.tr.module.smart.common.mapper.BizInfusionClinicMapper;
+/**
+ * biz_infusion_clinicService接口实现类
+ *
+ * @author lf
+ * @date  2025/08/05 10:28
+ **/
+@Service
+public class BizInfusionClinicServiceImpl implements IBizInfusionClinicService {
+    @Autowired
+    private BizInfusionClinicRepository baseRepository;
+
+
+    /**
+    * 根据条件查询biz_infusion_clinic
+    * @param    query 查询参数
+    * @author   lf
+    * @date      2025/08/05 10:28
+    */
+    @Override
+    public List<BizInfusionClinicDTO> selectBizInfusionClinicList(BizInfusionClinicQueryDTO query){
+        return BizInfusionClinicMapper.INSTANCE.convertDtoList(
+                baseRepository.selectList(new LambdaQueryWrapper<BizInfusionClinicPO>()
+                )
+        );
+    };
+
+    /**
+    * 根据id查询biz_infusion_clinic
+    * @param    id 主键id
+    * @author   lf
+    * @date      2025/08/05 10:28
+    */
+    @Override
+    public BizInfusionClinicDTO selectBizInfusionClinicById(String id){
+        return BizInfusionClinicMapper.INSTANCE.convertDto(baseRepository.selectById(id));
+    };
+
+    /**
+    * 编辑biz_infusion_clinic
+    * @param   source 编辑实体类
+    * @author  lf
+    * @date     2025/08/05 10:28
+    */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean updateBizInfusionClinicById(BizInfusionClinicDTO source){
+            return baseRepository.updateById(BizInfusionClinicMapper.INSTANCE.convertPO(source))!=0;
+    };
+
+    /**
+    * 新增biz_infusion_clinic
+    * @param   source 新增实体类
+    * @author lf
+    * @date  2025/08/05 10:28
+    */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean insertBizInfusionClinic(BizInfusionClinicDTO source){
+        return baseRepository.insert(BizInfusionClinicMapper.INSTANCE.convertPO(source))!=0;
+    };
+
+    /**
+    * 删除biz_infusion_clinic详情
+    * @param  ids 删除主键集合
+    * @author lf
+    * @date    2025/08/05 10:28
+    */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int removeBizInfusionClinicByIds(Collection<String> ids){
+        if(CollectionUtil.isEmpty(ids)){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"请选择要删除的数据");
+        }
+        return baseRepository.deleteBatchIds(ids);
+    };
+}

+ 92 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizInfusionHistoryServiceImpl.java

@@ -0,0 +1,92 @@
+package cn.tr.module.smart.common.service.impl;
+
+import cn.tr.core.exception.TRExcCode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import cn.hutool.core.collection.CollectionUtil;
+import org.springframework.transaction.annotation.Transactional;
+import cn.tr.core.exception.ServiceException;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import cn.tr.module.smart.common.repository.BizInfusionHistoryRepository;
+import cn.tr.module.smart.common.po.BizInfusionHistoryPO;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryDTO;
+import cn.tr.module.smart.common.dto.BizInfusionHistoryQueryDTO;
+import java.util.*;
+import cn.tr.module.smart.common.service.IBizInfusionHistoryService;
+import cn.tr.module.smart.common.mapper.BizInfusionHistoryMapper;
+/**
+ * 输注-输注历史记录表Service接口实现类
+ *
+ * @author lf
+ * @date  2025/08/05 10:31
+ **/
+@Service
+public class BizInfusionHistoryServiceImpl implements IBizInfusionHistoryService {
+    @Autowired
+    private BizInfusionHistoryRepository baseRepository;
+
+
+    /**
+    * 根据条件查询输注-输注历史记录表
+    * @param    query 查询参数
+    * @author   lf
+    * @date      2025/08/05 10:31
+    */
+    @Override
+    public List<BizInfusionHistoryDTO> selectBizInfusionHistoryList(BizInfusionHistoryQueryDTO query){
+        return BizInfusionHistoryMapper.INSTANCE.convertDtoList(
+                baseRepository.selectList(new LambdaQueryWrapper<BizInfusionHistoryPO>()
+                )
+        );
+    };
+
+    /**
+    * 根据id查询输注-输注历史记录表
+    * @param    id 主键id
+    * @author   lf
+    * @date      2025/08/05 10:31
+    */
+    @Override
+    public BizInfusionHistoryDTO selectBizInfusionHistoryById(String id){
+        return BizInfusionHistoryMapper.INSTANCE.convertDto(baseRepository.selectById(id));
+    };
+
+    /**
+    * 编辑输注-输注历史记录表
+    * @param   source 编辑实体类
+    * @author  lf
+    * @date     2025/08/05 10:31
+    */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean updateBizInfusionHistoryById(BizInfusionHistoryDTO source){
+            return baseRepository.updateById(BizInfusionHistoryMapper.INSTANCE.convertPO(source))!=0;
+    };
+
+    /**
+    * 新增输注-输注历史记录表
+    * @param   source 新增实体类
+    * @author lf
+    * @date  2025/08/05 10:31
+    */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean insertBizInfusionHistory(BizInfusionHistoryDTO source){
+        return baseRepository.insert(BizInfusionHistoryMapper.INSTANCE.convertPO(source))!=0;
+    };
+
+    /**
+    * 删除输注-输注历史记录表详情
+    * @param  ids 删除主键集合
+    * @author lf
+    * @date    2025/08/05 10:31
+    */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int removeBizInfusionHistoryByIds(Collection<String> ids){
+        if(CollectionUtil.isEmpty(ids)){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"请选择要删除的数据");
+        }
+        return baseRepository.deleteBatchIds(ids);
+    };
+}

+ 2 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizPatientServiceImpl.java

@@ -43,6 +43,8 @@ public class BizPatientServiceImpl implements IBizPatientService {
     public BizPatientPO insertBizPatientAndReturnObj(BizClinicAddOrEditDTO source) {
         BizPatientPO insertSource = new BizPatientPO();
         insertSource.setPatientCode(source.getPatientCode());
+        insertSource.setNewHuman(source.getNewHuman());
+        insertSource.setCardNo(source.getCardNo());
         baseRepository.insert(insertSource);
         return insertSource;
     }

+ 7 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/mapper/SysTenantMapper.java

@@ -38,6 +38,13 @@ public interface SysTenantMapper {
     )
     List<SysTenantPojo> toPojoList(List<SysTenantPO> source);
 
+    @Mappings(
+            {
+                    @Mapping(target = "tenantId",source = "id")
+            }
+    )
+    SysTenantPojo toPojo(SysTenantPO source);
+
     SysTenantPO toPO(SysTenantAndRoleAddDTO source);
     SysTenantPO toPONoPackage(SysTenantAddNoPackageDTO source);
 }

+ 3 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/po/SysTenantPO.java

@@ -22,6 +22,9 @@ public class SysTenantPO extends BasePO {
     @ApiModelProperty("租户名称")
     private String name;
 
+    @ApiModelProperty("医院编码")
+    private String code;
+
     @ApiModelProperty("租户类型")
     private String type;
 

+ 11 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/provider/SysTenantApiProvider.java

@@ -3,6 +3,7 @@ package cn.tr.module.sys.user.provider;
 import cn.tr.module.api.sys.tenant.SysTenantApi;
 import cn.tr.module.api.sys.tenant.SysTenantPojo;
 import cn.tr.module.sys.tenant.mapper.SysTenantMapper;
+import cn.tr.module.sys.tenant.po.SysTenantPO;
 import cn.tr.module.sys.tenant.repository.SysTenantRepository;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,4 +25,14 @@ public class SysTenantApiProvider implements SysTenantApi {
     public List<SysTenantPojo> selectAll() {
         return SysTenantMapper.INSTANCE.toPojoList(repository.selectList(new LambdaQueryWrapper<>()));
     }
+
+    @Override
+    public SysTenantPojo selectByHospitalCode(String hospitalCode) {
+        return SysTenantMapper.INSTANCE.toPojo(
+                repository.selectOne(new LambdaQueryWrapper<SysTenantPO>()
+                        .eq(SysTenantPO::getCode,hospitalCode)
+                        .last("limit 1")
+                )
+        );
+    }
 }

+ 64 - 0
tr-plugins/tr-spring-boot-starter-plugin-mybatis/src/main/java/cn/tr/plugin/mybatis/config/handler/JsonbListTypeHandler.java

@@ -0,0 +1,64 @@
+package cn.tr.plugin.mybatis.config.handler;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.CollectionType;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedJdbcTypes;
+import org.apache.ibatis.type.MappedTypes;
+import org.postgresql.util.PGobject;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+
+@MappedJdbcTypes(JdbcType.OTHER)
+@MappedTypes(List.class)
+public abstract class JsonbListTypeHandler<T> extends BaseTypeHandler<List<T>> {
+
+    private static final ObjectMapper mapper = new ObjectMapper();
+
+    public abstract Class<T> specificType();
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i, List<T> parameter, JdbcType jdbcType) throws SQLException {
+        try {
+            PGobject jsonObject = new PGobject();
+            jsonObject.setType("jsonb");
+            jsonObject.setValue(mapper.writeValueAsString(parameter));
+            ps.setObject(i, jsonObject);
+        } catch (JsonProcessingException e) {
+            throw new SQLException("Error converting List<T> to JSONB string", e);
+        }
+    }
+
+    @Override
+    public List<T> getNullableResult(ResultSet rs, String columnName) throws SQLException {
+        return parseJson(rs.getString(columnName));
+    }
+
+    @Override
+    public List<T> getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+        return parseJson(rs.getString(columnIndex));
+    }
+
+    @Override
+    public List<T> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
+        return parseJson(cs.getString(columnIndex));
+    }
+
+    private List<T> parseJson(String json) throws SQLException {
+        if (json == null || json.isEmpty()) {
+            return null;
+        }
+        try {
+            CollectionType collectionType = mapper.getTypeFactory()
+                    .constructCollectionType(List.class,specificType());
+            return mapper.readValue(json, collectionType);
+        } catch (JsonProcessingException e) {
+            throw new SQLException("Error parsing JSONB string to List<T>: " + json, e);
+        }
+    }
+}