浏览代码

每日推送医生端、居民端接口修改

huangwenjie 7 年之前
父节点
当前提交
ade7a8bd00

+ 16 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -1,11 +1,9 @@
package com.yihu.wlyy.web.doctor.jimeiJkEdu;
package com.yihu.wlyy.web.doctor.jimeiJkEdu;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.call.CustomerService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jw.JwSmjkService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.service.GcEduArticleService;
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.HealthEduArticlePatientModel;
@ -40,7 +38,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @Autowired
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    private JMJkEduArticleService jmJkEduArticleService;
    @Autowired
    @Autowired
    private GcEduArticleService gcEduArticleService;
    private ThirdJkEduArticleService thirdJkEduArticleService;
    
    @Autowired
    @Autowired
    private JmsTemplate jmsTemplate;
    private JmsTemplate jmsTemplate;
    @Value("${activemq.queue.healtHarticleQueue}")
    @Value("${activemq.queue.healtHarticleQueue}")
@ -234,6 +233,19 @@ public class DoctorJMJkEduArticleController extends BaseController {
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
        }
    }
    }
    
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @ApiOperation("获取文章详情")
    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,getUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    /*************************************************************************医生角色end***************************************************************************************************/
    /*************************************************************************医生角色end***************************************************************************************************/

+ 32 - 20
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -1,34 +1,20 @@
package com.yihu.wlyy.web.third.jkEduArticle;
package com.yihu.wlyy.web.third.jkEduArticle;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
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.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.service.GcEduArticleService;
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.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
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;
    private String articleBaseUrl;
    @Autowired
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    private ThirdJkEduArticleService thirdJkEduArticleService;
    @Autowired
    private GcEduArticleService gcEduArticleService;
    @Autowired
    private JmsTemplate jmsTemplate;
    /**********************************福州健康文章接口********************************************/
    /**********************************福州健康文章接口********************************************/
@ -252,6 +234,36 @@ public class ThirdJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
            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(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(1,cid,"");
                }else{
                    response = new JSONArray();
                }
            }else{
                response = new JSONArray();
            }
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    /*************************************************** ConfigDicSho *************************************************/
    /*************************************************** ConfigDicSho *************************************************/