Browse Source

修复关注医生接口

mengkang 4 năm trước cách đây
mục cha
commit
98fc5cf8b7

+ 68 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -4550,9 +4550,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if("1".equals(outpatient.getType())){
                if("1".equals(outpatient.getType())){
                    systemMessageDO.setTitle("图文复诊");
                    systemMessageDO.setTitle("图文复诊");
                    systemMessageDO.setType("1");
                    systemMessageDO.setType("1");
                    saveInquirySystemMessage(outpatient);
                }else {
                }else {
                    systemMessageDO.setTitle("视频复诊");
                    systemMessageDO.setTitle("视频复诊预约成功");
                    systemMessageDO.setType("2");
                    systemMessageDO.setType("2");
                    saveInquirySystemMessage(outpatient);
                }
                }
            }
            }
            systemMessageDO.setReceiver(outpatient.getDoctor());
            systemMessageDO.setReceiver(outpatient.getDoctor());
@ -4567,6 +4569,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            data.put("age",IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
            data.put("age",IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
            data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
            data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
            data.put("question",outpatient.getDescription());
            data.put("question",outpatient.getDescription());
            String msg="您的视频复诊已预约成功。\n" +
                    "预计"+outpatient.getDoctorName()+"医生将于"+outpatient.getRegisterDate()+" 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
            data.put("msg",msg);
            systemMessageDO.setData(data.toString());
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);
            systemMessageService.saveMessage(systemMessageDO);
@ -4578,6 +4583,39 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return systemMessageDO;
        return systemMessageDO;
    }
    }
    public void saveInquirySystemMessage(WlyyOutpatientDO outpatient){
        SystemMessageDO systemMessageDO = new SystemMessageDO();
        String msg="";
        if("1".equals(outpatient.getType())){
            msg=outpatient.getPatientName()+",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        }else {
            msg=outpatient.getPatientName()+",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        }
        systemMessageDO.setTitle("线上问诊支付提醒");
        systemMessageDO.setType("11");
        systemMessageDO.setSender(outpatient.getDoctor());
        systemMessageDO.setSenderName(outpatient.getDoctorName());
        systemMessageDO.setRelationCode(outpatient.getId());
        systemMessageDO.setReceiver(outpatient.getPatient());
        systemMessageDO.setReceiverName(outpatient.getPatientName());
        JSONObject data = new JSONObject();
        try {
            data.put("name",outpatient.getPatientName());
            data.put("age",IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
            data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
            data.put("question",outpatient.getDescription());
            data.put("msg",msg);
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
    /**
     * 指定门诊医生医生
     * 指定门诊医生医生
     * @param outpatientJson
     * @param outpatientJson
@ -5492,11 +5530,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (status==2){
        if (status==2){
            /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
            /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
            logger.info("开始====="+wlyyPrescriptionDO.getCheckStatus());
            logger.info("开始====="+wlyyPrescriptionDO.getCheckStatus());
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                try {
                try {
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId,1);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId,1);
                    WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
                    DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                    DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                    //his处方拼接开方条件
                    //his处方拼接开方条件
@ -5505,12 +5543,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        //设置his药品查询条件
                        //设置his药品查询条件
                        setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, info, outpatientDO.getIcd10());
                        setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, info, outpatientDO.getIcd10());
                    }
                    }
                    for (WlyyInspectionDO ins:inspectionDOS){
                    for (WlyyInspectionDO ins:inspectionDOS){
                        //设置his药品查询条件
                        //设置his药品查询条件
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
                    }
                    }
                    sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                    sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                } catch (Exception e) {
                } catch (Exception e) {
                    e.printStackTrace();
                    e.printStackTrace();
                }
                }
@ -5519,6 +5557,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyPrescriptionDO.setCheckStatus(2);
            wlyyPrescriptionDO.setCheckStatus(2);
            wlyyPrescriptionDO.setCheckReason(reason);
            wlyyPrescriptionDO.setCheckReason(reason);
            wlyyPrescriptionDO.setStatus(20);
            wlyyPrescriptionDO.setStatus(20);
            //发送系统消息 处方支付提醒
            SystemMessageDO messageDO = new SystemMessageDO();
            messageDO.setType("6");
            messageDO.setTitle("处方支付提醒");
            messageDO.setSender(outpatientDO.getDoctor());
            messageDO.setSenderName(outpatientDO.getDoctorName());
            messageDO.setRelationCode(outpatientDO.getId());
            messageDO.setReceiver(outpatientDO.getPatient());
            messageDO.setReceiverName(outpatientDO.getPatientName());
            try {
                JSONObject data = new JSONObject();
                data.put("name",outpatientDO.getPatientName());
                data.put("age", IdCardUtil.getAgeForIdcard(outpatientDO.getIdcard()));
                data.put("gender",IdCardUtil.getSexForIdcard_new(outpatientDO.getIdcard()));
                data.put("question","");
                String msg=outpatientDO.getPatientName()+",您好!医生已为您开具处方,请及时支付。如您已支付请忽略本条信息。";
                data.put("msg",msg);
                messageDO.setData(data.toString());
                systemMessageService.saveMessage(messageDO);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }else{
        }else{
            wlyyPrescriptionDO.setCheckStatus(status);
            wlyyPrescriptionDO.setCheckStatus(status);
            wlyyPrescriptionDO.setCheckReason(reason);
            wlyyPrescriptionDO.setCheckReason(reason);
@ -5528,6 +5591,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (status==2||status==1){
        if (status==2||status==1){
            sendCheckMessage(status,wlyyPrescriptionDO,operate,operateName);
            sendCheckMessage(status,wlyyPrescriptionDO,operate,operateName);
        }
        }
        return prescriptionCheckDO;
        return prescriptionCheckDO;
    }
    }

+ 45 - 5
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -18,12 +18,15 @@ import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultDao;
@ -162,6 +165,9 @@ public class ImService {
	@Autowired
	@Autowired
	private HibenateUtils hibenateUtils;
	private HibenateUtils hibenateUtils;
	@Autowired
	private SystemMessageService systemMessageService;
	
	
	@Value("${wechat.id}")
	@Value("${wechat.id}")
	private String wxId;
	private String wxId;
@ -1343,9 +1349,45 @@ public class ImService {
//		returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "28", evalueContent.toString());
//		returnJson = imUtil.sendIM(consultTeam.getDoctor(), consultTeam.getPatient(), "28", evalueContent.toString());
//		String response = imUtil.sendTopicIM(consultTeam.getDoctor(), doctor.getName(), consult, "28", evalueContent.toString(),null);
//		String response = imUtil.sendTopicIM(consultTeam.getDoctor(), doctor.getName(), consult, "28", evalueContent.toString(),null);
//		String response = imUtil.sendImMsg(consultTeam.getDoctor(), doctor.getName(), session_id, "28", evalueContent.toString(),null);
//		String response = imUtil.sendImMsg(consultTeam.getDoctor(), doctor.getName(), session_id, "28", evalueContent.toString(),null);
		
		
		
		//保存系统消息服务评价
		SystemMessageDO messageDO = new SystemMessageDO();
		messageDO.setType("10");
		messageDO.setTitle("服务评价");
		messageDO.setSender(doctor.getId());
		messageDO.setSenderName(doctor.getName());
		messageDO.setReceiver(patient.getId());
		messageDO.setReceiverName(patient.getName());
		net.sf.json.JSONObject data = new net.sf.json.JSONObject();
		data.put("name",patient.getName());
		data.put("age",IdCardUtil.getAgeForIdcard(patient.getIdcard()));
		data.put("gender",patient.getSex().toString());
		data.put("question",consultTeam.getSymptoms());
		if (cons.getType()!=null&&1==cons.getType()){
			String msg =patient.getName()+ ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
		}
		if (cons.getType()!=null&&9==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
		}
		if (cons.getType()!=null&&16==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
		}
		if (cons.getType()!=null&&17==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
		}
		messageDO.setData(data.toString());
		try {
			systemMessageService.saveMessage(messageDO);
		} catch (Exception e) {
			e.printStackTrace();
		}
		String endName = "";
		String endName = "";
		String endId = "";
		String endId = "";
		JSONObject obj = new JSONObject();
		JSONObject obj = new JSONObject();
@ -1374,8 +1416,6 @@ public class ImService {
		if (obj.getInteger("status") == -1) {
		if (obj.getInteger("status") == -1) {
			throw new RuntimeException(String.valueOf(obj.get("message")));
			throw new RuntimeException(String.valueOf(obj.get("message")));
		}
		}
		
		
//		//推送给IM文字消息
//		//推送给IM文字消息
//		if (endType == 1) {
//		if (endType == 1) {

+ 31 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.ImService;
@ -88,6 +89,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@Autowired
	@Autowired
	private BusinessOrderService businessOrderService;
	private BusinessOrderService businessOrderService;
	@Autowired
	private SystemMessageService systemMessageService;
	
	
	@Value("${fastDFS.fastdfs_file_url}")
	@Value("${fastDFS.fastdfs_file_url}")
	private String fastdfs_file_url;
	private String fastdfs_file_url;
@ -405,6 +409,33 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
//			res = re.getInteger("status");
//			res = re.getInteger("status");
//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null;
//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null;
			//线上问诊支付提醒
			if (type==17||type==1){
				SystemMessageDO systemMessageDO = new SystemMessageDO();
				systemMessageDO.setTitle("线上问诊支付提醒");
				systemMessageDO.setType("11");
				systemMessageDO.setSender(re.getString("doctor"));
				systemMessageDO.setSenderName(re.getString("doctorName"));
				systemMessageDO.setRelationCode(re.getString("sessiond_id"));
				systemMessageDO.setReceiver(re.getString("patient"));
				systemMessageDO.setReceiverName(re.getString("patientName"));
				net.sf.json.JSONObject data = new net.sf.json.JSONObject();
				data.put("name",re.getString("patientName"));
				data.put("age", IdCardUtil.getAgeForIdcard(re.getString("patient_idcard")));
				data.put("gender",IdCardUtil.getSexForIdcard_new(re.getString("patient_idcard")));
				data.put("question",symptoms);
				String msg= "";
				if (type==17){
					msg=re.getString("patientName")+",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
				}else {
					msg=re.getString("patientName")+",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
				}
				data.put("msg",msg);
				systemMessageDO.setData(data.toString());
				systemMessageService.saveMessage(systemMessageDO);
			}
			//发送系统消息
			//发送系统消息
			SystemMessageDO systemMessageDO = new SystemMessageDO();
			SystemMessageDO systemMessageDO = new SystemMessageDO();
			systemMessageDO.setTitle("新增专家咨询");
			systemMessageDO.setTitle("新增专家咨询");