ソースを参照

Merge branch 'dev' of liuwenbin/wlyy2.0 into dev

liuwenbin 6 年 前
コミット
413b53268c

+ 31 - 19
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java

@ -94,24 +94,7 @@ public class MyFamilyService {
        BasePatientDO familyPatient = null;
        //3、生成申请绑定的记录,二维码
        PatientApplyLog patientApplyLog = new PatientApplyLog();
        patientApplyLog.setPatientFamilyMemberName(familyPatient.getName());
        patientApplyLog.setPatienyFamilyMemberCode(familyPatient.getId());
        String scene ="family_"+patient+"_"+familyPatient.getId();
        String qrCode = weChatQrcodeService.getQrcode(request,wechatId, scene);
        if(StringUtils.isEmpty(qrCode)){
            throw new Exception("qrCode is null");
        }
        patientApplyLog.setQrCode(qrCode);
        Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime);
        Long failurTime = (new Date()).getTime()+time;
        patientApplyLog.setFailureTime(new Date(failurTime));
        patientApplyLog.setDel(1);
        patientApplyLog.setCreateTime(new Date());
        patientApplyLog.setCreateUser(patient);
        patientApplyLog.setCreateUserName(patientDO.getName());
        patientApplyLogService.save(patientApplyLog);
        createFamilyQrCode(request,familyPatient,wechatId,patient);
        //4、发送绑定家人的系统消息
        BaseMessageDO messageDO = new BaseMessageDO();
        messageDO.setSaasId(saasId);
@ -134,7 +117,36 @@ public class MyFamilyService {
        messageService.save(messageDO);
    }
    /**
     * 生成绑定家人的二维码
     * @param request
     * @param familyPatient
     * @param wechatId
     * @param patient
     * @return
     * @throws Exception
     */
    public String createFamilyQrCode(HttpServletRequest request,BasePatientDO familyPatient,String wechatId, String patient) throws Exception{
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);
        PatientApplyLog patientApplyLog = new PatientApplyLog();
        patientApplyLog.setPatientFamilyMemberName(familyPatient.getName());
        patientApplyLog.setPatienyFamilyMemberCode(familyPatient.getId());
        String scene ="family_"+familyPatient.getId()+"_"+familyPatient.getId();
        String qrCode = weChatQrcodeService.getQrcode(request,wechatId, scene);
        if(StringUtils.isEmpty(qrCode)){
            throw new Exception("qrCode is null");
        }
        patientApplyLog.setQrCode(qrCode);
        Long time = 1000*60*60*Long.valueOf(qrCodeFailurTime);
        Long failurTime = (new Date()).getTime()+time;
        patientApplyLog.setFailureTime(new Date(failurTime));
        patientApplyLog.setDel(1);
        patientApplyLog.setCreateTime(new Date());
        patientApplyLog.setCreateUser(familyPatient.getId());
        patientApplyLog.setCreateUserName(patientDO.getName());
        patientApplyLogService.save(patientApplyLog);
        return qrCode;
    }

+ 2 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/PatientApplyLogService.java

@ -3,10 +3,12 @@ package com.yihu.jw.patient.service.myFamily;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.dao.myFamily.PatientApplyLogDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * @author liuwenbin on 2018/11/30.
 */
@Service
public class PatientApplyLogService extends BaseJpaService<PatientApplyLog, PatientApplyLogDao> {
}