|  | @ -1,9 +1,12 @@
 | 
	
		
			
				|  |  | package com.yihu.jw.hospital.endpoint.article;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
	
		
			
				|  | @ -26,6 +29,9 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private KnowledgeArticleService  knowledgeArticleService;
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private KnowledgeCategoryService knowledgeCategoryService;
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "获取文章列表")
 | 
	
		
			
				|  |  | 	public ListEnvelop searchKnowledgePageList(
 | 
	
	
		
			
				|  | @ -81,4 +87,89 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 		knowledgeArticleService.saveArticle(jsonData);
 | 
	
		
			
				|  |  | 		return success("操作成功");
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.reviewArticle)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "审核/退回文章")
 | 
	
		
			
				|  |  | 	public Envelop saveArticle(
 | 
	
		
			
				|  |  | 			@ApiParam(name = "articleId", value = "文章ID")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "articleId", required = true) String articleId,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "status", value = "0未审核,1已审核,2退回")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "status", required = true) Integer status
 | 
	
		
			
				|  |  | 	)throws Exception {
 | 
	
		
			
				|  |  | 		knowledgeArticleService.reviewArticle(articleId,status);
 | 
	
		
			
				|  |  | 		return success("操作成功");
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchCategoryList)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "获取分类列表")
 | 
	
		
			
				|  |  | 	public ListEnvelop searchCategoryList(
 | 
	
		
			
				|  |  | 			@ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "fields", required = false) String fields,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "filters", required = false) String filters,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "sorts", required = false) String sorts,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
 | 
	
		
			
				|  |  | 			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
 | 
	
		
			
				|  |  | 		List<KnowledgeCategoryDO> result  = knowledgeCategoryService.search(fields,filters,sorts,page,pageSize);
 | 
	
		
			
				|  |  | 		return success(result);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveCategory)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "保存/更新分类")
 | 
	
		
			
				|  |  | 	public Envelop saveCategory(
 | 
	
		
			
				|  |  | 			@ApiParam(name = "jsonData", value = "Json数据", required = true)
 | 
	
		
			
				|  |  | 			@RequestParam String jsonData)throws Exception {
 | 
	
		
			
				|  |  | 		knowledgeCategoryService.saveCategory(jsonData);
 | 
	
		
			
				|  |  | 		return success("操作成功");
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.updateDel)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "根据分类code删除分类")
 | 
	
		
			
				|  |  | 	public Envelop updateDel(
 | 
	
		
			
				|  |  | 			@ApiParam(name = "id", value = "id", required = true)
 | 
	
		
			
				|  |  | 			@RequestParam(value = "id", required = true)String id)throws Exception {
 | 
	
		
			
				|  |  | 		Boolean flag = knowledgeCategoryService.updateDel(id);
 | 
	
		
			
				|  |  | 		if (!flag) {
 | 
	
		
			
				|  |  | 			return success("操作成功");
 | 
	
		
			
				|  |  | 		}else{
 | 
	
		
			
				|  |  | 			return failed("操作失败");
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.saveArticleDept)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "设置文章发送的科室")
 | 
	
		
			
				|  |  | 	public ObjEnvelop saveArticleDept(@ApiParam(name = "articleId", value = "文章ID")
 | 
	
		
			
				|  |  | 	                                 @RequestParam(value = "articleId",required = true)String articleId,
 | 
	
		
			
				|  |  | 	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
 | 
	
		
			
				|  |  | 	                                 @RequestParam(value = "sdJsons",required = true)String sdJsons)throws Exception {
 | 
	
		
			
				|  |  | 		return success(knowledgeArticleService.saveArticleDept(articleId,sdJsons));
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findDeptByArticle)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "查询文章下的科室")
 | 
	
		
			
				|  |  | 	public ListEnvelop findDeptByArticle(@ApiParam(name = "articleId", value = "文章ID")
 | 
	
		
			
				|  |  | 	                                    @RequestParam(value = "articleId",required = true)String articleId)throws Exception {
 | 
	
		
			
				|  |  | 		return success(knowledgeArticleService.findDeptByArticle(articleId));
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByDept)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "查询部门下发放的文章")
 | 
	
		
			
				|  |  | 	public ListEnvelop findArticleByDept(@ApiParam(name = "dept", value = "科室")
 | 
	
		
			
				|  |  | 	                                    @RequestParam(value = "dept",required = true)String dept)throws Exception {
 | 
	
		
			
				|  |  | 		return success(knowledgeArticleService.findArticleByDept(dept));
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.saveDeptArticle)
 | 
	
		
			
				|  |  | 	@ApiOperation(value = "设置科室发送的文章")
 | 
	
		
			
				|  |  | 	public ObjEnvelop saveDeptArticle(@ApiParam(name = "dept", value = "部门code")
 | 
	
		
			
				|  |  | 	                                 @RequestParam(value = "dept",required = true)String dept,
 | 
	
		
			
				|  |  | 	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
 | 
	
		
			
				|  |  | 	                                 @RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
 | 
	
		
			
				|  |  | 		return success(knowledgeArticleService.saveDeptArticle(dept,sdJsons));
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | }
 |