| | |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | // led 入库信息显示 |
| | | if (ledThread != null) { |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(dto.getWorkNo()); |
| | | ledCommand.setIoType(1); |
| | | ledCommand.setTitle("全板入库"); |
| | | ledCommand.setLocNo(dto.getLocNo()); |
| | | ledCommand.setStaNo(dto.getStaNo()); |
| | | commands.add(ledCommand); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); |
| | | // ledThread.errorReset(); |
| | | } |
| | | // // led 入库信息显示 |
| | | // if (ledThread != null) { |
| | | // // 命令集合 |
| | | // List<LedCommand> commands = new ArrayList<>(); |
| | | // // 组装命令 |
| | | // LedCommand ledCommand = new LedCommand(); |
| | | // ledCommand.setWorkNo(dto.getWorkNo()); |
| | | // ledCommand.setIoType(1); |
| | | // ledCommand.setTitle("全板入库"); |
| | | // ledCommand.setLocNo(dto.getLocNo()); |
| | | // ledCommand.setStaNo(dto.getStaNo()); |
| | | // commands.add(ledCommand); |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); |
| | | //// ledThread.errorReset(); |
| | | // } |
| | | } else { |
| | | News.error(""+mark+" - 5"+" - 请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // staProtocol.setWorkNo((short)9992); |
| | |
| | | } |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | && staProtocol.getWorkNo() == 0) { |
| | | |
| | | //根据参数判断是否校验可出信号 |
| | | String crnOutVerifyOut = "Y"; |
| | | Config crnOutVerifyOutEnableConfig = configService.selectOne(new EntityWrapper<Config>() |
| | | .eq("code", "crnOutVerifyOutEnable")); |
| | | if(crnOutVerifyOutEnableConfig != null) { |
| | | crnOutVerifyOut = crnOutVerifyOutEnableConfig.getValue(); |
| | | } |
| | | |
| | | if (crnOutVerifyOut.equals("Y")) { |
| | | if (!staProtocol.isOutEnable()) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | // 堆垛机控制过滤 |
| | |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setLocNo(wrkMast.getLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(wrkMast.getBarcode()); |
| | | // ledCommand.setSourceStaNo(wrkMast.getSourceStaNo()); |
| | | if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | |
| | | // }catch (Exception e){ |
| | | // log.error("工作档案明细输入电视机失败1:异常信息==》"+e); |
| | | // } |
| | | wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(),wrkDetl.getWeight(),wrkDetl.getSpecs(),wrkDetl.getSku()))); |
| | | wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto( |
| | | wrkDetl.getMatnr() |
| | | , wrkDetl.getMaktx() |
| | | , wrkDetl.getAnfme() |
| | | , wrkDetl.getWeight() |
| | | , wrkDetl.getStockNum() |
| | | , wrkDetl.getStockNum2() |
| | | , wrkDetl.getSpecs() |
| | | , wrkDetl.getSku() |
| | | , wrkDetl.getZpallet() |
| | | , wrkDetl.getModel() |
| | | , wrkDetl.getSupp() |
| | | , wrkDetl.getKpCstmrName() |
| | | , wrkDetl.getOrderNo() |
| | | ))); |
| | | } |
| | | commands.add(ledCommand); |
| | | } |