|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.es.entity.HealthEduArticleES;
|
|
|
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
|
|
|
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
|
|
@ -12,6 +13,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.MediaType;
|
|
@ -23,9 +25,7 @@ import javax.jms.JMSException;
|
|
|
import javax.jms.Message;
|
|
|
import javax.jms.Session;
|
|
|
import javax.jms.TextMessage;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2017/11/14.
|
|
@ -453,4 +453,63 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
|
return error(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询发送给居民的文章列表
|
|
|
*
|
|
|
* @param pagesize 分页大小
|
|
|
* @return 列表
|
|
|
*/
|
|
|
@RequestMapping(value = "list_by_team", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
@ApiOperation(value = "查询发送给居民的文章列表")
|
|
|
public String listByTeam(@RequestParam @ApiParam(value = "第几页") int page,
|
|
|
@RequestParam @ApiParam(value = "页大小") int pagesize,
|
|
|
@RequestParam @ApiParam(value = "居民code") String patient,
|
|
|
@RequestParam @ApiParam(value = "团队code") Long teamCode) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "请输入需查询的居民");
|
|
|
}
|
|
|
if (teamCode == null || teamCode < 1) {
|
|
|
return error(-1, "请输入需查询的居民的团队");
|
|
|
}
|
|
|
page = page > 0 ? page - 1 : 0;
|
|
|
List<HealthEduArticleES> list = jmJkEduArticleService.findByPatientAndTeam(patient, teamCode, page, pagesize);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
if (list != null) {
|
|
|
for (HealthEduArticleES map : list) {
|
|
|
org.json.JSONObject json = new org.json.JSONObject();
|
|
|
// 文章标识
|
|
|
json.put("doctorCode", map.getDoctorCode());
|
|
|
// 文章标识
|
|
|
json.put("doctorName", map.getDoctorName());
|
|
|
// 文章标识
|
|
|
json.put("doctorPhoto", map.getSendPic());
|
|
|
// 文章标识
|
|
|
json.put("code", map.getArticleId());
|
|
|
// 文章标题
|
|
|
json.put("title", map.getArticleTitle());
|
|
|
// 文章查看URL
|
|
|
// json.put("url", map.get("url"));
|
|
|
// 文章简介
|
|
|
//json.put("content", parsrHtml(map.get("content").toString()));
|
|
|
json.put("content", map.getArticleContent());
|
|
|
|
|
|
json.put("read", map.getIsRead());
|
|
|
|
|
|
json.put("attached_content", map.getLeaveWords());
|
|
|
// 发送日期
|
|
|
json.put("czrq", DateUtil.dateToStrLong(map.getCzrq()));
|
|
|
// 发送团队
|
|
|
json.put("adminTeamCode", map.getAdminTeamCode());
|
|
|
jsonArray.put(json);
|
|
|
}
|
|
|
}
|
|
|
return write(200, "查询成功", "data", jsonArray);
|
|
|
} catch (Exception ex) {
|
|
|
error(ex);
|
|
|
return invalidUserException(ex, -1, "查询失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|