Merge remote-tracking branch 'origin/master'

master
heminjian502 2 years ago
commit ff85acbbbe

@ -6,7 +6,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.req.AppPatientHospitalDoctor;
import com.ruoyi.system.domain.req.AppPatientReq;
import com.ruoyi.system.domain.req.AppRecordReq;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.TRecordResp;
import com.ruoyi.system.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -82,8 +84,7 @@ public class AppController extends BaseController
@GetMapping("/doctor/info")
public AjaxResult doctorInformation(Long doctorId)
{
TDoctor tDoctor = tDoctorService.selectTDoctorById(doctorId);
return AjaxResult.success(tDoctor);
return AjaxResult.success(tDoctorService.selectAppDoctorDetailById(doctorId));
}
/**
@ -99,6 +100,7 @@ public class AppController extends BaseController
// 患者预约新增t_record中的一条记录;判断关联表是否存在当前关系
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor);
tPatientHospitalDoctor.setPatientId(getUserId());
TRecord tRecord = new TRecord();
tRecord.setHospitalId(tPatientHospitalDoctor.getHospitalId());
tRecord.setPatientId(tPatientHospitalDoctor.getPatientId());
@ -129,6 +131,7 @@ public class AppController extends BaseController
@GetMapping(value = "/config/ai/refreshtime")
@Log(title = "获取AI结果刷新时间接口")
@ApiOperation("获取AI结果刷新时间接口")
public AjaxResult getConfigKey()
{
String configKey="t.ai.refreshtime";
@ -142,25 +145,29 @@ public class AppController extends BaseController
*/
@ApiOperation("诊断记录上传")
@PostMapping("/record/diagnostic/upload")
public AjaxResult diagnosticRecordsUploaded(TRecord tRecord) {
public AjaxResult diagnosticRecordsUploaded(AppRecordReq appRecordReq) {
TRecord tRecord = new TRecord();
BeanUtils.copyProperties(appRecordReq, tRecord);
return AjaxResult.success(tRecordService.updateTRecord(tRecord));
}
/**
*
*
* @param tPatient t
* @param appPatientReq App
* @return {@code AjaxResult}
*/
@ApiOperation("添加患者")
@PostMapping("/patient/add")
public AjaxResult addPatient(AppPatientReq tPatient)
public AjaxResult addPatient(AppPatientReq appPatientReq)
{
TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient);
tPatientService.insertTPatient(tPatient);
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
tPatientHospitalDoctor.setHospitalId(tPatient.getHospitalId());
tPatientHospitalDoctor.setDoctorId(tPatient.getDoctorId());
tPatientHospitalDoctor.setPatientId(tPatient.getId());
tPatientHospitalDoctor.setHospitalId(appPatientReq.getHospitalId());
tPatientHospitalDoctor.setDoctorId(appPatientReq.getDoctorId());
tPatientHospitalDoctor.setPatientId(appPatientReq.getId());
List<TPatientHospitalDoctor> tPatientHospitalDoctors = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor);
if (tPatientHospitalDoctors.isEmpty())
{
@ -169,6 +176,20 @@ public class AppController extends BaseController
return AjaxResult.success();
}
/**
*
*
* @param appPatientReq App
* @return {@code AjaxResult}
*/
@ApiOperation("患者信息修改")
@PostMapping("/patient/modify")
public AjaxResult patientsWithModified(AppPatientReq appPatientReq) {
TPatient tPatient = new TPatient();
BeanUtils.copyProperties(appPatientReq, tPatient);
return AjaxResult.success(tPatientService.updateTPatient(tPatient));
}
/**
*
*
@ -180,7 +201,7 @@ public class AppController extends BaseController
public AjaxResult diagnosisOfRecordList(AppPatientHospitalDoctor appPatientHospitalDoctor) {
TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor();
BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor);
List<TRecord> tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor);
List<TRecordResp> tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor);
return AjaxResult.success(tRecords);
}
@ -191,12 +212,11 @@ public class AppController extends BaseController
* @return {@code AjaxResult}
*/
@ApiOperation("患者诊断记录信息详情")
@GetMapping("/record/info")
public AjaxResult patientsWithDiagnosisOfRecordInformationDetails(Long id) {
@GetMapping("/record/info/{id}")
public AjaxResult patientsWithDiagnosisOfRecordInformationDetails(@PathVariable("id") Long id) {
return AjaxResult.success(tRecordService.selectById(id));
}
/**
*
*
@ -206,11 +226,10 @@ public class AppController extends BaseController
@ApiOperation("患者已诊列表")
@GetMapping("/record/diagnosedList")
public AjaxResult patientsDiagnosedList(TRecordResultReq recordResultReq) {
recordResultReq.setStatus("0");
recordResultReq.setStatus("1");
return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq));
}
/**
*
*
@ -220,7 +239,7 @@ public class AppController extends BaseController
@ApiOperation("患者候诊列表")
@GetMapping("/record/waitingList")
public AjaxResult patientsWaitingList(TRecordResultReq recordResultReq) {
recordResultReq.setStatus("2");
recordResultReq.setStatus("0");
return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq));
}
}

@ -1,13 +1,19 @@
package com.ruoyi.web.controller.pc;
import java.util.List;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.system.domain.TPatientHospitalDoctor;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.RecordHistoryDataResp;
import com.ruoyi.system.domain.resp.TRecordResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -118,9 +124,9 @@ public class TRecordController extends BaseController
return AjaxResult.success(tRecordService.selectById(id));
}
@GetMapping("getHistoryList")
@GetMapping("getHistoryRecordList")
@ApiOperation("查询患者历史数据图表")
public AjaxResult getHistoryList(TRecord tRecord){
return null;
public AjaxResult getHistoryRecordList(TRecord tRecord){
return tRecordService.getHistoryList(tRecord);
}
}

@ -13,52 +13,36 @@ import java.io.Serializable;
* @date 2022/8/9 14:48
*/
@ApiModel(value = "AppPatientHospitalDoctor", description = "App端患者预约入参实体")
public class AppPatientHospitalDoctor implements Serializable
{
public class AppPatientHospitalDoctor implements Serializable {
private static final long serialVersionUID = 1L;
/** 患者ID */
@NotNull(message = "patientId不为空")
@ApiModelProperty("patientId")
private Long patientId;
/** 医院ID */
/**
* ID
*/
@NotNull(message = "hospitalId不为空")
@ApiModelProperty("hospitalId")
private Long hospitalId;
/** 医生ID */
/**
* ID
*/
@NotNull(message = "doctorId不为空")
@ApiModelProperty("doctorId")
private Long doctorId;
public Long getPatientId()
{
return patientId;
}
public void setPatientId(Long patientId)
{
this.patientId = patientId;
}
public Long getHospitalId()
{
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId)
{
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
public Long getDoctorId()
{
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId)
{
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
}

@ -1,11 +1,8 @@
package com.ruoyi.system.domain.req;
import com.ruoyi.system.domain.TPatient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* App
*
@ -13,33 +10,186 @@ import javax.validation.constraints.NotNull;
* @date 2022/8/9 14:32
*/
@ApiModel(value = "AppPatientReq", description = "App端添加患者入参实体")
public class AppPatientReq extends TPatient
{
@NotNull(message = "doctorId不为空")
public class AppPatientReq {
/**
* id
*/
@ApiModelProperty("doctorId")
private Long doctorId;
@NotNull(message = "hospitalId不为空")
/**
* Id
*/
@ApiModelProperty("hospitalId")
private Long hospitalId;
public Long getDoctorId()
{
/**
* ID
*/
@ApiModelProperty("patientId")
private Long id;
/**
* openid
*/
@ApiModelProperty("腾讯openid")
private String openId;
/**
*
*/
@ApiModelProperty("编号")
private String identifier;
/**
*
*/
@ApiModelProperty("名称")
private String name;
/**
*
*/
@ApiModelProperty("电话")
private String phone;
/**
* 0 1 2
*/
@ApiModelProperty("用户性别: 0=男,1=女,2=未知")
private String sex;
/**
*
*/
@ApiModelProperty("年龄")
private Integer age;
/**
*
*/
@ApiModelProperty("身高")
private Integer height;
/**
*
*/
@ApiModelProperty("体重")
private Integer weight;
/**
* 0 1 2
*/
@ApiModelProperty("婚姻状态: 0=未婚,1=已婚,2=未知")
private String marriage;
/**
*
*/
@ApiModelProperty("基础疾病")
private String disease;
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId)
{
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
public Long getHospitalId()
{
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId)
{
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public String getMarriage() {
return marriage;
}
public void setMarriage(String marriage) {
this.marriage = marriage;
}
public String getDisease() {
return disease;
}
public void setDisease(String disease) {
this.disease = disease;
}
}

@ -0,0 +1,229 @@
package com.ruoyi.system.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
/**
* App
*
* @author gongzhenkun
* @date 2022/8/9 17:02
*/
@ApiModel(value = "AppRecordReq", description = "App端诊断记录上传入参实体")
public class AppRecordReq implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
*
*/
@ApiModelProperty("患者")
private Long patientId;
/**
*
*/
@ApiModelProperty("医生")
private Long doctorId;
/**
*
*/
@ApiModelProperty("医院")
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;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("上传时间")
private Date uploadTime;
/**
*
*/
@ApiModelProperty("舌下")
private String imgSx;
/**
*
*/
@ApiModelProperty("舌上")
private String imgSm;
/**
*
*/
@ApiModelProperty("响应时长")
private Long responseTime;
/**
*
*/
@ApiModelProperty("ai结果返回时间")
private Date aiResultReturnTime;
/**
*
*/
@ApiModelProperty("ai结果修改时间")
private Date aiResultModifyTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPatientId() {
return patientId;
}
public void setPatientId(Long patientId) {
this.patientId = patientId;
}
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getAiResult() {
return aiResult;
}
public void setAiResult(String aiResult) {
this.aiResult = aiResult;
}
public String getAiResult2() {
return aiResult2;
}
public void setAiResult2(String aiResult2) {
this.aiResult2 = aiResult2;
}
public String getUpdateResult() {
return updateResult;
}
public void setUpdateResult(String updateResult) {
this.updateResult = updateResult;
}
public String getUpdateResult2() {
return updateResult2;
}
public void setUpdateResult2(String updateResult2) {
this.updateResult2 = updateResult2;
}
public Date getUploadTime() {
return uploadTime;
}
public void setUploadTime(Date uploadTime) {
this.uploadTime = uploadTime;
}
public String getImgSx() {
return imgSx;
}
public void setImgSx(String imgSx) {
this.imgSx = imgSx;
}
public String getImgSm() {
return imgSm;
}
public void setImgSm(String imgSm) {
this.imgSm = imgSm;
}
public Long getResponseTime() {
return responseTime;
}
public void setResponseTime(Long responseTime) {
this.responseTime = responseTime;
}
public Date getAiResultReturnTime() {
return aiResultReturnTime;
}
public void setAiResultReturnTime(Date aiResultReturnTime) {
this.aiResultReturnTime = aiResultReturnTime;
}
public Date getAiResultModifyTime() {
return aiResultModifyTime;
}
public void setAiResultModifyTime(Date aiResultModifyTime) {
this.aiResultModifyTime = aiResultModifyTime;
}
}

@ -0,0 +1,226 @@
package com.ruoyi.system.domain.resp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* App
*
* @author gongzhenkun
* @date 2022/8/9 17:39
*/
@ApiModel(value = "AppDoctorResp", description = "App端医生信息反参实体")
public class AppDoctorResp implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* ID
*/
@ApiModelProperty("用户ID")
private Long userId;
/**
*
*/
@ApiModelProperty("编号")
private String identifier;
/**
*
*/
@ApiModelProperty("名称")
private String name;
/**
*
*/
@ApiModelProperty("电话")
private String phone;
/**
* 0 1 2
*/
@ApiModelProperty("用户性别: 0=男,1=女,2=未知")
private String sex;
/**
*
*/
@ApiModelProperty("年龄")
private Integer age;
/**
* 0 1 2
*/
@ApiModelProperty("婚姻状态: 0=未婚,1=已婚,2=未知")
private String marriage;
/**
*
*/
@ApiModelProperty("职称")
private String title;
/**
*
*/
@ApiModelProperty("专长")
private String speciality;
/**
*
*/
@ApiModelProperty("简介")
private String introduction;
/**
*
*/
@ApiModelProperty("职业医师照片路径")
private String medicalLicense;
/**
* base64
*/
@ApiModelProperty("二维码base64")
private String qrCode;
/**
*
*/
@ApiModelProperty("医院Id")
private Long hospitalId;
/**
*
*/
@ApiModelProperty("医院名称")
private String hospitalName;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getMarriage() {
return marriage;
}
public void setMarriage(String marriage) {
this.marriage = marriage;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSpeciality() {
return speciality;
}
public void setSpeciality(String speciality) {
this.speciality = speciality;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getMedicalLicense() {
return medicalLicense;
}
public void setMedicalLicense(String medicalLicense) {
this.medicalLicense = medicalLicense;
}
public String getQrCode() {
return qrCode;
}
public void setQrCode(String qrCode) {
this.qrCode = qrCode;
}
public String getHospitalName() {
return hospitalName;
}
public void setHospitalName(String hospitalName) {
this.hospitalName = hospitalName;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
}

@ -0,0 +1,57 @@
package com.ruoyi.system.domain.resp;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class RecordHistoryDataResp
{
private List<Integer> shezhiList;
private List<Integer> shetaiList;
private List<Integer> shexiaList;
private List<Date> dateList;
public RecordHistoryDataResp()
{
}
public List<Integer> getShezhiList()
{
return shezhiList;
}
public void setShezhiList(List<Integer> shezhiList)
{
this.shezhiList = shezhiList;
}
public List<Integer> getShetaiList()
{
return shetaiList;
}
public void setShetaiList(List<Integer> shetaiList)
{
this.shetaiList = shetaiList;
}
public List<Integer> getShexiaList()
{
return shexiaList;
}
public void setShexiaList(List<Integer> shexiaList)
{
this.shexiaList = shexiaList;
}
public List<Date> getDateList()
{
return dateList;
}
public void setDateList(List<Date> dateList)
{
this.dateList = dateList;
}
}

@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import org.apache.ibatis.annotations.Param;
@ -81,5 +82,12 @@ public interface TDoctorMapper
*/
int queryPatintCountByDoctor(@Param("hospitalId")Long hospitalId, @Param("doctorId")Long doctorId);
/**
*
*
* @param id
* @return
*/
public AppDoctorResp selectAppDoctorDetailById(Long id);
}

@ -120,5 +120,5 @@ public interface TRecordMapper
* @param tPatientHospitalDoctor t
* @return {@code List<TRecord>}
*/
public List<TRecord> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor);
public List<TRecordResp> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor);
}

@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
/**
@ -62,4 +63,12 @@ public interface ITDoctorService
public int deleteTDoctorById(Long id);
List<PcTDoctorQueryByPageResp> queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq);
/**
*
*
* @param id
* @return
*/
public AppDoctorResp selectAppDoctorDetailById(Long id);
}

@ -2,6 +2,7 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.TPatientHospitalDoctor;
import com.ruoyi.system.domain.TRecord;
import com.ruoyi.system.domain.req.TRecordResultReq;
@ -85,5 +86,13 @@ public interface ITRecordService
* @param tPatientHospitalDoctor t
* @return {@code List<TRecord>}
*/
public List<TRecord> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor);
public List<TRecordResp> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor);
/**
*
*
* @param tRecord
* @return {@code AjaxResult}
*/
AjaxResult getHistoryList(TRecord tRecord);
}

