|
@@ -1,42 +1,54 @@
|
|
|
package thyyxxk.webserver.service.externalhttp;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpRequest;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.dtflys.forest.annotation.*;
|
|
|
-
|
|
|
-//@BaseRequest(baseURL = "http://172.16.30.33:8089/thmz")
|
|
|
-@BaseRequest(baseURL = "http://webhis.thyy.cn:81/thmz")
|
|
|
-public interface OutpatientBookingHttp {
|
|
|
-
|
|
|
- @Post("/login")
|
|
|
- JSONObject getToken(@JSONBody JSONObject js);
|
|
|
-
|
|
|
- @Get("/getAmpmByDateAndDeptCode?date={date}&deptCode={deptCode}")
|
|
|
- JSONObject getAmpmByDateAndDeptCode(@Header("Authorization") String Authorization,
|
|
|
- @Var("date") String date,
|
|
|
- @Var("deptCode") String deptCode);
|
|
|
-
|
|
|
- @Get("/getChargeTypeByRequestDayAndDoctor?unitCode={unitCode}&m={ampm}&date={date}&apTime={apTime}&doctorCode={}")
|
|
|
- JSONObject getChargeTypeByRequestDayAndDoctor(@Header("Authorization") String Authorization,
|
|
|
- @Var("unitCode") String unitCode,
|
|
|
- @Var("ampm") String ampm,
|
|
|
- @Var("date") String date,
|
|
|
- @Var("apTime") String apTime);
|
|
|
-
|
|
|
- @Get("/getDoctorCodeByRequestDayAndDoctor?unitCode={unitCode}&m={ampm}&chargeType={chargeType}&date={date}&apTime={apTime}")
|
|
|
- JSONObject getDoctorCodeByRequestDayAndDoctor(@Header("Authorization") String Authorization,
|
|
|
- @Var("unitCode") String unitCode,
|
|
|
- @Var("ampm") String ampm,
|
|
|
- @Var("date") String date,
|
|
|
- @Var("apTime") String apTime,
|
|
|
- @Var("chargeType") String chargeType);
|
|
|
-
|
|
|
- @Get("/getMzChargeTypeByMzyRequestId?mzyRequestId={mzyRequestId}&birthDay={birthDay}&patientId={patientId}")
|
|
|
- JSONObject getMzChargeTypeByMzyRequestId(@Header("Authorization") String Authorization,
|
|
|
- @Var("mzyRequestId") String mzyRequestId,
|
|
|
- @Var("birthDay") String birthDay,
|
|
|
- @Var("patientId") String patientId);
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class OutpatientBookingHttp {
|
|
|
+ private static final String baseURL = "http://webhis.thyy.cn:81/thmz";
|
|
|
+
|
|
|
+ public JSONObject getAmpmByDateAndDeptCode(String authorization, String date, String deptCode) {
|
|
|
+ String url = baseURL + StrUtil.format("/getAmpmByDateAndDeptCode?date={}&deptCode={}",
|
|
|
+ date, deptCode);
|
|
|
+ String body = HttpRequest.get(url).header("Authorization", authorization)
|
|
|
+ .execute().body();
|
|
|
+ return JSON.parseObject(body);
|
|
|
+ }
|
|
|
+
|
|
|
+ public JSONObject getChargeTypeByRequestDayAndDoctor(String authorization,
|
|
|
+ String unitCode, String ampm,
|
|
|
+ String date, String apTime) {
|
|
|
+ String url = baseURL + StrUtil.format("/getChargeTypeByRequestDayAndDoctor?" +
|
|
|
+ "unitCode={}&m={}&date={}&apTime={}&doctorCode={}", unitCode, ampm, date, apTime);
|
|
|
+ String body = HttpRequest.get(url).header("Authorization", authorization)
|
|
|
+ .execute().body();
|
|
|
+ return JSON.parseObject(body);
|
|
|
+ }
|
|
|
+
|
|
|
+ public JSONObject getDoctorCodeByRequestDayAndDoctor(String authorization,
|
|
|
+ String unitCode, String ampm,
|
|
|
+ String date, String apTime,
|
|
|
+ String chargeType) {
|
|
|
+ String url = baseURL + StrUtil.format("/getDoctorCodeByRequestDayAndDoctor?" +
|
|
|
+ "unitCode={}&m={}&chargeType={}&date={}&apTime={}", unitCode, ampm, chargeType, date, ampm);
|
|
|
+ String body = HttpRequest.get(url).header("Authorization", authorization)
|
|
|
+ .execute().body();
|
|
|
+ return JSON.parseObject(body);
|
|
|
+ }
|
|
|
+
|
|
|
+ public JSONObject getMzChargeTypeByMzyRequestId(String authorization, String mzyRequestId,
|
|
|
+ String birthDay, String patientId) {
|
|
|
+ String url = baseURL + StrUtil.format("/getMzChargeTypeByMzyRequestId?" +
|
|
|
+ "mzyRequestId={}&birthDay={}&patientId={}", mzyRequestId, birthDay, patientId);
|
|
|
+ String body = HttpRequest.get(url).header("Authorization", authorization)
|
|
|
+ .execute().body();
|
|
|
+ return JSON.parseObject(body);
|
|
|
+ }
|
|
|
|
|
|
@Post("/saveMzyReqrec")
|
|
|
- JSONObject saveMzyReqrec(@Header("Authorization") String Authorization, @JSONBody JSONObject jsonObject);
|
|
|
+ public JSONObject saveMzyReqrec(@Header("Authorization") String Authorization, @JSONBody JSONObject jsonObject);
|
|
|
|
|
|
}
|