|
|
@ -1,6 +1,7 @@ |
|
|
package com.gaotao.modules.api.service.impl; |
|
|
package com.gaotao.modules.api.service.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
import com.gaotao.common.utils.HttpUtils; |
|
|
import com.gaotao.common.utils.HttpUtils; |
|
|
import com.gaotao.modules.api.entity.RfidTunnelOrderRequest; |
|
|
import com.gaotao.modules.api.entity.RfidTunnelOrderRequest; |
|
|
@ -58,19 +59,17 @@ public class RfidMachineApiServiceImpl implements RfidMachineApiService { |
|
|
String jsonBody = objectMapper.writeValueAsString(request); |
|
|
String jsonBody = objectMapper.writeValueAsString(request); |
|
|
String responseStr = HttpUtils.doPost(url, jsonBody, null); |
|
|
String responseStr = HttpUtils.doPost(url, jsonBody, null); |
|
|
|
|
|
|
|
|
// 解析响应 - rqrq |
|
|
|
|
|
RfidTunnelOrderResponse response = objectMapper.readValue(responseStr, RfidTunnelOrderResponse.class); |
|
|
|
|
|
|
|
|
|
|
|
// 判断响应结果 - rqrq |
|
|
|
|
|
if (!"200".equals(response.getResCode())) { |
|
|
|
|
|
throw new RuntimeException("RFID通道机返回失败,错误码:" + response.getResCode() |
|
|
|
|
|
+ ",错误信息:" + response.getResMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
|
|
JsonNode jsonNode = mapper.readTree(responseStr); |
|
|
|
|
|
|
|
|
// 更新接口日志为成功 - rqrq |
|
|
|
|
|
|
|
|
int code = jsonNode.get("resCode").asInt(); |
|
|
|
|
|
String msg = jsonNode.get("resMsg").asText(); |
|
|
|
|
|
if(code!=200){ |
|
|
|
|
|
throw new RuntimeException("调用WCS接口失败,错误码:"+code+",错误信息:"+msg); |
|
|
|
|
|
} |
|
|
if (logId != null) { |
|
|
if (logId != null) { |
|
|
interfaceCallLogService.updateCallResult(logId, responseStr, "Success", |
|
|
|
|
|
response.getResMsg(), null); |
|
|
|
|
|
|
|
|
interfaceCallLogService.updateCallResult(logId, null, "Success", msg, null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log.info("推送订单信息到RFID通道机完成 - rqrq,托盘条码={}", request.getPalletBarcode()); |
|
|
log.info("推送订单信息到RFID通道机完成 - rqrq,托盘条码={}", request.getPalletBarcode()); |
|
|
|