|
|
@ -105,7 +105,8 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
/** |
|
|
/** |
|
|
* 海安立库开关,仅用于分拣清单测试特例判断;接口真实外呼仍由HaiAnWcsApiServiceImpl统一控制 - rqrq |
|
|
* 海安立库开关,仅用于分拣清单测试特例判断;接口真实外呼仍由HaiAnWcsApiServiceImpl统一控制 - rqrq |
|
|
*/ |
|
|
*/ |
|
|
@Value("${interface.haianWarehouse:false}") |
|
|
|
|
|
|
|
|
// 默认按真实海安接口处理,只有配置显式为false时才允许联调固定数据,避免开关未注入时误走兜底 - rqrq |
|
|
|
|
|
@Value("${interface.haianWarehouse:true}") |
|
|
private boolean haianWarehouseEnabled; |
|
|
private boolean haianWarehouseEnabled; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
@ -342,6 +343,10 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
"areaCode=" + wcsAreaCode + ", status=" + HaiAnStationStaticData.GROUND_LOCATION_IDLE, |
|
|
"areaCode=" + wcsAreaCode + ", status=" + HaiAnStationStaticData.GROUND_LOCATION_IDLE, |
|
|
ex.getMessage() |
|
|
ex.getMessage() |
|
|
); |
|
|
); |
|
|
|
|
|
if (haianWarehouseEnabled) { |
|
|
|
|
|
// 真实接口模式禁止把网络或解析失败伪装成可用站点,直接向页面返回失败原因 - rqrq |
|
|
|
|
|
throw new RuntimeException("真实站点接口调用失败,禁止返回静态清单:" + ex.getMessage(), ex); |
|
|
|
|
|
} |
|
|
// 真实调用失败时回退静态数据,避免页面在联调期完全不可用 - rqrq |
|
|
// 真实调用失败时回退静态数据,避免页面在联调期完全不可用 - rqrq |
|
|
result.setMockMode(Boolean.TRUE); |
|
|
result.setMockMode(Boolean.TRUE); |
|
|
result.setRows(buildMockStationRows()); |
|
|
result.setRows(buildMockStationRows()); |
|
|
@ -450,6 +455,10 @@ public class HaiAnPdaAutoWarehouseServiceImpl implements HaiAnPdaAutoWarehouseSe |
|
|
return result; |
|
|
return result; |
|
|
} catch (Exception ex) { |
|
|
} catch (Exception ex) { |
|
|
// 接口层已写调用日志与错误日志;这里只回退空列表,避免 PDA 因外呼失败卡死 - rqrq |
|
|
// 接口层已写调用日志与错误日志;这里只回退空列表,避免 PDA 因外呼失败卡死 - rqrq |
|
|
|
|
|
if (haianWarehouseEnabled) { |
|
|
|
|
|
// 真实接口模式禁止把分拣接口失败伪装成正常空清单,直接中断扫码流程 - rqrq |
|
|
|
|
|
throw new RuntimeException("真实分拣清单接口调用失败,禁止返回空列表:" + ex.getMessage(), ex); |
|
|
|
|
|
} |
|
|
result.setMockMode(Boolean.TRUE); |
|
|
result.setMockMode(Boolean.TRUE); |
|
|
result.setMessage("查询分拣清单失败,已回退空列表: " + ex.getMessage()); |
|
|
result.setMessage("查询分拣清单失败,已回退空列表: " + ex.getMessage()); |
|
|
result.setRfidList(new ArrayList<String>()); |
|
|
result.setRfidList(new ArrayList<String>()); |
|
|
|