浏览代码

20170814 wxw
修改越人接口

wangxingwang 8 年之前
父节点
当前提交
e4b2d2110a

+ 279 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/yueren/YueRenController.java

@ -0,0 +1,279 @@
package com.yihu.wlyy.controller.manager.yueren;
import com.google.gson.Gson;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.util.HttpClientUtil;
import io.swagger.annotations.Api;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
/**
 * Created by Administrator on 2017/8/14.
 */
@Controller
@RequestMapping("/yueren")
@Api(description = "调用越人接口")
public class YueRenController extends BaseController {
    @Value("${yueren.api}")
    private String api;
    //--预约模块 begin
    /**
     * 获取每个接口需要传递的key值
     * @return
     */
    @RequestMapping(value = "/phonekey", method = RequestMethod.POST)
    @ResponseBody
    public String getPhoneKey() {
        String postStr = remoteCall("/yueren/phonekey", new JSONObject());
        return postStr;
    }
    /**
     * 新增客户咨询预约单,如果是新客人,同时新增客户信息
     * @param key
     * @param sl_date 预约时间
     * @param sl_state 咨询状态
     * @param u_tel
     * @param u_name
     * @param u_sex
     * @param sh_id 门店编号
     * @param u_idnum 身份证号码
     * @param u_native 籍贯
     * @param u_birthday
     * @param u_province
     * @param u_city
     * @param u_area
     * @param u_address
     * @param sl_pass 报告单是否审核通过
     * @return
     */
    @RequestMapping(value = "insertslip", method = RequestMethod.POST)
    @ResponseBody
    public String insertSlip(String key, String sl_date,String sl_state,String u_tel, String u_name, String u_sex,
                             String sh_id, String u_idnum, String u_native, String u_birthday, String u_province,
                             String u_city,String u_area,String u_address, String sl_pass) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("sl_date", sl_date);
        params.put("sl_state", sl_state);
        params.put("u_tel", u_tel);
        params.put("u_name", u_name);
        params.put("u_sex", u_sex);
        params.put("sh_id", sh_id);
        params.put("u_idnum", u_idnum);
        params.put("u_native", u_native);
        params.put("u_birthday", u_birthday);
        params.put("u_province", u_province);
        params.put("u_city", u_city);
        params.put("u_area", u_area);
        params.put("u_address", u_address);
        params.put("sl_pass", sl_pass);
        String postStr = remoteCall("/yueren/insertslip", params);
        return postStr;
    }
    //--预约模块 end
    //--四诊模块 begin
    /**
     * 上传图片音频等附件
     * @param file 附件
     * @return
     */
    @RequestMapping(value = "/uploadattachment", method = RequestMethod.POST)
    @ResponseBody
    public String uploadAttachment(String file, String e_no) {
        JSONObject params = new JSONObject();
        params.put("file", file);
        String postStr = remoteCall("/yueren/uploadattachment", params);
        return postStr;
    }
    /**
     * 处理头像舌苔声音
     * @param key
     * @param at_id 文件id
     * @param answer 答案,格式固定为(”/attach/{{key}}/文件id/文件名称”)
     * @param answer_type 答案类型,备选数值(图片,录音,视频)
     * @param ct_id 预约编号
     * @param object_type 对象类型,备选数值(1,2,3)1脸型,2舌像,3录音
     * @return
     */
    @RequestMapping(value = "dillphoneimgdata", method = RequestMethod.POST)
    @ResponseBody
    public String inserTemp(String key, String at_id, String answer, String answer_type, String ct_id, String object_type) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("at_id", at_id);
        params.put("answer", answer);
        params.put("answer_type", answer_type);
        params.put("ct_id", ct_id);
        params.put("object_type", object_type);
        String postStr = remoteCall("/yueren/dillphoneimgdata", params);
        return postStr;
    }
    //--四诊模块 end
    //--答题模块 begin
    /**
     * 查找试卷
     * @param key
     * @param tp_type '问卷类型',//(备选值:1,2,4)1:初筛问卷,2:助理问卷,4:现场问卷,
     * @param sh_id 所属门店编号
     * @return
     */
    @RequestMapping(value = "findtest", method = RequestMethod.POST)
    @ResponseBody
    public String findTest(String key, String tp_type, String sh_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("tp_type", tp_type);
        params.put("sh_id", sh_id);
        String postStr = remoteCall("/yueren/findtest", params);
        return postStr;
    }
    /**
     * 查找试卷题目
     * @param key
     * @param ct_id 咨询编号
     * @param tp_id 试卷编号
     * @param pb_id 问题编号
     * @return
     */
    @RequestMapping(value = "giveproblem", method = RequestMethod.POST)
    @ResponseBody
    public String giveproblem(String key,String ct_id, String tp_id, String pb_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        params.put("tp_id", tp_id);
        params.put("pb_id", pb_id);
        String postStr = remoteCall("/yueren/giveproblem", params);
        return postStr;
    }
    /**
     *
     * @param key
     * @param ct_id 咨询编号
     * @param tp_id 试卷编号
     * @param pb_id 问题编号
     * @param dc_answer 答案数组
     * @return 将用户提交的试卷题目的答案进行保存
     */
    @RequestMapping(value = "handleproblem", method = RequestMethod.POST)
    @ResponseBody
    public String handleproblem(String key, String ct_id, String tp_id,String pb_id, String[] dc_answer) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        params.put("tp_id", tp_id);
        params.put("pb_id", pb_id);
        params.put("dc_answer", dc_answer);
        String postStr = remoteCall("/yueren/handleproblem", params);
        return postStr;
    }
    /**
     * 将用户提交的试卷题目的答案进行处理
     * @param key
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "centralizedproblem", method = RequestMethod.POST)
    @ResponseBody
    public String centralizedproblem(String key, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        String postStr = remoteCall("/yueren/centralizedproblem", params);
        return postStr;
    }
    /**
     * 在生成报告单之前,必须调用这个接口,将风险预警中的因素中的所有病处理到影响中
     * @param key
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "conclusionfactor", method = RequestMethod.POST)
    @ResponseBody
    public String conclusionFactor(String key, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        String postStr = remoteCall("/yueren/conclusionfactor", params);
        return postStr;
    }
    //--答题模块 end
    //--报告单模块 begin
    /**
     * 生成报告单
     * @param key
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "insertconconhealth", method = RequestMethod.POST)
    @ResponseBody
    public String insertConsultConclusionHealth(String key, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        String postStr = remoteCall("/yueren/insertconconhealth", params);
        return postStr;
    }
    /**
     * 查找报告单结论
     * @param key
     * @param ct_id 咨询编号
     * @param reqtype 请求类型(备选数值1)
     * @return
     */
    @RequestMapping(value = "findconconhealth", method = RequestMethod.POST)
    @ResponseBody
    public String insertConsultConclusion(String key, String ct_id, String reqtype) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        params.put("reqtype", reqtype);
        String postStr = remoteCall("/yueren/findconconhealth", params);
        return postStr;
    }
    /**
     * 查找状态要素结论积分图及个人信息
     * @param key
     * @param ct_id 咨询编号
     * @return
     */
    @RequestMapping(value = "findintegral", method = RequestMethod.POST)
    @ResponseBody
    public String findIntegral(String key, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("key", key);
        params.put("ct_id", ct_id);
        String postStr = remoteCall("/yueren/findintegral", params);
        return postStr;
    }
    private String remoteCall(String url, JSONObject jsonDate) {
        try {
            String result = HttpClientUtil.postBody(api + url, jsonDate);
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return "{\"status\":500,\"exception\":\"连接出错\"}";
        }
    }
}

+ 7 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -55,6 +55,8 @@ service-gateway:
  update-team-url: http://172.19.103.87:8011/wlyy_service/third/doctor/LoadTeamInfo
im-service:
  im_service_url: http://172.19.103.88:3000/api/v2
yueren:
  api: http://120.77.209.211:8080
---
spring:
@ -77,6 +79,8 @@ service-gateway:
  update-team-url: http://172.19.103.87:8011/wlyy_service/third/doctor/LoadTeamInfo
im-service:
  im_service_url: http://172.19.103.88:3000/api/v2
yueren:
  api: http://120.77.209.211:8080
---
spring:
@ -98,4 +102,6 @@ spring:
service-gateway:
  update-team-url: http://59.61.92.90:8072/wlyy_service/third/doctor/LoadTeamInfo
im-service:
  im_service_url: http://120.41.253.95:3000/api/v2
  im_service_url: http://120.41.253.95:3000/api/v2
yueren:
  api: http://120.77.209.211:8080