|
@ -3,9 +3,8 @@ package com.yihu.jw.base.endpoint.article;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
|
|
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
|
|
|
|
import com.yihu.jw.article.service.KnowledgeArticleDictService;
|
|
import com.yihu.jw.base.dao.role.RoleDao;
|
|
import com.yihu.jw.base.dao.role.RoleDao;
|
|
import com.yihu.jw.base.dao.user.UserDao;
|
|
|
|
import com.yihu.jw.base.service.article.KnowledgeArticleService;
|
|
|
|
import com.yihu.jw.base.service.article.KnowledgeCategoryService;
|
|
import com.yihu.jw.base.service.article.KnowledgeCategoryService;
|
|
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
|
|
import com.yihu.jw.entity.base.role.RoleDO;
|
|
import com.yihu.jw.entity.base.role.RoleDO;
|
|
@ -18,6 +17,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
|
import com.yihu.jw.user.UserDao;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
@ -29,16 +29,16 @@ import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 健康文章
|
|
|
|
|
|
* 官网-文章
|
|
* @author huangwenjie
|
|
* @author huangwenjie
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.PREFIX)
|
|
@RequestMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.PREFIX)
|
|
@Api(value = "文章管理接口", description = "文章管理接口", tags = {"文章管理接口"})
|
|
|
|
|
|
@Api(value = "官网-文章管理接口", tags = {"官网-文章管理接口"})
|
|
public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private KnowledgeArticleService knowledgeArticleService;
|
|
|
|
|
|
private KnowledgeArticleDictService knowledgeArticleDictService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private KnowledgeCategoryService knowledgeCategoryService;
|
|
private KnowledgeCategoryService knowledgeCategoryService;
|
|
@ -90,8 +90,9 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
filters=filters+";del=1"+";createUser="+userId+"";
|
|
filters=filters+";del=1"+";createUser="+userId+"";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<KnowledgeArticleDictDO> list = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
|
|
|
|
List<KnowledgeArticleDictDO> totals = knowledgeArticleService.search(fields,filters,sorts);
|
|
|
|
|
|
filters += ";type=1";
|
|
|
|
List<KnowledgeArticleDictDO> list = knowledgeArticleDictService.search(fields,filters,sorts,page,pageSize);
|
|
|
|
List<KnowledgeArticleDictDO> totals = knowledgeArticleDictService.search(fields,filters,sorts);
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
result.put("total",totals.size());
|
|
result.put("total",totals.size());
|
|
@ -117,7 +118,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
|
|
@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
|
|
|
|
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.findArticleList(first,second,key,page,pageSize));
|
|
|
|
|
|
return success(knowledgeArticleDictService.findArticleList(first,second,1,key,page,pageSize));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedException(e);
|
|
return failedException(e);
|
|
}
|
|
}
|
|
@ -141,7 +142,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "id", value = "id,多个使用英文逗号分隔", required = true)
|
|
@ApiParam(name = "id", value = "id,多个使用英文逗号分隔", required = true)
|
|
@RequestParam(value = "id", required = true)String id)throws Exception {
|
|
@RequestParam(value = "id", required = true)String id)throws Exception {
|
|
try {
|
|
try {
|
|
knowledgeArticleService.delArticle(id);
|
|
|
|
|
|
knowledgeArticleDictService.delArticle(id);
|
|
return success("操作成功");
|
|
return success("操作成功");
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedException(e);
|
|
return failedException(e);
|
|
@ -155,7 +156,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam String jsonData)throws Exception {
|
|
@RequestParam String jsonData)throws Exception {
|
|
|
|
|
|
try {
|
|
try {
|
|
knowledgeArticleService.saveArticle(jsonData);
|
|
|
|
|
|
knowledgeArticleDictService.saveArticle(jsonData,1);
|
|
return success("操作成功");
|
|
return success("操作成功");
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@ -174,7 +175,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "reason", required = false) String reason
|
|
@RequestParam(value = "reason", required = false) String reason
|
|
)throws Exception {
|
|
)throws Exception {
|
|
try {
|
|
try {
|
|
knowledgeArticleService.reviewArticle(articleId,status,reason);
|
|
|
|
|
|
knowledgeArticleDictService.reviewArticle(articleId,status,reason);
|
|
return success("操作成功");
|
|
return success("操作成功");
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedException(e);
|
|
return failedException(e);
|
|
@ -250,7 +251,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "sdJsons", value = "部门与科室关系json")
|
|
@ApiParam(name = "sdJsons", value = "部门与科室关系json")
|
|
@RequestParam(value = "sdJsons",required = true)String sdJsons)throws Exception {
|
|
@RequestParam(value = "sdJsons",required = true)String sdJsons)throws Exception {
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.saveArticleDept(articleId,sdJsons));
|
|
|
|
|
|
return success(knowledgeArticleDictService.saveArticleDept(articleId,sdJsons));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedObjEnvelopException(e);
|
|
return failedObjEnvelopException(e);
|
|
}
|
|
}
|
|
@ -261,7 +262,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
public ListEnvelop findDeptByArticle(@ApiParam(name = "articleId", value = "文章ID")
|
|
public ListEnvelop findDeptByArticle(@ApiParam(name = "articleId", value = "文章ID")
|
|
@RequestParam(value = "articleId",required = true)String articleId)throws Exception {
|
|
@RequestParam(value = "articleId",required = true)String articleId)throws Exception {
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.findDeptByArticle(articleId));
|
|
|
|
|
|
return success(knowledgeArticleDictService.findDeptByArticle(articleId));
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedListEnvelopException(e);
|
|
return failedListEnvelopException(e);
|
|
@ -273,7 +274,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
public ListEnvelop findArticleByDept(@ApiParam(name = "dept", value = "科室")
|
|
public ListEnvelop findArticleByDept(@ApiParam(name = "dept", value = "科室")
|
|
@RequestParam(value = "dept",required = true)String dept)throws Exception {
|
|
@RequestParam(value = "dept",required = true)String dept)throws Exception {
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.findArticleByDept(dept));
|
|
|
|
|
|
return success(knowledgeArticleDictService.findArticleByDept(dept));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedListEnvelopException(e);
|
|
return failedListEnvelopException(e);
|
|
}
|
|
}
|
|
@ -287,7 +288,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
|
|
@RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
|
|
|
|
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.saveDeptArticle(dept,sdJsons));
|
|
|
|
|
|
return success(knowledgeArticleDictService.saveDeptArticle(dept,sdJsons));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedObjEnvelopException(e);
|
|
return failedObjEnvelopException(e);
|
|
}
|
|
}
|
|
@ -308,7 +309,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
BasePatientBusinessDO patientBusinessDO = toEntity(jsonObject.toJSONString(),BasePatientBusinessDO.class);
|
|
BasePatientBusinessDO patientBusinessDO = toEntity(jsonObject.toJSONString(),BasePatientBusinessDO.class);
|
|
patientBusinessDOList.add(patientBusinessDO);
|
|
patientBusinessDOList.add(patientBusinessDO);
|
|
}
|
|
}
|
|
listEnvelop.setDetailModelList(knowledgeArticleService.sendBusinessToPatient(patientBusinessDOList));
|
|
|
|
|
|
listEnvelop.setDetailModelList(knowledgeArticleDictService.sendBusinessToPatient(patientBusinessDOList));
|
|
return listEnvelop;
|
|
return listEnvelop;
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedListEnvelopException(e);
|
|
return failedListEnvelopException(e);
|
|
@ -322,7 +323,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "status", value = "1发布0未发布")
|
|
@ApiParam(name = "status", value = "1发布0未发布")
|
|
@RequestParam(value = "status",required = false)Integer status)throws Exception {
|
|
@RequestParam(value = "status",required = false)Integer status)throws Exception {
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.releaseArticle(id,status));
|
|
|
|
|
|
return success(knowledgeArticleDictService.releaseArticle(id,status));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedObjEnvelopException(e);
|
|
return failedObjEnvelopException(e);
|
|
}
|
|
}
|
|
@ -341,7 +342,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@ApiParam(name = "pageSize", value = "分页大小)")
|
|
@ApiParam(name = "pageSize", value = "分页大小)")
|
|
@RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
|
|
@RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
|
|
|
|
|
|
MixEnvelop mixEnvelop=knowledgeArticleService.findArticleByCategoryAndName(categoryFirst,categorySecond,keyWords,page,pageSize);
|
|
|
|
|
|
MixEnvelop mixEnvelop=knowledgeArticleDictService.findArticleByCategoryAndName(categoryFirst,categorySecond,keyWords,page,pageSize);
|
|
return mixEnvelop;
|
|
return mixEnvelop;
|
|
}
|
|
}
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.getArticleGroup)
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.getArticleGroup)
|
|
@ -367,7 +368,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
|
|
@RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
|
|
|
|
|
|
try {
|
|
try {
|
|
return success(knowledgeArticleService.findPatientFavorite(patient,page,pageSize));
|
|
|
|
|
|
return success(knowledgeArticleDictService.findPatientFavorite(patient,page,pageSize));
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
return failedException(e);
|
|
return failedException(e);
|
|
}
|
|
}
|