|
|
|
@ -6,6 +6,7 @@ import com.gaotao.common.utils.HttpUtils; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnCallPalletRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnCheckInventoryExistsRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnDirectMaterialCallRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnGroundLocationQueryRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnGroundLocationStatusUpdateRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnOutsideTransferTaskRequest; |
|
|
|
import com.gaotao.modules.autoWareHourceHaian.api.entity.HaiAnSpecialPalletTask; |
|
|
|
@ -119,6 +120,7 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
private static final String WOT_ACTION_TYPE_PALLET_OUT = "栈板出库"; |
|
|
|
private static final Integer GROUND_LOCATION_STATUS_TYPE_BIND = 1; |
|
|
|
private static final Integer GROUND_LOCATION_STATUS_TYPE_REMOVE = 2; |
|
|
|
private static final String GROUND_LOCATION_IDLE = "IDLE"; |
|
|
|
// 入库口1固定站点号(留空待业务确认后手工填写)- rqrq |
|
|
|
private static final String INBOUND_PORT_1_STATION_CODE = "入库口1"; |
|
|
|
// 入库口2固定站点号(留空待业务确认后手工填写)- rqrq |
|
|
|
@ -310,15 +312,13 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
result.setRows(rows); |
|
|
|
result.setMsg("OK"); |
|
|
|
|
|
|
|
// TODO 外部真实接口路径待联调确认,此处先按约定结构解析并保留容错回退 - rqrq |
|
|
|
String requestBody = "\"" + wcsAreaCode + "\""; |
|
|
|
String requestUrl = (haianWcsUrl == null ? "" : haianWcsUrl) + "query-location-list"; |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
String response = null; |
|
|
|
String logStatus = "SUCCESS"; |
|
|
|
String logErrorMessage = null; |
|
|
|
// 区域站点清单统一走getGroundLocationList:第一个参数传wcs_area_code,第二个状态参数固定IDLE - rqrq |
|
|
|
HaiAnGroundLocationQueryRequest queryRequest = new HaiAnGroundLocationQueryRequest(); |
|
|
|
queryRequest.setAreaCode(wcsAreaCode); |
|
|
|
queryRequest.setStatus(GROUND_LOCATION_IDLE); |
|
|
|
|
|
|
|
try { |
|
|
|
response = HttpUtils.doPost(requestUrl, requestBody, null); |
|
|
|
String response = haiAnWcsApiService.getGroundLocationList(queryRequest); |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
JsonNode rootNode = mapper.readTree(response); |
|
|
|
int resCode = rootNode.path("resCode").asInt(); |
|
|
|
@ -334,6 +334,10 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
if (!StringUtils.hasText(locationCode)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
// 双保险:即使下级系统未严格按status过滤返回,也只透出空闲点位给当前海安PDA流程 - rqrq |
|
|
|
if (!GROUND_LOCATION_IDLE.equalsIgnoreCase(status)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
HaiAnStationRow row = new HaiAnStationRow(); |
|
|
|
row.setStationId(locationCode); |
|
|
|
row.setStationCode(locationCode); |
|
|
|
@ -346,17 +350,15 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
result.setRows(rows); |
|
|
|
return result; |
|
|
|
} catch (Exception ex) { |
|
|
|
logStatus = "ERROR"; |
|
|
|
logErrorMessage = ex.getMessage(); |
|
|
|
// 海安接口失败同步落sys_error_log,保留请求参数和异常信息便于排查 - rqrq |
|
|
|
haiAnSysErrorLogService.haiAnLogInterface( |
|
|
|
site, |
|
|
|
"海安立库", |
|
|
|
"查询站点清单", |
|
|
|
"WCS", |
|
|
|
"query-location-list", |
|
|
|
"query-ground-location-list", |
|
|
|
wcsAreaCode, |
|
|
|
requestBody, |
|
|
|
"areaCode=" + wcsAreaCode + ", status=" + GROUND_LOCATION_IDLE, |
|
|
|
ex.getMessage() |
|
|
|
); |
|
|
|
// 真实调用失败时回退静态数据,避免页面在联调期完全不可用 - rqrq |
|
|
|
@ -364,21 +366,6 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
|
result.setRows(buildMockStationRows()); |
|
|
|
result.setMsg("真实站点接口调用失败,已回退静态清单: " + ex.getMessage()); |
|
|
|
return result; |
|
|
|
} finally { |
|
|
|
long executionTime = System.currentTimeMillis() - startTime; |
|
|
|
// 海安接口调用日志统一写入haian_interface_call_log,失败也记录 - rqrq |
|
|
|
haiAnInterfaceCallLogService.haiAnLogCompleteCall( |
|
|
|
"WCS", |
|
|
|
"query-location-list", |
|
|
|
requestBody, |
|
|
|
response, |
|
|
|
logStatus, |
|
|
|
logErrorMessage, |
|
|
|
executionTime, |
|
|
|
site, |
|
|
|
wcsAreaCode, |
|
|
|
"海安区域站点清单查询" |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|