|
@ -855,39 +855,27 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
|
|
|
* @param idcard
|
|
|
* @return
|
|
|
*/
|
|
|
public BasePatientDO addPaitentByIdcard(String idcard) {
|
|
|
public BasePatientDO addPaitentByIdcard(String idcard,String name,String ssc,String mobile,Integer sex) {
|
|
|
try {
|
|
|
org.json.JSONArray jsonArray = jwArchivesService.getSickArchiveRecord(idcard);
|
|
|
if (jsonArray.length() > 0) {
|
|
|
org.json.JSONObject json = jsonArray.getJSONObject(0);
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
|
// patient.setCode(getCode());
|
|
|
patient.setName(json.getString("sickName"));
|
|
|
patient.setIdcard(idcard);
|
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
|
|
|
patient.setSsc(json.getString("ssc"));
|
|
|
|
|
|
String salt = UUID.randomUUID().toString().replace("-", "");
|
|
|
String password = idcard.substring(idcard.length() - 6, idcard.length());
|
|
|
password = MD5.GetMD5Code("a" + password + "*" + salt);
|
|
|
patient.setSalt(salt);
|
|
|
patient.setPassword(password);
|
|
|
//统一身份认证状态
|
|
|
// patient.setIsCertified(0);
|
|
|
// patient.setStatus(1);
|
|
|
// patient.setCzrq(new Date());
|
|
|
// patient.setSicardStatus(0);
|
|
|
patientDao.save(patient);
|
|
|
//同步居民签约记录
|
|
|
// try {
|
|
|
// jwSignService.LoadSignFamilyByIdcard(idcard);
|
|
|
// } catch (ServiceException se){
|
|
|
// se.printStackTrace();
|
|
|
// } catch (Exception e){
|
|
|
// e.printStackTrace();
|
|
|
// }
|
|
|
return patient;
|
|
|
}
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
|
String salt = UUID.randomUUID().toString().substring(0,5);
|
|
|
String pw = idcard.substring(idcard.length()-6);
|
|
|
patient.setIdcard(idcard);
|
|
|
patient.setCardType("01");
|
|
|
patient.setName(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.setSsc(ssc);
|
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
|
|
|
patient.setSex(sex);
|
|
|
patient = patientDao.save(patient);
|
|
|
return patient;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|