云霄中医院修改

dtxyy
yewj 7 months ago
parent 9b6a0f6be3
commit ce1433110d

@ -101,7 +101,7 @@ public class YxzyyClient extends CommonHttpClient {
public BaseResponse getUnit(UdiwmsUnitRequest udiwmsUnitRequest) {
YxUnitRequest yxUnitRequest = new YxUnitRequest();
BeanUtil.copyProperties(udiwmsUnitRequest, yxUnitRequest);
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_CORP_URL), yxUnitRequest);
String response = httpClient.postJson2(thrSystemDetailService.getUrl(Constants.URL_NAME_CORP_URL), yxUnitRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
}
@ -110,7 +110,7 @@ public class YxzyyClient extends CommonHttpClient {
public BaseResponse getProducts(UdiwmsProductRequest udiwmsProductRequest) {
YxProductRequest yxProductRequest = new YxProductRequest();
BeanUtil.copyProperties(udiwmsProductRequest, yxProductRequest);
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_PI_QUERY_URL), yxProductRequest);
String response = httpClient.postJson2(thrSystemDetailService.getUrl(Constants.URL_NAME_PI_QUERY_URL), yxProductRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
}
@ -119,7 +119,7 @@ public class YxzyyClient extends CommonHttpClient {
public BaseResponse getOrderTypes(UdiwmsBusTypeRequest udiwmsBusTypeRequest) {
YxBusTypeRequest yxBusTypeRequest = new YxBusTypeRequest();
BeanUtil.copyProperties(udiwmsBusTypeRequest, yxBusTypeRequest);
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_BUS_TYPE_QUERY_URL), yxBusTypeRequest);
String response = httpClient.postJson2(thrSystemDetailService.getUrl(Constants.URL_NAME_BUS_TYPE_QUERY_URL), yxBusTypeRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
}
@ -132,7 +132,7 @@ public class YxzyyClient extends CommonHttpClient {
//查询绑定的第三方单据类型
String thirdAction = thrBustypeOriginDao.findThirdActionByBillType(udiwmsOrderQueryRequest.getBillType(), DictUtl.CURRENT_HOSP_CODE);
udiwmsOrderQueryRequest.setBillType(thirdAction);
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_ORDER_QUERY_URL), udiwmsOrderQueryRequest);
String response = httpClient.postJson2(thrSystemDetailService.getUrl(Constants.URL_NAME_ORDER_QUERY_URL), udiwmsOrderQueryRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
return baseResponse;
}

@ -82,6 +82,28 @@ public class HttpClient {
return response;
}
public String postJson2(String url, Object object) {
//请求时间
Date date = new Date();
//转json字符串时将空属性转换为空字符串
String json = JSONObject.toJSONString(object);
log.info(url + "\n" + json);
String response = "";
Integer status;
try {
response = okHttpCli.doPostJson(url, json, getHeaderArray());
status = ConstantType.LOG_STATUS_SUCCESS;
} catch (Exception e) {
response = JSONObject.toJSONString(ResultVOUtils.error(500, "网络错误,或远程服务器无法异常,无法连接!"));
status = ConstantType.LOG_STATUS_ERROR;
log.error("请求第三方系统接口异常,错误信息:{}", e);
}
long time = System.currentTimeMillis() - date.getTime();
erpLogService.addThirdErpLog(date, url, "postJson", json, response, time, status);
log.error("接口响应信息:" + response);
return response;
}
public String get(String url, Map<String, String> params) {
//请求时间
Date date = new Date();

Loading…
Cancel
Save