From 30e7d66dea807eb7cee4bf63ca20efd3527c1383 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Mon, 8 Aug 2022 17:14:13 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 59 +++++++++++++++++-- 1 file changed, 53 insertions(+), 6 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 c3641d5..49959cd 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 @@ -2,19 +2,19 @@ package com.ruoyi.web.controller.api; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.system.domain.TDoctor; import com.ruoyi.system.domain.THospital; +import com.ruoyi.system.domain.TPatientHospitalDoctor; import com.ruoyi.system.domain.TRecord; -import com.ruoyi.system.service.ITHospitalService; -import com.ruoyi.system.service.ITRecordService; +import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; /** @@ -32,6 +32,12 @@ public class AppController extends BaseController @Autowired private ITHospitalService tHospitalService; + @Resource + private ITDoctorService tDoctorService; + + @Resource + private ITPatientHospitalDoctorService itPatientHospitalDoctorService; + /** * 完成AI诊断 @@ -40,8 +46,8 @@ public class AppController extends BaseController @GetMapping("/ai/finish") public AjaxResult finish(Long id) { - TRecord record= tRecordService.selectTRecordById(id); - if(record!=null) + TRecord record = tRecordService.selectTRecordById(id); + if (record != null) { record.setStatus("1"); } @@ -54,4 +60,45 @@ public class AppController extends BaseController List tHospitals = tHospitalService.selectTHospitalList(new THospital()); return AjaxResult.success(tHospitals); } + + + /** + * 医生信息获取 + * + * @param doctorId 医生id + * @return {@code AjaxResult} + */ + @ApiOperation("医生信息获取") + @GetMapping("/doctorInformation") + public AjaxResult doctorInformation(Long doctorId) + { + TDoctor tDoctor = tDoctorService.selectTDoctorById(doctorId); + return AjaxResult.success(tDoctor); + } + + /** + * 病人预约 + * + * @param tPatientHospitalDoctor tPatientHospitalDoctor + * @return {@code AjaxResult} + */ + @ApiOperation("患者预约") + @GetMapping("/getDoctorInfo") + public AjaxResult patientsToMakeAnAppointment(TPatientHospitalDoctor tPatientHospitalDoctor) + { + // 患者预约,新增t_record中的一条记录;判断关联表是否存在当前关系 + TRecord tRecord = new TRecord(); + tRecord.setHospitalId(tPatientHospitalDoctor.getHospitalId()); + tRecord.setPatientId(tPatientHospitalDoctor.getPatientId()); + tRecord.setDoctorId(tPatientHospitalDoctor.getDoctorId()); + tRecord.setStatus("0"); + tRecord.setCreateBy(getUsername()); + tRecordService.insertTRecord(tRecord); + List tPHDs = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + if (tPHDs.isEmpty()) + { + itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + return AjaxResult.success(); + } } From 35586668d0d00efd3cd1ef360b74b84606ececc2 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:12:51 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E5=B0=B1=E8=AF=8A=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/pc/TRecordController.java | 9 +- .../system/domain/req/TRecordResultReq.java | 115 +++++++ .../ruoyi/system/domain/resp/TRecordResp.java | 298 ++++++++++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 22 +- .../ruoyi/system/service/ITRecordService.java | 20 +- .../service/impl/TRecordServiceImpl.java | 24 +- .../resources/mapper/system/TRecordMapper.xml | 76 ++++- 7 files changed, 530 insertions(+), 34 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index e24ad9f..be9d8d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -2,6 +2,9 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -23,7 +26,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 诊断记录信息Controller - * + * * @author ruoyi * @date 2022-08-03 */ @@ -39,10 +42,10 @@ public class TRecordController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:record:list')") @GetMapping("/list") - public TableDataInfo list(TRecord tRecord) + public TableDataInfo list(TRecordResultReq tRecord) { startPage(); - List list = tRecordService.selectTRecordList(tRecord); + List list = tRecordService.selectTRecordListWithoutResult(tRecord); return getDataTable(list); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java new file mode 100644 index 0000000..b0becb8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -0,0 +1,115 @@ +package com.ruoyi.system.domain.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; + +import java.util.Date; + +public class TRecordResultReq +{ + + private String name; + private String sex; + private Integer age; + private Long doctorId; + private Long hospitalId; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + //预约时间排序 + private String doctorTime; + //首诊时间排序 + private String firstVisitTime; + private String status; + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + 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 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 getDoctorTime() + { + return doctorTime; + } + + public void setDoctorTime(String doctorTime) + { + this.doctorTime = doctorTime; + } + + public String getFirstVisitTime() + { + return firstVisitTime; + } + + public void setFirstVisitTime(String firstVisitTime) + { + this.firstVisitTime = firstVisitTime; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java new file mode 100644 index 0000000..08ea033 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -0,0 +1,298 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; + +import java.util.Date; + +public class TRecordResp +{ + /** ID */ + private Long id; + + /** 患者 */ + @Excel(name = "患者") + private Long patientId; + + /** 医生 */ + @Excel(name = "医生") + private Long doctorId; + + /** 医院 */ + @Excel(name = "医院") + private Long hospitalId; + + /** 状态(0预约 1就诊) */ + @Excel(name = "状态", readConverterExp = "0=预约,1=就诊") + private String status; + + /** ai诊断结果 */ + @Excel(name = "ai诊断结果") + private String aiResult; + + /** ai诊断结果,无图片 */ + @Excel(name = "ai诊断结果,无图片") + private String aiResult2; + + /** 医生诊断结果 */ + @Excel(name = "医生诊断结果") + private String updateResult; + + /** 医生诊断结果,无图片 */ + @Excel(name = "医生诊断结果,无图片") + private String updateResult2; + + /** 上传时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date uploadTime; + + /** 舌下 */ + @Excel(name = "舌下") + private String imgSx; + + /** 舌上 */ + @Excel(name = "舌上") + private String imgSm; + + /** 响应时长 */ + @Excel(name = "响应时长") + private Long responseTime; + + @Excel(name = "编号") + private String identifier; + + /** 名称 */ + @Excel(name = "名称") + private String patientName; + + private String doctorName; + + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** 年龄 */ + @Excel(name = "年龄") + private Integer age; + + @Excel(name = "婚姻状态", readConverterExp = "0=未婚,1=已婚,2=未知") + private String marriage; + + /** 基础疾病 */ + @Excel(name = "基础疾病") + private String disease; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createTime; + + + 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 String getIdentifier() + { + return identifier; + } + + public void setIdentifier(String identifier) + { + this.identifier = identifier; + } + + public String getPatientName() + { + return patientName; + } + + public void setPatientName(String patientName) + { + this.patientName = patientName; + } + + public String getDoctorName() + { + return doctorName; + } + + public void setDoctorName(String doctorName) + { + this.doctorName = doctorName; + } + + 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 getDisease() + { + return disease; + } + + public void setDisease(String disease) + { + this.disease = disease; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 711cb3b..bc1b81d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -2,18 +2,22 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TRecord; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; +import org.apache.ibatis.annotations.Mapper; /** * 诊断记录信息Mapper接口 - * + * * @author ruoyi * @date 2022-08-03 */ -public interface TRecordMapper +@Mapper +public interface TRecordMapper { /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -21,7 +25,7 @@ public interface TRecordMapper /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +33,7 @@ public interface TRecordMapper /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +41,7 @@ public interface TRecordMapper /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +49,7 @@ public interface TRecordMapper /** * 删除诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -53,9 +57,11 @@ public interface TRecordMapper /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTRecordByIds(Long[] ids); + + List selectTRecordListWithoutResult(TRecordResultReq tRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index be8b8da..123a898 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -2,18 +2,20 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.TRecord; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; /** * 诊断记录信息Service接口 - * + * * @author ruoyi * @date 2022-08-03 */ -public interface ITRecordService +public interface ITRecordService { /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -21,7 +23,7 @@ public interface ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息集合 */ @@ -29,7 +31,7 @@ public interface ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -37,7 +39,7 @@ public interface ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -45,7 +47,7 @@ public interface ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键集合 * @return 结果 */ @@ -53,9 +55,11 @@ public interface ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ public int deleteTRecordById(Long id); + + List selectTRecordListWithoutResult(TRecordResultReq tRecord); } 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 148e538..40ef61f 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 @@ -2,6 +2,8 @@ package com.ruoyi.system.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.TRecordResp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TRecordMapper; @@ -10,19 +12,19 @@ import com.ruoyi.system.service.ITRecordService; /** * 诊断记录信息Service业务层处理 - * + * * @author ruoyi * @date 2022-08-03 */ @Service -public class TRecordServiceImpl implements ITRecordService +public class TRecordServiceImpl implements ITRecordService { @Autowired private TRecordMapper tRecordMapper; /** * 查询诊断记录信息 - * + * * @param id 诊断记录信息主键 * @return 诊断记录信息 */ @@ -34,7 +36,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 查询诊断记录信息列表 - * + * * @param tRecord 诊断记录信息 * @return 诊断记录信息 */ @@ -46,7 +48,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 新增诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -59,7 +61,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 修改诊断记录信息 - * + * * @param tRecord 诊断记录信息 * @return 结果 */ @@ -72,7 +74,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 批量删除诊断记录信息 - * + * * @param ids 需要删除的诊断记录信息主键 * @return 结果 */ @@ -84,7 +86,7 @@ public class TRecordServiceImpl implements ITRecordService /** * 删除诊断记录信息信息 - * + * * @param id 诊断记录信息主键 * @return 结果 */ @@ -93,4 +95,10 @@ public class TRecordServiceImpl implements ITRecordService { return tRecordMapper.deleteTRecordById(id); } + + @Override + public List selectTRecordListWithoutResult(TRecordResultReq tRecord) + { + return tRecordMapper.selectTRecordListWithoutResult(tRecord); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index e5ab34f..d567099 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -23,12 +23,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 + tr.id, + tr.patient_id AS patientId, + tr.doctor_id AS doctorId, + tr.hospital_id AS hospitalId, + tr.STATUS, + tr.ai_result AS aiResult, + tr.ai_result2 AS aiResult2, + tr.update_result AS update_result, + tr.update_result2 AS updateResult2, + tr.update_time AS updateTime, + tr.upload_time AS uploadTime, + td.NAME AS doctorName, + tp.identifier, + tp.NAME AS patientName, + tp.sex, + tp.age, + tp.marriage, + tp.disease, + tp.create_time AS createTime + FROM + t_record tr + LEFT JOIN t_doctor td ON tr.doctor_id = td.id + LEFT JOIN t_patient tp ON tr.patient_id = tp.id + + + + SELECT + tr.id, + tr.patient_id AS patientId, + tr.doctor_id AS doctorId, + tr.hospital_id AS hospitalId, + tr.STATUS, + tr.ai_result2 AS aiResult2, + tr.update_result2 AS updateResult2, + tr.update_time AS updateTime, + tr.upload_time AS uploadTime, + td.NAME AS doctorName, + tp.identifier, + tp.NAME AS patientName, + tp.sex, + tp.age, + tp.marriage, + tp.disease, + tp.create_time AS createTime + FROM + t_record tr + LEFT JOIN t_doctor td ON tr.doctor_id = td.id + LEFT JOIN t_patient tp ON tr.patient_id = tp.id - + + + - + insert into t_record @@ -111,9 +173,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from t_record where id in + delete from t_record where id in #{id} - \ No newline at end of file + From 83ae80c0c71fec76973205f6ab25ce8b2199705e Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:27:53 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E6=82=A3=E8=80=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=B0=E5=B7=B2=E8=AF=8A=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/web/controller/api/AppController.java | 15 ++++++++++++--- .../web/controller/pc/TRecordController.java | 2 ++ 2 files changed, 14 insertions(+), 3 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 49959cd..547d77b 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 @@ -1,5 +1,6 @@ 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.TDoctor; @@ -10,9 +11,7 @@ import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -101,4 +100,14 @@ public class AppController extends BaseController } return AjaxResult.success(); } + + @PutMapping("updateStatus/{id}") + @Log(title = "修改患者记录至已诊状态") + public AjaxResult updateStatus(@PathVariable("id") Long id){ + TRecord tRecord = new TRecord(); + tRecord.setId(id); + tRecord.setStatus("1"); + tRecordService.updateTRecord(tRecord); + return AjaxResult.success("更新状态成功",null); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index be9d8d0..aaec73b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -104,4 +104,6 @@ public class TRecordController extends BaseController { return toAjax(tRecordService.deleteTRecordByIds(ids)); } + + } From e200a0842b0ebe1dc69505833f45849fcdeb8b93 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:28:37 +0800 Subject: [PATCH 04/22] =?UTF-8?q?=E6=82=A3=E8=80=85=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E5=88=B0=E5=B7=B2=E8=AF=8A=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/web/controller/api/AppController.java | 3 +++ 1 file changed, 3 insertions(+) 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 547d77b..f1fa95a 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 @@ -104,6 +104,9 @@ public class AppController extends BaseController @PutMapping("updateStatus/{id}") @Log(title = "修改患者记录至已诊状态") public AjaxResult updateStatus(@PathVariable("id") Long id){ + if(id == null){ + return AjaxResult.error("未获取到记录id"); + } TRecord tRecord = new TRecord(); tRecord.setId(id); tRecord.setStatus("1"); From e16698a4ed5225173901806fc33441a2b4e9015c Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:38:02 +0800 Subject: [PATCH 05/22] =?UTF-8?q?=E8=8E=B7=E5=8F=96AI=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/api/AppController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 f1fa95a..639dee7 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 @@ -37,6 +37,9 @@ public class AppController extends BaseController @Resource private ITPatientHospitalDoctorService itPatientHospitalDoctorService; + @Resource + private ISysConfigService configService; + /** * 完成AI诊断 @@ -113,4 +116,11 @@ public class AppController extends BaseController tRecordService.updateTRecord(tRecord); return AjaxResult.success("更新状态成功",null); } + + @GetMapping(value = "/configKey/{configKey}") + @Log(title = "获取AI结果刷新时间接口") + public AjaxResult getConfigKey(@PathVariable String configKey) + { + return AjaxResult.success(configService.selectConfigByKey(configKey)); + } } From 58baace802be1b5d13e50a3a45ad66b97c8e42fd Mon Sep 17 00:00:00 2001 From: zhuqing Date: Tue, 9 Aug 2022 09:53:50 +0800 Subject: [PATCH 06/22] pclogin + hosptial --- .../controller/pc/THospitalController.java | 10 +++++++- .../controller/system/SysLoginController.java | 24 +++++++++++++++++++ .../com/ruoyi/system/domain/THospital.java | 9 +++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java index 5410b2c..4bffa50 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/THospitalController.java @@ -2,7 +2,9 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -27,6 +29,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2022-08-03 */ +@Api("pc-医院列表") @RestController @RequestMapping("/system/hospital") public class THospitalController extends BaseController @@ -37,6 +40,7 @@ public class THospitalController extends BaseController /** * 查询医院信息列表 */ + @ApiOperation("查询医院信息列表") @GetMapping("/list") public TableDataInfo list(THospital tHospital) { @@ -60,6 +64,7 @@ public class THospitalController extends BaseController /** * 获取医院信息详细信息 */ + @ApiOperation("获取医院信息详细信息") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -69,6 +74,7 @@ public class THospitalController extends BaseController /** * 新增医院信息 */ + @ApiOperation("新增医院信息") @Log(title = "医院信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody THospital tHospital) @@ -79,6 +85,7 @@ public class THospitalController extends BaseController /** * 修改医院信息 */ + @ApiOperation("修改医院信息") @Log(title = "医院信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody THospital tHospital) @@ -89,6 +96,7 @@ public class THospitalController extends BaseController /** * 删除医院信息 */ + @ApiOperation("删除医院信息") @Log(title = "医院信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 3aa2ee9..5fc940f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -2,7 +2,12 @@ package com.ruoyi.web.controller.system; import java.util.List; import java.util.Set; +import com.ruoyi.system.domain.TDoctor; +import com.ruoyi.system.domain.THospital; +import com.ruoyi.system.service.ITDoctorService; +import com.ruoyi.system.service.ITHospitalService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -34,6 +39,12 @@ public class SysLoginController @Autowired private SysPermissionService permissionService; + @Autowired + private ITHospitalService itHospitalService; + + @Autowired + private ITDoctorService itDoctorService; + /** * 登录方法 * @@ -76,6 +87,19 @@ public class SysLoginController ajax.put("user", user); ajax.put("roles", roles); ajax.put("permissions", permissions); + //添加医生和医院标识返回 + THospital tHospital = new THospital(); + tHospital.setAdminId(user.getUserId()); + List tHospitals = itHospitalService.selectTHospitalList(tHospital); + if (!ObjectUtils.isEmpty(tHospitals)){ + ajax.put("hospitalId", tHospitals.get(0).getId()); + } + TDoctor tDoctor = new TDoctor(); + tDoctor.setUserId(user.getUserId()); + List selectTDoctorList = itDoctorService.selectTDoctorList(tDoctor); + if (!ObjectUtils.isEmpty(selectTDoctorList)){ + ajax.put("doctorId", selectTDoctorList.get(0).getId()); + } return ajax; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java index 1cb1aaa..13ea616 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/THospital.java @@ -1,32 +1,41 @@ package com.ruoyi.system.domain; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import javax.validation.constraints.NotNull; + /** * 医院信息对象 t_hospital * * @author ruoyi * @date 2022-08-04 */ +@ApiModel(value = "THospital", description = "PC端医院实体") public class THospital extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ + @ApiModelProperty("id") private Long id; /** 名称 */ + @ApiModelProperty("名称") @Excel(name = "名称") private String name; /** 排序 */ + @ApiModelProperty("排序") @Excel(name = "排序") private Long num; /** 管理员ID */ + @ApiModelProperty("管理员ID") @Excel(name = "管理员ID") private Long adminId; From 99b54aa1ea1520f8ca9cb79f1ffc24953bc62edc Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:54:03 +0800 Subject: [PATCH 07/22] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2married=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/domain/resp/TRecordResp.java | 13 ------------- .../main/resources/mapper/system/TRecordMapper.xml | 2 -- 2 files changed, 15 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java index 08ea033..4330a29 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -75,9 +75,6 @@ public class TRecordResp @Excel(name = "年龄") private Integer age; - @Excel(name = "婚姻状态", readConverterExp = "0=未婚,1=已婚,2=未知") - private String marriage; - /** 基础疾病 */ @Excel(name = "基础疾病") private String disease; @@ -266,16 +263,6 @@ public class TRecordResp this.age = age; } - public String getMarriage() - { - return marriage; - } - - public void setMarriage(String marriage) - { - this.marriage = marriage; - } - public String getDisease() { return disease; diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index d567099..7a3780d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -40,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tp.NAME AS patientName, tp.sex, tp.age, - tp.marriage, tp.disease, tp.create_time AS createTime FROM @@ -65,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tp.NAME AS patientName, tp.sex, tp.age, - tp.marriage, tp.disease, tp.create_time AS createTime FROM From bc738fcc151d84c2913d996d395660cc406cf180 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 09:56:25 +0800 Subject: [PATCH 08/22] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/req/TRecordResultReq.java | 20 +++++++++---------- .../resources/mapper/system/TRecordMapper.xml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java index b0becb8..9d17b72 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -17,9 +17,9 @@ public class TRecordResultReq @JsonFormat(pattern = "yyyy-MM-dd") private Date createTime; //预约时间排序 - private String doctorTime; + private String doctorOder; //首诊时间排序 - private String firstVisitTime; + private String firstVisitOder; private String status; public String getName() @@ -83,24 +83,24 @@ public class TRecordResultReq this.status = status; } - public String getDoctorTime() + public String getDoctorOder() { - return doctorTime; + return doctorOder; } - public void setDoctorTime(String doctorTime) + public void setDoctorOder(String doctorOder) { - this.doctorTime = doctorTime; + this.doctorOder = doctorOder; } - public String getFirstVisitTime() + public String getFirstVisitOder() { - return firstVisitTime; + return firstVisitOder; } - public void setFirstVisitTime(String firstVisitTime) + public void setFirstVisitOder(String firstVisitOder) { - this.firstVisitTime = firstVisitTime; + this.firstVisitOder = firstVisitOder; } public Date getCreateTime() diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 7a3780d..b899156 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tp.age = #{age} and tp.sex = #{sex} and DATE_FORMAT(tp.create_time,'%Y-%m-%d') = #{createTime} - order by tr.create_time ${doctorTime}, tp.create_time ${firstVisitTime} + order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder} From c9ed837d6437abdea65c8e3e58d9489603eef139 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 10:03:56 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/domain/TRecord.java | 30 +++++++++++++++++++ .../resources/mapper/system/TRecordMapper.xml | 10 +++++++ 2 files changed, 40 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 71e5324..70009e2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -69,6 +69,14 @@ public class TRecord extends BaseEntity @Excel(name = "响应时长") private Long responseTime; + /** 响应时长 */ + @Excel(name = "ai结果返回时间") + private Date aiResultReturnTime; + + /** 响应时长 */ + @Excel(name = "ai结果修改时间") + private Date aiResultModifyTime; + public void setId(Long id) { this.id = id; @@ -187,6 +195,26 @@ public class TRecord extends BaseEntity return 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; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -205,6 +233,8 @@ public class TRecord extends BaseEntity .append("imgSx", getImgSx()) .append("imgSm", getImgSm()) .append("responseTime", getResponseTime()) + .append("aiResultReturnTime", getAiResultReturnTime()) + .append("aiResultModifyTime", getAiResultModifyTime()) .toString(); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index b899156..61c9cbe 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -20,6 +20,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -35,6 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, + tr.ai_result_return_time, + tr.ai_result_modify_time, td.NAME AS doctorName, tp.identifier, tp.NAME AS patientName, @@ -59,6 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, + tr.ai_result_return_time, + tr.ai_result_modify_time, td.NAME AS doctorName, tp.identifier, tp.NAME AS patientName, @@ -126,6 +132,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" img_sx, img_sm, response_time, + ai_result_return_time, + ai_result_modify_time, #{patientId}, @@ -142,6 +150,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{imgSx}, #{imgSm}, #{responseTime}, + #{aiResultReturnTime}, + #{aiResultModifyTime}, From f4dea8df30adef10b35747d3db3a9961e085025b Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 10:16:03 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/domain/resp/TRecordResp.java | 25 +++++++++++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 2 ++ .../ruoyi/system/service/ITRecordService.java | 2 ++ .../service/impl/TRecordServiceImpl.java | 6 +++++ .../resources/mapper/system/TRecordMapper.xml | 16 +++++++++--- 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java index 4330a29..146b708 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -82,6 +82,11 @@ public class TRecordResp @JsonFormat(pattern = "yyyy-MM-dd") private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date aiResultReturnTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date aiResultModifyTime; public Long getId() { @@ -282,4 +287,24 @@ public class TRecordResp { this.createTime = createTime; } + + 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; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index bc1b81d..3ca39b0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -64,4 +64,6 @@ public interface TRecordMapper public int deleteTRecordByIds(Long[] ids); List selectTRecordListWithoutResult(TRecordResultReq tRecord); + + TRecordResp selectTById(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index 123a898..449f570 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -62,4 +62,6 @@ public interface ITRecordService public int deleteTRecordById(Long id); List selectTRecordListWithoutResult(TRecordResultReq tRecord); + + TRecordResp selectTById(Long id); } 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 40ef61f..f30b620 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 @@ -101,4 +101,10 @@ public class TRecordServiceImpl implements ITRecordService { return tRecordMapper.selectTRecordListWithoutResult(tRecord); } + + @Override + public TRecordResp selectTById(Long id) + { + return tRecordMapper.selectTById(id); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 61c9cbe..713bcc9 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + 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 tr.id, tr.patient_id AS patientId, @@ -37,8 +40,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, - tr.ai_result_return_time, - tr.ai_result_modify_time, + tr.ai_result_return_time AS aiResultReturnTime, + tr.ai_result_modify_time AS aiResultModifyTime, td.NAME AS doctorName, tp.identifier, tp.NAME AS patientName, @@ -63,8 +66,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, - tr.ai_result_return_time, - tr.ai_result_modify_time, + tr.ai_result_return_time AS aiResultReturnTime, + tr.ai_result_modify_time AS aiResultModifyTime, td.NAME AS doctorName, tp.identifier, tp.NAME AS patientName, @@ -186,4 +189,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + From f633ee875d1d5e8b13650cbc37fd28bfd07c8355 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 10:18:50 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=82=A3=E8=80=85?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/web/controller/pc/TRecordController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index aaec73b..0c95a74 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -105,5 +105,11 @@ public class TRecordController extends BaseController return toAjax(tRecordService.deleteTRecordByIds(ids)); } - + @GetMapping("getInfo/{id}") + public AjaxResult getInfoById(@PathVariable("id") Long id){ + if(id == null){ + return AjaxResult.error("未获取到id"); + } + return AjaxResult.success(tRecordService.selectTById(id)); + } } From b8d66f7c73ea13bc8c160e0662fa72d036f0e924 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 10:20:09 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=82=A3=E8=80=85?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/pc/TRecordController.java | 2 +- .../src/main/java/com/ruoyi/system/mapper/TRecordMapper.java | 2 +- .../main/java/com/ruoyi/system/service/ITRecordService.java | 2 +- .../com/ruoyi/system/service/impl/TRecordServiceImpl.java | 4 ++-- .../src/main/resources/mapper/system/TRecordMapper.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index 0c95a74..b5ab255 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -110,6 +110,6 @@ public class TRecordController extends BaseController if(id == null){ return AjaxResult.error("未获取到id"); } - return AjaxResult.success(tRecordService.selectTById(id)); + return AjaxResult.success(tRecordService.selectById(id)); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 3ca39b0..b7d018a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -65,5 +65,5 @@ public interface TRecordMapper List selectTRecordListWithoutResult(TRecordResultReq tRecord); - TRecordResp selectTById(Long id); + TRecordResp selectById(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index 449f570..d9f6c20 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -63,5 +63,5 @@ public interface ITRecordService List selectTRecordListWithoutResult(TRecordResultReq tRecord); - TRecordResp selectTById(Long id); + TRecordResp selectById(Long id); } 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 f30b620..8e0595d 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 @@ -103,8 +103,8 @@ public class TRecordServiceImpl implements ITRecordService } @Override - public TRecordResp selectTById(Long id) + public TRecordResp selectById(Long id) { - return tRecordMapper.selectTById(id); + return tRecordMapper.selectById(id); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 713bcc9..b860c0d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -190,7 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - where id = #{id} From d2cb73cfdc0eb17e96e153b4954d06e1752c376a Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 10:32:05 +0800 Subject: [PATCH 13/22] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=82=A3=E8=80=85?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=AE=B5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/req/TRecordResultReq.java | 25 +++++++++++++++++++ .../resources/mapper/system/TRecordMapper.xml | 6 +++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java index 9d17b72..8d5232e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -22,6 +22,11 @@ public class TRecordResultReq private String firstVisitOder; private String status; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + public String getName() { return name; @@ -112,4 +117,24 @@ public class TRecordResultReq { this.createTime = createTime; } + + public Date getStartTime() + { + return startTime; + } + + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getEndTime() + { + return endTime; + } + + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index b860c0d..537ef68 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -108,8 +108,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and tr.status = #{status} and tp.age = #{age} and tp.sex = #{sex} - and DATE_FORMAT(tp.create_time,'%Y-%m-%d') = #{createTime} - order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder} + + AND tp.create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') + + order by tr.create_time ${doctorOder}, tp.create_time ${firstVisitOder} From a0e3dccd6afc8a59f602729f001e805c56867585 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 10:40:44 +0800 Subject: [PATCH 14/22] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=82=A3=E8=80=85?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=BE=85=E8=AF=8A=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/system/domain/resp/TRecordResp.java | 23 +++++++++++++++---- .../resources/mapper/system/TRecordMapper.xml | 8 +++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java index 146b708..0891056 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -47,6 +47,9 @@ public class TRecordResp @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd") private Date uploadTime; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date waitingTime; + /** 舌下 */ @Excel(name = "舌下") private String imgSx; @@ -80,7 +83,7 @@ public class TRecordResp private String disease; @JsonFormat(pattern = "yyyy-MM-dd") - private Date createTime; + private Date firstTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date aiResultReturnTime; @@ -278,14 +281,14 @@ public class TRecordResp this.disease = disease; } - public Date getCreateTime() + public Date getFirstTime() { - return createTime; + return firstTime; } - public void setCreateTime(Date createTime) + public void setFirstTime(Date firstTime) { - this.createTime = createTime; + this.firstTime = firstTime; } public Date getAiResultReturnTime() @@ -307,4 +310,14 @@ public class TRecordResp { this.aiResultModifyTime = aiResultModifyTime; } + + public Date getWaitingTime() + { + return waitingTime; + } + + public void setWaitingTime(Date waitingTime) + { + this.waitingTime = waitingTime; + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 537ef68..47b903f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, + tr.create_time AS waitingTime, tr.ai_result_return_time AS aiResultReturnTime, tr.ai_result_modify_time AS aiResultModifyTime, td.NAME AS doctorName, @@ -48,7 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tp.sex, tp.age, tp.disease, - tp.create_time AS createTime + tp.img_sx AS imgSx, + tp.img_sm AS imgSm, + tp.create_time AS firstTime FROM t_record tr LEFT JOIN t_doctor td ON tr.doctor_id = td.id @@ -66,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tr.update_result2 AS updateResult2, tr.update_time AS updateTime, tr.upload_time AS uploadTime, + tr.create_time AS waitingTime, tr.ai_result_return_time AS aiResultReturnTime, tr.ai_result_modify_time AS aiResultModifyTime, td.NAME AS doctorName, @@ -74,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tp.sex, tp.age, tp.disease, - tp.create_time AS createTime + tp.create_time AS firstTime FROM t_record tr LEFT JOIN t_doctor td ON tr.doctor_id = td.id From 5bfe6a88a8996f40904cde1d820942d12625fd9f Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 10:47:54 +0800 Subject: [PATCH 15/22] =?UTF-8?q?app=E6=82=A3=E8=80=85=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 47 +++++++++++++++++-- .../ruoyi/system/mapper/TRecordMapper.java | 10 ++++ .../ruoyi/system/service/ITRecordService.java | 10 ++++ .../service/impl/TRecordServiceImpl.java | 7 +++ .../resources/mapper/system/TRecordMapper.xml | 11 +++++ 5 files changed, 80 insertions(+), 5 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 639dee7..f5a56ec 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,10 +3,7 @@ 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.TDoctor; -import com.ruoyi.system.domain.THospital; -import com.ruoyi.system.domain.TPatientHospitalDoctor; -import com.ruoyi.system.domain.TRecord; +import com.ruoyi.system.domain.*; import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -34,6 +31,9 @@ public class AppController extends BaseController @Resource private ITDoctorService tDoctorService; + @Resource + private ITPatientService tPatientService; + @Resource private ITPatientHospitalDoctorService itPatientHospitalDoctorService; @@ -85,7 +85,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("患者预约") - @GetMapping("/getDoctorInfo") + @GetMapping("/patientsToMakeAnAppointment") public AjaxResult patientsToMakeAnAppointment(TPatientHospitalDoctor tPatientHospitalDoctor) { // 患者预约,新增t_record中的一条记录;判断关联表是否存在当前关系 @@ -123,4 +123,41 @@ public class AppController extends BaseController { return AjaxResult.success(configService.selectConfigByKey(configKey)); } + + /** + * 诊断记录上传 + * + * @return {@code AjaxResult} + */ + @ApiOperation("诊断记录上传") + @PostMapping("/diagnosticRecordsUploaded") + public AjaxResult diagnosticRecordsUploaded(TRecord tRecord) { + return AjaxResult.success(tRecordService.updateTRecord(tRecord)); + } + + /** + * 添加病人 + * + * @param tPatient t病人 + * @return {@code AjaxResult} + */ + @ApiOperation("添加患者") + @PostMapping("/addPatient") + public AjaxResult addPatient(TPatient tPatient) { + return AjaxResult.success(tPatientService.insertTPatient(tPatient)); + } + + + /** + * 诊断记录列表 + * + * @param tPatientHospitalDoctor t病人医院医生 + * @return {@code AjaxResult} + */ + @ApiOperation("诊断记录列表") + @GetMapping("/diagnosisOfRecordList") + public AjaxResult diagnosisOfRecordList(TPatientHospitalDoctor tPatientHospitalDoctor) { + List tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor); + return AjaxResult.success(tRecords); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index b7d018a..79fa024 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; + +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.TRecordResp; @@ -66,4 +68,12 @@ public interface TRecordMapper List selectTRecordListWithoutResult(TRecordResultReq tRecord); TRecordResp selectById(Long id); + + /** + * 通过病人医院医生id查询记录列表 + * + * @param tPatientHospitalDoctor t病人医院医生 + * @return {@code List} + */ + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index d9f6c20..4717092 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service; import java.util.List; + +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.TRecordResp; @@ -64,4 +66,12 @@ public interface ITRecordService List selectTRecordListWithoutResult(TRecordResultReq tRecord); TRecordResp selectById(Long id); + + /** + * 通过病人医院医生id查询记录列表 + * + * @param tPatientHospitalDoctor t病人医院医生 + * @return {@code List} + */ + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor); } 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 8e0595d..658960d 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 @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.TPatientHospitalDoctor; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.domain.resp.TRecordResp; import org.springframework.beans.factory.annotation.Autowired; @@ -107,4 +108,10 @@ public class TRecordServiceImpl implements ITRecordService { return tRecordMapper.selectById(id); } + + @Override + public List queryRecordListByPHDids(TPatientHospitalDoctor tPatientHospitalDoctor) + { + return tRecordMapper.queryRecordListByPHDids(tPatientHospitalDoctor); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 47b903f..b23843f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -181,6 +181,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" img_sx = #{imgSx}, img_sm = #{imgSm}, response_time = #{responseTime}, + ai_result_return_time = #{aiResultReturnTime}, + ai_result_modify_time = #{aiResultModifyTime}, where id = #{id} @@ -200,4 +202,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + From dd9c9b1ace22bc3e7b5f5796474630685f98ac0b Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 11:03:33 +0800 Subject: [PATCH 16/22] =?UTF-8?q?app=E6=82=A3=E8=80=85=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) 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 f5a56ec..2854d5e 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 @@ -4,6 +4,7 @@ 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.req.TRecordResultReq; import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -160,4 +161,44 @@ public class AppController extends BaseController List tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor); return AjaxResult.success(tRecords); } + + /** + * 患者诊断记录信息细节 + * + * @param id id + * @return {@code AjaxResult} + */ + @ApiOperation("患者诊断记录信息详情") + @GetMapping("/diagnosisOfRecordDetails") + public AjaxResult patientsWithDiagnosisOfRecordInformationDetails(Long id) { + return AjaxResult.success(tRecordService.selectById(id)); + } + + + /** + * 患者已诊列表 + * + * @param recordResultReq 记录结果要求 + * @return {@code AjaxResult} + */ + @ApiOperation("患者已诊列表") + @GetMapping("/patientsDiagnosedList") + public AjaxResult patientsDiagnosedList(TRecordResultReq recordResultReq) { + recordResultReq.setStatus("0"); + return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); + } + + + /** + * 病人等待名单 + * + * @param recordResultReq 记录结果要求 + * @return {@code AjaxResult} + */ + @ApiOperation("患者候诊列表") + @GetMapping("/patientsWaitingList") + public AjaxResult patientsWaitingList(TRecordResultReq recordResultReq) { + recordResultReq.setStatus("2"); + return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); + } } From 390f4a406eb09c15733dd801dc3cb574722d1c0f Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 14:45:39 +0800 Subject: [PATCH 17/22] =?UTF-8?q?app=E6=96=B0=E5=A2=9E=E6=82=A3=E8=80=85?= =?UTF-8?q?=E9=80=BB=E8=BE=91=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 | 16 ++++++- .../system/domain/req/AppPatientReq.java | 45 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java 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 2854d5e..e38b24d 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 @@ -4,6 +4,7 @@ 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.req.AppPatientReq; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.service.*; import io.swagger.annotations.Api; @@ -144,8 +145,19 @@ public class AppController extends BaseController */ @ApiOperation("添加患者") @PostMapping("/addPatient") - public AjaxResult addPatient(TPatient tPatient) { - return AjaxResult.success(tPatientService.insertTPatient(tPatient)); + public AjaxResult addPatient(AppPatientReq tPatient) + { + tPatientService.insertTPatient(tPatient); + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + tPatientHospitalDoctor.setHospitalId(tPatient.getHospitalId()); + tPatientHospitalDoctor.setDoctorId(tPatient.getDoctorId()); + tPatientHospitalDoctor.setPatientId(tPatient.getId()); + List tPatientHospitalDoctors = itPatientHospitalDoctorService.selectTPatientHospitalDoctorList(tPatientHospitalDoctor); + if (tPatientHospitalDoctors.isEmpty()) + { + itPatientHospitalDoctorService.insertTPatientHospitalDoctor(tPatientHospitalDoctor); + } + return AjaxResult.success(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java new file mode 100644 index 0000000..4152214 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientReq.java @@ -0,0 +1,45 @@ +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端添加患者入参实体 + * + * @author gongzhenkun + * @date 2022/8/9 14:32 + */ +@ApiModel(value = "AppPatientReq", description = "App端添加患者入参实体") +public class AppPatientReq extends TPatient +{ + @NotNull(message = "doctorId不为空") + @ApiModelProperty("doctorId") + private Long doctorId; + + @NotNull(message = "hospitalId不为空") + @ApiModelProperty("hospitalId") + private Long hospitalId; + + 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; + } +} From 5045b6cc9a5ec1899de902e2a7d2ca31a1fb56a9 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 14:56:09 +0800 Subject: [PATCH 18/22] =?UTF-8?q?app=E6=82=A3=E8=80=85=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E5=85=A5=E5=8F=82=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 | 10 ++- .../domain/req/AppPatientHospitalDoctor.java | 64 +++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java 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 e38b24d..c05e542 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 @@ -4,11 +4,13 @@ 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.req.AppPatientHospitalDoctor; import com.ruoyi.system.domain.req.AppPatientReq; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -81,16 +83,18 @@ public class AppController extends BaseController } /** - * 病人预约 + * 患者预约 * - * @param tPatientHospitalDoctor tPatientHospitalDoctor + * @param appPatientHospitalDoctor 应用病人医院医生 * @return {@code AjaxResult} */ @ApiOperation("患者预约") @GetMapping("/patientsToMakeAnAppointment") - public AjaxResult patientsToMakeAnAppointment(TPatientHospitalDoctor tPatientHospitalDoctor) + public AjaxResult patientsToMakeAnAppointment(AppPatientHospitalDoctor appPatientHospitalDoctor) { // 患者预约,新增t_record中的一条记录;判断关联表是否存在当前关系 + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); TRecord tRecord = new TRecord(); tRecord.setHospitalId(tPatientHospitalDoctor.getHospitalId()); tRecord.setPatientId(tPatientHospitalDoctor.getPatientId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java new file mode 100644 index 0000000..b966230 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/AppPatientHospitalDoctor.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.domain.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * App端患者预约入参实体 + * + * @author gongzhenkun + * @date 2022/8/9 14:48 + */ +@ApiModel(value = "AppPatientHospitalDoctor", description = "App端患者预约入参实体") +public class AppPatientHospitalDoctor implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 患者ID */ + @NotNull(message = "patientId不为空") + @ApiModelProperty("patientId") + private Long patientId; + + /** 医院ID */ + @NotNull(message = "hospitalId不为空") + @ApiModelProperty("hospitalId") + private Long hospitalId; + + /** 医生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() + { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) + { + this.hospitalId = hospitalId; + } + + public Long getDoctorId() + { + return doctorId; + } + + public void setDoctorId(Long doctorId) + { + this.doctorId = doctorId; + } +} From 1bc8e56fca0aef847061872886dc36b185c63511 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 9 Aug 2022 15:03:01 +0800 Subject: [PATCH 19/22] =?UTF-8?q?app=E8=AF=8A=E6=96=AD=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=85=A5=E5=8F=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/api/AppController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 c05e542..1d8a99f 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 @@ -164,16 +164,17 @@ public class AppController extends BaseController return AjaxResult.success(); } - /** * 诊断记录列表 * - * @param tPatientHospitalDoctor t病人医院医生 + * @param appPatientHospitalDoctor 应用病人医院医生 * @return {@code AjaxResult} */ @ApiOperation("诊断记录列表") @GetMapping("/diagnosisOfRecordList") - public AjaxResult diagnosisOfRecordList(TPatientHospitalDoctor tPatientHospitalDoctor) { + public AjaxResult diagnosisOfRecordList(AppPatientHospitalDoctor appPatientHospitalDoctor) { + TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); + BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); List tRecords = tRecordService.queryRecordListByPHDids(tPatientHospitalDoctor); return AjaxResult.success(tRecords); } From 592bac7a387ea72ba02e871938d0f2d3af140c3b Mon Sep 17 00:00:00 2001 From: zhangcl Date: Tue, 9 Aug 2022 15:36:35 +0800 Subject: [PATCH 20/22] api --- .../web/controller/api/AppController.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 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 1d8a99f..82ddfc3 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 @@ -61,6 +61,10 @@ public class AppController extends BaseController } + /** + * 医院列表 + */ + @ApiOperation("医院列表") @GetMapping("/hospital/list") public AjaxResult hospitalList() { List tHospitals = tHospitalService.selectTHospitalList(new THospital()); @@ -75,7 +79,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("医生信息获取") - @GetMapping("/doctorInformation") + @GetMapping("/doctor/info") public AjaxResult doctorInformation(Long doctorId) { TDoctor tDoctor = tDoctorService.selectTDoctorById(doctorId); @@ -89,7 +93,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("患者预约") - @GetMapping("/patientsToMakeAnAppointment") + @GetMapping("/patient/makeAnAppointment") public AjaxResult patientsToMakeAnAppointment(AppPatientHospitalDoctor appPatientHospitalDoctor) { // 患者预约,新增t_record中的一条记录;判断关联表是否存在当前关系 @@ -110,7 +114,7 @@ public class AppController extends BaseController return AjaxResult.success(); } - @PutMapping("updateStatus/{id}") + @PutMapping("/record/ai/finish/{id}") @Log(title = "修改患者记录至已诊状态") public AjaxResult updateStatus(@PathVariable("id") Long id){ if(id == null){ @@ -123,10 +127,11 @@ public class AppController extends BaseController return AjaxResult.success("更新状态成功",null); } - @GetMapping(value = "/configKey/{configKey}") + @GetMapping(value = "/config/ai/refreshtime") @Log(title = "获取AI结果刷新时间接口") - public AjaxResult getConfigKey(@PathVariable String configKey) + public AjaxResult getConfigKey() { + String configKey="t.ai.refreshtime"; return AjaxResult.success(configService.selectConfigByKey(configKey)); } @@ -136,7 +141,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("诊断记录上传") - @PostMapping("/diagnosticRecordsUploaded") + @PostMapping("/record/diagnostic/upload") public AjaxResult diagnosticRecordsUploaded(TRecord tRecord) { return AjaxResult.success(tRecordService.updateTRecord(tRecord)); } @@ -148,7 +153,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("添加患者") - @PostMapping("/addPatient") + @PostMapping("/patient/add") public AjaxResult addPatient(AppPatientReq tPatient) { tPatientService.insertTPatient(tPatient); @@ -171,7 +176,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("诊断记录列表") - @GetMapping("/diagnosisOfRecordList") + @GetMapping("/record/list") public AjaxResult diagnosisOfRecordList(AppPatientHospitalDoctor appPatientHospitalDoctor) { TPatientHospitalDoctor tPatientHospitalDoctor = new TPatientHospitalDoctor(); BeanUtils.copyProperties(appPatientHospitalDoctor, tPatientHospitalDoctor); @@ -186,7 +191,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("患者诊断记录信息详情") - @GetMapping("/diagnosisOfRecordDetails") + @GetMapping("/record/info") public AjaxResult patientsWithDiagnosisOfRecordInformationDetails(Long id) { return AjaxResult.success(tRecordService.selectById(id)); } @@ -199,7 +204,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("患者已诊列表") - @GetMapping("/patientsDiagnosedList") + @GetMapping("/record/diagnosedList") public AjaxResult patientsDiagnosedList(TRecordResultReq recordResultReq) { recordResultReq.setStatus("0"); return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); @@ -213,7 +218,7 @@ public class AppController extends BaseController * @return {@code AjaxResult} */ @ApiOperation("患者候诊列表") - @GetMapping("/patientsWaitingList") + @GetMapping("/record/waitingList") public AjaxResult patientsWaitingList(TRecordResultReq recordResultReq) { recordResultReq.setStatus("2"); return AjaxResult.success(tRecordService.selectTRecordListWithoutResult(recordResultReq)); From 45d3d8389f9f91c2fb7551d6a9972cd87bd328b8 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Tue, 9 Aug 2022 15:58:18 +0800 Subject: [PATCH 21/22] =?UTF-8?q?=E5=A2=9E=E5=8A=A0swagger=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/pc/TRecordController.java | 13 ++++++++- .../system/domain/req/TRecordResultReq.java | 16 +++++++++++ .../ruoyi/system/domain/resp/TRecordResp.java | 28 ++++++++++++++++++- .../ruoyi/system/service/ITRecordService.java | 12 ++++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index b5ab255..e2b6e98 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -3,8 +3,11 @@ package com.ruoyi.web.controller.pc; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.system.domain.TPatientHospitalDoctor; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.domain.resp.TRecordResp; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -30,6 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo; * @author ruoyi * @date 2022-08-03 */ +@Api("pc-就诊记录") @RestController @RequestMapping("/system/record") public class TRecordController extends BaseController @@ -40,7 +44,7 @@ public class TRecordController extends BaseController /** * 查询诊断记录信息列表 */ - @PreAuthorize("@ss.hasPermi('system:record:list')") + @ApiOperation("查询就诊记录列表") @GetMapping("/list") public TableDataInfo list(TRecordResultReq tRecord) { @@ -106,10 +110,17 @@ public class TRecordController extends BaseController } @GetMapping("getInfo/{id}") + @ApiOperation("查询患者诊断记录信息") public AjaxResult getInfoById(@PathVariable("id") Long id){ if(id == null){ return AjaxResult.error("未获取到id"); } return AjaxResult.success(tRecordService.selectById(id)); } + + @GetMapping("getHistoryList") + @ApiOperation("查询患者历史数据图表") + public AjaxResult getHistoryList(TRecord tRecord){ + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java index 8d5232e..82413eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/TRecordResultReq.java @@ -2,28 +2,44 @@ package com.ruoyi.system.domain.req; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.Date; + + +@ApiModel(value = "TRecordResultReq", description = "就诊分页查询入参实体") public class TRecordResultReq { + @ApiModelProperty("患者姓名") private String name; + @ApiModelProperty("患者性别") private String sex; + @ApiModelProperty("患者年龄") private Integer age; + @ApiModelProperty("医生id") private Long doctorId; + @ApiModelProperty("医院id") private Long hospitalId; @JsonFormat(pattern = "yyyy-MM-dd") private Date createTime; + + @ApiModelProperty("注册日期排序:asc 正序,desc 倒序") //预约时间排序 private String doctorOder; //首诊时间排序 + @ApiModelProperty("首诊时间排序:asc 正序,desc 倒序") private String firstVisitOder; + @ApiModelProperty("状态") private String status; + @ApiModelProperty("初诊日期开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date startTime; + @ApiModelProperty("初诊日期结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date endTime; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java index 0891056..7d813ec 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/TRecordResp.java @@ -2,93 +2,119 @@ package com.ruoyi.system.domain.resp; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.Date; + +@ApiModel(value = "TRecordResp", description = "就诊记录分页查询反参实体") public class TRecordResp { /** ID */ + @ApiModelProperty("患者就诊记录id") private Long id; /** 患者 */ @Excel(name = "患者") + @ApiModelProperty("患者id") private Long patientId; /** 医生 */ @Excel(name = "医生") + @ApiModelProperty("医生id") private Long doctorId; /** 医院 */ + @ApiModelProperty("医院id") @Excel(name = "医院") private Long hospitalId; /** 状态(0预约 1就诊) */ @Excel(name = "状态", readConverterExp = "0=预约,1=就诊") + @ApiModelProperty("状态(0预约 1就诊)") private String status; /** ai诊断结果 */ @Excel(name = "ai诊断结果") + @ApiModelProperty("ai诊断结果") private String aiResult; /** ai诊断结果,无图片 */ @Excel(name = "ai诊断结果,无图片") + @ApiModelProperty("ai诊断结果,无图片") private String aiResult2; /** 医生诊断结果 */ @Excel(name = "医生诊断结果") + @ApiModelProperty("医生诊断结果") private String updateResult; /** 医生诊断结果,无图片 */ @Excel(name = "医生诊断结果,无图片") + @ApiModelProperty("医生诊断结果,无图片") private String updateResult2; /** 上传时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("上传时间") private Date uploadTime; @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("待诊时间") private Date waitingTime; /** 舌下 */ @Excel(name = "舌下") + @ApiModelProperty("舌下") private String imgSx; /** 舌上 */ @Excel(name = "舌上") + @ApiModelProperty("舌上") private String imgSm; /** 响应时长 */ @Excel(name = "响应时长") + @ApiModelProperty("响应时长") private Long responseTime; @Excel(name = "编号") + @ApiModelProperty("编号") private String identifier; /** 名称 */ @Excel(name = "名称") + @ApiModelProperty("患者名称") private String patientName; - + @ApiModelProperty("医生名称") private String doctorName; @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + @ApiModelProperty("用户性别") private String sex; /** 年龄 */ @Excel(name = "年龄") + @ApiModelProperty("患者年龄") private Integer age; /** 基础疾病 */ @Excel(name = "基础疾病") + @ApiModelProperty("基础疾病") private String disease; @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("初诊时间") private Date firstTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("ai结果返回时间") private Date aiResultReturnTime; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("ai结果修改时间") private Date aiResultModifyTime; public Long getId() diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java index 4717092..8512ded 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITRecordService.java @@ -63,8 +63,20 @@ public interface ITRecordService */ public int deleteTRecordById(Long id); + /** + * 查询就诊记录信息列表 + * + * @param tRecord 查询参数 + * @return 结果 + */ List selectTRecordListWithoutResult(TRecordResultReq tRecord); + /** + * 根据患者记录id查询就诊记录详情 + * + * @param id 查询参数 + * @return 结果 + */ TRecordResp selectById(Long id); /** From 63f89de96a1d2e8ad8d7972ccf594377cf23fcfe Mon Sep 17 00:00:00 2001 From: zhuqing Date: Tue, 9 Aug 2022 16:33:51 +0800 Subject: [PATCH 22/22] platform --- .../web/controller/pc/PlatformController.java | 68 ++++++++++++++++++ .../domain/resp/PlatformDayPlanResp.java | 52 ++++++++++++++ .../domain/resp/WeekMonthPersonCountResp.java | 40 +++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 45 ++++++++++++ .../system/service/impl/PlatformService.java | 72 +++++++++++++++++++ .../resources/mapper/system/TRecordMapper.xml | 54 ++++++++++++++ 6 files changed, 331 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java new file mode 100644 index 0000000..92696ff --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/PlatformController.java @@ -0,0 +1,68 @@ +package com.ruoyi.web.controller.pc; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.service.ITRecordService; +import com.ruoyi.system.service.impl.PlatformService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * @Author zhuqing + * @Date 2022/8/9 + * 工作台 + */ +@RestController +@RequestMapping("/platform") +@Api("工作台") +public class PlatformController { + + @Autowired + private PlatformService platformService; + + @ApiOperation("工作台-设备统计") + @PostMapping("/equCount") + public AjaxResult equCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + Map stringIntegerMap = platformService.equCount(hospitalId, doctorId); + return AjaxResult.success(stringIntegerMap); + } + + @ApiOperation("工作台-今日就诊计划") + @PostMapping("/dayPlan") + public AjaxResult dayPlan( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List platformDayPlanResps = platformService.dayPlan(hospitalId, doctorId); + return AjaxResult.success(platformDayPlanResps); + } + + @ApiOperation("工作台-就诊人数统计") + @PostMapping("/weekMonthPersonCount") + public AjaxResult weekMonthPersonCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId, + @ApiParam(name = "weekMonth",value = "周月的区分 1-周 2-月",required = false) @RequestParam(required = false) Long weekMonth){ + List weekMonthPersonCountResps = platformService.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + return AjaxResult.success(weekMonthPersonCountResps); + } + + @ApiOperation("工作台-患者年龄统计") + @PostMapping("/ageCount") + public AjaxResult ageCount( + @ApiParam(name = "hospitalId",value = "医院id",required = false) @RequestParam(required = false) Long hospitalId, + @ApiParam(name = "doctorId",value = "医生id",required = false) @RequestParam(required = false) Long doctorId){ + List tPatients = platformService.ageCount(hospitalId,doctorId); + return AjaxResult.success(tPatients); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java new file mode 100644 index 0000000..bcc88f4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PlatformDayPlanResp.java @@ -0,0 +1,52 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "PlatformDayPlanResp", description = "工作台今日就诊计划反参实体") +public class PlatformDayPlanResp { + + /** 医院 */ + @ApiModelProperty("name") + private String name; + + /** 状态(0预约 1就诊) */ + @ApiModelProperty("状态(0预约 1就诊)") + private String status; + + /** 创建时间 */ + @JsonFormat(pattern = "HH:mm") + @ApiModelProperty("创建时间") + private Date createTime; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java new file mode 100644 index 0000000..1ec0fc8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/WeekMonthPersonCountResp.java @@ -0,0 +1,40 @@ +package com.ruoyi.system.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.Date; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@ApiModel(value = "WeekMonthPersonCountResp", description = "工作台今日就诊计划反参实体") +public class WeekMonthPersonCountResp { + + /** 医院 */ + @ApiModelProperty("count") + private int count; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty("创建时间") + private Date createTime; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java index 79fa024..20b4152 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TRecordMapper.java @@ -3,10 +3,15 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.TPatientHospitalDoctor; + +import com.ruoyi.system.domain.TPatient; import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.req.TRecordResultReq; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; import com.ruoyi.system.domain.resp.TRecordResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 诊断记录信息Mapper接口 @@ -17,6 +22,46 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface TRecordMapper { + /** + * --------------------------工作台相关接口------------------------------------------ + */ + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + int selectEquCount(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("status")String status, + @Param("month")Long month, + @Param("week")Long week, + @Param("day")Long day); + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + List dayPlan(@Param("hospitalId") Long hospitalId, + @Param("doctorId")Long doctorId); + + /** + * 就诊人数统计 1-周 2-月 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + List weekMonthPersonCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId, + @Param("weekMonth")Long weekMonth); + + + List ageCount(@Param("hospitalId")Long hospitalId, + @Param("doctorId")Long doctorId); + /** * 查询诊断记录信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java new file mode 100644 index 0000000..e01cc65 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PlatformService.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.service.impl; + +import com.ruoyi.system.domain.TPatient; +import com.ruoyi.system.domain.resp.PlatformDayPlanResp; +import com.ruoyi.system.domain.resp.WeekMonthPersonCountResp; +import com.ruoyi.system.mapper.TRecordMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author zhuqing + * @Date 2022/8/9 + */ +@Component +public class PlatformService { + + @Autowired + private TRecordMapper tRecordMapper; + + /** + * 设备统计各个个数查询 + * @param hospitalId + * @param doctorId + * @return + */ + public Map equCount(Long hospitalId, Long doctorId) { + //就诊总数 + int all = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, null,null); + //本月总数 + int month = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", 1L, null,null); + //本周总数 + int week = tRecordMapper.selectEquCount(hospitalId, doctorId, "1", null, 1L,null); + //今日预约 + int day = tRecordMapper.selectEquCount(hospitalId, doctorId, "0", null, null,1L); + Map map = new HashMap(){{ + put("all",all); + put("month",month); + put("week",week); + put("day",day); + }}; + return map; + } + + /** + * 今日就诊计划 + * @param hospitalId + * @param doctorId + * @return + */ + public List dayPlan(Long hospitalId, Long doctorId) { + return tRecordMapper.dayPlan(hospitalId, doctorId); + } + + /** + * 周/月就诊人数统计 + * @param hospitalId + * @param doctorId + * @param weekMonth + * @return + */ + public List weekMonthPersonCount(Long hospitalId, Long doctorId,Long weekMonth) { + return tRecordMapper.weekMonthPersonCount(hospitalId, doctorId,weekMonth); + } + + public List ageCount(Long hospitalId, Long doctorId) { + return tRecordMapper.ageCount(hospitalId, doctorId); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index b23843f..a27682c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -85,6 +85,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN t_patient tp ON tr.patient_id = tp.id + + + + + + + + + + +