|
@ -1,6 +1,7 @@
|
|
|
package com.yihu.wlyy.service.third.fzzb;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
@ -81,9 +82,9 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
* @param userId 是 当前用户ID
|
|
|
* @return
|
|
|
*/
|
|
|
public String getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId){
|
|
|
|
|
|
String response = "";
|
|
|
public JSONArray getDoctorArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId) throws Exception{
|
|
|
JSONArray re = new JSONArray();
|
|
|
JSONObject json = null;
|
|
|
try{
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("articleTitle",articleTitle);
|
|
@ -92,13 +93,18 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
param.put("pageIndex",pageIndex);
|
|
|
param.put("pageSize",pageSize);
|
|
|
param.put("userId",userId);
|
|
|
|
|
|
response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalList,param.toString(),"1"));
|
|
|
|
|
|
String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalList,param.toString(),"1"));
|
|
|
json = JSON.parseObject(response);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
if("10000".equals(json.getString("Code"))){
|
|
|
return json.getJSONArray("Result");
|
|
|
}else {
|
|
|
throw new Exception(json.getString("Message"));
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -106,18 +112,24 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
* @param articleId 文章id
|
|
|
* @return
|
|
|
*/
|
|
|
public String getArticalById(String articleId){
|
|
|
String response = "";
|
|
|
public JSONObject getArticalById(String articleId) throws Exception{
|
|
|
JSONObject re = new JSONObject();
|
|
|
JSONObject json = null;
|
|
|
try{
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("articleId",articleId);
|
|
|
|
|
|
response = httpClientUtil.httpPost(baseUrl,getParamsMap(getArticalById,param.toString(),"1"));
|
|
|
|
|
|
String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getArticalById,param.toString(),"1"));
|
|
|
json = JSON.parseObject(response);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
if("10000".equals(json.getString("Code"))){
|
|
|
return json.getJSONObject("Result");
|
|
|
}else {
|
|
|
throw new Exception(json.getString("Message"));
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -131,8 +143,10 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
* @param userType 是 1 医生 2 居民
|
|
|
* @return
|
|
|
*/
|
|
|
public String getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId,Integer userType){
|
|
|
String response = "";
|
|
|
public JSONArray getCollectionArticalList(String articleTitle, Integer articleState, String firstLevelCategoryId,
|
|
|
Integer pageIndex, Integer pageSize,String userId,Integer userType) throws Exception{
|
|
|
JSONArray re = new JSONArray();
|
|
|
JSONObject json = null;
|
|
|
try{
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("articleTitle",articleTitle);
|
|
@ -143,12 +157,18 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
param.put("userId",userId);
|
|
|
param.put("userType",userType);
|
|
|
|
|
|
response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCollectionArticalList,param.toString(),"1"));
|
|
|
|
|
|
String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCollectionArticalList,param.toString(),"1"));
|
|
|
json = JSON.parseObject(response);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
if("10000".equals(json.getString("Code"))){
|
|
|
return json.getJSONObject("Result").getJSONArray("result");
|
|
|
}else {
|
|
|
throw new Exception(json.getString("Message"));
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
|
|
@ -157,22 +177,25 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
* @param categoryLevel 是 获取类别:1、一级类别 2、二级类别
|
|
|
* @return
|
|
|
*/
|
|
|
public String getCategoryList(String categoryLevel) throws Exception{
|
|
|
String response = "";
|
|
|
public JSONArray getCategoryList(String categoryLevel) throws Exception{
|
|
|
JSONArray re = new JSONArray();
|
|
|
JSONObject json = null;
|
|
|
try{
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("categoryLevel",categoryLevel);
|
|
|
|
|
|
response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCategoryList,param.toString(),"1"));
|
|
|
JSONObject json = JSON.parseObject(response);
|
|
|
if("10000".equals(json.getString(""))){
|
|
|
|
|
|
}
|
|
|
|
|
|
String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getCategoryList,param.toString(),"1"));
|
|
|
json = JSON.parseObject(response);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
if("10000".equals(json.getString("Code"))){
|
|
|
return json.getJSONObject("Result").getJSONArray("result");
|
|
|
}else {
|
|
|
throw new Exception(json.getString("Message"));
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -242,9 +265,10 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
* @param userId 是 当前用户ID
|
|
|
* @return
|
|
|
*/
|
|
|
public String getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId, Integer pageIndex, Integer pageSize,String userId){
|
|
|
|
|
|
String response = "";
|
|
|
public JSONArray getDoctorArticalByUserId(String articleTitle, Integer articleState, String firstLevelCategoryId,
|
|
|
Integer pageIndex, Integer pageSize,String userId) throws Exception{
|
|
|
JSONArray re = new JSONArray();
|
|
|
JSONObject json = null;
|
|
|
try{
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("articleTitle",articleTitle);
|
|
@ -254,12 +278,18 @@ public class HealthEducationArticleService extends BaseService{
|
|
|
param.put("pageSize",pageSize);
|
|
|
param.put("userId",userId);
|
|
|
|
|
|
response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalByUserId,param.toString(),"1"));
|
|
|
|
|
|
String response = httpClientUtil.httpPost(baseUrl,getParamsMap(getDoctorArticalByUserId,param.toString(),"1"));
|
|
|
json = JSON.parseObject(response);
|
|
|
}catch (Exception e){
|
|
|
logger.error(e.getMessage());
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
if("10000".equals(json.getString("Code"))){
|
|
|
return json.getJSONObject("Result").getJSONArray("result");
|
|
|
}else {
|
|
|
throw new Exception(json.getString("Message"));
|
|
|
}
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
}
|