chenweida пре 8 година
родитељ
комит
38737d2524

+ 48 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -917,15 +917,15 @@ public class DoctorInfoService extends BaseService {
            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);
            }
        }
@ -991,4 +991,45 @@ public class DoctorInfoService extends BaseService {
            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);
    }
}

+ 22 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -1589,6 +1589,28 @@ public class DoctorController extends BaseController {
        }
    }
    /**
     * 转换团队中的全科医生
     *
     * @param newDoctorCode 新的全科医生的code
     * @param oldDoctorCode 旧的全科医生的code
     * @param patients      患者code 多个逗号分隔
     * @return
     */
    @RequestMapping(value = "/updateTeamDoctors")
    @ResponseBody
    public String updateTeamDoctors(String newDoctorCode,
                                    String oldDoctorCode,
                                    String patients) {
        try {
            doctorInfoService.updateTeamDoctors(newDoctorCode, oldDoctorCode, patients);
            return write(200, "更新成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "更新失败");
        }
    }
    /**
     * 医生手机号变更
     *