|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.es.entity.HealthEduArticleES;
|
|
|
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
|
|
|
import com.yihu.wlyy.util.ElasticsearchUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
|
|
|
import io.swagger.annotations.Api;
|
|
@ -32,6 +33,12 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
String fastdfs_file_url;
|
|
|
@Value("${neiwang.enable}")
|
|
|
private Boolean isneiwang = false; //如果不是内网项目要转到到内网wlyy在上传
|
|
|
@Value("${es.type.HealthEduArticlePatient}")
|
|
|
private String esType;
|
|
|
@Value("${es.index.HealthEduArticlePatient}")
|
|
|
private String esIndex;
|
|
|
@Autowired
|
|
|
private ElasticsearchUtil elasticsearchUtil;
|
|
|
|
|
|
@RequestMapping(value = "saveArticle", method = RequestMethod.POST)
|
|
|
@ApiOperation("添加、编辑文章")
|
|
@ -136,12 +143,13 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
if(StringUtils.isNotBlank(patient)){
|
|
|
com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");
|
|
|
Set<String> articleids = new HashSet<>();
|
|
|
if(pushresponse.size() > 0){
|
|
|
if(pushresponse.size() > 0)
|
|
|
{
|
|
|
for (int i = 0; i < pushresponse.size(); i++) {
|
|
|
articleids.add(pushresponse.getJSONObject(i).getString("articleId"));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
StringBuffer sql3 = null;
|
|
|
JSONArray datas = response.getJSONArray("aaData");
|
|
|
if(datas.size() > 0 && !articleids.isEmpty()){
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
@ -151,6 +159,10 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
}else{
|
|
|
datas.getJSONObject(i).put("ispush","0");
|
|
|
}
|
|
|
// sql3 = new StringBuffer();
|
|
|
// sql3.append("SELECT COUNT(*) as num FROM "+esType+" WHERE userType=2 AND articleId='"+dataarticleid+"'");
|
|
|
// Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
|
|
|
// datas.getJSONObject(i).put("ispush","0");
|
|
|
}
|
|
|
response.put("aaData",datas);
|
|
|
}
|