OutpatientBookingHttp.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package thyyxxk.webserver.service.externalhttp;
  2. import cn.hutool.core.util.StrUtil;
  3. import cn.hutool.http.HttpRequest;
  4. import com.alibaba.fastjson.JSON;
  5. import com.alibaba.fastjson.JSONObject;
  6. import org.springframework.stereotype.Service;
  7. @Service
  8. public class OutpatientBookingHttp {
  9. private static final String baseURL = "http://webhis.thyy.cn:81/thmz";
  10. public JSONObject getAmpmByDateAndDeptCode(String authorization, String date, String deptCode) {
  11. String url = baseURL + StrUtil.format("/getAmpmByDateAndDeptCode?date={}&deptCode={}",
  12. date, deptCode);
  13. String body = HttpRequest.get(url).header("Authorization", authorization)
  14. .execute().body();
  15. return JSON.parseObject(body);
  16. }
  17. public JSONObject getChargeTypeByRequestDayAndDoctor(String authorization,
  18. String unitCode, String ampm,
  19. String date, String apTime) {
  20. String url = baseURL + StrUtil.format("/getChargeTypeByRequestDayAndDoctor?" +
  21. "unitCode={}&ampm={}&date={}&apTime={}&doctorCode={}", unitCode, ampm, date, apTime);
  22. String body = HttpRequest.get(url).header("Authorization", authorization)
  23. .execute().body();
  24. return JSON.parseObject(body);
  25. }
  26. public JSONObject getDoctorCodeByRequestDayAndDoctor(String authorization,
  27. String unitCode, String ampm,
  28. String date, String apTime,
  29. String chargeType) {
  30. String url = baseURL + StrUtil.format("/getDoctorCodeByRequestDayAndDoctor?" +
  31. "unitCode={}&ampm={}&chargeType={}&date={}&apTime={}", unitCode, ampm, chargeType, date, ampm);
  32. String body = HttpRequest.get(url).header("Authorization", authorization)
  33. .execute().body();
  34. return JSON.parseObject(body);
  35. }
  36. public JSONObject getMzChargeTypeByMzyRequestId(String authorization, String mzyRequestId,
  37. String birthDay, String patientId) {
  38. String url = baseURL + StrUtil.format("/getMzChargeTypeByMzyRequestId?" +
  39. "mzyRequestId={}&birthDay={}&patientId={}", mzyRequestId, birthDay, patientId);
  40. String body = HttpRequest.get(url).header("Authorization", authorization)
  41. .execute().body();
  42. return JSON.parseObject(body);
  43. }
  44. @Post("/saveMzyReqrec")
  45. public JSONObject saveMzyReqrec(@Header("Authorization") String Authorization, @JSONBody JSONObject jsonObject);
  46. }