| | |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.zy.core.model.protocol.StationProtocol; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | |
| | | default void onApplyFailed(StoreInTaskContext context, AsyncInTaskResult result) { |
| | | context.getStationProtocol().setSystemWarning("请求入库失败,WMS返回=" + buildFailureMessage(result)); |
| | | String warning = "请求入库失败,WMS返回=" + buildFailureMessage(result); |
| | | context.getStationProtocol().setSystemWarning(warning); |
| | | syncWarningToBackStation(context, warning); |
| | | } |
| | | |
| | | default String buildFailureMessage(AsyncInTaskResult result) { |
| | |
| | | return result.getMessage(); |
| | | } |
| | | |
| | | default void syncWarningToBackStation(StoreInTaskContext context, String warning) { |
| | | if (context == null || context.getStationObjModel() == null || context.getStationThread() == null) { |
| | | return; |
| | | } |
| | | StationObjModel backStation = context.getStationObjModel().getBackStation(); |
| | | if (backStation == null || backStation.getStationId() == null) { |
| | | return; |
| | | } |
| | | if (backStation.getStationId().equals(context.getStationProtocol().getStationId())) { |
| | | return; |
| | | } |
| | | |
| | | List<StationProtocol> stations = context.getStationThread().getStatus(); |
| | | if (stations != null) { |
| | | for (StationProtocol station : stations) { |
| | | if (station != null && backStation.getStationId().equals(station.getStationId())) { |
| | | station.setSystemWarning(warning); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | java.util.Map<Integer, StationProtocol> stationMap = context.getStationThread().getStatusMap(); |
| | | if (stationMap == null) { |
| | | return; |
| | | } |
| | | StationProtocol backStationProtocol = stationMap.get(backStation.getStationId()); |
| | | if (backStationProtocol != null) { |
| | | backStationProtocol.setSystemWarning(warning); |
| | | } |
| | | } |
| | | |
| | | } |