Selaa lähdekoodia

add
增加泵数据

18339543638 4 kuukautta sitten
vanhempi
commit
e4f993521a

+ 4 - 4
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/ALiYunController.java

@@ -1,15 +1,15 @@
 package cn.tr.module.smart.app.controller;
 
 import cn.tr.core.pojo.CommonResult;
-import cn.tr.module.smart.app.controller.dto.UploadFileDTO;
 import cn.tr.module.smart.app.controller.vo.WxDoctorClinicRoomThumbnailVO;
 import cn.tr.module.smart.common.service.ALiYunService;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
 import java.util.*;
 
 /**
@@ -28,7 +28,7 @@ public class ALiYunController {
 
     @PostMapping("/recognize")
     @ApiOperation(value = "识别患者图片信息",notes = "权限: 无")
-    public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> recognizeImage(@RequestBody byte[] source) throws Exception {
-        return CommonResult.success(aliYunService.recognizeImage(source));
+    public CommonResult<List<WxDoctorClinicRoomThumbnailVO>> recognizeImage(@RequestParam MultipartFile file) throws Exception {
+        return CommonResult.success(aliYunService.recognizeImage(file));
     }
 }

+ 6 - 0
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/vo/DoctorClinicRoomVO.java

@@ -20,12 +20,18 @@ public class DoctorClinicRoomVO implements Serializable {
     @ApiModelProperty(value = "手术ID", position = 1)
     private String clinicRoomId;
 
+    @ApiModelProperty("用户头像连接")
+    private String patientAvatar;
+
     @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 = 4)
     private String deptName;
 

+ 1 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/ALiYunService.java

@@ -16,5 +16,5 @@ import java.util.Map;
  */
 public interface ALiYunService {
 
-    List<WxDoctorClinicRoomThumbnailVO> recognizeImage(byte[] file) throws Exception;
+    List<WxDoctorClinicRoomThumbnailVO> recognizeImage(MultipartFile file) throws Exception;
 }

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

@@ -68,7 +68,7 @@ public class ALiYunServiceImpl implements ALiYunService {
     }
 
     @Override
-    public List<WxDoctorClinicRoomThumbnailVO> recognizeImage(byte[] bytes) throws Exception {
+    public List<WxDoctorClinicRoomThumbnailVO> recognizeImage(MultipartFile file) throws Exception {
         List<WxDoctorClinicRoomThumbnailVO> result = new ArrayList<>();
         List<BizDeptPO> deptList = deptRepository.selectList(new LambdaQueryWrapper<>());
 
@@ -87,14 +87,12 @@ public class ALiYunServiceImpl implements ALiYunService {
 
                             .collect(Collectors.toList())));
         }
-
-        String imageName="aiImage/"+ IdWorker.getIdStr()+".png";
         String imageUrl;
         SysStorageRecordDTO uploadResult = fileService.upload(
                 null,
                 null,
-                imageName,
-                bytes,
+                file.getOriginalFilename(),
+                file.getBytes(),
                 null);
 
         imageUrl = uploadResult.getAbsolutePath();

+ 38 - 15
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -28,10 +28,11 @@
         <result property="lastAfterQuestionTime" column="last_after_question_time"/>
     </resultMap>
 
-    <resultMap id="RoomAndPatient" type="cn.tr.module.smart.app.controller.vo.DoctorClinicRoomVO">
-        <result property="clinicRoomId" column="id"/>
+    <resultMap id="roomAndPatient" type="cn.tr.module.smart.app.controller.vo.DoctorClinicRoomVO">
+        <result property="clinicRoomId" column="clinic_room_id"/>
         <result property="clinicName" column="clinic_name"/>
         <result property="clinicStartTime" column="clinic_start_time"/>
+        <result property="deptId" column="dept_id"/>
         <result property="deptName" column="dept_name"/>
         <result property="patientCode" column="patient_code"/>
         <result property="patientName" column="patient_name"/>
@@ -39,6 +40,16 @@
         <result property="patientGender" column="patient_gender"/>
         <result property="followUpCount" column="follow_up_count"/>
         <result property="assessCount" column="assess_count"/>
+        <result property="patientAvatar" column="patient_avatar"/>
+        <result property="deviceType" column="device_type"/>
+        <result property="deviceId" column="device_id"/>
+        <result property="electricQuantity" column="electric_quantity"/>
+        <result property="deviceRunState" column="device_run_state"/>
+        <result property="deviceAlarm" column="device_alarm"/>
+        <result property="warnLowBattery" column="warn_low_battery"/>
+        <result property="warnWillFinished" column="warn_will_finished"/>
+        <result property="warnAnalgesicPoor" column="warn_analgesic_poor"/>
+        <result property="warnFlow" column="warn_flow"/>
     </resultMap>
 
 
@@ -92,20 +103,32 @@
         </where>
     </select>
 
-    <select id="selectByClinicRoomAndPatientList" resultMap="RoomAndPatient">
-        SELECT bcr.id,
-        bcr.clinic_name,
-        bcr.clinic_start_time,
-        bcr.dept_name,
-        bcr.patient_name,
-        bcr.patient_age,
-        bcr.patient_gender,
-        bcr.patient_code,
-        bcr.follow_up_count,
-        bcr.assess_count
+    <select id="selectByClinicRoomAndPatientList" resultMap="roomAndPatient">
+        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,
+        bcr.dept_name as dept_name,
+        bcr.patient_name as patient_name,
+        bcr.patient_age as patient_age,
+        bcr.patient_gender as patient_gender,
+        bcr.patient_code as patient_code,
+        bcr.follow_up_count as follow_up_count,
+        bcr.image_url as patient_avatar,
+        bcr.assess_count as assess_count,
+        bih.device_id as device_id,
+        bih.device_type as device_type,
+        bih.electric_quantity as electric_quantity,
+        bih.device_run_state as device_run_state,
+        bih.device_alarm as device_alarm,
+        bih.warn_low_battery as warn_low_battery,
+        bih.warn_will_finished as warn_will_finished,
+        bih.warn_flow as warn_flow,
+        bih.warn_analgesic_poor as warn_analgesic_poor
         FROM biz_clinic_room bcr
-        join biz_clinic_room_doctor_user bcrmu
-        on bcr.id = bcrmu.clinic_room_id
+        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
+        left join biz_infusion_history as bih on bih.id=bic.infusion_id
         <where>
             and bcr.deleted = 0
             <if test="source.clinicStatus != null and source.clinicStatus != ''">