|
@ -5,12 +5,8 @@ import java.util.*;
|
|
|
import com.yihu.wlyy.entity.education.*;
|
|
|
import com.yihu.wlyy.service.app.health.*;
|
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import com.yihu.wlyy.util.SystemConf;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.htmlparser.Parser;
|
|
|
import org.htmlparser.beans.StringBean;
|
|
|
import org.htmlparser.util.ParserException;
|
|
@ -267,6 +263,7 @@ public class DoctorHealthEduArticleController extends BaseController {
|
|
|
}
|
|
|
// 查询医生信息
|
|
|
Doctor doctor = doctorService.findDoctorByCode(getUID());
|
|
|
JSONArray messages = new JSONArray();
|
|
|
for (String p : patientSet) {
|
|
|
for (String a : articles) {
|
|
|
// 查询文章信息
|
|
@ -298,13 +295,21 @@ public class DoctorHealthEduArticleController extends BaseController {
|
|
|
heap.setRead(1);
|
|
|
list.add(heap);
|
|
|
}
|
|
|
|
|
|
JSONObject message = new JSONObject();
|
|
|
message.put("receiver", p);
|
|
|
message.put("type", MessageType.MESSAGE_TYPE_PATIENT_HEALTH_EDU.P_HE_01.name());
|
|
|
message.put("title", MessageType.MESSAGE_TYPE_PATIENT_HEALTH_EDU.健康教育.name());
|
|
|
message.put("msg", MessageType.MESSAGE_TYPE_PATIENT_HEALTH_EDU.您有新的健康教育.name());
|
|
|
messages.put(message);
|
|
|
}
|
|
|
// 保存到数据库
|
|
|
int row = healthEduArticleService.send(list);
|
|
|
if (row <= 0) {
|
|
|
return error(-1, "发送失败!");
|
|
|
} else {
|
|
|
// 推送消息给患
|
|
|
// 推送消息给患者
|
|
|
PushMsgTask.getInstance().put(messages);
|
|
|
return success("发送成功!");
|
|
|
}
|
|
|
} catch (Exception e) {
|