wangzl 5 mesiacov pred
rodič
commit
c7b585925a

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

@@ -44,4 +44,7 @@ public class BizPatientDTO extends BaseDTO  {
     @ApiModelProperty(value = "手术开始时间", position = 8)
     private Date clinicStartTime;
 
+    @ApiModelProperty(value = "住院号", position = 9)
+    private String patientCode;
+
 }

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

@@ -2,6 +2,7 @@ package cn.tr.module.smart.common.repository;
 
 import cn.tr.module.smart.common.dto.BizClinicRoomDTO;
 import cn.tr.module.smart.common.dto.BizClinicRoomQueryDTO;
+import cn.tr.module.smart.web.dto.BizPatientClinicListDTO;
 import cn.tr.module.smart.wx.controller.vo.BizWxAppletClinicDetailVO;
 import cn.tr.module.smart.wx.controller.vo.BizWxAppletClinicVO;
 import cn.tr.module.smart.wx.dto.BizWxAppletClinicQueryDTO;
@@ -36,4 +37,6 @@ public interface BizClinicRoomRepository extends BaseMapper<BizClinicRoomPO> {
     BizWxAppletClinicDetailVO stdSelectWxAppletById(@Param("id") String id);
 
     List<BizClinicRoomDTO> selectClinicByCondition(@Param("queryDTO") BizClinicRoomQueryDTO queryDTO);
+
+    List<BizPatientClinicListDTO> selectClinicAndDoctorByPatientIdList(@Param("patientId") String patientId);
 }

+ 4 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/IBizPatientService.java

@@ -6,9 +6,11 @@ import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
 import cn.tr.module.smart.common.dto.BizPatientDTO;
 import cn.tr.module.smart.common.dto.BizPatientQueryDTO;
 import cn.tr.module.smart.common.po.BizPatientPO;
+import cn.tr.module.smart.web.dto.BizPatientDetailDTO;
 import cn.tr.module.smart.wx.dto.BizClinicAddOrEditDTO;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.List;
 
 /**
  * 患者信息Service接口
@@ -32,7 +34,7 @@ public interface IBizPatientService{
      * @author   lf
      * @date      2025/06/09 15:58
      */
-    BizPatientDTO selectBizPatientById(String id);
+    BizPatientDetailDTO selectBizPatientById(String id);
 
     /**
      * 编辑患者信息

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

@@ -4,8 +4,12 @@ import cn.tr.core.exception.TRExcCode;
 import cn.tr.module.smart.app.controller.dto.WxDoctorPatientInfoDTO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorPatientListVO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorPatientVO;
+import cn.tr.module.smart.common.dto.BizClinicRoomDTO;
+import cn.tr.module.smart.common.mapper.BizClinicRoomMapper;
 import cn.tr.module.smart.common.po.BizClinicRoomPO;
 import cn.tr.module.smart.common.repository.BizClinicRoomRepository;
+import cn.tr.module.smart.web.dto.BizPatientClinicListDTO;
+import cn.tr.module.smart.web.dto.BizPatientDetailDTO;
 import cn.tr.module.smart.wx.dto.BizClinicAddOrEditDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -79,9 +83,23 @@ public class BizPatientServiceImpl implements IBizPatientService {
      * @date      2025/06/09 15:58
      */
     @Override
