From 455bbc81d6b71efbe4565bbcbe376289428af2f0 Mon Sep 17 00:00:00 2001 From: changpengfei Date: Wed, 8 Sep 2021 17:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E7=BB=9F=E8=AE=A1=EF=BC=8C?= =?UTF-8?q?=E7=A0=81=E8=A1=A8=E8=BD=AC=E6=8D=A2=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talkonlineweb/controller/DoctorController.java | 44 ++++++++++++++++++++-- .../com/lyms/talkonlineweb/domain/LymsDoctor.java | 8 ++++ .../talkonlineweb/mapper/LymsDoctorMapper.java | 5 +++ .../talkonlineweb/service/LymsDoctorService.java | 3 ++ .../service/impl/LymsDoctorServiceImpl.java | 10 +++++ 5 files changed, 67 insertions(+), 3 deletions(-) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java index bb5f2c3..127ff84 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java @@ -2,11 +2,11 @@ package com.lyms.talkonlineweb.controller; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.lyms.talkonlineweb.domain.LymsDict; import com.lyms.talkonlineweb.domain.LymsDoctor; import com.lyms.talkonlineweb.domain.LymsHdepart; import com.lyms.talkonlineweb.result.BaseResponse; -import com.lyms.talkonlineweb.service.LymsDoctorService; -import com.lyms.talkonlineweb.service.LymsHdepartService; +import com.lyms.talkonlineweb.service.*; import com.lyms.talkonlineweb.util.Constant; import com.lyms.talkonlineweb.util.JwtUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +29,13 @@ public class DoctorController { @Autowired private LymsDoctorService lymsDoctorService; + @Autowired + private LymsHdepartService lymsHdepartService; + @Autowired + private LymsHospitalService lymsHospitalService; + @Autowired + private LymsDictService lymsDictService; + /** * 获取医生列表 @@ -42,12 +49,32 @@ public class DoctorController { BaseResponse baseResponse=new BaseResponse(); Page page=new Page<>(current,size); Page doctorPagePage=lymsDoctorService.page(page, Wrappers.query(doctor).orderByDesc("updated_time","createdtime")); - + conDocCode(doctorPagePage); baseResponse.setObject(doctorPagePage); return baseResponse; } + public void conDocCode(Page doctorPagePage){ + Map param=new HashMap(); + param.put("vtype",4); + List dLst=lymsDictService.listByMap(param); + doctorPagePage.getRecords().forEach(d->{ + param.clear(); + param.put("did",d.getDpid()); + List departLst=lymsHdepartService.listByMap(param); + if(departLst.size()>0){ + LymsHdepart depart=departLst.get(0); + d.setHname(depart.getHname()); + d.setDdname(depart.getDname()); + dLst.forEach(dd->{ + if(dd.getCode()==d.getLvl()){ + d.setLname(dd.getValue()); + } + }); + } + }); + } /** @@ -123,4 +150,15 @@ public class DoctorController { return baseResponse; } + /** + * 统计医生信息 + * @return + */ + @GetMapping("statDoctor") + public BaseResponse statDoctor(){ + BaseResponse baseResponse=new BaseResponse(); + Map stat=lymsDoctorService.statDoctor(); + baseResponse.setObject(stat); + return baseResponse; + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java index 535d2f3..e2d78fc 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsDoctor.java @@ -120,6 +120,14 @@ public class LymsDoctor implements Serializable { @TableField(exist = false) private static final long serialVersionUID = 1L; + + @TableField(exist = false) + private String hname;//医院名称 + @TableField(exist = false) + private String ddname;//科室名称 + @TableField(exist = false) + private String lname;//职位 + @Override public boolean equals(Object that) { if (this == that) { diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java index c5d5d74..f7d66a7 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java @@ -2,12 +2,17 @@ package com.lyms.talkonlineweb.mapper; import com.lyms.talkonlineweb.domain.LymsDoctor; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Select; + +import java.util.Map; /** * @Entity com.lyms.talkonlineweb.domain.LymsDoctor */ public interface LymsDoctorMapper extends BaseMapper { + @Select("SELECT COUNT(1) dall,SUM(d.`stat`) dsum,(COUNT(1)-SUM(d.`stat`)) rcnt FROM lyms_doctor d ") + Map statDoctor(); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java index 169f615..aeef538 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java @@ -3,9 +3,12 @@ package com.lyms.talkonlineweb.service; import com.lyms.talkonlineweb.domain.LymsDoctor; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Map; + /** * */ public interface LymsDoctorService extends IService { + Map statDoctor(); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java index cb24f66..27e8d8b 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java @@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lyms.talkonlineweb.domain.LymsDoctor; import com.lyms.talkonlineweb.service.LymsDoctorService; import com.lyms.talkonlineweb.mapper.LymsDoctorMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Map; + /** * */ @@ -13,6 +16,13 @@ import org.springframework.stereotype.Service; public class LymsDoctorServiceImpl extends ServiceImpl implements LymsDoctorService{ + @Autowired + private LymsDoctorMapper lymsDoctorMapper; + + @Override + public Map statDoctor() { + return lymsDoctorMapper.statDoctor(); + } } -- 1.8.3.1