|
@ -1,9 +1,14 @@
|
|
|
package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.es.entity.HealthEduArticlePatient;
|
|
|
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
|
|
|
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
|
|
|
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;
|
|
|
import com.yihu.wlyy.web.third.gateway.vo.base.ResultPageListModel;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@ -12,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by Trick on 2017/11/14.
|
|
|
*/
|
|
@ -207,4 +214,52 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**医生、卫计委(管理员)-已推送文章
|
|
|
* @param page
|
|
|
* @param pagesize
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "pushArticleList", method = RequestMethod.GET)
|
|
|
@ApiOperation("查询医生、卫计委(管理员)给患者推送健教文章列表 ")
|
|
|
public String pushArticleList(
|
|
|
@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类", required = false) @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
|
|
|
@ApiParam(name = "secondLevelCategoryId", value = "文章二级分类", required = false) @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
|
|
|
@ApiParam(name = "articleTitle", value = "文章标题", required = false) @RequestParam(value = "articleTitle", required = false) String articleTitle,
|
|
|
@ApiParam(name = "sendTimeStart", value = "发送时间开始", required = false) @RequestParam(value = "sendTimeStart", required = false) String sendTimeStart,
|
|
|
@ApiParam(name = "sendTimeEnd", value = "发送时间结束", required = false) @RequestParam(value = "sendTimeEnd", required = false) String sendTimeEnd,
|
|
|
@ApiParam(name = "myArticle", value = "我的文章 1选中0未选", required = false) @RequestParam(value = "myArticle", required = false,defaultValue = "0") Integer myArticle,
|
|
|
@ApiParam(name = "sendType", value = "1医生 2卫计委(管理员)", required = true) @RequestParam(value = "sendType", required = true) Integer sendType,
|
|
|
@ApiParam(name = "iDisplayStart", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
|
|
|
@ApiParam(name = "iDisplayLength", value = "每页显示条数", required = true) @RequestParam(value = "pagesize", required = true) Integer pagesize,
|
|
|
@ApiParam(name = "currentRoleCode", value = "当前登录的角色code", required = false) @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode,
|
|
|
@ApiParam(name = "currentRoleLevel", value = "当前登录的角色级别", required = false) @RequestParam(value = "currentRoleLevel", required = false) String currentRoleLevel,
|
|
|
@ApiParam(name = "sEcho", value = "插件自带") @RequestParam(value = "sEcho", required = false) Integer sEcho) {
|
|
|
|
|
|
try {
|
|
|
if(StringUtils.isEmpty(currentRoleCode)){
|
|
|
currentRoleCode = getCurrentRoleCode();
|
|
|
}
|
|
|
if(StringUtils.isEmpty(currentRoleLevel)){
|
|
|
currentRoleLevel = getCurrentRoleLevel();
|
|
|
}
|
|
|
List<HealthEduArticlePatientModel> eduArticlePatients = jmJkEduArticleService.pushArticleList(page, pagesize, getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,currentRoleLevel,articleTitle,sendTimeStart,sendTimeEnd);
|
|
|
// Long count = jmJkEduArticleService.pushArticleListCount(getUID(),2);
|
|
|
List<HealthEduArticlePatient> eduArticlePatientsCount = jmJkEduArticleService.pushArticleListCount(getUID(),firstLevelCategoryId,secondLevelCategoryId,myArticle,sendType,currentRoleCode,
|
|
|
currentRoleLevel, articleTitle,sendTimeStart, sendTimeEnd);
|
|
|
net.sf.json.JSONObject obj = new net.sf.json.JSONObject();
|
|
|
obj.put("Code", 100);
|
|
|
obj.put("Message", "成功");
|
|
|
JSONArray obj2 = new JSONArray();
|
|
|
obj2.add(eduArticlePatients);
|
|
|
obj.put("aaData", obj2.toString());
|
|
|
obj.put("iTotalDisplayRecords", eduArticlePatientsCount.size());
|
|
|
obj.put("iTotalRecords", eduArticlePatientsCount.size());
|
|
|
obj.put("sEcho", sEcho);
|
|
|
return obj.toString();
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1,"失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|