From fd51f938c3dcf61acc34a6b735af2d8a93252fb5 Mon Sep 17 00:00:00 2001 From: zhuqing Date: Wed, 10 Aug 2022 17:32:32 +0800 Subject: [PATCH] doctor --- .../controller/pc/THospitalController.java | 2 +- .../domain/req/PcTDoctorQueryByPageReq.java | 12 +++++++++ .../system/domain/req/PcTDoctorUpdateReq.java | 26 ------------------- .../domain/resp/PcTDoctorQueryByPageResp.java | 13 ++++++++++ .../ruoyi/system/mapper/TRecordMapper.java | 11 ++++++++ .../service/impl/TDoctorServiceImpl.java | 22 +++++++++++++++- .../resources/mapper/system/TDoctorMapper.xml | 7 ++++- .../resources/mapper/system/TRecordMapper.xml | 9 +++++++ 8 files changed, 73 insertions(+), 29 deletions(-) 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 de04639..5276504 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 @@ -42,7 +42,7 @@ public class THospitalController extends BaseController * 查询医院信息列表 */ @ApiOperation("查询医院信息列表") - @GetMapping("/list") + @PostMapping("/list") public TableDataInfo list(@RequestBody THospital tHospital) { startPage(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java index 6118b19..04f1a5a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorQueryByPageReq.java @@ -37,6 +37,10 @@ public class PcTDoctorQueryByPageReq { @ApiModelProperty("名称") private String name; + /** 删除标志(0代表存在 2代表删除) */ + @ApiModelProperty("删除标志(0代表存在 2代表删除)") + private String delFlag; + public String getIdentifier() { return identifier; } @@ -76,4 +80,12 @@ public class PcTDoctorQueryByPageReq { public void setEndTime(Date endTime) { this.endTime = endTime; } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java index da41d40..c06907e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/req/PcTDoctorUpdateReq.java @@ -17,10 +17,6 @@ public class PcTDoctorUpdateReq { @ApiModelProperty("id") private Long id; - /** 编号 */ - @ApiModelProperty("工作证号") - private String identifier; - /** 名称 */ @ApiModelProperty("名称") private String name; @@ -45,10 +41,6 @@ public class PcTDoctorUpdateReq { @ApiModelProperty("二维码base64") private String qrCode; - /** 医院 */ - @ApiModelProperty("医院") - private Long hospitalId; - public Long getId() { return id; } @@ -57,14 +49,6 @@ public class PcTDoctorUpdateReq { this.id = id; } - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - public String getName() { return name; } @@ -113,26 +97,16 @@ public class PcTDoctorUpdateReq { this.qrCode = qrCode; } - public Long getHospitalId() { - return hospitalId; - } - - public void setHospitalId(Long hospitalId) { - this.hospitalId = hospitalId; - } - @Override public String toString() { return "PcTDoctorUpdateReq{" + "id=" + id + - ", identifier='" + identifier + '\'' + ", name='" + name + '\'' + ", phone='" + phone + '\'' + ", title='" + title + '\'' + ", speciality='" + speciality + '\'' + ", medicalLicense='" + medicalLicense + '\'' + ", qrCode='" + qrCode + '\'' + - ", hospitalId=" + hospitalId + '}'; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java index 9c6a617..95d305d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/resp/PcTDoctorQueryByPageResp.java @@ -89,6 +89,17 @@ public class PcTDoctorQueryByPageResp { @ApiModelProperty("最近一次就诊时间") private Date latestTime; + @ApiModelProperty("诊断次数") + private int countRecords; + + public int getCountRecords() { + return countRecords; + } + + public void setCountRecords(int countRecords) { + this.countRecords = countRecords; + } + public Date getLatestTime() { return latestTime; } @@ -253,6 +264,8 @@ public class PcTDoctorQueryByPageResp { ", createTime=" + createTime + ", updateTime=" + updateTime + ", countPatints=" + countPatints + + ", latestTime=" + latestTime + + ", countRecords=" + countRecords + '}'; } } 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 9c4e431..f27f503 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 @@ -80,6 +80,17 @@ public interface TRecordMapper @Param("doctorId")Long doctorId, @Param("weekMonth")Long weekMonth); + /** + * --------------------------工作台相关接口------------------------------------------ + */ + /** + * 此医生最近一次就诊时间 + * @param tRecord + * @return + */ + public List selectTRecordDoctorFirst(TRecord tRecord); + + /** * 查询诊断记录信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java index edf4104..e0ee9d1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDoctorServiceImpl.java @@ -2,14 +2,17 @@ package com.ruoyi.system.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.TRecord; import com.ruoyi.system.domain.req.PcTDoctorQueryByPageReq; import com.ruoyi.system.domain.resp.AppDoctorResp; import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp; +import com.ruoyi.system.mapper.TRecordMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.TDoctorMapper; import com.ruoyi.system.domain.TDoctor; import com.ruoyi.system.service.ITDoctorService; +import org.springframework.util.ObjectUtils; /** * 医生信息Service业务层处理 @@ -23,6 +26,8 @@ public class TDoctorServiceImpl implements ITDoctorService @Autowired private TDoctorMapper tDoctorMapper; + @Autowired + private TRecordMapper tRecordMapper; /** * 查询医生信息 * @@ -99,8 +104,23 @@ public class TDoctorServiceImpl implements ITDoctorService @Override public List queryByPage(PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq) { + Long hospitalId = pcTDoctorQueryByPageReq.getHospitalId(); + TRecord record = new TRecord(); + record.setStatus("1"); + record.setHospitalId(hospitalId); List pcTDoctorQueryByPageResps = tDoctorMapper.queryByPage(pcTDoctorQueryByPageReq); - pcTDoctorQueryByPageResps.stream().forEach(a -> a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(pcTDoctorQueryByPageReq.getHospitalId(),a.getId()))); + pcTDoctorQueryByPageResps.stream().forEach(a ->{ + record.setDoctorId(a.getId()); + List tRecords = tRecordMapper.selectTRecordDoctorFirst(record); + //最近一次就诊时间 + if (!ObjectUtils.isEmpty(tRecords)){ + a.setLatestTime(tRecords.get(0).getCreateTime()); + } + //患者个数 + a.setCountPatints(tDoctorMapper.queryPatintCountByDoctor(hospitalId,a.getId())); + //诊断次数 + a.setCountRecords(tRecords.size()); + }); return pcTDoctorQueryByPageResps; } diff --git a/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml index afa30b9..51fce70 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TDoctorMapper.xml @@ -162,7 +162,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from t_doctor - del_flag = '0' and hospital_id = #{hospitalId} AND create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') @@ -172,6 +171,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND identifier like concat('%', #{identifier}, '%') + + and hospital_id = #{hospitalId} + + + and del_flag = #{delFlag} + order by create_time desc diff --git a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml index 0976020..553fb9a 100644 --- a/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/TRecordMapper.xml @@ -159,6 +159,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +