|
@ -116,10 +116,10 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
sql2.append(" and sendType='"+sendType+"' ");
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(firstLevelCategoryId)){
|
|
|
sql2.append("and level1Type="+firstLevelCategoryId);
|
|
|
sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(secondLevelCategoryId)){
|
|
|
sql2.append("and level2Type="+secondLevelCategoryId);
|
|
|
sql2.append("and secondLevelCategoryId="+secondLevelCategoryId);
|
|
|
}
|
|
|
if(myArticle==1){
|
|
|
sql2.append(" and operatorId="+sendCode);
|
|
@ -138,7 +138,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
sql2.append(" and createTime <='"+sendTimeEnd+"'");
|
|
|
}
|
|
|
sql2.append(" order by createTime limit " + page + "," + pagesize);
|
|
|
List<com.yihu.es.entity.HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql2.toString(), com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
|
|
|
List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(), HealthEduArticleES.class, esIndex, esType);
|
|
|
Map<String, HealthEduArticlePatientModel> result = new HashMap<>();
|
|
|
HealthEduArticlePatientModel heapm = null;
|
|
|
com.alibaba.fastjson.JSONObject article = null;
|
|
@ -146,7 +146,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
|
|
|
List<HealthEduArticlePatientModel> resultList = new ArrayList<>();
|
|
|
|
|
|
for (HealthEduArticlePatient one : esList) {
|
|
|
for (HealthEduArticleES one : esList) {
|
|
|
article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
|
|
|
if (result.get(one.getArticleId()) != null) {
|
|
|
heapm = result.get(one.getArticleId());
|
|
@ -161,10 +161,12 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
heapm.setAttachedTitle(article.getString("articleTitle"));
|
|
|
heapm.setAttachedContent(article.getString("articleContent"));
|
|
|
heapm.setArticleType(article.getString("articleType"));
|
|
|
heapm.setLevel1Type(article.getString("firstLevelCategoryId"));
|
|
|
heapm.setLevel2Type(article.getString("secondLevelCategoryId"));
|
|
|
heapm.setLevel1Type(one.getFirstLevelCategoryId());
|
|
|
heapm.setLevel1TypeName(one.getFirstLevelCategoryName());
|
|
|
heapm.setLevel2Type(one.getSecondLevelCategoryId());
|
|
|
heapm.setLevel2TypeName(one.getSecondLevelCategoryName());
|
|
|
heapm.setLevel(article.getString("articlelevel"));
|
|
|
heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
|
|
|
// heapm.setAllCount(heapm.getAllCount() + one.getPatients().size());
|
|
|
if(article.getString("browseNumber") != null){
|
|
|
heapm.setBrowseNumbere(Integer.valueOf(article.getString("browseNumber")));//文章浏览数
|
|
|
}
|
|
@ -200,20 +202,20 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public List<HealthEduArticlePatient> pushArticleListCount(String sendCode, String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
|
|
|
public List<HealthEduArticleES> pushArticleListCount(String sendCode, String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
|
|
|
String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
|
|
|
|
|
|
StringBuffer sql2 = new StringBuffer("select * from " + esType +
|
|
|
" where doctorCode='" + sendCode + "'");
|
|
|
" where sendCode='" + sendCode + "'");
|
|
|
if(sendType==1){
|
|
|
|
|
|
sql2.append(" and sendType='"+sendType+"' ");
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(firstLevelCategoryId)){
|
|
|
sql2.append("and level1Type="+firstLevelCategoryId);
|
|
|
sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(secondLevelCategoryId)){
|
|
|
sql2.append("and level2Type="+secondLevelCategoryId);
|
|
|
sql2.append("and secondLevelCategoryId="+secondLevelCategoryId);
|
|
|
}
|
|
|
if(myArticle==1){
|
|
|
sql2.append(" and operatorId="+sendCode);
|
|
@ -231,7 +233,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
|
|
|
sql2.append(" and createTime <='"+sendTimeEnd+"'");
|
|
|
}
|
|
|
List<HealthEduArticlePatient> esList = elasticsearchUtil.excute(sql2.toString(), com.yihu.es.entity.HealthEduArticlePatient.class, esIndex, esType);
|
|
|
List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(),HealthEduArticleES.class, esIndex, esType);
|
|
|
return esList;
|
|
|
}
|
|
|
|
|
@ -1105,7 +1107,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
|
|
|
heapm = new HealthEduArticlePatientModel();
|
|
|
heapm.setSendName(one.getSendName());
|
|
|
heapm.setSendCode(one.getSendCode());
|
|
|
heapm.setSendCode(one.getDoctorCode());
|
|
|
heapm.setCreateTime(DateUtil.dateToStrLong(one.getCreateTime()));
|
|
|
heapm.setArticleId(article.getString("articleId"));
|
|
|
heapm.setAttachedTitle(article.getString("articleTitle"));
|
|
@ -1124,7 +1126,7 @@ public class JMJkEduArticleService extends BaseService {
|
|
|
heapm.setSendType(one.getSendType());//发送类型
|
|
|
heapm.setIsread(String.valueOf(one.getIsRead()));//已读未读标识,1已读,2未读
|
|
|
heapm.setLeaveWords(one.getLeaveWords());//医生留言
|
|
|
doctor = doctorDao.findByCode(one.getSendCode());
|
|
|
doctor = doctorDao.findByCode(one.getDoctorCode());
|
|
|
heapm.setPhoto(doctor.getPhoto());
|
|
|
result.add(heapm);
|
|
|
// heapm.setTime();//时间 xx小时前 2017-10-11
|