|
@ -72,6 +72,8 @@ public class MessageUtil {
|
|
|
private GetuiService getuiService;
|
|
|
@Autowired
|
|
|
private GetuiClientDao getuiClientDao;
|
|
|
@Autowired
|
|
|
private DingdingUtil dingdingUtil;
|
|
|
|
|
|
/**
|
|
|
* 您好{1}有一条新的在线报名申请,请及时前往APP消息应用进行处理。
|
|
@ -113,6 +115,40 @@ public class MessageUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送钉钉消息
|
|
|
* type 1 安防紧急预警 2紧急呼叫 4im 5生日祝福
|
|
|
* msgtype 消息类型 text
|
|
|
*/
|
|
|
public void sendDoctorDingdingMessage(BaseDoctorDO doctorDO,String doctorCode,String msgtype,String type,String content,String title,String url){
|
|
|
try {
|
|
|
if(doctorDO == null){
|
|
|
doctorDO = baseDoctorDao.findById(doctorCode);
|
|
|
}
|
|
|
if(StringUtils.isBlank(doctorDO.getYktDoctorId())){
|
|
|
//没有钉钉id不推送
|
|
|
return;
|
|
|
}
|
|
|
JSONObject msg = new JSONObject();
|
|
|
msg.put("msgtype",msgtype);
|
|
|
if("text".equals(msgtype)){
|
|
|
JSONObject text = new JSONObject();
|
|
|
text.put("content",content);
|
|
|
msg.put("text",text);
|
|
|
}else if("link".equals(msgtype)){
|
|
|
JSONObject link = new JSONObject();
|
|
|
link.put("messageUrl",url);
|
|
|
link.put("title",title);
|
|
|
link.put("text",content);
|
|
|
link.put("picMediaId",DingdingUtil.picMediaId);
|
|
|
msg.put("link",link);
|
|
|
}
|
|
|
dingdingUtil.sendP2pMsg(msg.toString(), doctorDO.getYktDoctorId());
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param wechatId
|