From ccd37938a45c3f79bd576e8c30152c16d69f0224 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Wed, 10 Aug 2022 11:08:19 +0800 Subject: [PATCH] =?UTF-8?q?App=E7=AB=AF=E8=AF=8A=E6=96=AD=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=B8=8A=E4=BC=A0=E5=85=A5=E5=8F=82=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 7 ++- .../ruoyi/system/domain/req/AppRecordReq.java | 51 ++----------------- .../service/impl/TRecordServiceImpl.java | 32 +++++++++--- 3 files changed, 36 insertions(+), 54 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 5ee236b..dbdaa28 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -3,7 +3,10 @@ package com.ruoyi.web.controller.api; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.system.domain.*; +import com.ruoyi.system.domain.THospital; +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.TPatientHospitalDoctor; +import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.req.AppPatientHospitalDoctor; import com.ruoyi.system.domain.req.AppPatientReq; import com.ruoyi.system.domain.req.AppRecordReq; @@ -113,7 +116,7 @@ public class AppController extends BaseController { itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); } - return AjaxResult.success(); + return AjaxResult.success("预约成功"); } @PutMapping("/record/ai/finish/{id}") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppRecordReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppRecordReq.java index 8a4a942..31494e7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppRecordReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppRecordReq.java @@ -20,6 +20,7 @@ public class AppRecordReq implements Serializable { /** * ID */ + @ApiModelProperty("记录id") private Long id; /** @@ -31,45 +32,27 @@ public class AppRecordReq implements Serializable { /** * 医生 */ - @ApiModelProperty("医生") + @ApiModelProperty("医生id") private Long doctorId; /** * 医院 */ - @ApiModelProperty("医院") + @ApiModelProperty("医院id") private Long hospitalId; - /** - * 状态(0预约 1就诊) - */ - @ApiModelProperty("状态 0=预约,1=就诊") - private String status; - /** * ai诊断结果 */ @ApiModelProperty("ai诊断结果") private String aiResult; - /** - * ai诊断结果,无图片 - */ - @ApiModelProperty("ai诊断结果,无图片") - private String aiResult2; - /** * 医生诊断结果 */ @ApiModelProperty("医生诊断结果") private String updateResult; - /** - * 医生诊断结果,无图片 - */ - @ApiModelProperty("医生诊断结果,无图片") - private String updateResult2; - /** * 上传时间 */ @@ -80,13 +63,13 @@ public class AppRecordReq implements Serializable { /** * 舌下 */ - @ApiModelProperty("舌下") + @ApiModelProperty("舌下(Base64编码)") private String imgSx; /** * 舌上 */ - @ApiModelProperty("舌上") + @ApiModelProperty("舌上(Base64编码)") private String imgSm; /** @@ -139,14 +122,6 @@ public class AppRecordReq implements Serializable { this.hospitalId = hospitalId; } - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - public String getAiResult() { return aiResult; } @@ -155,14 +130,6 @@ public class AppRecordReq implements Serializable { this.aiResult = aiResult; } - public String getAiResult2() { - return aiResult2; - } - - public void setAiResult2(String aiResult2) { - this.aiResult2 = aiResult2; - } - public String getUpdateResult() { return updateResult; } @@ -171,14 +138,6 @@ public class AppRecordReq implements Serializable { this.updateResult = updateResult; } - public String getUpdateResult2() { - return updateResult2; - } - - public void setUpdateResult2(String updateResult2) { - this.updateResult2 = updateResult2; - } - public Date getUploadTime() { return uploadTime; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java index efc0890..ed51b6c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TRecordServiceImpl.java @@ -1,22 +1,22 @@ package com.ruoyi.system.service.impl; -import java.util.*; -import java.util.stream.Collectors; - import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.TPatientHospitalDoctor; +import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.domain.resp.RecordHistoryDataResp; import com.ruoyi.system.domain.resp.TRecordResp; +import com.ruoyi.system.mapper.TRecordMapper; +import com.ruoyi.system.service.ITRecordService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.system.mapper.TRecordMapper; -import com.ruoyi.system.domain.TRecord; -import com.ruoyi.system.service.ITRecordService; + +import java.util.*; +import java.util.stream.Collectors; /** * 诊断记录信息Service业务层处理 @@ -76,10 +76,30 @@ public class TRecordServiceImpl implements ITRecordService @Override public int updateTRecord(TRecord tRecord) { + // 处理无图片信息 + if (tRecord.getAiResult() != null) { + JSONObject jsonObject = JSONObject.parseObject(tRecord.getAiResult()); + tRecord.setAiResult2(noPicture(jsonObject)); + } + if (tRecord.getUpdateResult() != null) { + JSONObject jsonObject = JSONObject.parseObject(tRecord.getUpdateResult()); + tRecord.setUpdateResult2(noPicture(jsonObject)); + } tRecord.setUpdateTime(DateUtils.getNowDate()); return tRecordMapper.updateTRecord(tRecord); } + private static String noPicture(JSONObject jsonObject) { + jsonObject.getJSONObject("shezhi").getJSONObject("shemian").put("img_sz", null); + jsonObject.getJSONObject("shezhi").getJSONObject("yudian").put("img_sz_yudian", null); + jsonObject.getJSONObject("shezhi").getJSONObject("yuban").put("img_sz_yuban", null); + jsonObject.getJSONObject("shezhi").getJSONObject("liewen").put("img_sz_liewen", null); + jsonObject.getJSONObject("shetai").put("img_st", null); + jsonObject.getJSONObject("shexia").put("img_sx", null); + jsonObject.getJSONObject("shexia").put("img_sx_vein", null); + return jsonObject.toString(); + } + /** * 批量删除诊断记录信息 *