|
@ -23,7 +23,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2017/11/14.
|
|
@ -126,7 +128,9 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
@ApiParam(name = "sEcho", value = "插件自带")
|
|
|
@RequestParam(value = "sEcho", required = false) Integer sEcho,
|
|
|
@ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
|
|
|
@RequestParam(value = "roleType", required = false) Integer roleType){
|
|
|
@RequestParam(value = "archive", required = false) Integer roleType,
|
|
|
@ApiParam(name = "patient", value = "居民CODE")
|
|
|
@RequestParam(value = "patient", required = false) String patient){
|
|
|
try {
|
|
|
if(StringUtils.isEmpty(currentUserRole)){
|
|
|
currentUserRole=getCurrentRoleCode();
|
|
@ -137,6 +141,29 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
|
|
|
JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
|
|
|
getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
|
|
|
|
|
|
|
|
|
//判断文章列表是否有推送过该居民
|
|
|
if(StringUtils.isNotBlank(patient)){
|
|
|
com.alibaba.fastjson.JSONArray pushresponse = jmJkEduArticleService.pushArticleLogs(0,0,patient,"");
|
|
|
Set<String> articleids = new HashSet<>();
|
|
|
if(pushresponse.size() > 0){
|
|
|
for (int i = 0; i < pushresponse.size(); i++) {
|
|
|
articleids.add(pushresponse.getJSONObject(i).getString("articleId"));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
JSONArray datas = response.getJSONObject("data").getJSONArray("aaData");
|
|
|
if(datas.size() > 0 && !articleids.isEmpty()){
|
|
|
for (int i = 0; i < datas.size(); i++) {
|
|
|
String dataarticleid = datas.getJSONObject(i).getString("articleid");
|
|
|
if(articleids.contains(dataarticleid)){
|
|
|
datas.getJSONObject(i).put("ispush","1");
|
|
|
}
|
|
|
}
|
|
|
response.getJSONObject("data").put("aaData",datas);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
} catch (Exception e){
|