Sfoglia il codice sorgente

医生端查询手术列表修改调整提交

wangzl 2 mesi fa
parent
commit
dfd0aa2e7b

+ 11 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/AppClinicRoomController.java

@@ -93,6 +93,7 @@ public class AppClinicRoomController extends BaseController {
     @ApiOperationSupport(author = "lf",order = 7)
     @ApiOperation(value="查询住院号相关未绑定医生的手术信息",notes = "权限: 无")
     @PostMapping("/queryPatientCode")
+    @Deprecated
     public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> queryPatientCode(@RequestBody@Validated AppDoctorClinicQueryByPatientCodeDTO source) {
         return CommonResult.success(clinicRoomService.stdAppSelectListByPatientCode(source));
     }
@@ -114,12 +115,14 @@ public class AppClinicRoomController extends BaseController {
     @ApiOperationSupport(author = "wangzl",order = 8)
     @ApiOperation(value="查询住院号相关最新的手术信息",notes = "权限: 无")
     @PostMapping("/queryPatientCodeLast")
+    @Deprecated
     public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> queryPatientCodeLast(@RequestBody@Validated AppDoctorClinicQueryByPatientCodeDTO source) {
         return CommonResult.success(clinicRoomService.stdAppSelectListByPatientCodeLast(source));
     }
     @ApiOperationSupport(author = "wangzl",order = 9)
     @ApiOperation(value="绑定手术信息",notes = "权限: 无")
     @PostMapping("/bindLastClinic")
+    @Deprecated
     public CommonResult<Boolean> stdBindLastClinic(@RequestBody@Validated(Insert.class) BizClinicAddOrEditDTO source) {
         return CommonResult.success(clinicRoomService.stdBindLastClinic(source));
     }
@@ -127,7 +130,15 @@ public class AppClinicRoomController extends BaseController {
     @ApiOperationSupport(author = "wangzl",order = 10)
     @ApiOperation(value="新增手术信息",notes = "权限: 无")
     @PostMapping("/insert")
+    @Deprecated
     public CommonResult<Boolean> stdInsertDoctorApp(@RequestBody@Validated(Insert.class) BizClinicAddOrEditDTO source) {
         return CommonResult.success(clinicRoomService.stdInsertDoctorApp(source));
     }
+
+    @ApiOperationSupport(author = "wangzl", order = 11)
+    @ApiOperation(value = "查询手术信息列表", notes = "权限: 无")
+    @PostMapping("/queryClinicList")
+    public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> queryClinicList(@RequestBody AppDoctorClinicQueryByPatientCodeDTO source) {
+        return CommonResult.success(clinicRoomService.queryClinicList(source));
+    }
 }

+ 3 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/dto/AppDoctorClinicQueryByPatientCodeDTO.java

@@ -22,9 +22,11 @@ public class AppDoctorClinicQueryByPatientCodeDTO implements Serializable {
     private static final long serialVersionUID = 1L;
 
     @ApiModelProperty(value = "住院号", position = 1)
-    @NotBlank(message = "住院号不能为空")
     private String patientCode;
 
+    @ApiModelProperty(value = "检索内容",position = 2)
+    private String condition;
+
     @ApiModelProperty(hidden = true)
     @JsonIgnore
     private String wxUserId;

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

@@ -61,4 +61,5 @@ public interface BizClinicRoomRepository extends BaseMapper<BizClinicRoomPO> {
 
     List<WxDoctorClinicRoomThumbnailVO> stdAppselectListByPatientCode(@Param("query") AppDoctorClinicQueryByPatientCodeDTO source);
     List<WxDoctorClinicRoomThumbnailVO> stdAppselectListByPatientCodeLast(@Param("query") AppDoctorClinicQueryByPatientCodeDTO source);
+    List<WxDoctorClinicRoomThumbnailVO> stdQueryClinicList(@Param("query") AppDoctorClinicQueryByPatientCodeDTO source);
 }

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

@@ -203,4 +203,11 @@ public interface IBizClinicRoomService {
     List<BizWxDeptQuestionVO> generatePreSurgeryQuestionnaireAi(String clinicId) throws NoApiKeyException, InputRequiredException;
 
     List<BizWxDeptQuestionVO> getPreSurgeryQuestionnaireAi(String clinicId);
+    /**
+     * @description: 医生端查询手术信息列表
+     * @author wangzl
+     * @date 2025/9/23
+     */
+    List<WxDoctorClinicRoomThumbnailVO> queryClinicList(AppDoctorClinicQueryByPatientCodeDTO source);
+
 }

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

@@ -779,6 +779,17 @@ public class BizClinicRoomServiceImpl implements IBizClinicRoomService {
         return null;
     }
 
+    /**
+     * @param source
+     * @description: 医生端查询手术信息列表
+     * @author wangzl
+     * @date 2025/9/23
+     */
+    @Override
+    public List<WxDoctorClinicRoomThumbnailVO> queryClinicList(AppDoctorClinicQueryByPatientCodeDTO source) {
+        return baseRepository.stdQueryClinicList(source);
+    }
+
     /**
      * 微信小程序基于医生已填写的信息更新数据
      */

+ 49 - 2
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -65,6 +65,7 @@
         <result property="warnFlow" column="warn_flow"/>
         <result property="unreadCount" column="unread_count"/>
         <result property="lastModifyUserType" column="last_modify_user_type"/>
+        <result property="infusionId" column="infusion_id"/>
     </resultMap>
 
 
@@ -155,7 +156,8 @@
         bih.warn_flow as warn_flow,
         bih.warn_analgesic_poor as warn_analgesic_poor,
         bcr.last_modify_user_type as last_modify_user_type,
-        GREATEST(COALESCE(igu.unread_count, 0), 0) as unread_count
+        GREATEST(COALESCE(igu.unread_count, 0), 0) as unread_count,
+        bih.id as infusion_id
         FROM biz_clinic_room bcr
         join biz_clinic_room_doctor_user bcrmu on bcr.id = bcrmu.clinic_room_id
         left join biz_infusion_clinic as bic on bic.clinic_id = bcr.id
@@ -647,7 +649,10 @@
         left join biz_clinic_room_wx_user as bcrwu on bcr.id = bcrwu.clinic_room_id
         left join biz_clinic_room_doctor_user as bcrdu on bcr.id = bcrdu.clinic_room_id
         <where>
-            bcrdu.id is null and bp.deleted = 0 and bcr.deleted = 0 and bp.patient_code like concat('%',#{query.patientCode},'%')
+            bcrdu.id is null and bp.deleted = 0 and bcr.deleted = 0
+            <if test="query.patientCode !=null and query.patientCode != ''">
+                and bp.patient_code like concat('%',#{query.patientCode},'%')
+            </if>
             <if test="query.wxUserId !=null and query.wxUserId != ''">
                 and bcrwu.wx_user_id = #{query.wxUserId}
             </if>
@@ -655,4 +660,46 @@
         order by bcr.clinic_start_time desc
          LIMIT 1
     </select>
+    <select id="stdQueryClinicList" resultMap="stdThumbnailResult">
+        select
+        bcr.id as clinic_room_id,
+        bcr.clinic_name as clinic_name,
+        bcr.clinic_start_time as clinic_start_time,
+        bcr.dept_id as dept_id,
+        bp.id as patient_id,
+        bcr.dept_name as dept_name,
+        bcr.patient_code as patient_code,
+        bcr.patient_name as patient_name,
+        bcr.patient_gender as patient_gender,
+        bcr.patient_age as patient_age,
+        bcr.image_url as patient_avatar,
+        bcr.last_modify_user_type as last_modify_user_type,
+        bp.card_no as card_no,
+        bp.new_human as new_human,
+        bcrdu.user_id as doctor_id,
+        bcrwu.wx_user_id as wx_user_id
+        from
+        biz_patient as bp
+        join biz_clinic_room as bcr on bp.current_clinic_id = bcr.id
+        left join biz_clinic_room_wx_user as bcrwu on bcr.id = bcrwu.clinic_room_id
+        left join biz_clinic_room_doctor_user as bcrdu on bcr.id = bcrdu.clinic_room_id
+        <where>
+            bcrdu.id is null
+            and bp.deleted = 0
+            and bcr.deleted = 0
+            <if test="query.patientCode !=null and query.patientCode != ''">
+                and bp.patient_code like concat('%',#{query.patientCode},'%')
+            </if>
+            <if test="query.condition !=null and query.condition != ''">
+                and (
+                bcr.patient_name LIKE concat('%',#{query.condition,jdbcType=VARCHAR},'%')
+                or bcr.clinic_name like concat('%',#{query.condition,jdbcType=VARCHAR},'%')
+                )
+            </if>
+            <if test="query.wxUserId !=null and query.wxUserId != ''">
+                and bcrwu.wx_user_id = #{query.wxUserId}
+            </if>
+        </where>
+        order by bcr.clinic_start_time desc
+    </select>
 </mapper>