|
@ -176,6 +176,10 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
// 文章简介
|
|
|
//json.put("content", parsrHtml(map.get("content").toString()));
|
|
|
json.put("content", map.get("content").toString());
|
|
|
|
|
|
json.put("read", map.get("is_read"));
|
|
|
|
|
|
json.put("attached_content", map.get("attached_content"));
|
|
|
// 发送日期
|
|
|
json.put("czrq", DateUtil.dateToStrLong((Date) map.get("czrq")));
|
|
|
// 发送团队
|
|
@ -355,9 +359,11 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
}
|
|
|
// 查询医生信息
|
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
//Doctor doctor = doctorService.findDoctorByCode("test00000000005");
|
|
|
String msgHead = doctor.getName() + "医生给您发来了一篇患教文章";
|
|
|
String endMsg = "为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
|
|
|
String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
|
|
|
if(StringUtils.isNotBlank(attachedContent)){
|
|
|
endMsg = attachedContent;
|
|
|
}
|
|
|
JSONArray messages = new JSONArray();
|
|
|
Map<String, Map<String, Object>> msgs = new HashMap<>();
|
|
|
String batchNo = UUID.randomUUID().toString();
|
|
@ -408,28 +414,25 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
heap.setCzrq(createTime);
|
|
|
list.add(heap);
|
|
|
consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, "{\"title\":\"" + temp.getTitle()+ "\",\"type\":0,\"id\":\"" + temp.getCode() + "\",\"img\":\"" + temp.getUrl() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patientTemp.getName());
|
|
|
//if (StringUtils.isNotEmpty(patientTemp.getOpenid())) {
|
|
|
if(StringUtils.isNotBlank(attachedContent)){
|
|
|
//发送备注
|
|
|
consultService.sendMucMessageBySingnType(doctor.getCode(), doctor.getName(), p, attachedContent, ImUtill.CONTENT_TYPE_TEXT, patientTemp.getName());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(patientTemp.getOpenid())) {
|
|
|
// 推送消息给微信端
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("first", patientTemp.getName() + ",您好!\n" + msgHead);
|
|
|
json.put("toUser", p);
|
|
|
json.put("article", temp.getCode() + "");
|
|
|
json.put("title", temp.getTitle());
|
|
|
json.put("doctorName", doctor.getName());
|
|
|
json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
|
|
|
json.put("remark", endMsg);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
content.put("openid", patientTemp.getOpenid());
|
|
|
content.put("name", patientTemp.getName());
|
|
|
content.put("json", json);
|
|
|
content.put("code",patientTemp.getCode());
|
|
|
msgs.put(patientTemp.getCode(), content);
|
|
|
//}
|
|
|
// 推送消息给微信端
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("first", patientTemp.getName() + ",您好!\n" + msgHead);
|
|
|
json.put("toUser", p);
|
|
|
json.put("article", temp.getCode() + "");
|
|
|
json.put("title", temp.getTitle());
|
|
|
json.put("doctorName", doctor.getName());
|
|
|
json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
|
|
|
json.put("remark", endMsg);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
content.put("openid", patientTemp.getOpenid());
|
|
|
content.put("name", patientTemp.getName());
|
|
|
content.put("json", json);
|
|
|
content.put("code",patientTemp.getCode());
|
|
|
msgs.put(patientTemp.getCode(), content);
|
|
|
}
|
|
|
}
|
|
|
// 保存到数据库
|
|
@ -458,9 +461,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
PushMsgTask.getInstance().putWxMsg(getAccessToken(), 9, member.getOpenid(), member.getName(), data);
|
|
|
}
|
|
|
}
|
|
|
JSONObject json = (JSONObject) map.get("json");
|
|
|
}
|
|
|
|
|
|
for (HealthEduArticlePatient heap : list) {
|
|
|
BusinessLogs.info(BusinessLogs.BusinessType.article, getUID(), heap.getPatient(), new JSONObject(heap));
|
|
|
}
|
|
@ -539,7 +540,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String getPatientHealthLogs(@RequestParam(value = "page", required = true) int page, @RequestParam(value = "pagesize", required = true) int pagesize){
|
|
|
try{
|
|
|
List<Map<String,Object>> result = healthEduArticlePatientService.findByDoctor("fa4dd1995f0f11e68344fa163e8aee56",page,pagesize);
|
|
|
List<Map<String,Object>> result = healthEduArticlePatientService.findByDoctor(getUID(),page,pagesize);
|
|
|
return write(200,"查询成功!","list",result);
|
|
|
}catch (Exception e){
|
|
|
return write(-1,"查询失败!");
|
|
@ -550,7 +551,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String getPatientHealthLog(@RequestParam(value = "article", required = true) String article, @RequestParam(value = "batchNo", required = false) String batchNo){
|
|
|
try{
|
|
|
List<Map<String,Object>> result = healthEduArticlePatientService.findByBatchNo("fa4dd1995f0f11e68344fa163e8aee56",article,batchNo);
|
|
|
List<Map<String,Object>> result = healthEduArticlePatientService.findByBatchNo(getUID(),article,batchNo);
|
|
|
return write(200,"查询成功!","list",result);
|
|
|
}catch (Exception e){
|
|
|
return write(-1,"查询失败!");
|