|
@ -786,17 +786,49 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public void updateTeamHealthDoctorsAll(String newDoctorCode,String doctor) throws Exception {
|
|
|
public int updateTeamHealthDoctorsAll(String newDoctorCode,String doctor) throws Exception {
|
|
|
List<String> patients = signFamilyDao.findNohealthByDoctor(doctor);
|
|
|
boolean hasNoTeam = false;
|
|
|
if(patients != null){
|
|
|
for (String patient : patients) {
|
|
|
try {
|
|
|
updateTeamHealthDoctor(newDoctorCode, "", patient);
|
|
|
if(updateTeamHealthDoctorAll(newDoctorCode, patient) == -1){
|
|
|
hasNoTeam = true;
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return hasNoTeam ? 2 : 1;
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public int updateTeamHealthDoctorAll(String newDoctorCode, String patient) throws Exception {
|
|
|
//得到患者的签约信息
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
if(StringUtils.isEmpty(signFamily.getTeamCode())){
|
|
|
return -1;
|
|
|
}
|
|
|
Doctor newD = doctorDao.findByCode(newDoctorCode);
|
|
|
//修改签约中的健康管理师
|
|
|
signFamily.setDoctorHealth(newD.getCode());
|
|
|
signFamily.setDoctorHealthName(newD.getName());
|
|
|
|
|
|
//添加新的健康管理师到服务团队里
|
|
|
DoctorTeamMember newDoctorTeamMember = new DoctorTeamMember();
|
|
|
newDoctorTeamMember.setTeam(signFamily.getTeamCode());
|
|
|
newDoctorTeamMember.setCzrq(new Date());
|
|
|
newDoctorTeamMember.setName(newD.getName());
|
|
|
newDoctorTeamMember.setMemberCode(newD.getCode());
|
|
|
newDoctorTeamMember.setType(3);
|
|
|
newDoctorTeamMember.setSignType("2");
|
|
|
newDoctorTeamMember.setDel("1");
|
|
|
newDoctorTeamMember.setCode(UUID.randomUUID().toString().replace("-", ""));
|
|
|
doctorTeamDoctor.save(newDoctorTeamMember);
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
/**
|