| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.ShuttleProtocolStatusType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.ShuttleSlave; |
| | |
| | | continue; |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if (Cools.isEmpty(shuttleProtocol.getErrorCode())) { |
| | | continue; |
| | | } |
| | | int i = Integer.parseInt(shuttleProtocol.getErrorCode()); |
| | | if (i > 0) { |
| | | BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(i); |
| | | if (!Cools.isEmpty(shuttleProtocol.getErrorCode()) && Integer.parseInt(shuttleProtocol.getErrorCode()) > 0 && !Cools.isEmpty(shuttleProtocol.getErrorCode())) { |
| | | BasShuttleErr basShuttleErr = basShuttleErrService.queryByCode(Integer.parseInt(shuttleProtocol.getErrorCode())); |
| | | String errName = basShuttleErr == null ? "未知异常" : basShuttleErr.getErrName(); |
| | | //故障中 |
| | | map.put("deviceNo", shuttleProtocol.getShuttleNo());//设备号-小车号 |
| | | map.put("errorMsg", errName);//异常信息 |
| | | map.put("device", "四向车");//异常信息 |
| | | list.add(map); |
| | | } else if (shuttleProtocol.getMode() != 1) { |
| | | map.put("deviceNo", shuttleProtocol.getShuttleNo());//设备号-小车号 |
| | | map.put("errorMsg", shuttleProtocol.getMode$());//异常信息 |
| | | map.put("device", "四向车");//异常信息 |
| | | list.add(map); |
| | | } else if (shuttleProtocol.getProtocolStatusType() != ShuttleProtocolStatusType.IDLE) { |
| | | map.put("deviceNo", shuttleProtocol.getShuttleNo());//设备号-小车号 |
| | | map.put("errorMsg", shuttleProtocol.getProtocolStatus$());//异常信息 |
| | | map.put("device", "四向车");//异常信息 |
| | | list.add(map); |
| | | } |
| | | } |
| | | return R.ok().add(list); |