|
@ -4,10 +4,12 @@ import java.util.*;
|
|
|
|
|
|
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.DoctorTeam;
|
|
|
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
|
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.patient.*;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
|
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
@ -74,7 +76,10 @@ public class SignWebService extends BaseService {
|
|
|
private SignPatientLabelInfoService signPatientLabelInfoService;
|
|
|
@Autowired
|
|
|
private SignFamilyRenewLogDao signFamilyRenewLogDao;
|
|
|
|
|
|
@Autowired
|
|
|
private DoctorTeamDao doctorTeamDao;
|
|
|
@Autowired
|
|
|
private DoctorTeamMemberDao doctorTeamMemberDao;
|
|
|
|
|
|
/**
|
|
|
* 根据医生代码及签约状态编码 获取该医生签约患者的信息列表
|
|
@ -1015,7 +1020,7 @@ public class SignWebService extends BaseService {
|
|
|
signPatientLabelInfoService.setRenewPatientLabels(renew.getPatient(), health, disease,custom, renew.getDoctor(),renew.getDoctor());
|
|
|
//1.3.3.2设置可修改健康管理师
|
|
|
if(StringUtils.isNotBlank(healthDoctor)){
|
|
|
setHealthDoctor(renew,healthDoctor);
|
|
|
updateHealthDoctor(renew,healthDoctor);
|
|
|
}
|
|
|
//1.3.3.2设置新团队
|
|
|
if(teamCode!=null&&teamCode!=0){
|
|
@ -1151,7 +1156,7 @@ public class SignWebService extends BaseService {
|
|
|
signPatientLabelInfoService.setPatientLabels(renew.getPatient(), renew.getIdcard(),"", health, disease, custom, renew.getDoctor(), renew.getDoctor());
|
|
|
//1.3.3.2设置可修改健康管理师
|
|
|
if(StringUtils.isNotBlank(healthDoctor)){
|
|
|
setHealthDoctor(renew,healthDoctor);
|
|
|
updateHealthDoctor(renew,healthDoctor);
|
|
|
}
|
|
|
//1.3.3.2设置新团队
|
|
|
if(teamCode!=null&&teamCode!=0){
|
|
@ -1635,17 +1640,17 @@ public class SignWebService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void setHealthDoctor(SignFamilyRenew signFamilyRenew,String healthDoctor){
|
|
|
Doctor doctor = doctorDao.findByCode(healthDoctor);
|
|
|
signFamilyRenew.setDoctorHealth(doctor.getCode());
|
|
|
signFamilyRenew.setDoctorHealthName(doctor.getName());
|
|
|
}
|
|
|
|
|
|
public void setHealthDoctor(SignFamily signFamilyRenew,String healthDoctor){
|
|
|
Doctor doctor = doctorDao.findByCode(healthDoctor);
|
|
|
signFamilyRenew.setDoctorHealth(doctor.getCode());
|
|
|
signFamilyRenew.setDoctorHealthName(doctor.getName());
|
|
|
}
|
|
|
// public void setHealthDoctor(SignFamilyRenew signFamilyRenew,String healthDoctor){
|
|
|
// Doctor doctor = doctorDao.findByCode(healthDoctor);
|
|
|
// signFamilyRenew.setDoctorHealth(doctor.getCode());
|
|
|
// signFamilyRenew.setDoctorHealthName(doctor.getName());
|
|
|
// }
|
|
|
//
|
|
|
// public void setHealthDoctor(SignFamily signFamilyRenew,String healthDoctor){
|
|
|
// Doctor doctor = doctorDao.findByCode(healthDoctor);
|
|
|
// signFamilyRenew.setDoctorHealth(doctor.getCode());
|
|
|
// signFamilyRenew.setDoctorHealthName(doctor.getName());
|
|
|
// }
|
|
|
|
|
|
public int setRenewLog(SignFamilyRenew renew){
|
|
|
if(renew ==null) {
|
|
@ -1717,4 +1722,66 @@ public class SignWebService extends BaseService {
|
|
|
signFamilyRenewLogDao.save(log);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
public void updateHealthDoctor(SignFamilyRenew renew ,String healthDoctor){
|
|
|
|
|
|
DoctorTeam team = doctorTeamDao.findByCode(renew.getTeamCode());
|
|
|
if(StringUtils.isNotBlank(renew.getDoctorHealth())){
|
|
|
//删除之前健管师成员
|
|
|
doctorTeamMemberDao.deleteMember(renew.getDoctorHealth());
|
|
|
}
|
|
|
Doctor hd = doctorDao.findByCode(healthDoctor);
|
|
|
if(hd==null){
|
|
|
return ;
|
|
|
}
|
|
|
team.setName(renew.getDoctorName()+","+hd.getName()+","+renew.getName());
|
|
|
//新建健康管理师
|
|
|
DoctorTeamMember hdmb = new DoctorTeamMember();
|
|
|
hdmb.setName(hd.getName());
|
|
|
hdmb.setMemberCode(healthDoctor);
|
|
|
hdmb.setCode(getCode());
|
|
|
hdmb.setDel("1");
|
|
|
hdmb.setCzrq(new Date());
|
|
|
hdmb.setTeam(team.getCode());
|
|
|
hdmb.setType(hd.getLevel());
|
|
|
hdmb.setSignType("2");
|
|
|
//新增团队成员
|
|
|
doctorTeamMemberDao.save(hdmb);
|
|
|
//保存团队
|
|
|
doctorTeamDao.save(team);
|
|
|
|
|
|
renew.setDoctorHealthName(hd.getName());
|
|
|
renew.setDoctorHealth(hd.getCode());
|
|
|
}
|
|
|
|
|
|
public void updateHealthDoctor(SignFamily renew ,String healthDoctor){
|
|
|
|
|
|
DoctorTeam team = doctorTeamDao.findByCode(renew.getTeamCode());
|
|
|
if(StringUtils.isNotBlank(renew.getDoctorHealth())){
|
|
|
//删除之前健管师成员
|
|
|
doctorTeamMemberDao.deleteMember(renew.getDoctorHealth());
|
|
|
}
|
|
|
Doctor hd = doctorDao.findByCode(healthDoctor);
|
|
|
if(hd==null){
|
|
|
return ;
|
|
|
}
|
|
|
team.setName(renew.getDoctorName()+","+hd.getName()+","+renew.getName());
|
|
|
//新建健康管理师
|
|
|
DoctorTeamMember hdmb = new DoctorTeamMember();
|
|
|
hdmb.setName(hd.getName());
|
|
|
hdmb.setMemberCode(healthDoctor);
|
|
|
hdmb.setCode(getCode());
|
|
|
hdmb.setDel("1");
|
|
|
hdmb.setCzrq(new Date());
|
|
|
hdmb.setTeam(team.getCode());
|
|
|
hdmb.setType(hd.getLevel());
|
|
|
hdmb.setSignType("2");
|
|
|
//新增团队成员
|
|
|
doctorTeamMemberDao.save(hdmb);
|
|
|
//保存团队
|
|
|
doctorTeamDao.save(team);
|
|
|
|
|
|
renew.setDoctorHealthName(hd.getName());
|
|
|
renew.setDoctorHealth(hd.getCode());
|
|
|
}
|
|
|
}
|