-    public BizPatientDTO selectBizPatientById(String id){
-        return BizPatientMapper.INSTANCE.convertDto(baseRepository.selectById(id));
-    };
+    public BizPatientDetailDTO selectBizPatientById(String id){
+        //查询最新手术的患者信息
+        BizPatientPO bizPatientPO = baseRepository.selectById(id);
+        BizClinicRoomPO bizClinicRoomPO = clinicRoomRepository.selectById(bizPatientPO.getCurrentClinicId());
+        if(Objects.isNull(bizClinicRoomPO)){
+            throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001,"未查询到手术信息");
+        }
+        //查询所有手术信息
+        List<BizPatientClinicListDTO> bizPatientClinicListDTOS = clinicRoomRepository.selectClinicAndDoctorByPatientIdList(id);
+        return BizPatientDetailDTO.builder()
+                .patientCode(bizClinicRoomPO.getPatientCode())
+                .patientName(bizClinicRoomPO.getPatientName())
+                .patientGender(bizClinicRoomPO.getPatientGender())
+                .patientAge(bizClinicRoomPO.getPatientAge())
+                .clinicList(bizPatientClinicListDTOS)
+                .build();
+    }
 
     /**
      * 编辑患者信息

+ 2 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/web/controller/BizPatientController.java

@@ -1,5 +1,6 @@
 package cn.tr.module.smart.web.controller;
 
+import cn.tr.module.smart.web.dto.BizPatientDetailDTO;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 
@@ -45,7 +46,7 @@ public class BizPatientController extends BaseController{
     @ApiOperation(value = "根据id查询患者信息",notes = "权限: common:patient:query")
     @GetMapping("/detail/{id}")
     @SaCheckPermission("common:patient:query")
-    public CommonResult<BizPatientDTO> findById(@PathVariable("id") String id){
+    public CommonResult<BizPatientDetailDTO> findById(@PathVariable("id") String id){
         return CommonResult.success(bizPatientService.selectBizPatientById(id));
     }
 

+ 35 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/web/dto/BizPatientClinicListDTO.java

@@ -0,0 +1,35 @@
+package cn.tr.module.smart.web.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/7/17 8:37
+ */
+@Data
+@ToString
+@ApiModel("Web端")
+public class BizPatientClinicListDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "手术ID" ,position = 1)
+    private String clinicId;
+    @ApiModelProperty(value = "手术名称",position = 2)
+    private String clinicName;
+    @ApiModelProperty(value = "手术开始时间",position = 3)
+    private Date clinicStartTime;
+    @ApiModelProperty(value = "科室ID",position = 4)
+    private String deptId;
+    @ApiModelProperty(value = "科室名称",position = 5)
+    private String deptName;
+    @ApiModelProperty(value = "医生名称",position = 6)
+    private String doctorName;
+
+}

+ 33 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/web/dto/BizPatientDetailDTO.java

@@ -0,0 +1,33 @@
+package cn.tr.module.smart.web.dto;
+
+import cn.tr.plugin.mybatis.pojo.BaseDTO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+
+import java.util.List;
+
+/**
+ * @author wangzl
+ * @description: TODO
+ * @date 2025/7/17 8:06
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@ToString
+@ApiModel("患者信息详情页")
+public class BizPatientDetailDTO extends BaseDTO {
+
+    @ApiModelProperty(value = "住院编号", position = 1)
+    private String patientCode;
+    @ApiModelProperty(value = "患者姓名", position = 2)
+    private String patientName;
+    @ApiModelProperty(value = "性别", position = 3)
+    private String patientGender;
+    @ApiModelProperty(value = "年龄", position = 4)
+    private Integer patientAge;
+    @ApiModelProperty(value = "手术信息", position = 5)
+    private List<BizPatientClinicListDTO> clinicList;
+}

+ 17 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -209,4 +209,21 @@
             </if>
         </where>
     </select>
+    <select id="selectClinicAndDoctorByPatientIdList"
+            resultType="cn.tr.module.smart.web.dto.BizPatientClinicListDTO">
+        SELECT
+            bcr.id,
+            bcr.clinic_name,
+            bcr.clinic_start_time,
+            bcr.dept_id,
+            bcr.dept_name
+        FROM
+            biz_clinic_room bcr
+                JOIN biz_clinic_room_doctor_user bcrdu ON bcr.ID = bcrdu.clinic_room_id
+        <where>
+            <if test="patientId != null and patientId != ''">
+                and bcr.patient_id = #{patientId}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 1 - 0
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizPatientMapper.xml

@@ -71,6 +71,7 @@
             bcr.clinic_name as clinicName,
             bcr.clinic_start_time as clinicStartTime,
             bp.current_clinic_id as currentClinicId,
+            bp.patient_code as patientCode,
             bp.create_by as create_by,
             bp.create_time as create_time,
             bp.update_time as update_time,