|
@ -3,7 +3,9 @@ package com.yihu.jw.security.service;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
|
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
|
|
import com.yihu.jw.security.dao.patient.BasePatientDao;
|
|
import com.yihu.jw.security.dao.patient.BasePatientDao;
|
|
|
|
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
|
|
import com.yihu.jw.security.utils.AES;
|
|
import com.yihu.jw.security.utils.AES;
|
|
import com.yihu.jw.security.utils.IdCardUtil;
|
|
import com.yihu.jw.security.utils.IdCardUtil;
|
|
import com.yihu.utils.security.MD5;
|
|
import com.yihu.utils.security.MD5;
|
|
@ -32,6 +34,8 @@ public class OauthWjwConfigService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private BasePatientDao basePatientDao;
|
|
private BasePatientDao basePatientDao;
|
|
|
|
@Autowired
|
|
|
|
private WlyyPatientFamilyMemberDao familyMemberDao;
|
|
|
|
|
|
public BasePatientDO savePatient(String data)throws Exception{
|
|
public BasePatientDO savePatient(String data)throws Exception{
|
|
logger.info("savePatient :"+data);
|
|
logger.info("savePatient :"+data);
|
|
@ -52,7 +56,24 @@ public class OauthWjwConfigService {
|
|
if(StringUtils.isNotBlank(userIdNo)){
|
|
if(StringUtils.isNotBlank(userIdNo)){
|
|
|
|
|
|
BasePatientDO basePatientDO = basePatientDao.findByIdcardAndDel(userIdNo,"1");
|
|
BasePatientDO basePatientDO = basePatientDao.findByIdcardAndDel(userIdNo,"1");
|
|
|
|
logger.info("12312321321===="+userIdNo);
|
|
if(basePatientDO!=null){
|
|
if(basePatientDO!=null){
|
|
|
|
WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(basePatientDO.getId(),"7");
|
|
|
|
if (basePatientFamilyMemberDO==null){
|
|
|
|
basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
|
|
|
|
basePatientFamilyMemberDO.setPatient(basePatientDO.getId());
|
|
|
|
basePatientFamilyMemberDO.setFamilyRelation("7");
|
|
|
|
basePatientFamilyMemberDO.setFamilyRelationName("自己");
|
|
|
|
basePatientFamilyMemberDO.setCardType("身份证");
|
|
|
|
basePatientFamilyMemberDO.setCardNo(basePatientDO.getIdcard());
|
|
|
|
basePatientFamilyMemberDO.setCreateTime(new Date());
|
|
|
|
basePatientFamilyMemberDO.setUpdateTime(new Date());
|
|
|
|
basePatientFamilyMemberDO.setIsAuthorize(1);
|
|
|
|
basePatientFamilyMemberDO.setIsDel(1);
|
|
|
|
basePatientFamilyMemberDO.setFamilyMember(basePatientDO.getId());
|
|
|
|
familyMemberDao.save(basePatientFamilyMemberDO);
|
|
|
|
}
|
|
|
|
logger.info("==================");
|
|
return basePatientDO;
|
|
return basePatientDO;
|
|
}
|
|
}
|
|
|
|
|
|
@ -75,7 +96,22 @@ public class OauthWjwConfigService {
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(userIdNo));
|
|
patient.setBirthday(IdCardUtil.getBirthdayForIdcard(userIdNo));
|
|
patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(userIdNo)));
|
|
patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(userIdNo)));
|
|
|
|
|
|
basePatientDao.save(patient);
|
|
|
|
|
|
patient = basePatientDao.save(patient);
|
|
|
|
WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patient.getId(),"7");
|
|
|
|
if (basePatientFamilyMemberDO==null){
|
|
|
|
basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
|
|
|
|
basePatientFamilyMemberDO.setPatient(patient.getId());
|
|
|
|
basePatientFamilyMemberDO.setFamilyRelation("7");
|
|
|
|
basePatientFamilyMemberDO.setFamilyRelationName("自己");
|
|
|
|
basePatientFamilyMemberDO.setCardType("身份证");
|
|
|
|
basePatientFamilyMemberDO.setCardNo(patient.getIdcard());
|
|
|
|
basePatientFamilyMemberDO.setCreateTime(new Date());
|
|
|
|
basePatientFamilyMemberDO.setUpdateTime(new Date());
|
|
|
|
basePatientFamilyMemberDO.setIsAuthorize(1);
|
|
|
|
basePatientFamilyMemberDO.setIsDel(1);
|
|
|
|
basePatientFamilyMemberDO.setFamilyMember(patient.getId());
|
|
|
|
familyMemberDao.save(basePatientFamilyMemberDO);
|
|
|
|
}
|
|
|
|
|
|
return basePatientDO;
|
|
return basePatientDO;
|
|
|
|
|