| | |
| | | |
| | | import com.zy.asrs.entity.dto.TvDataDto; |
| | | import com.zy.asrs.entity.dto.TvLocDataDto; |
| | | import com.zy.asrs.entity.dto.WcsCrnDto; |
| | | import com.zy.asrs.entity.dto.WcsStationDto; |
| | | import com.zy.asrs.enums.RedisKeyType; |
| | | import com.zy.asrs.service.BasStationTvService; |
| | | import com.zy.asrs.service.TvDeviceService; |
| | | import com.zy.asrs.utils.CrnUtils; |
| | | import com.zy.asrs.utils.StationUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.RedisUtil; |
| | |
| | | private BasStationTvService basStationTvService; |
| | | @Autowired |
| | | private StationUtils stationUtils; |
| | | @Autowired |
| | | private CrnUtils crnUtils; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | |
| | | continue; |
| | | } |
| | | |
| | | if(Cools.isEmpty(wcsStationDto.getTaskNo())||wcsStationDto.getTaskNo().equals("0")) { |
| | | continue; |
| | | } |
| | | |
| | | if (Cools.isEmpty(wcsStationDto.getWrkDetls())) { |
| | | continue; |
| | | } |
| | | |
| | | String errorMsg = ""; |
| | | if (!Cools.isEmpty(wcsStationDto.getErrorMsg())) { |
| | | errorMsg += wcsStationDto.getErrorMsg(); |
| | |
| | | tvDataDto.setBarcode(wcsStationDto.getBarcode()); |
| | | tvDataDto.setErrorMsg(errorMsg); |
| | | tvDataDto.setIoType(wcsStationDto.getIoType()); |
| | | tvDataDto.setOrderNo(wcsStationDto.getOrderNo()); |
| | | tvDataDto.setWrkDetls(wcsStationDto.getWrkDetls()); |
| | | |
| | | if (Cools.isEmpty(errorMsg)) { |
| | |
| | | |
| | | |
| | | map.put("data", list); |
| | | System.out.println(map); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | |
| | | errors.add(deviceError); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<WcsCrnDto> crnList = new ArrayList<>(crnUtils.crnMap.values()); |
| | | crnList.sort(Comparator.comparing(WcsCrnDto::getCrnNo, Comparator.nullsLast(Integer::compareTo))); |
| | | for (WcsCrnDto wcsCrnDto : crnList) { |
| | | if (wcsCrnDto == null || wcsCrnDto.getCrnNo() == null) { |
| | | continue; |
| | | } |
| | | if (wcsCrnDto.getOnline() == null || wcsCrnDto.getOnline() != 1) { |
| | | errors.add("堆垛机#" + wcsCrnDto.getCrnNo() + "离线"); |
| | | continue; |
| | | } |
| | | if (wcsCrnDto.getAlarm() != null && wcsCrnDto.getAlarm() != 0) { |
| | | errors.add("堆垛机#" + wcsCrnDto.getCrnNo() + "报警,报警码:" + wcsCrnDto.getAlarm()); |
| | | } |
| | | if (wcsCrnDto.getMode() == null || wcsCrnDto.getMode() != 3) { |
| | | String modeDesc = Cools.isEmpty(wcsCrnDto.getModeDesc()) ? "未知" : wcsCrnDto.getModeDesc(); |
| | | errors.add("堆垛机#" + wcsCrnDto.getCrnNo() + "非自动模式,当前模式:" + modeDesc); |
| | | } |
| | | } |
| | | |
| | |
| | | if(o == null){ |
| | | return R.error(); |
| | | } |
| | | |
| | | return R.ok().add(JSON.parseObject(o.toString())); |
| | | } |
| | | |