patient+doctor

master
zhuqing 2 years ago
parent 12bcd2ee45
commit 81284dd473

@ -9,7 +9,6 @@ import com.ruoyi.system.domain.resp.PcTDoctorQueryByPageResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -61,10 +60,11 @@ public class TDoctorController extends BaseController
@ApiOperation("导出医生信息列表")
@Log(title = "医生信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TDoctor tDoctor)
public void export(HttpServletResponse response, @RequestBody @Validated PcTDoctorQueryByPageReq pcTDoctorQueryByPageReq)
{
List<TDoctor> list = tDoctorService.selectTDoctorList(tDoctor);
ExcelUtil<TDoctor> util = new ExcelUtil<TDoctor>(TDoctor.class);
// List<TDoctor> list = tDoctorService.selectTDoctorList(tDoctor);
List<PcTDoctorQueryByPageResp> list = tDoctorService.queryByPage(pcTDoctorQueryByPageReq);
ExcelUtil<PcTDoctorQueryByPageResp> util = new ExcelUtil<PcTDoctorQueryByPageResp>(PcTDoctorQueryByPageResp.class);
util.exportExcel(response, list, "医生信息数据");
}

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import com.ruoyi.common.exception.ServiceException;
@ -107,19 +108,23 @@ public class SysLoginController
//添加医生和医院标识返回
Long hospitalId = null;
Long doctorId = null;
TDoctor tDoctor = new TDoctor();
tDoctor.setUserId(user.getUserId());
List<TDoctor> selectTDoctorList = itDoctorService.selectTDoctorList(tDoctor);
if (!ObjectUtils.isEmpty(selectTDoctorList)){
doctorId = selectTDoctorList.get(0).getId();
}
THospital tHospital = new THospital();
tHospital.setAdminId(user.getUserId());
List<THospital> tHospitals = itHospitalService.selectTHospitalList(tHospital);
if (!ObjectUtils.isEmpty(tHospitals)){
hospitalId = tHospitals.get(0).getId();
}
ajax.put("hospitalId", hospitalId);
TDoctor tDoctor = new TDoctor();
tDoctor.setUserId(user.getUserId());
List<TDoctor> selectTDoctorList = itDoctorService.selectTDoctorList(tDoctor);
if (!ObjectUtils.isEmpty(selectTDoctorList)){
doctorId = selectTDoctorList.get(0).getId();
//医生登录返回hospitalId
if (Objects.isNull(hospitalId) && Objects.nonNull(doctorId)){
hospitalId = selectTDoctorList.get(0).getHospitalId();
}
ajax.put("hospitalId", hospitalId);
ajax.put("doctorId", doctorId);
return ajax;
}

@ -1,5 +1,6 @@
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;
@ -21,12 +22,14 @@ public class PcTDoctorQueryByPageReq {
* startTime
*/
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* endTime
*/
@ApiModelProperty("结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/** 编号 */

@ -1,5 +1,6 @@
package com.ruoyi.system.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -21,12 +22,14 @@ public class PcTPatintQueryByPageReq {
* startTime
*/
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* endTime
*/
@ApiModelProperty("结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/** 编号 */

@ -24,14 +24,17 @@ public class PcTDoctorQueryByPageResp {
/** 编号 */
@ApiModelProperty("编号")
@Excel(name = "工作证号")
private String identifier;
/** 名称 */
@ApiModelProperty("名称")
@Excel(name = "名称")
private String name;
/** 电话 */
@ApiModelProperty("电话")
@Excel(name = "电话")
private String phone;
/** 用户性别0男 1女 2未知 */
@ -70,10 +73,14 @@ public class PcTDoctorQueryByPageResp {
@ApiModelProperty("医院id")
private Long hospitalId;
/** 删除标志0代表存在 2代表删除 */
@ApiModelProperty("删除标志0代表存在 2代表删除 ")
private String delFlag;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("创建时间")
@Excel(name = "注册时间")
private Date createTime;
/** 更新时间 */
@ -82,14 +89,17 @@ public class PcTDoctorQueryByPageResp {
private Date updateTime;
@ApiModelProperty("患者个数")
@Excel(name = "患者个数")
private int countPatints;
/** 最近一次就诊时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("最近一次就诊时间")
@Excel(name = "最近一次就诊时间")
private Date latestTime;
@ApiModelProperty("诊断次数")
@Excel(name = "诊断次数")
private int countRecords;
public int getCountRecords() {
@ -244,6 +254,14 @@ public class PcTDoctorQueryByPageResp {
this.countPatints = countPatints;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
@Override
public String toString() {
return "PcTDoctorQueryByPageResp{" +
@ -261,6 +279,7 @@ public class PcTDoctorQueryByPageResp {
", medicalLicense='" + medicalLicense + '\'' +
", qrCode='" + qrCode + '\'' +
", hospitalId=" + hospitalId +
", delFlag='" + delFlag + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", countPatints=" + countPatints +

@ -39,6 +39,7 @@ public class PcTPatientQueryByPageResp {
/** 用户性别0男 1女 2未知 */
@ApiModelProperty("用户性别0男 1女 2未知")
@Excel(name = "用户性别0男 1女 2未知")
private String sex;
/** 年龄 */

@ -156,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
introduction,
medical_license as medicalLicense,
qr_code as qrCode,
del_flag as delFlag,
hospital_id as hospitalId,
create_time as createTime,
update_time as updateTime

@ -134,13 +134,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.disease,
a.create_time as createTime,
a.update_time as updateTime,
d.`name` as doctorName,
a.del_flag as delFlag,
d.`name` as doctorName
from t_patient a left join t_patient_hospital_doctor b on a.id = b.patient_id
left join t_hospital c on b.hospital_id = c.id
left join t_doctor d on b.doctor_id = d.id
<where>
<if test="delFlag != null">
and del_flag = #{delFlag}
and a.del_flag = #{delFlag}
</if>
<if test="startTime != null and endTime != null">
AND a.create_time between DATE_FORMAT(#{startTime},'%Y-%m-%d %H:%i:%s') and DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s')
@ -155,7 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and b.doctor_d = #{doctorId}
</if>
<if test="doctorName != null and doctorName != ''">
and d.name = like concat('%', #{doctorName}, '%')
and d.name like concat('%', #{doctorName}, '%')
</if>
</where>
GROUP BY a.id

Loading…
Cancel
Save