Bläddra i källkod

Merge branch 'dev' of linzhuo/patient-co-management into dev

chenweida 8 år sedan
förälder
incheckning
dcf5923fa3

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorDao.java

@ -95,8 +95,8 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    @Query("select d from Doctor d, DoctorTeamMember dtm where d.code=dtm.memberCode and dtm.signType='2' and dtm.team=?1  and dtm.del='1'")
    List<Doctor> findJiatingDoctorByTeam(String code);
    @Query("select dtm.type from Doctor d, DoctorTeamMember dtm where d.code=dtm.memberCode and dtm.signType='2' and dtm.team=?1 and dtm.memberCode=?2  and dtm.del='1'")
    int findTeamType(String teamCode,String docCode);
    @Query("select dtm from Doctor d, DoctorTeamMember dtm where d.code=dtm.memberCode and dtm.signType='2' and dtm.team=?1 and dtm.memberCode=?2  and dtm.del='1'")
    List<DoctorTeamMember> findTeamType(String teamCode,String docCode);
    // 手机号查询正常医生信息
    @Query("select p from Doctor p where p.mobile = ?1 and p.del=1")

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/team/DrHealthTeamService.java

@ -10,6 +10,7 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatient;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.repository.doctor.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.talk.TalkGroupService;
@ -262,7 +263,7 @@ public class DrHealthTeamService extends BaseService {
        }
    }
    public int findTeamType(String parientCode,String docCode) {
    public List<DoctorTeamMember> findTeamType(String parientCode,String docCode) {
        //查看当前的患者所在的家庭团队
        DoctorTeam doctorTeam = doctorTeamDao.findByParientCode(parientCode);
        //查看家庭团队里面的医生

+ 16 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.patient.account;
import com.sun.org.apache.regexp.internal.RE;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.service.app.account.PatientInfoService;
@ -540,6 +541,7 @@ public class PatientController extends WeixinBaseController {
            String id = getUID();
            //查询家庭签约
            SignFamily jt = familyContractService.findByPatientYes(id);
            Map<String,Object> docMap = new HashMap<>();
            if (jt != null) {
                List<Doctor> doctors = doctorTeamService.findJiatingTeamDoctors(id);
                if (doctors != null) {
@ -551,7 +553,20 @@ public class PatientController extends WeixinBaseController {
                        doctorJson.put("code", doctor.getCode());
                        doctorJson.put("name", doctor.getName());
                        doctorJson.put("level", doctor.getLevel());
                        doctorJson.put("teamlevel",doctorTeamService.findTeamType(id,doctor.getCode()));
                        List<DoctorTeamMember> oc = new ArrayList<>();
                        if(docMap.get(doctor.getCode())!=null){//不为空证明全科,建管同一个
                            oc = (List<DoctorTeamMember>)docMap.get(doctor.getCode());
                            doctorJson.put("teamlevel",2);
                        }else{//为空证明建管和全科不一致,或者第一次进入
                            oc = doctorTeamService.findTeamType(id,doctor.getCode());
                            if(oc!=null&&oc.size()==1){//找出只有一条直接返回团队所属职位
                                doctorJson.put("teamlevel",oc.get(0).getType());
                            }
                            if(oc!=null&&oc.size()==2){//两条数据证明专科全科一致
                                docMap.put(doctor.getCode(),oc);
                                doctorJson.put("teamlevel",3);
                            }
                        }
                        familyDoctors.put(doctor.getCode(), doctorJson);
                    }
                }