|
@@ -42,7 +42,7 @@ public class ThmzService {
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("patIdType", "11");
|
|
|
params.put("patIdNo", patIdNo);
|
|
|
- JSONObject response = template.postForObject(thmzApi + "/queryPatientInfo", params, JSONObject.class);
|
|
|
+ JSONObject response = template.postForObject(thmzApi + "/api/v1/queryPatientInfo", params, JSONObject.class);
|
|
|
log.info("在绑卡前查询患者信息:\n参数:{}\n结果:{}", params, response);
|
|
|
if (null == response || response.getInteger("resultCode") != 0) {
|
|
|
return null;
|
|
@@ -51,7 +51,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public String savePatientInfo(CreatCardParam request) {
|
|
|
- CreateCardResponse response = template.postForObject(thmzApi + "/savePatientInfo", request, CreateCardResponse.class);
|
|
|
+ CreateCardResponse response = template.postForObject(thmzApi + "/api/v1/savePatientInfo", request, CreateCardResponse.class);
|
|
|
log.info("首诊患者建档:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
if (null == response) {
|
|
|
return "ERROR:网络异常。";
|
|
@@ -63,7 +63,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getMzClass() {
|
|
|
- MzClassResponse response = template.getForObject(thmzApi + "/getMzClass", MzClassResponse.class);
|
|
|
+ MzClassResponse response = template.getForObject(thmzApi + "/api/v1/getMzClass", MzClassResponse.class);
|
|
|
log.info("获取门诊科室分类:{}", JSON.toJSON(response));
|
|
|
if (null == response || 0 != response.getResultCode()) {
|
|
|
return new ArrayList<>();
|
|
@@ -72,9 +72,9 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getUnitCodeByMzClass(QueryUnitCodeRequest request) {
|
|
|
- String url = thmzApi + "/getUnitCodeByMzClass";
|
|
|
+ String url = thmzApi + "/api/v1/getUnitCodeByMzClass";
|
|
|
if (request.isP4Request()) {
|
|
|
- url = thmzApi + "/getP4UnitCode";
|
|
|
+ url = thmzApi + "/api/v1/getP4UnitCode";
|
|
|
}
|
|
|
MzClassResponse response = template.postForObject(url, request, MzClassResponse.class);
|
|
|
log.info("获取门诊科室列表:{}", JSON.toJSON(response));
|
|
@@ -86,7 +86,7 @@ public class ThmzService {
|
|
|
|
|
|
public List<Map<String, Object>> getDoctorByDateAndDept(QueryMzDoctorRequest request) {
|
|
|
String url = String.format(thmzApi
|
|
|
- + "/getDoctorByDateAndDept?requestDay=%s&unitCode=%s",
|
|
|
+ + "/api/v1/getDoctorByDateAndDept?requestDay=%s&unitCode=%s",
|
|
|
request.getRequestDay(), request.getUnitCode());
|
|
|
SourcesResponse response = template.getForObject(url, SourcesResponse.class);
|
|
|
if (null == response || response.getResultCode() == -1) {
|
|
@@ -96,7 +96,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getDoctorsArrangement(QueryMzDoctorRequest request) {
|
|
|
- String url = String.format(thmzApi + "/getRequestByDateAndDeptAndDoctor?requestDay=%s&unitCode=%s&doctorCode=%s",
|
|
|
+ String url = String.format(thmzApi + "/api/v1/getRequestByDateAndDeptAndDoctor?requestDay=%s&unitCode=%s&doctorCode=%s",
|
|
|
request.getRequestDay(), request.getUnitCode(), request.getDoctorCode());
|
|
|
SourcesResponse response = template.getForObject(url, SourcesResponse.class);
|
|
|
if (null == response || null == response.getResultCode() || response.getResultCode() == -1) {
|
|
@@ -106,7 +106,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getRegisterCost(QueryRegisterCostRequest request) {
|
|
|
- String url = String.format(thmzApi + "/getMzChargeTypeByRequestIdForHaiCi?" +
|
|
|
+ String url = String.format(thmzApi + "/api/v1/getMzChargeTypeByRequestIdForHaiCi?" +
|
|
|
"mzyRequestId=%d&patientId=%s", request.getMzyRequestId(), request.getPatientId());
|
|
|
HrgCommonResponse data = template.getForObject(url, HrgCommonResponse.class);
|
|
|
log.info("获取挂号费用:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(data));
|
|
@@ -119,11 +119,9 @@ public class ThmzService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- public List<Map<String, String>> getPaidMzGhList(String patientId) {
|
|
|
- JSONObject params = new JSONObject();
|
|
|
- params.put("patientId", patientId);
|
|
|
+ public List<Map<String, String>> getPaidMzGhList(QueryReceiptRequest request) {
|
|
|
SourcesResponse response = template.postForObject(thmzApi
|
|
|
- + "/getRegistrationForPaid", params, SourcesResponse.class);
|
|
|
+ + "/api/v1/getRegistrationForPaid", request, SourcesResponse.class);
|
|
|
if (null == response || response.getResultCode() != 0) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
@@ -131,7 +129,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public List<MzyReqrec> listMzyReqrec(QueryMzyReqrecRequest request) {
|
|
|
- String url = thmzApi + "/listMzyReqrec?patientId=" + request.getPatientId()
|
|
|
+ String url = thmzApi + "/api/v1/listMzyReqrec?patientId=" + request.getPatientId()
|
|
|
+ "&payMark=" + request.getPayMark();
|
|
|
List<MzyReqrec> list = new ArrayList<>();
|
|
|
JSONObject response = template.getForObject(url, JSONObject.class);
|
|
@@ -157,7 +155,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public MzyReqrec getMzyReqrecInfo(QueryMzyReqrecRequest request) {
|
|
|
- String url = thmzApi + "/getMzyReqrecInfo?patientId=" +
|
|
|
+ String url = thmzApi + "/api/v1/getMzyReqrecInfo?patientId=" +
|
|
|
request.getPatientId() + "×=" + request.getTimes();
|
|
|
JSONObject response = template.getForObject(url, JSONObject.class);
|
|
|
if (null == response || 0 != response.getInteger("resultCode")) {
|
|
@@ -178,7 +176,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public String cancelReqFromHis(QueryMzyReqrecRequest request) {
|
|
|
- String url = thmzApi + "/cancelReqrec";
|
|
|
+ String url = thmzApi + "/api/v1/cancelReqrec";
|
|
|
JSONObject response = template.postForObject(url, request, JSONObject.class);
|
|
|
log.info("自助退号:\n参数:{}\n结果:{}", JSON.toJSON(request), response);
|
|
|
if (null == response) {
|
|
@@ -191,7 +189,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, Object>>> getMzChargeDetailForUnPaid(QueryReceiptRequest request) {
|
|
|
- String url = thmzApi + "/getMzChargeDetailForUnPaid";
|
|
|
+ String url = thmzApi + "/api/v1/getMzChargeDetailForUnPaid";
|
|
|
SourcesResponse response = template.postForObject(url, request, SourcesResponse.class);
|
|
|
if (null == response || null == response.getResultCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
|
|
@@ -203,7 +201,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, Object>>> getChargeDetailByHisOrdNum(QueryReceiptRequest request) {
|
|
|
- String url = thmzApi + "/getChargeDetailByHisOrdNum";
|
|
|
+ String url = thmzApi + "/api/v1/getChargeDetailByHisOrdNum";
|
|
|
SourcesResponse response = template.postForObject(url, request, SourcesResponse.class);
|
|
|
if (null == response || null == response.getResultCode()) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "网络服务错误!");
|
|
@@ -215,13 +213,13 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, String>>> getMzPaidList(QueryReceiptRequest request) {
|
|
|
- String url = thmzApi + "/getMzChargeDetailForPaid";
|
|
|
+ String url = thmzApi + "/api/v1/getMzChargeDetailForPaid";
|
|
|
SourcesResponse hrgResponse = template.postForObject(url, request, SourcesResponse.class);
|
|
|
return ThmzUtil.getResultVoCompletableFuture(hrgResponse);
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, Object>>> getMzPaidDetail(QueryReceiptRequest request) {
|
|
|
- String url = thmzApi + "/getSfjkMzbrmx?djh=" + request.getHisOrdNum();
|
|
|
+ String url = thmzApi + "/api/v1/getSfjkMzbrmx?djh=" + request.getHisOrdNum();
|
|
|
SourcesResponse hrgResponse = template.getForObject(url, SourcesResponse.class);
|
|
|
if (null == hrgResponse) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
@@ -233,7 +231,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<Map<String, String>>> getParentIdByPatientId(String patientId) {
|
|
|
- String url = thmzApi + "/getParentIdByPatientId?patientId=" + patientId;
|
|
|
+ String url = thmzApi + "/api/v1/getParentIdByPatientId?patientId=" + patientId;
|
|
|
HrgCommonResponse response = template.getForObject(url, HrgCommonResponse.class);
|
|
|
if (null != response && response.getCode() == 0) {
|
|
|
return ResultVoUtil.success(CastUtil.cast(response.getData()));
|
|
@@ -263,7 +261,7 @@ public class ThmzService {
|
|
|
}
|
|
|
|
|
|
private ExceptionEnum saveMzPayResult(SaveMzPayRequest request, int times) {
|
|
|
- String url = request.isNormalClinic() ? thmzApi + "/payChargeDetailFormHaiCi"
|
|
|
+ String url = request.isNormalClinic() ? thmzApi + "/api/v1/payChargeDetailFormHaiCi"
|
|
|
: "http://172.16.32.160:8088/thmz/api/v1/payChargeDetailFormHaiCi";
|
|
|
String des = request.isNormalClinic() ? "门诊" : "医美";
|
|
|
SaveMzFeeResponse mzFeeResponse = null;
|
|
@@ -289,7 +287,7 @@ public class ThmzService {
|
|
|
public String saveAppointment(SaveAppointmentRequest request) {
|
|
|
SaveGhFeeResponse response = null;
|
|
|
try {
|
|
|
- response = template.postForObject(thmzApi + "/payRegistrationFormHaiCi",
|
|
|
+ response = template.postForObject(thmzApi + "/api/v1/payRegistrationFormHaiCi",
|
|
|
request, SaveGhFeeResponse.class);
|
|
|
log.info("保存挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
} catch (Exception e) {
|
|
@@ -307,7 +305,7 @@ public class ThmzService {
|
|
|
public String saveClinicRegister(SaveClinicRegisterRequest request) {
|
|
|
SaveGhFeeResponse response = null;
|
|
|
try {
|
|
|
- response = template.postForObject(thmzApi + "/payRegistration", request, SaveGhFeeResponse.class);
|
|
|
+ response = template.postForObject(thmzApi + "/api/v1/payRegistration", request, SaveGhFeeResponse.class);
|
|
|
log.info("保存诊间挂号信息: \n参数:{},\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
} catch (Exception e) {
|
|
|
log.error("网络连接失败,保存诊间挂号信息失败:", e);
|
|
@@ -321,20 +319,21 @@ public class ThmzService {
|
|
|
return "ERROR:" + response.getMessage();
|
|
|
}
|
|
|
|
|
|
- public String saveTemplate(SaveTemplateRequest request) {
|
|
|
- HrgCommonResponse response = null;
|
|
|
- try {
|
|
|
- response = template.postForObject(thmzApi + "/saveTcPrescription", request, HrgCommonResponse.class);
|
|
|
- log.info("保存套餐缴费:\n参数:{}\n结果:{}", JSON.toJSON(request), JSON.toJSON(response));
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("网络连接失败,保存套餐缴费信息失败:", e);
|
|
|
- }
|
|
|
+
|
|
|
+ public ResultVo<String> queryInvoiceFile(QueryDzfpRequest request) {
|
|
|
+ String url = thmzApi + "/queryInvoiceFile";
|
|
|
+ JSONObject response = template.postForObject(url, request, JSONObject.class);
|
|
|
if (null == response) {
|
|
|
- return "ERROR:保存套餐缴费失败,门诊接口返回空。";
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
}
|
|
|
- if (0 == response.getCode() || response.getMessage().contains("已经缴费成功")) {
|
|
|
- return "保存套餐信息成功。";
|
|
|
+ Integer code = response.getInteger("code");
|
|
|
+ if (null == code) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
}
|
|
|
- return "ERROR:" + response.getMessage();
|
|
|
+ if (code == 0) {
|
|
|
+ JSONObject data = response.getJSONObject("data");
|
|
|
+ return ResultVoUtil.success(data.getString("pdfFileStr"));
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, response.getString("message"));
|
|
|
}
|
|
|
}
|