| 
															
																@ -2,16 +2,14 @@ package com.yihu.jw.door.util; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.doctor.dao.BaseDoctorDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.wx.WxAccessTokenDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.wx.WxAccessTokenDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.wx.WxTemplateConfigDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.wx.WxTemplateConfigDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.wx.WxWechatDO; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.door.WlyyDoorServiceOrderDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.hospital.message.SystemMessageDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.hospital.message.SystemMessageDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.exception.ApiException; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.exception.code.ExceptionCode; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.message.dao.SystemMessageDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.hospital.message.dao.SystemMessageDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.rm.base.WechatRequestMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.wechat.WeixinMessagePushUtils; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.wechat.WeixinMessagePushUtils; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -19,11 +17,10 @@ import com.yihu.jw.util.wechat.wxhttp.HttpUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.wechat.dao.WxAccessTokenDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.wechat.dao.WxAccessTokenDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.wechat.dao.WxTemplateConfigDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.wechat.dao.WxTemplateConfigDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.wechat.service.WxAccessTokenService; 
															 | 
															
															 | 
															
																import com.yihu.jw.wechat.service.WxAccessTokenService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.utils.network.HttpUtils; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import org.apache.commons.collections.CollectionUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.apache.commons.lang3.StringUtils; 
															 | 
															
															 | 
															
																import org.apache.commons.lang3.StringUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.slf4j.Logger; 
															 | 
															
															 | 
															
																import org.slf4j.Logger; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.slf4j.LoggerFactory; 
															 | 
															
															 | 
															
																import org.slf4j.LoggerFactory; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.beans.BeanUtils; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
															
															 | 
															
																import org.springframework.beans.factory.annotation.Autowired; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.beans.factory.annotation.Value; 
															 | 
															
															 | 
															
																import org.springframework.beans.factory.annotation.Value; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.jdbc.core.BeanPropertyRowMapper; 
															 | 
															
															 | 
															
																import org.springframework.jdbc.core.BeanPropertyRowMapper; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -56,13 +53,14 @@ public class MessageUtil { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private SystemMessageDao systemMessageDao; 
															 | 
															
															 | 
															
																    private SystemMessageDao systemMessageDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private WxAccessTokenDao wxAccessTokenDao; 
															 | 
															
															 | 
															
																    private WxAccessTokenDao wxAccessTokenDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private BaseDoctorDao baseDoctorDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    //发送微信模板消息 
															 | 
															
															 | 
															
																    //发送微信模板消息 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public static String sendMessageUrl ="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public static String sendMessageUrl = "http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param wxId 
															 | 
															
															 | 
															
																     * @param wxId 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param patient 患者id 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param patient       患者id 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param cardNo 
															 | 
															
															 | 
															
																     * @param cardNo 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param first 
															 | 
															
															 | 
															
																     * @param first 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param noticeContent 
															 | 
															
															 | 
															
																     * @param noticeContent 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -70,52 +68,52 @@ public class MessageUtil { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @param redirectUrl 
															 | 
															
															 | 
															
																     * @param redirectUrl 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * @return 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public String sendWXMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String msg="first:"+first+"contentMsg:"+noticeContent+"remark:"+remark; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("发送的信息="+msg); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public String sendWXMes(String wxId, String patient, String cardNo, String first, String noticeContent, String remark, String redirectUrl) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String msg = "first:" + first + "contentMsg:" + noticeContent + "remark:" + remark; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        logger.info("发送的信息=" + msg); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject params = new JSONObject(); 
															 | 
															
															 | 
															
																        JSONObject params = new JSONObject(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("transType","sms.hospital.notice"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("merchId","3501000014"); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("transType", "sms.hospital.notice"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("merchId", "3501000014"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject p = new JSONObject(); 
															 | 
															
															 | 
															
																        JSONObject p = new JSONObject(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String openId = ""; 
															 | 
															
															 | 
															
																        String openId = ""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(StringUtils.isNotBlank(patient)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            String sql = "select * from base.base_patient_wechat where wechat_id='"+wxId+"'and patient_id='"+patient+"' "; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            List<BasePatientWechatDo> paientWechatDos = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(BasePatientWechatDo.class)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if(paientWechatDos!=null&&paientWechatDos.size()>0){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isNotBlank(patient)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String sql = "select * from base.base_patient_wechat where wechat_id='" + wxId + "'and patient_id='" + patient + "' "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            List<BasePatientWechatDo> paientWechatDos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientWechatDo.class)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (paientWechatDos != null && paientWechatDos.size() > 0) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                openId = paientWechatDos.get(0).getOpenid(); 
															 | 
															
															 | 
															
																                openId = paientWechatDos.get(0).getOpenid(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                p.put("openId",openId); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                p.put("openId", openId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            p.put("cardNo",cardNo); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            p.put("cardNo", cardNo); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        p.put("first",first); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        p.put("noticeTime", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        p.put("noticeContent",noticeContent); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(StringUtils.isNotBlank(redirectUrl)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            p.put("redirectUrl",redirectUrl); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        p.put("first", first); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        p.put("noticeTime", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        p.put("noticeContent", noticeContent); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isNotBlank(redirectUrl)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            p.put("redirectUrl", redirectUrl); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        p.put("remark",remark); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        params.put("param",p); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        p.put("remark", remark); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("param", p); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("params :"+params.toString()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        logger.info("params :" + params.toString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if(StringUtils.isNotBlank(openId)||StringUtils.isNotBlank(cardNo)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            String rs = HttpUtil.sendPost(sendMessageUrl,params.toJSONString()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isNotBlank(openId) || StringUtils.isNotBlank(cardNo)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String rs = HttpUtil.sendPost(sendMessageUrl, params.toJSONString()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            JSONObject rsJson = JSON.parseObject(rs); 
															 | 
															
															 | 
															
																            JSONObject rsJson = JSON.parseObject(rs); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            String resCode = rsJson.getString("respCode"); 
															 | 
															
															 | 
															
																            String resCode = rsJson.getString("respCode"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if("000000".equals(resCode)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if ("000000".equals(resCode)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                return "1"; 
															 | 
															
															 | 
															
																                return "1"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            return "0"; 
															 | 
															
															 | 
															
																            return "0"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            return "-1"; 
															 | 
															
															 | 
															
																            return "-1"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public String ehospitalNotice(String userName, String idCard, String phone, String title, String content, String contentString,String url) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String msg="first:"+title+"contentMsg:"+content+"remark:"+contentString; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        logger.info("发送的信息="+msg); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public String ehospitalNotice(String userName, String idCard, String phone, String title, String content, String contentString, String url) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String msg = "first:" + title + "contentMsg:" + content + "remark:" + contentString; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        logger.info("发送的信息=" + msg); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        JSONObject jsonObject = new JSONObject(); 
															 | 
															
															 | 
															
																        JSONObject jsonObject = new JSONObject(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        jsonObject.put("userName", userName); 
															 | 
															
															 | 
															
																        jsonObject.put("userName", userName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        jsonObject.put("idCard", idCard); 
															 | 
															
															 | 
															
																        jsonObject.put("idCard", idCard); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -130,62 +128,63 @@ public class MessageUtil { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return responseMsg; 
															 | 
															
															 | 
															
																        return responseMsg; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public void putTemplateWxMessage(String wechatId,String templateName,String scene,String openId,String first,String remark,String url,String ...keywords){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first, String remark, String url, String... keywords) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        try { 
															 | 
															
															 | 
															
																        try { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId); 
															 | 
															
															 | 
															
																            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (wxAccessTokenDO==null){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                logger.info("wx_access_token表获取为空,wechatId"+wechatId); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (wxAccessTokenDO == null) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.info("wx_access_token表获取为空,wechatId" + wechatId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                return; 
															 | 
															
															 | 
															
																                return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            WxTemplateConfigDO newConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1); 
															 | 
															
															 | 
															
																            WxTemplateConfigDO newConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (newConfig==null){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                logger.info("微信模板不存在!请确认wechatId:"+wechatId+",templateName:"+templateName+",scene:"+scene); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (newConfig == null) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                return; 
															 | 
															
															 | 
															
																                return; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (StringUtils.isNoneBlank(url)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNoneBlank(url)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setUrl(url); 
															 | 
															
															 | 
															
																                newConfig.setUrl(url); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (StringUtils.isNoneBlank(remark)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (StringUtils.isNoneBlank(remark)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setRemark(remark); 
															 | 
															
															 | 
															
																                newConfig.setRemark(remark); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            newConfig.setFirst(first); 
															 | 
															
															 | 
															
																            newConfig.setFirst(first); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            int keyLength = keywords.length; 
															 | 
															
															 | 
															
																            int keyLength = keywords.length; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=1){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 1) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[0]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[0]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=2){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 2) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[1]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[1]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=3){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 3) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[2]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[2]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=4){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 4) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[3]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[3]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=5){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 5) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[4]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[4]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=6){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 6) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[5]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[5]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if (keyLength>=7){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (keyLength >= 7) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                newConfig.setKeyword1(keywords[6]); 
															 | 
															
															 | 
															
																                newConfig.setKeyword1(keywords[6]); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            //发起微信消息模板推送 
															 | 
															
															 | 
															
																            //发起微信消息模板推送 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), openId, newConfig); 
															 | 
															
															 | 
															
																            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), openId, newConfig); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }catch (Exception e){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } catch (Exception e) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            logger.info("微信模板推送异常"); 
															 | 
															
															 | 
															
																            logger.info("微信模板推送异常"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            e.printStackTrace(); 
															 | 
															
															 | 
															
																            e.printStackTrace(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    /** 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     * 
															 | 
															
															 | 
															
																     * 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     */ 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public SystemMessageDO saveSystemMessage(String messageId,String relationCode,String title,String type,String sender,String senderName,String receiver,String receiverName,String idCard,String msg,String over) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public SystemMessageDO saveSystemMessage(String messageId, String relationCode, String title, String type, String sender, String senderName, String receiver, String receiverName, String idCard, String msg, String over) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        SystemMessageDO messageDO = new SystemMessageDO(); 
															 | 
															
															 | 
															
																        SystemMessageDO messageDO = new SystemMessageDO(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (StringUtils.isBlank(messageId)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            messageDO.setId(UUID.randomUUID().toString().replace("-","")); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (StringUtils.isBlank(messageId)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            messageDO.setId(UUID.randomUUID().toString().replace("-", "")); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setTitle(title); 
															 | 
															
															 | 
															
																        messageDO.setTitle(title); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setType(type); 
															 | 
															
															 | 
															
																        messageDO.setType(type); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -194,19 +193,7 @@ public class MessageUtil { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setRelationCode(relationCode); 
															 | 
															
															 | 
															
																        messageDO.setRelationCode(relationCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setReceiver(receiver); 
															 | 
															
															 | 
															
																        messageDO.setReceiver(receiver); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setReceiverName(receiverName); 
															 | 
															
															 | 
															
																        messageDO.setReceiverName(receiverName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        net.sf.json.JSONObject data = new net.sf.json.JSONObject(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.put("name", receiverName); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        try { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if(StringUtils.isNoneBlank(idCard)){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                data.put("age", IdCardUtil.getAgeForIdcard(idCard)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                data.put("gender", IdCardUtil.getSexForIdcard(idCard)); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } catch (Exception e) { 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            e.printStackTrace(); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        data.put("msg", msg); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setData(data.toString()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        messageDO.setData(msg); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setOver(over); 
															 | 
															
															 | 
															
																        messageDO.setOver(over); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        messageDO.setCreateTime(new Date()); 
															 | 
															
															 | 
															
																        messageDO.setCreateTime(new Date()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        systemMessageDao.save(messageDO); 
															 | 
															
															 | 
															
																        systemMessageDao.save(messageDO); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -214,6 +201,96 @@ public class MessageUtil { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public void updateMessage(WlyyDoorServiceOrderDO doorServiceOrder,String[] type,String toType,String sender,String receiver){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String orderId=doorServiceOrder.getId(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        List<SystemMessageDO> messages = systemMessageDao.queryByRelationCodeAndTypeIn(orderId,type); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (toType.equals("434")){//医生接单 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (CollectionUtils.isEmpty(messages)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.error("当前工单没有医生待接单消息!orderId:" + orderId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                messages.forEach(message->{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    systemMessageDao.orderMessageDel(message.getReceiver(),message.getRelationCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    if (message.getType().equals("403") ) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());//· 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        String msg=doorServiceOrder.getDispatcherName() + "接受了服务工单"+ doorServiceOrder.getNumber(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        saveSystemMessage(message.getId(),message.getRelationCode(),"医生接单","434",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        message.setOver("0"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        systemMessageDao.save(message); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                }); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (toType.equals("435")) {//医生拒单 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (CollectionUtils.isEmpty(messages)) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.error("当前工单没有医生待接单消息!orderId:" + orderId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                SystemMessageDO message = messages.get(0); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String msg=doorServiceOrder.getDoctorName() + "拒绝了服务工单" + doorServiceOrder.getNumber() + ", 请重新派单"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                saveSystemMessage(message.getId(),message.getRelationCode(),"医生拒单","435",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (toType.equals("431")) {//调度员派单(派给本社区医生) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(CollectionUtils.isEmpty(messages)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.error("当前工单没有 居民新增预约 消息!!orderId:" + orderId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                // 设置消息处理完毕 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                messages.forEach( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        message -> { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            String title = "调度员派单(派给本社区医生)"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            if("system".equals(doorServiceOrder.getUpdateUser())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                title = "系统派单(派给服务医生)"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            if (message.getType() .equals("430")) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                message.setTitle(title); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                String msg = doorServiceOrder.getDispatcherName() + "已将服务工单" + doorServiceOrder.getNumber() + "指派给" + doorServiceOrder.getDoctorName() + "医生"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                saveSystemMessage(message.getId(),message.getRelationCode(),title,"431",doorServiceOrder.getUpdateUser(),doorServiceOrder.getUpdateUserName(), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                        doorServiceOrder.getUpdateUser(),doorServiceOrder.getUpdateUserName(),null,msg,message.getOver()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                message.setOver("0"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                systemMessageDao.save(message); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                ); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (toType.equals("432")){//调度员拒单 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(CollectionUtils.isEmpty(messages)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.error("当前工单没有系统消息!!orderId:" + orderId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                // 432 调度员拒单即取消工单-- 李四拒绝了张三的服务工单12345678 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                messages.forEach( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        message -> { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            if (message.getType() .equals("430")) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                String msg=doorServiceOrder.getDispatcherName() + "拒绝了"+ doorServiceOrder.getPatientName() +"的服务工单" + doorServiceOrder.getNumber(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                saveSystemMessage(message.getId(),message.getRelationCode(),"调度员拒单","432",doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(), 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                        doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                message.setOver("0"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                                systemMessageDao.save(message); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                ); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (toType.equals("patientCancel")){//居民取消 消息列表也应该不显示 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(CollectionUtils.isEmpty(messages)){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                logger.error("当前工单没有系统消息!!orderId:" + orderId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                messages.forEach( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        message -> { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            message.setOver("0"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            systemMessageDao.save(message); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                ); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public static void main(String[] args){ 
															 | 
															
															 | 
															
																    public static void main(String[] args){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        try { 
															 | 
															
															 | 
															
																        try { 
															 |