@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq;
import com.ruoyi.system.domain.resp.AppDoctorResp;
import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -102,4 +103,15 @@ public class TDoctorServiceImpl implements ITDoctorService
pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId())));
return pcTDoctorQueryByPageResps;
}
/**
*
*
* @param id
* @return
*/
@Override
public AppDoctorResp selectAppDoctorDetailById(Long id) {
return tDoctorMapper.selectAppDoctorDetailById(id);
}
}

@ -1,10 +1,17 @@
package com.ruoyi.system.service.impl;
import java.util.List;
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.req.TRecordResultReq;
import com.ruoyi.system.domain.resp.RecordHistoryDataResp;
import com.ruoyi.system.domain.resp.TRecordResp;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TRecordMapper;
@ -110,8 +117,60 @@ public class TRecordServiceImpl implements ITRecordService
}
@Override
public List<TRecord> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor)
public List<TRecordResp> queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor)
{
return tRecordMapper.queryRecordListByPHDids(tPatientHospitalDoctor);
}
@Override
public AjaxResult getHistoryList(TRecord tRecord)
{
List<TRecord> tRecords = tRecordMapper.selectTRecordList(tRecord);
tRecords.removeIf(o->"0".equals(o.getStatus()));
if (CollectionUtils.isEmpty(tRecords)){
return AjaxResult.success();
}
List<TRecord> records = tRecords.stream().sorted(Comparator.comparing(TRecord::getCreateTime)).collect(Collectors.toList());
List<String> jsonKeyList = new ArrayList<String>(){{
add("shemian-sz_avg_red");
add("st_avg_yellow");
add("sx_vein_color");
}};
RecordHistoryDataResp recordHistoryDataRespMap = getDataList(records,jsonKeyList);
return AjaxResult.success(recordHistoryDataRespMap);
}
private RecordHistoryDataResp getDataList(List<TRecord> records, List<String> jsonKeyList)
{
RecordHistoryDataResp recordHistoryDataResp = new RecordHistoryDataResp();
List<Date> dateList = records.stream().map(TRecord::getCreateTime).collect(Collectors.toList());
recordHistoryDataResp.setDateList(dateList);
List<JSONObject> result = records.stream().map(tRecord -> {
JSONObject jsonObject;
if(StringUtils.isEmpty(tRecord.getUpdateResult2())){
jsonObject = JSONObject.parseObject(tRecord.getAiResult2());
}else {
jsonObject = JSONObject.parseObject(tRecord.getUpdateResult2());
}
return jsonObject;
}).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(result)){
List<Integer> shezhiList = new LinkedList<>();
List<Integer> shetaiList = new LinkedList<>();
List<Integer> shexiaList = new LinkedList<>();
String[] keys0 = jsonKeyList.get(0).split("-");
String key1 = jsonKeyList.get(1);
String key2 = jsonKeyList.get(2);
result.forEach(jsonObject -> {
shezhiList.add(jsonObject.getJSONObject("data").getJSONObject("shezhi").getJSONObject(keys0[0]).getInteger(keys0[1]));
shetaiList.add(jsonObject.getJSONObject("data").getJSONObject("shetai").getInteger(key1));
shexiaList.add(jsonObject.getJSONObject("data").getJSONObject("shexia").getInteger(key2));
});
recordHistoryDataResp.setShezhiList(shezhiList);
recordHistoryDataResp.setShetaiList(shetaiList);
recordHistoryDataResp.setShexiaList(shexiaList);
}
return recordHistoryDataResp;
}
}

