|
@ -1080,6 +1080,67 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(),HealthEduArticleES.class, esIndex, esType);
|
|
|
return esList;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取居民被制定团队下的医生推送的文章列表
|
|
|
* @param patientCode 居民CODE
|
|
|
* @param teamCode 团队CODE
|
|
|
* @param uid 医生CODE
|
|
|
* @param page 分页
|
|
|
* @param pagesize 分页数
|
|
|
* @param level1Type 文章类型
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray fetchPatientArticlePushedList(String patientCode, String teamCode, String uid, Integer page, Integer pagesize, String level1Type) throws Exception {
|
|
|
|
|
|
|
|
|
page = (page - 1) * pagesize;
|
|
|
|
|
|
String sql = "SELECT * FROM " + esType + " where patientCode= '" + patientCode + "' and adminTeamCode = '"+teamCode+"' and doctorCode='" + uid + "' and userType = 1";
|
|
|
|
|
|
if(!StringUtils.isEmpty(level1Type)){
|
|
|
sql= sql + " and firstLevelCategoryId = '"+level1Type+"' ";
|
|
|
}
|
|
|
sql += " order by createTime desc ";
|
|
|
if(pagesize !=0){
|
|
|
sql= sql+ " limit " + page + "," + pagesize;
|
|
|
}
|
|
|
|
|
|
List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql, HealthEduArticleES.class, esIndex, esType);
|
|
|
HealthEduArticlePatientModel heapm = null;
|
|
|
JSONObject article = null;
|
|
|
List<HealthEduArticlePatientModel> result = new ArrayList<>();
|
|
|
Doctor doctor = null;
|
|
|
for (HealthEduArticleES one : esList) {
|
|
|
article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
|
|
|
heapm = new HealthEduArticlePatientModel();
|
|
|
heapm.setSendName(one.getSendName());
|
|
|
heapm.setSendCode(one.getDoctorCode());
|
|
|
heapm.setCreateTime(DateUtil.dateToStrLong(one.getCreateTime()));
|
|
|
heapm.setArticleId(article.containsKey("articleId")?article.getString("articleId"):"");
|
|
|
heapm.setAttachedTitle(article.containsKey("articleTitle")?article.getString("articleTitle"):"");
|
|
|
heapm.setAttachedContent(article.containsKey("articleContent")?article.getString("articleContent"):"");
|
|
|
heapm.setArticleType(article.containsKey("articleType")?article.getString("articleType"):"");
|
|
|
heapm.setLevel1Type(article.containsKey("firstLevelCategoryId")?article.getString("firstLevelCategoryId"):"");
|
|
|
heapm.setLevel2Type(article.containsKey("secondLevelCategoryId")?article.getString("secondLevelCategoryId"):"");
|
|
|
heapm.setLevel(article.containsKey("articlelevel")?article.getString("articlelevel"):"");
|
|
|
// heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
|
|
|
heapm.setBrowseNumbere(Integer.valueOf(article.containsKey("browseNumber")?article.getString("browseNumber"):"0"));//文章浏览数
|
|
|
heapm.setCommentNumber(Integer.valueOf(article.containsKey("commentNumber")?article.getString("commentNumber"):"0"));//文章评论数
|
|
|
heapm.setPointNumber(Integer.valueOf(article.containsKey("pointNumber")?article.getString("pointNumber"):"0"));//文章点赞数
|
|
|
heapm.setArticleCover(article.containsKey("articleCover")?article.getString("articleCover"):"");//封面
|
|
|
heapm.setComputeTime(article.containsKey("insertTime")?computeTime(article.getString("insertTime")):"");
|
|
|
heapm.setOperatorName(article.containsKey("operatorName")?article.getString("operatorName"):"");
|
|
|
heapm.setSendType(one.getSendType());//发送类型
|
|
|
heapm.setIsread(String.valueOf(one.getIsRead()));//已读未读标识,1已读,2未读
|
|
|
heapm.setLeaveWords(one.getLeaveWords());//医生留言
|
|
|
doctor = doctorDao.findByCode(one.getDoctorCode());
|
|
|
heapm.setPhoto(doctor.getPhoto());
|
|
|
result.add(heapm);
|
|
|
// heapm.setTime();//时间 xx小时前 2017-10-11
|
|
|
}
|
|
|
JSONArray re = new JSONArray();
|
|
|
re.addAll(result);
|
|
|
return re;
|
|
|
}
|
|
|
}
|