|
@ -1,34 +1,20 @@
|
|
|
package com.yihu.wlyy.web.third.jkEduArticle;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.web.third.gateway.service.GcEduArticleService;
|
|
|
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 com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.elasticsearch.common.collect.HppcMaps;
|
|
|
import org.json.JSONObject;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.jms.core.JmsTemplate;
|
|
|
import org.springframework.jms.core.MessageCreator;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.jms.JMSException;
|
|
|
import javax.jms.Message;
|
|
|
import javax.jms.Session;
|
|
|
import javax.jms.TextMessage;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
|
* 调用福州健教接口
|
|
@ -46,10 +32,6 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
private String articleBaseUrl;
|
|
|
@Autowired
|
|
|
private ThirdJkEduArticleService thirdJkEduArticleService;
|
|
|
@Autowired
|
|
|
private GcEduArticleService gcEduArticleService;
|
|
|
@Autowired
|
|
|
private JmsTemplate jmsTemplate;
|
|
|
|
|
|
|
|
|
/**********************************福州健康文章接口********************************************/
|
|
@ -106,7 +88,7 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
|
|
|
@RequestParam(value = "articleId", required = true) String articleId){
|
|
|
try {
|
|
|
com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId);
|
|
|
com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,"");
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -193,7 +175,7 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
|
|
|
/*************************************************** Category *****************************************************/
|
|
|
|
|
|
@RequestMapping(value = "addCategory",method = RequestMethod.GET)
|
|
|
@RequestMapping(value = "addCategory",method = RequestMethod.POST)
|
|
|
@ApiOperation("添加二级分类-仅向市级管理员开放编辑权限")
|
|
|
public String addCategory(@ApiParam(name = "categoryName", value = "文章分类名称")
|
|
|
@RequestParam(value = "categoryName", required = true) String categoryName,
|
|
@ -202,12 +184,13 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
@ApiParam(name = "firstlevelId", value = "一级类别ID")
|
|
|
@RequestParam(value = "firstlevelId", required = true ) String firstlevelId,
|
|
|
@ApiParam(name = "secondLevelId", value = "二级类别ID")
|
|
|
@RequestParam(value = "secondLevelId", required = true ) String secondLevelId,
|
|
|
@ApiParam(name = "currentRoleCode", value = "当前登录角色")
|
|
|
@RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
|
|
|
@RequestParam(value = "secondLevelId", required = false ) String secondLevelId
|
|
|
// @ApiParam(name = "currentRoleCode", value = "当前登录角色")
|
|
|
// @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode
|
|
|
){
|
|
|
|
|
|
try {
|
|
|
thirdJkEduArticleService.addCategory(categoryName,categoryLevel,firstlevelId,secondLevelId,getUID(),currentRoleCode);
|
|
|
thirdJkEduArticleService.addCategory(categoryName,categoryLevel,firstlevelId,secondLevelId,getUID(),getCurrentRoleCode());
|
|
|
return success("添加成功!");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -222,12 +205,12 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
@ApiParam(name = "categoryName", value = "文章分类名称")
|
|
|
@RequestParam(value = "categoryName", required = true ) String categoryName,
|
|
|
@ApiParam(name = "categoryState", value = "类别状态1、正常、2删除")
|
|
|
@RequestParam(value = "categoryState", required = true ) Integer categoryState,
|
|
|
@ApiParam(name = "currentRoleCode", value = "当前登录角色")
|
|
|
@RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
|
|
|
@RequestParam(value = "categoryState", required = false ) Integer categoryState){
|
|
|
// @ApiParam(name = "currentRoleCode", value = "当前登录角色")
|
|
|
// @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
|
|
|
|
|
|
try {
|
|
|
thirdJkEduArticleService.updateCategory(categoryId,categoryName,categoryState,getUID(),currentRoleCode);
|
|
|
thirdJkEduArticleService.updateCategory(categoryId,categoryName,categoryState,getUID(),getCurrentRoleCode());
|
|
|
return success("更新成功!");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -237,10 +220,44 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
|
|
|
@RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取文章类别")
|
|
|
public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
|
|
|
@RequestParam(value = "categoryLevel", required = false) String categoryLevel){
|
|
|
public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别")
|
|
|
@RequestParam(value = "categoryLevel", required = false) Integer categoryLevel,
|
|
|
@ApiParam(name = "firstlevelId", value = "一级类别Id")
|
|
|
@RequestParam(value = "firstlevelId", required = false) String firstlevelId,
|
|
|
@ApiParam(name = "secondLevelId", value = "二级类别Id")
|
|
|
@RequestParam(value = "secondLevelId", required = false) String secondLevelId){
|
|
|
try {
|
|
|
com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel,firstlevelId,secondLevelId);
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getCategoryByName",method = RequestMethod.GET)
|
|
|
@ApiOperation("根据一级类别名称获取二级分类下得所有分类")
|
|
|
public String getCategoryList(@ApiParam(name = "name", value = "类别名称")
|
|
|
@RequestParam(value = "name", required = true) String name){
|
|
|
try {
|
|
|
com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel);
|
|
|
com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(1,"","");
|
|
|
if(response.size() > 0){
|
|
|
String cid = "";
|
|
|
for (int i = 0; i < response.size(); i++) {
|
|
|
String cname = response.getJSONObject(i).getString("categoryname");
|
|
|
if(StringUtils.isNotBlank(cname) && name.equals(cname)){
|
|
|
cid = response.getJSONObject(i).getString("categoryid");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(cid)){
|
|
|
response = thirdJkEduArticleService.getCategoryList(2,cid,"");
|
|
|
}else{
|
|
|
response = new JSONArray();
|
|
|
}
|
|
|
}else{
|
|
|
response = new JSONArray();
|
|
|
}
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -262,4 +279,16 @@ public class ThirdJkEduArticleController extends BaseController {
|
|
|
return error(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getArticleQRCode",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取认证标识")
|
|
|
public String getArticleQRCode(){
|
|
|
try {
|
|
|
com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticleQRCode(getCurrentRoleLevel(), getCurrentRoleCode());
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return error(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|