|
@ -102,8 +102,15 @@ public class MyFamilyService {
|
|
|
BasePatientDO patientDO = patientService.findByIdAndDel(patient);
|
|
|
//1、检验手机号码是否有存在账号,
|
|
|
BasePatientDO familyPatient = patientService.findByMobileAndDel(familyMobile);
|
|
|
Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime);
|
|
|
if(familyPatient==null){
|
|
|
//2、没有存在账号的,预注册一个账号,调用预注册接口
|
|
|
Map<String,Object> map = patientService.bespeakRegist(familyMobile,time);
|
|
|
if(Integer.valueOf(map.get("code")+"")==1){
|
|
|
familyPatient = (BasePatientDO)map.get("patient");
|
|
|
}else{
|
|
|
throw new Exception(map.get("message")+"");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//3、生成申请绑定的记录
|
|
@ -125,8 +132,8 @@ public class MyFamilyService {
|
|
|
messageDO.setSenderName(patientDO.getName());
|
|
|
messageDO.setSenderPhoto(patientDO.getPhoto());
|
|
|
messageDO.setTitle("家人绑定");
|
|
|
messageDO.setMsgDigest("");
|
|
|
messageDO.setMsgContent("");
|
|
|
messageDO.setMsgDigest(null);
|
|
|
messageDO.setMsgContent(null);
|
|
|
messageDO.setMsgTypeCode("010801");
|
|
|
messageDO.setMsgTypeName("");
|
|
|
messageDO.setPlatform(platform);
|
|
@ -136,7 +143,6 @@ public class MyFamilyService {
|
|
|
messageDO.setCreateTime(new Date());
|
|
|
messageService.save(messageDO);
|
|
|
}
|
|
|
Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime);
|
|
|
Long failurTime = System.currentTimeMillis()+time;
|
|
|
patientApplyLog.setFailureTime(new Date(failurTime));
|
|
|
patientApplyLog = patientApplyLogService.save(patientApplyLog);
|
|
@ -234,15 +240,9 @@ public class MyFamilyService {
|
|
|
PatientApplyLog patientApplyLog = patientApplyLogService.findById(patientApplyLogId);
|
|
|
BasePatientDO apply = patientService.findByIdAndDel(patientApplyLog.getCreateUser());
|
|
|
BasePatientDO family = patientService.findByIdAndDel(patientApplyLog.getFamilyMemberCode());
|
|
|
Integer converRole = familyRelationTrans(patientApplyLog.getFamilyBindRole(),apply.getSex());
|
|
|
if(patientApplyLog.getFailureTime().getTime()<System.currentTimeMillis()){
|
|
|
map.put("key","0");
|
|
|
map.put("keyName","绑定过期");
|
|
|
map.put("applyPhoto",apply.getPhoto());
|
|
|
map.put("familyPhoto",family.getPhoto());
|
|
|
map.put("explain","您的"+role.get(converRole-1)+apply.getName()+"向您发起的绑定邀请已过期,您可以点下下方邀请绑定按钮,重新邀请绑定家人。");
|
|
|
return map;
|
|
|
}
|
|
|
map.put("applyPhoto",apply.getPhoto());
|
|
|
map.put("familyPhoto",family.getPhoto());
|
|
|
|
|
|
patientApplyLog.setStatus(status);
|
|
|
patientApplyLog.setConfirmTime(new Date());
|
|
|
patientApplyLogService.save(patientApplyLog);
|
|
@ -264,8 +264,6 @@ public class MyFamilyService {
|
|
|
patientFamilyMember2.setDel(1);
|
|
|
patientFamilyMemberService.save(patientFamilyMember2);
|
|
|
}
|
|
|
map.put("key","1");
|
|
|
map.put("keyName","绑定成功");
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@ -278,7 +276,9 @@ public class MyFamilyService {
|
|
|
* @param isAuthorize
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void scanQRcodeConfirmApply(Integer status,String applyPatient,String familyPatient,Integer familyBindRole,Integer isAuthorize)throws Exception{
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Map<String,Object> scanQRcodeConfirmApply(Integer status,String applyPatient,String familyPatient,Integer familyBindRole,Integer isAuthorize)throws Exception{
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
if(status==3){
|
|
|
BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO();
|
|
|
patientFamilyMember.setPatient(applyPatient);
|
|
@ -296,6 +296,11 @@ public class MyFamilyService {
|
|
|
patientFamilyMember2.setDel(1);
|
|
|
patientFamilyMemberService.save(patientFamilyMember2);
|
|
|
}
|
|
|
BasePatientDO apply = patientService.findByIdAndDel(applyPatient);
|
|
|
BasePatientDO family = patientService.findByIdAndDel(familyPatient);
|
|
|
map.put("applyPhoto",apply.getPhoto());
|
|
|
map.put("familyPhoto",family.getPhoto());
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -326,6 +331,15 @@ public class MyFamilyService {
|
|
|
BaseMessageDO messageDO = messageService.findById(messageId);
|
|
|
PatientApplyLog patientApplyLog = patientApplyLogService.findById(Integer.valueOf(messageDO.getRelationData()+""));
|
|
|
Map<String,Object> map = scanQRcode(patientApplyLog.getCreateUser(),patientApplyLog.getFamilyMemberCode(),patientApplyLog.getFamilyBindRole());
|
|
|
|
|
|
BasePatientDO apply = patientService.findByIdAndDel(patientApplyLog.getCreateUser());
|
|
|
Integer converRole = familyRelationTrans(patientApplyLog.getFamilyBindRole(),apply.getSex());
|
|
|
if(patientApplyLog.getFailureTime().getTime()<System.currentTimeMillis()) {
|
|
|
map.put("overdue", "1");//过期
|
|
|
map.put("explain", "您的" + role.get(converRole - 1) + apply.getName() + "向您发起的绑定邀请已过期");
|
|
|
}else {
|
|
|
map.put("overdue", "0");
|
|
|
}
|
|
|
map.put("patientApplyLogId",patientApplyLog.getId());
|
|
|
return map;
|
|
|
}
|