Selaa lähdekoodia

完善已推送文章,增加对象数据字段。

zd_123 7 vuotta sitten
vanhempi
commit
bae6c8099b

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/EduArticleController.java

@ -13,6 +13,7 @@ import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

+ 34 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduDoctorArticleController.java

@ -309,6 +309,7 @@ public class EduDoctorArticleController extends BaseController{
            @ApiParam(name = "articleTitle", value = "文章标题", required = false) @RequestParam(value = "articleTitle", required = false) String articleTitle,
            @ApiParam(name = "page", value = "当前页 起始1", required = true) @RequestParam(value = "page", required = true) Integer page,
            @ApiParam(name = "pagesize", value = "每页显示条数", required = true) @RequestParam(value = "pagesize", required = true) Integer pagesize) {
        int code =0;
        try {
            if (StringUtils.isEmpty(doctorCode)) {
                doctorCode = getUID();
@ -319,13 +320,40 @@ public class EduDoctorArticleController extends BaseController{
            }
            List<HealthEduArticlePatientModel> eduArticlePatients = gcEduArticleService.getPatientHealthLogs(doctorCode, "", "", "", "", articleTitle, "", "", page, pagesize);
            Long count = gcEduArticleService.getPatientHealthLogsCount(getUID(), "", "", "", "", articleTitle, "", "");
            return new ResultPageListModel(
                    page,
                    pagesize,
                    count.intValue()
                    , eduArticlePatients);
            String ids = "";
            if(eduArticlePatients!=null && eduArticlePatients.size()>0){
                for (HealthEduArticlePatientModel healthEduArticle:eduArticlePatients) {
                    if (StringUtils.isNotBlank(healthEduArticle.getArticleId())){
                        ids += healthEduArticle.getArticleId()+",";
                    }
                }
            }
            if (StringUtils.isNotBlank(ids)){
                ids = ids.substring(0,ids.length()-1);
                //调用福州接口
                String url ="http://172.17.110.230:83/WsPlatform/rest?Api=JkEdu.Article.getArticalList&Param={\"articleState\":\"1\",\"articleId\":\""+ids+"\"," +
                        "\"pageIndex\":\""+page+"\",\"pageSize\":\""+pagesize+"\",";
                String jsonStr = HttpUtil.sendPost(url,"");
                if (StringUtils.isNotBlank(jsonStr)){
                    //结果转map
                    Map<String,Object> map = (Map<String, Object>) JSON.parseObject(jsonStr);
                    code = Integer.valueOf(String.valueOf(map.get("Code")));
                    List<ArticleModel> list = new ArrayList<ArticleModel>();
                    if(code ==10000){
                        String result = String.valueOf(map.get("Result"));
                        String resultStr = String.valueOf(result);
                        JSONArray jsonArray = JSONArray.fromObject(resultStr);
                        list = (List<ArticleModel>) JSONArray.toCollection(jsonArray, ArticleModel.class);//转换成列表
                        return new ResultPageListModel(page,pagesize,count.intValue(), list);
                    }else{
                        return new ResultPageListModel(code, ErrorStateMessage.getMessge(code));
                    }
                }
                return  new ResultPageListModel(0,"远程请求失败!");
            }
            return  new ResultPageListModel(-1000,"没有相应的数据!");
        } catch (Exception e) {
            return new ResultPageListModel(com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel.statusEm.find_error.getCode(), com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel.statusEm.find_error.getMessage() + "," + e.getMessage());
            return new ResultPageListModel(code,ErrorStateMessage.getMessge(code)+ "," + e.getMessage());
        }
    }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduLableController.java

@ -31,7 +31,7 @@ import java.util.List;
 * Created by chenweida on 2017/8/30.
 */
@Controller
@RequestMapping(value = "/wlyygc/doctor/label", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyygc/doctor/labeledu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
@Api(description = "疾病标签")
public class EduLableController extends BaseController {

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/patient/EduPatientArticleController.java

@ -13,6 +13,7 @@ import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;