|  | @ -917,15 +917,15 @@ public class DoctorInfoService extends BaseService {
 | 
												
													
														
															|  |             return -3;
 |  |             return -3;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         //修改密码
 |  |         //修改密码
 | 
												
													
														
															|  |         String oldPassword=doc.getPassword();
 |  | 
 | 
												
													
														
															|  | 
 |  |         String oldPassword = doc.getPassword();
 | 
												
													
														
															|  |         //判断旧的密码是不是手机号码后六位
 |  |         //判断旧的密码是不是手机号码后六位
 | 
												
													
														
															|  |         String oldMobile=doc.getMobile();
 |  | 
 | 
												
													
														
															|  |         if(!org.springframework.util.StringUtils.isEmpty(oldMobile)){
 |  | 
 | 
												
													
														
															|  |             String passwordTemp=oldMobile.substring(5);
 |  | 
 | 
												
													
														
															|  |             passwordTemp=MD5.GetMD5Code(passwordTemp+doc.getSalt());
 |  | 
 | 
												
													
														
															|  |             if(passwordTemp.equals(oldPassword)){
 |  | 
 | 
												
													
														
															|  | 
 |  |         String oldMobile = doc.getMobile();
 | 
												
													
														
															|  | 
 |  |         if (!org.springframework.util.StringUtils.isEmpty(oldMobile)) {
 | 
												
													
														
															|  | 
 |  |             String passwordTemp = oldMobile.substring(5);
 | 
												
													
														
															|  | 
 |  |             passwordTemp = MD5.GetMD5Code(passwordTemp + doc.getSalt());
 | 
												
													
														
															|  | 
 |  |             if (passwordTemp.equals(oldPassword)) {
 | 
												
													
														
															|  |                 //如果密码是原来的电话号码后留位改成现在号码的后留位
 |  |                 //如果密码是原来的电话号码后留位改成现在号码的后留位
 | 
												
													
														
															|  |                 String newPassword=MD5.GetMD5Code(mobile.substring(5)+doc.getSalt());
 |  | 
 | 
												
													
														
															|  | 
 |  |                 String newPassword = MD5.GetMD5Code(mobile.substring(5) + doc.getSalt());
 | 
												
													
														
															|  |                 doc.setPassword(newPassword);
 |  |                 doc.setPassword(newPassword);
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -991,4 +991,45 @@ public class DoctorInfoService extends BaseService {
 | 
												
													
														
															|  |             return 0;
 |  |             return 0;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @Transactional
 | 
												
													
														
															|  | 
 |  |     public void updateTeamDoctors(String newDoctorCode, String oldDoctorCode, String patients) throws Exception {
 | 
												
													
														
															|  | 
 |  |         String[] patiensString = patients.split(",");
 | 
												
													
														
															|  | 
 |  |         for (int i = 0; i < patiensString.length; i++) {
 | 
												
													
														
															|  | 
 |  |             updateTeamDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     private void updateTeamDoctor(String newDoctorCode, String oldDoctorCode, String patient) throws Exception {
 | 
												
													
														
															|  | 
 |  |         //得到患者的签约信息
 | 
												
													
														
															|  | 
 |  |         SignFamily signFamily = signFamilyDao.findByPatient(patient);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         //判断患者对旧的全科医生是否存在健康咨询
 | 
												
													
														
															|  | 
 |  |         ConsultTeam consultTeam = consultTeamDao.findByParientCodeAndSignTypeAndDoctor(patient, oldDoctorCode, 2);
 | 
												
													
														
															|  | 
 |  |         if (consultTeam != null) {
 | 
												
													
														
															|  | 
 |  |             throw new Exception("存在没有关闭的健康咨询");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         //修改医生服务团队 删除旧的全科医生
 | 
												
													
														
															|  | 
 |  |         DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findMemberByTeamAndQkCode(signFamily.getTeamCode(), oldDoctorCode);
 | 
												
													
														
															|  | 
 |  |         if (doctorTeamMember != null) {
 | 
												
													
														
															|  | 
 |  |             doctorTeamMember.setDel("0");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         Doctor newD = doctorDao.findByCode(newDoctorCode);
 | 
												
													
														
															|  | 
 |  |         //修改签约中的全科医生
 | 
												
													
														
															|  | 
 |  |         signFamily.setDoctor(newD.getCode());
 | 
												
													
														
															|  | 
 |  |         signFamily.setDoctorName(newD.getName());
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         //添加新的全科医生到服务团队里
 | 
												
													
														
															|  | 
 |  |         DoctorTeamMember newDoctorTeamMember = new DoctorTeamMember();
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setTeam(signFamily.getTeamCode());
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setCzrq(new Date());
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setName(newD.getName());
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setMemberCode(newD.getCode());
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setType(2);
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setSignType("2");
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setDel("1");
 | 
												
													
														
															|  | 
 |  |         newDoctorTeamMember.setCode(UUID.randomUUID().toString().replace("-", ""));
 | 
												
													
														
															|  | 
 |  |         doctorTeamDoctor.save(newDoctorTeamMember);
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | }
 |  | }
 |