|  | @ -46,9 +46,9 @@ public class HealthArtListener implements MessageListener {
 | 
												
													
														
															|  |     public void onMessage(Message message) {
 |  |     public void onMessage(Message message) {
 | 
												
													
														
															|  |         try {
 |  |         try {
 | 
												
													
														
															|  |             TextMessage textMessage = (TextMessage) message;
 |  |             TextMessage textMessage = (TextMessage) message;
 | 
												
													
														
															|  |             JSONObject jo = JSONObject.fromObject(textMessage.getText());
 |  | 
 | 
												
													
														
															|  |             logger.info(jo.toString());
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |             HealthEduArticlePatient healthEduArticlePatient = (HealthEduArticlePatient)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
 | 
												
													
														
															|  | 
 |  | //            logger.info(jo.toString());
 | 
												
													
														
															|  | 
 |  |             sendWxTemplateAndIM(healthEduArticlePatient);
 | 
												
													
														
															|  |             //返回服务器表示消息消费成功
 |  |             //返回服务器表示消息消费成功
 | 
												
													
														
															|  |             message.acknowledge();
 |  |             message.acknowledge();
 | 
												
													
														
															|  |         } catch (JMSException e) {
 |  |         } catch (JMSException e) {
 | 
												
											
												
													
														
															|  | @ -57,15 +57,15 @@ public class HealthArtListener implements MessageListener {
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     //发送到IM和
 |  | 
 | 
												
													
														
															|  |     private void sendWxTemplateAndIM(List<HealthEduArticlePatient> healthEduArticlePatients, Integer sendType) {
 |  | 
 | 
												
													
														
															|  | 
 |  |     //发送到IM和微信消息模板
 | 
												
													
														
															|  | 
 |  |     private void sendWxTemplateAndIM(HealthEduArticlePatient one) {
 | 
												
													
														
															|  |         String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
 |  |         String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         healthEduArticlePatients.stream().forEach(one -> {
 |  | 
 | 
												
													
														
															|  | 
 |  | //        healthEduArticlePatients.stream().forEach(one -> {
 | 
												
													
														
															|  |             Patient patient = patientService.findByCode(one.getPatient());
 |  |             Patient patient = patientService.findByCode(one.getPatient());
 | 
												
													
														
															|  |             try {
 |  |             try {
 | 
												
													
														
															|  |                 //卫纪委发送不推IM
 |  |                 //卫纪委发送不推IM
 | 
												
													
														
															|  |                 if (1 == sendType) {
 |  | 
 | 
												
													
														
															|  | 
 |  |                 if (1 == one.getSendType()) {
 | 
												
													
														
															|  |                     consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
 |  |                     consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
 | 
												
													
														
															|  |                     if (StringUtils.isNotBlank(one.getAttachedMessage())) {
 |  |                     if (StringUtils.isNotBlank(one.getAttachedMessage())) {
 | 
												
													
														
															|  |                         //发送备注
 |  |                         //发送备注
 | 
												
											
												
													
														
															|  | @ -76,7 +76,7 @@ public class HealthArtListener implements MessageListener {
 | 
												
													
														
															|  |                 org.json.JSONObject json = new org.json.JSONObject();
 |  |                 org.json.JSONObject json = new org.json.JSONObject();
 | 
												
													
														
															|  |                 json.put("first", patient.getName() + ",您好! " + one.getSendName() + "医生给您发来了一篇患教文章");
 |  |                 json.put("first", patient.getName() + ",您好! " + one.getSendName() + "医生给您发来了一篇患教文章");
 | 
												
													
														
															|  |                 json.put("toUser", patient.getCode());
 |  |                 json.put("toUser", patient.getCode());
 | 
												
													
														
															|  |                 json.put("article", one.getId() + "");
 |  | 
 | 
												
													
														
															|  | 
 |  |                 json.put("article", one.getArticleId() + "");
 | 
												
													
														
															|  |                 json.put("title", one.getAttachedTitle());
 |  |                 json.put("title", one.getAttachedTitle());
 | 
												
													
														
															|  |                 json.put("doctorName", one.getSendName());
 |  |                 json.put("doctorName", one.getSendName());
 | 
												
													
														
															|  |                 json.put("represented", patient.getCode());//被代理人
 |  |                 json.put("represented", patient.getCode());//被代理人
 | 
												
											
												
													
														
															|  | @ -111,6 +111,6 @@ public class HealthArtListener implements MessageListener {
 | 
												
													
														
															|  |             } catch (Exception e) {
 |  |             } catch (Exception e) {
 | 
												
													
														
															|  |                 logger.error("patient:" + patient.getCode() + "," + e.getMessage());
 |  |                 logger.error("patient:" + patient.getCode() + "," + e.getMessage());
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         });
 |  | 
 | 
												
													
														
															|  | 
 |  | //        });
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | }
 |  | }
 |