|
@ -248,4 +248,61 @@ public class WlyyBusinessService {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询I健康接口获取居民信息
|
|
|
*/
|
|
|
public Map<String,Object> findWlyyPatient(String idcard)throws Exception{
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("idcard",idcard);
|
|
|
JSONObject re = wlyyHttpService.sendWlyyMes("wlyyGetSignFamily",param,null);
|
|
|
if(re!=null){
|
|
|
JSONObject p = re.getJSONObject("data");
|
|
|
|
|
|
BasePatientDO patientDO = basePatientDao.findByIdcardAndDel(idcard,"1");
|
|
|
if(patientDO == null){
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
|
|
|
|
String salt = UUID.randomUUID().toString().substring(0,5);
|
|
|
String mobile = p.getString("mobile");
|
|
|
String pw = mobile.substring(mobile.length()-6);
|
|
|
|
|
|
patient.setIdcard(idcard);
|
|
|
patient.setName(p.getString("name"));
|
|
|
patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
|
|
|
patient.setSalt(salt);
|
|
|
patient.setMobile(mobile);
|
|
|
patient.setDel("1");
|
|
|
patient.setEnabled(1);
|
|
|
patient.setLocked(0);
|
|
|
patient.setCreateTime(new Date());
|
|
|
patient.setUpdateTime(new Date());
|
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
|
|
|
|
|
|
BasePatientDO temp = basePatientDao.save(patient);
|
|
|
|
|
|
return getPatientInfoMap(temp);
|
|
|
}
|
|
|
return getPatientInfoMap(patientDO);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
public Map<String,Object> getPatientInfoMap(BasePatientDO basePatientDO){
|
|
|
Map<String,Object> rs = new HashedMap();
|
|
|
rs.put("id",basePatientDO.getId());
|
|
|
rs.put("name",basePatientDO.getName());
|
|
|
rs.put("sex",basePatientDO.getSex());
|
|
|
rs.put("provinceCode",basePatientDO.getProvinceCode());
|
|
|
rs.put("provinceName",basePatientDO.getProvinceName());
|
|
|
rs.put("cityCode",basePatientDO.getCityCode());
|
|
|
rs.put("cityName",basePatientDO.getCityName());
|
|
|
rs.put("townCode",basePatientDO.getTownCode());
|
|
|
rs.put("townName",basePatientDO.getTownName());
|
|
|
rs.put("idcard",basePatientDO.getIdcard());
|
|
|
rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
|
|
|
rs.put("mobile",basePatientDO.getMobile());
|
|
|
return rs;
|
|
|
}
|
|
|
}
|