|
@ -156,11 +156,22 @@ public class EnterpriseService {
|
|
|
|
|
|
public String sendMKMesByDoctor(String enterpriseId,String doctor,String content)throws Exception {
|
|
public String sendMKMesByDoctor(String enterpriseId,String doctor,String content)throws Exception {
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
|
|
|
|
|
|
|
|
String res="";
|
|
if (baseDoctorDO != null && StringUtils.isNotBlank(baseDoctorDO.getMobile())) {
|
|
if (baseDoctorDO != null && StringUtils.isNotBlank(baseDoctorDO.getMobile())) {
|
|
WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId, baseDoctorDO.getMobile());
|
|
WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId, baseDoctorDO.getMobile());
|
|
if (user != null) {
|
|
if (user != null) {
|
|
return sendMKMes(enterpriseId, user.getUserid(), content);
|
|
|
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
|
wlyyHttpLogDO.setDoctor(doctor);
|
|
|
|
wlyyHttpLogDO.setRequest(content);
|
|
|
|
wlyyHttpLogDO.setName("im消息推送");
|
|
|
|
wlyyHttpLogDO.setCode(enterpriseId);
|
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
|
wlyyHttpLogDO.setRequest("enterpriseId:"+enterpriseId+",doctor:"+doctor+",url:"+content);
|
|
|
|
res=sendMKMes(enterpriseId, user.getUserid(), content);
|
|
|
|
wlyyHttpLogDO.setResponse(res);
|
|
|
|
logger.info(res);
|
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
|
return res;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
return "";
|
|
@ -343,6 +354,16 @@ public class EnterpriseService {
|
|
String rs = HttpUtil.sendPost(mesurl,param.toJSONString());
|
|
String rs = HttpUtil.sendPost(mesurl,param.toJSONString());
|
|
|
|
|
|
logger.info("MKMes:"+rs);
|
|
logger.info("MKMes:"+rs);
|
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
|
wlyyHttpLogDO.setDoctor(userId);
|
|
|
|
wlyyHttpLogDO.setRequest(content);
|
|
|
|
wlyyHttpLogDO.setName("im消息推送");
|
|
|
|
wlyyHttpLogDO.setCode(enterpriseId);
|
|
|
|
wlyyHttpLogDO.setCreateTime(new Date());
|
|
|
|
wlyyHttpLogDO.setRequest("enterpriseId:"+enterpriseId+",doctor:"+userId+",url:"+content);
|
|
|
|
wlyyHttpLogDO.setResponse(rs);
|
|
|
|
logger.info(rs);
|
|
|
|
wlyyHttpLogDao.save(wlyyHttpLogDO);
|
|
|
|
|
|
return rs;
|
|
return rs;
|
|
}
|
|
}
|