Bläddra i källkod

家庭邀请添加密码

esb 8 år sedan
förälder
incheckning
e1f70f1218

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyService.java

@ -426,4 +426,11 @@ public class FamilyService {
            patientInvitationLog.setWxPushTime(new Date());
        }
    }
    public static void main(String[] args) {
        String idcard="350204195303064028";
        String password=idcard.substring(idcard.length()-6);
        String salt= "e0dac10563ce45f0b3dfc38045011500";
        System.out.println(MD5.GetMD5Code(password+salt));
    }
}

+ 7 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -29,28 +29,30 @@ public class DataHandingService {
        int doctorCount=0;
        List<Patient> patients= patientDao.findAllIdCardPatientAndNoPassword();
        for (Patient patient:patients){
            if(!StringUtils.isEmpty(patient.getPassword())){
            String idcard=patient.getIdcard();
            if(!StringUtils.isEmpty(patient.getPassword())||StringUtils.isEmpty(idcard)||(idcard.length()!=15&&idcard.length()!=18)){
                continue;
            }
            String phone= patient.getPhone();
            String password=phone.substring(5);
            String password=idcard.substring(idcard.length()-6);
            String salt= UUID.randomUUID().toString().replace("-","");
            patient.setSalt(salt);
            patient.setPassword(MD5.GetMD5Code(password+salt));
            patientCount++;
        }
        patientDao.save(patients);
        List<Doctor> doctors= doctorDao.findAllDoctors();
        for (Doctor doctor:doctors){
            if(!StringUtils.isEmpty(doctor.getPassword())){
            String phone= doctor.getMobile();
            if(!StringUtils.isEmpty(doctor.getPassword())||StringUtils.isEmpty(phone)||phone.length()!=11){
                continue;
            }
            String phone= doctor.getMobile();
            String password=phone.substring(5);
            String salt= UUID.randomUUID().toString().replace("-","");
            doctor.setSalt(salt);
            doctor.setPassword(MD5.GetMD5Code(password+salt));
            doctorCount++;
        }
        doctorDao.save(doctors);
        return "更新患者:"+patientCount+",更新医生:"+doctorCount;
    }