@ -179,4 +179,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryPatintCountByDoctor" resultType="int">
select COUNT(*) from t_patient_hospital_doctor where hospital_id = #{hospitalId} and doctor_id = #{doctorId}
</select>
<select id="selectAppDoctorDetailById" resultType="com.ruoyi.system.domain.resp.AppDoctorResp">
SELECT
td.id,
user_id AS userId,
identifier,
td.`name`,
th.`id` AS hospitalId,
th.`name` AS hospitalName,
phone,
sex,
age,
marriage,
title,
speciality,
introduction,
medical_license AS medicalLicense,
qr_code AS qrCode,
hospital_id AS hospitalId
FROM
t_doctor td
LEFT JOIN t_hospital th ON th.id = td.hospital_id
WHERE td.id = #{id}
</select>
</mapper>

@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTRecordVo">
select id, patient_id, doctor_id, hospital_id, status, ai_result, ai_result2, update_result, update_result2, create_time, update_time, upload_time, img_sx, img_sm, response_time from t_record
select id, patient_id, doctor_id, hospital_id, status,ai_result2,update_result2, create_time, update_time, upload_time,response_time from t_record
</sql>
<sql id="selectTRecordWithResult">
SELECT
@ -155,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="imgSm != null and imgSm != ''"> and img_sm = #{imgSm}</if>
<if test="responseTime != null "> and response_time = #{responseTime}</if>
</where>
</select>
<select id="selectTRecordListWithoutResult" parameterType="TRecordResultReq" resultType="TRecordResp">
@ -257,7 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="queryRecordListByPHDids" parameterType="TPatientHospitalDoctor" resultMap="TRecordResult">
<select id="queryRecordListByPHDids" parameterType="TPatientHospitalDoctor" resultType="TRecordResp">
<include refid="selectTRecordWithOutResult"/>
<where>
<if test="patientId != null and patientId != ''"> and patient_id = #{patientId}</if>

Loading…
Cancel
Save