|
@ -1036,13 +1036,15 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
|
|
JSONObject object1 = JSONObject.parseObject(res);
|
|
JSONObject object1 = JSONObject.parseObject(res);
|
|
if (null != object1&&null!=object1.get("status") && "200".equals(object1.get("status").toString())) {
|
|
if (null != object1&&null!=object1.get("status") && "200".equals(object1.get("status").toString())) {
|
|
JSONObject patient = object1.getJSONObject("userinfo");
|
|
JSONObject patient = object1.getJSONObject("userinfo");
|
|
logger.info("开始同步患者数据");
|
|
|
|
|
|
logger.info("开始同步患者数据"+res);
|
|
String idcard = patient.getString("idcard");
|
|
String idcard = patient.getString("idcard");
|
|
String idtype = patient.getString("idtype");
|
|
String idtype = patient.getString("idtype");
|
|
BasePatientDO patientDO2 = patientDao.findByIdcardAndDel(idcard,"1");
|
|
BasePatientDO patientDO2 = patientDao.findByIdcardAndDel(idcard,"1");
|
|
BasePatientDO patient1 = new BasePatientDO();
|
|
BasePatientDO patient1 = new BasePatientDO();
|
|
String salt = UUID.randomUUID().toString().substring(0,5);
|
|
String salt = UUID.randomUUID().toString().substring(0,5);
|
|
String mobile = patient.getString("mobile");
|
|
String mobile = patient.getString("mobile");
|
|
|
|
String birthday = patient.getString("birthday");
|
|
|
|
Integer sex = patient.getInteger("sex");
|
|
String pw = null;
|
|
String pw = null;
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(mobile)){
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(mobile)){
|
|
pw = mobile.substring(mobile.length()-6);
|
|
pw = mobile.substring(mobile.length()-6);
|
|
@ -1058,14 +1060,25 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
|
|
patient1.setIdcard(idcard);
|
|
patient1.setIdcard(idcard);
|
|
patient1.setCardType(idtype);
|
|
patient1.setCardType(idtype);
|
|
patient1.setName(patient.getString("name"));
|
|
patient1.setName(patient.getString("name"));
|
|
patient1.setSex(StringUtils.isNotBlank(idcard)?Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)):null);
|
|
|
|
|
|
if (sex!=null){
|
|
|
|
patient1.setSex(sex);
|
|
|
|
}else {
|
|
|
|
patient1.setSex(StringUtils.isNotBlank(idcard)?Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)):null);
|
|
|
|
}
|
|
patient1.setMobile(mobile);
|
|
patient1.setMobile(mobile);
|
|
patient1.setDel("1");
|
|
patient1.setDel("1");
|
|
patient1.setEnabled(1);
|
|
patient1.setEnabled(1);
|
|
patient1.setLocked(0);
|
|
patient1.setLocked(0);
|
|
patient1.setCreateTime(new Date());
|
|
patient1.setCreateTime(new Date());
|
|
patient1.setUpdateTime(new Date());
|
|
patient1.setUpdateTime(new Date());
|
|
patient1.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
|
|
|
|
|
|
if (StringUtils.isNotBlank(birthday)){
|
|
|
|
patient1.setBirthday(DateUtil.strToDateShort(birthday));
|
|
|
|
patient1.setAge(com.yihu.jw.security.utils.DateUtil.getAgeByBirthday(patient1.getBirthday()));
|
|
|
|
}else {
|
|
|
|
patient1.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
|
|
|
|
patient1.setAge(IdCardUtil.getAgeForIdcard(idcard));
|
|
|
|
}
|
|
|
|
|
|
patient1 = patientDao.save(patient1);
|
|
patient1 = patientDao.save(patient1);
|
|
logger.info("结束同步患者数据");
|
|
logger.info("结束同步患者数据");
|
|
return patient;
|
|
return patient;
|