|
@ -70,10 +70,28 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
try{
|
|
|
BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
|
|
|
BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
if(null==basePatientDO){
|
|
|
basePatientDO = new BasePatientDO();
|
|
|
List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
|
|
|
if (!"xm_zsyy_wx".equalsIgnoreCase(wxId)){
|
|
|
if (list!=null&&list.size()>0&&basePatientDO!=null){
|
|
|
if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
|
|
|
|
|
|
}else{
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}else if (list!=null&&list.size()>0&&basePatientDO==null){
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
|
|
|
return mixEnvelop;
|
|
|
} else {
|
|
|
if(basePatientDO==null){
|
|
|
basePatientDO = new BasePatientDO();
|
|
|
}
|
|
|
basePatientDO.setMobile(phoneNum);
|
|
|
}
|
|
|
}
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
PatientMappingDO patientMappingDO = patientMappingDao.findByIdcard(idCard);
|
|
|
if(null==patientMappingDO){
|
|
|
patientMappingDO = new PatientMappingDO();
|
|
@ -91,18 +109,6 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
String birth = "";
|
|
|
String yktFamilyId = "";
|
|
|
int sex=3;
|
|
|
List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
|
|
|
if (list!=null&&list.size()>0){
|
|
|
if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
|
|
|
|
|
|
}else {
|
|
|
mixEnvelop.setStatus(408);
|
|
|
mixEnvelop.setMessage("您所添加的家属手机号已被他人占用");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
}else {
|
|
|
basePatientDO.setMobile(phoneNum);
|
|
|
}
|
|
|
//获取his家属数据
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
|
|
@ -208,6 +214,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
mixEnvelop.setMessage("您所添加的家属的电话有误,无法添加");
|
|
|
return mixEnvelop;
|
|
|
}
|
|
|
basePatientDO.setMobile(Next_Of_Kin_Phone);
|
|
|
basePatientDO.setPhone(Next_Of_Kin_Phone);
|
|
|
}
|
|
|
if (!Pat_name.equalsIgnoreCase(familyName)) {
|
|
|
mixEnvelop.setStatus(408);
|
|
@ -578,6 +586,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
|
|
|
String sql="select t.id as \"id\",t.card_type as \"cardType\"," +
|
|
|
"t.family_member as \"familyMember\",t.patient as \"patient\"," +
|
|
|
"b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\",t.clinicid as \"clinicid\"," +
|
|
|
",b.phone as \"phone\","+
|
|
|
"c.relation_name \"relationName\",b.birthday as\"birthday\",b.sex as\"sex\"" +
|
|
|
" from wlyy_patient_family_member t left join base_patient b" +
|
|
|
" on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id " +
|