浏览代码

集美健教修改

yeshijie 7 年之前
父节点
当前提交
d9de807be2

+ 31 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/fzzb/HealthEducationArticleService.java

@ -45,7 +45,7 @@ public class HealthEducationArticleService extends BaseService{
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String cancelArticleCollection = "JkEdu.Behavior.cancelArticleCollection";//取消收藏接口
    private String saveArticleCollection = "JkEdu.Behavior.saveArticleCollection";//医生收藏接口
    private String getDoctorArticalByUserId = "JkEdu.Behavior.getDoctorArticalByUserId";//医生发表文章接口
    private String getDoctorArticalByUserId = "JkEdu.Article.getDoctorArticalByUserId";//医生发表文章接口
    /**
     * 封装入参
@ -96,7 +96,7 @@ public class HealthEducationArticleService extends BaseService{
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
            return re;
        }
@ -121,12 +121,16 @@ public class HealthEducationArticleService extends BaseService{
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getArticalById,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result");
            JSONArray result = json.getJSONArray("Result");
            if(result.size()>0){
                return result.getJSONObject(0);
            }
            return re;
        }else {
            throw new Exception(json.getString("Message"));
        }
@ -160,12 +164,12 @@ public class HealthEducationArticleService extends BaseService{
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCollectionArticalList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result").getJSONArray("result");
            return json.getJSONArray("Result");
        }else {
            throw new Exception(json.getString("Message"));
        }
@ -187,7 +191,7 @@ public class HealthEducationArticleService extends BaseService{
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCategoryList,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
            return re;
        }
@ -205,8 +209,9 @@ public class HealthEducationArticleService extends BaseService{
     * @param userType 是    1 医生 2 居民
     * @return
     */
    public String cancelArticleCollection(String articleId,String userId,Integer userType){
    public void cancelArticleCollection(String articleId,String userId,Integer userType) throws Exception{
        String response = "";
        JSONObject json = null;
        try{
            JSONObject param = new JSONObject();
            param.put("articleId",articleId);
@ -214,11 +219,16 @@ public class HealthEducationArticleService extends BaseService{
            param.put("userType",userType);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(cancelArticleCollection,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
        }
        if("10000".equals(json.getString("Code"))){
        }else {
            new Exception(json.getString("Message"));
        }
        return response;
    }
    /**
@ -230,8 +240,9 @@ public class HealthEducationArticleService extends BaseService{
     * @param userType 是    1 医生 2 居民
     * @return
     */
    public String saveArticleCollection(String articleId, String articleCategoryId, String articleCategoryName,String userId,Integer userType){
    public void saveArticleCollection(String articleId, String articleCategoryId, String articleCategoryName,String userId,Integer userType){
        String response = "";
        JSONObject json = null;
        try{
            Doctor doctor = doctorDao.findByCode(userId);
            String orgName = doctor.getHospitalName();//用户所属机构
@ -248,11 +259,16 @@ public class HealthEducationArticleService extends BaseService{
            param.put("userType",userType);
            response = httpClientUtil.httpPost(baseUrl,getParamsMap(saveArticleCollection,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
        }
        if("10000".equals(json.getString("Code"))){
        }else {
            new Exception(json.getString("Message"));
        }
        return response;
    }
    /**
@ -281,12 +297,12 @@ public class HealthEducationArticleService extends BaseService{
            String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalByUserId,param.toString(),"1"));
            json = JSON.parseObject(response);
        }catch (Exception e){
            logger.error(e.getMessage());
            e.printStackTrace();
            return re;
        }
        if("10000".equals(json.getString("Code"))){
            return json.getJSONObject("Result").getJSONArray("result");
            return json.getJSONArray("Result");
        }else {
            throw new Exception(json.getString("Message"));
        }

+ 22 - 22
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -608,7 +608,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String getDoctorArticalList(@ApiParam(name = "articleTitle", value = "文章标题")
                                       @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                       @ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
                                       @RequestParam(value = "articleState", required = true,defaultValue = "1") Integer articleState,
                                       @RequestParam(value = "articleState", required = true) Integer articleState,
                                       @ApiParam(name = "firstLevelCategoryId", value = "一级类别ID ,多个逗号隔开")
                                       @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                       @ApiParam(name = "pageIndex", value = "起始页数 0开始,默认0")
@ -616,12 +616,12 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                       @ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
    }
@ -634,7 +634,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
    }
@ -643,7 +643,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String getCollectionArticalList(@ApiParam(name = "articleTitle", value = "文章标题")
                                       @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                       @ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
                                       @RequestParam(value = "articleState", required = true,defaultValue = "1") Integer articleState,
                                       @RequestParam(value = "articleState", required = true) Integer articleState,
                                       @ApiParam(name = "firstLevelCategoryId", value = "一级类别ID ,多个逗号隔开")
                                       @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                       @ApiParam(name = "pageIndex", value = "起始页数 0开始,默认0")
@ -656,7 +656,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
    }
@ -669,7 +669,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
    }
@ -679,12 +679,12 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId){
        try {
//            String response = healthEducationArticleService.cancelArticleCollection(articleId,getUID(),1);
            String response = healthEducationArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return write(200,"查询成功!","data",response);
            healthEducationArticleService.cancelArticleCollection(articleId,getUID(),1);
//            healthEducationArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"取消失败!");
        }
    }
@ -694,17 +694,17 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String saveArticleCollection(@ApiParam(name = "articleId", value = "文章id")
                                        @RequestParam(value = "articleId", required = true) String articleId,
                                        @ApiParam(name = "articleCategoryId", value = "文章类别ID")
                                        @RequestParam(value = "articleCategoryId", required = true,defaultValue = "1") String articleCategoryId,
                                        @RequestParam(value = "articleCategoryId", required = false,defaultValue = "1") String articleCategoryId,
                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
                                        @RequestParam(value = "articleCategoryName", required = true) String articleCategoryName){
                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
        try {
//            String response = healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getUID(),1);
            String response = healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
          healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getUID(),1);
//            healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
            return write(200,"查询成功!","data",response);
            return success("收藏成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"收藏失败!");
        }
    }
@ -713,7 +713,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    public String getDoctorArticalByUserId(@ApiParam(name = "articleTitle", value = "文章标题")
                                       @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                       @ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
                                       @RequestParam(value = "articleState", required = true,defaultValue = "1") Integer articleState,
                                       @RequestParam(value = "articleState", required = true) Integer articleState,
                                       @ApiParam(name = "firstLevelCategoryId", value = "一级类别ID ,多个逗号隔开")
                                       @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                       @ApiParam(name = "pageIndex", value = "起始页数 0开始,默认0")
@ -721,12 +721,12 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                                       @ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
//            com.alibaba.fastjson.JSONArray response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
    }