| | |
| | | import com.zy.asrs.domain.enums.LedErrorAreaType; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.InboundTaskApplyParam; |
| | | import com.zy.asrs.mapper.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.*; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.MatDto; |
| | | import com.zy.common.model.SearchLocParam; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.CollectionUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.News; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.*; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.*; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.*; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.system.entity.license.LicenseVerify; |
| | |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 立体仓库WCS系统主流程业务 |
| | |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private BasDevpOptService basDevpOptService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | |
| | | private BasDevpPositionService basDevpPositionService; |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | @Autowired |
| | | private OpenService openService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("00000000".endsWith(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | |
| | | // 获取入库站信息 |
| | | // SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | String barcode = barcodeThread.getBarcode(); |
| | | |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("00000000".endsWith(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | |
| | | // 尺寸检测异常 |
| | |
| | | } |
| | | // 退回 |
| | | if (back) { |
| | | barcodeThread.setBarcode(""); |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(3); |
| | | |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,201); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // led 异常显示 |
| | | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | |
| | | |
| | | try { |
| | | |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setBarcode(barcode); |
| | | param.setIoType(1); |
| | | param.setSourceStaNo(inSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | // 替换为新的任务申请接口 |
| | | InboundTaskApplyParam applyParam = new InboundTaskApplyParam(); |
| | | applyParam.setBarcode(barcode); |
| | | applyParam.setStationCode(String.valueOf(inSta.getStaNo())); |
| | | applyParam.setStatus(1); // 1:满板 |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .setPath("/inboundTaskApply") |
| | | .setJson(JSON.toJSONString(applyParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | // 解析响应,只确认申请是否成功 |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | |
| | | // if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { |
| | | // staProtocol.setStaNo(607);//607 |
| | | // } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 |
| | | staProtocol.setStaNo(dto.getRgvSstaNo().shortValue()); |
| | | // } |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,283); |
| | | if (jsonObject != null && jsonObject.getInteger("code") != null && jsonObject.getInteger("code") == 200) { |
| | | log.info("入库任务申请成功,等待WMS下发任务。条码:{},站点:{}", barcode, inSta.getStaNo()); |
| | | staProtocol.setWorkNo(9998);//设置为9998等待上位机下发任务/9997是空板入库判断,待下发时也写入9998 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | // // 获取工作号 |
| | | int workNo = commonService.getWorkNo(3); |
| | | |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,201); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // led 异常显示 |
| | | LedErrorThreadUtil.ledErrorThread("入库请求失败"+jsonObject.getInteger("code"),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/inboundTaskApply", JSON.toJSONString(applyParam), response); |
| | | } |
| | | |
| | | // 原有逻辑注释掉 |
| | | // LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | // |
| | | // SearchLocParam param = new SearchLocParam(); |
| | | // param.setBarcode(barcode); |
| | | // param.setIoType(1); |
| | | // param.setSourceStaNo(inSta.getStaNo()); |
| | | // param.setLocType1(locTypeDto.getLocType1()); |
| | | // String response = new HttpHandler.Builder() |
| | | // .setUri(wmsUrl) |
| | | // .setPath("/rpc/pakin/loc/v1") |
| | | // .setJson(JSON.toJSONString(param)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | // StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | // |
| | | // barcodeThread.setBarcode(""); |
| | | // staProtocol.setWorkNo(dto.getWorkNo()); |
| | | // staProtocol.setStaNo(wrkMast.getStaNoSou$().shortValue()); |
| | | // |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false,283); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // if (!result) { |
| | | // LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | // } else { |
| | | // // 获取工作号 |
| | | // int workNo = commonService.getWorkNo(3); |
| | | // |
| | | // staProtocol.setWorkNo(workNo); |
| | | // staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | // |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false,201); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // // led 异常显示 |
| | | // LedErrorThreadUtil.ledErrorThread("入库请求失败"+jsonObject.getInteger("code"),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 9000 && staProtocol.getWorkNo() <= 9999) || staProtocol.getWorkNo()==0) && staProtocol.isPakMk()) { |
| | | && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 9000 && staProtocol.getWorkNo() <= 9997) || staProtocol.getWorkNo()==0) && staProtocol.isPakMk()) { |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |
| | | |
| | | SearchLocParam param = new SearchLocParam(); |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | InboundTaskApplyParam applyParam = new InboundTaskApplyParam(); |
| | | applyParam.setBarcode(null); |
| | | applyParam.setStationCode(String.valueOf(emptyInSta.getStaNo())); |
| | | applyParam.setStatus(0); // 1:满板 |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .setPath("/inboundTaskApply") |
| | | .setJson(JSON.toJSONString(applyParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | // 更新站点信息 且 下发plc命令 |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol.setStaNo(dto.getStaNoSou$(dto.getStaNo(),staProtocol.getSiteId()).shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,4087); |
| | | // 解析响应,只确认申请是否成功 |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject != null && jsonObject.getInteger("code") != null && jsonObject.getInteger("code") == 200) { |
| | | log.info("入库任务申请成功,等待WMS下发任务,站点:{}",emptyInSta.getStaNo()); |
| | | staProtocol.setWorkNo(9998);//设置为9998等待上位机下发任务 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+emptyInSta.getStaNo(),emptyInSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/inboundTaskApply", JSON.toJSONString(applyParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | if (wrkMastMapper.updateById(wrkMast) != 0) { |
| | | // 复位堆垛机 |
| | | crnThread.setResetFlag(true); |
| | | if(wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107) { //拣料出库任务状态上报,其他上报在wms任务完成定时任务中 |
| | | openService.reportTaskStatus(String.valueOf(wrkMast.getWrkNo()),3,1,wrkMast.getBarcode()); |
| | | } |
| | | |
| | | } else { |
| | | log.error("更新工作档的工作状态为14失败!!! [工作号:{}]", wrkMast.getWrkNo()); |
| | | } |
| | |
| | | log.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | if (waitWrkMast.getWrkSts() == 11) { |
| | | if (waitWrkMast.getIoPri() + 100000D < 999999999D) { |
| | | waitWrkMast.setIoPri(waitWrkMast.getIoPri()+100000D); |
| | | if (waitWrkMast.getIoPri() + 10D < 9999D) { |
| | | waitWrkMast.setIoPri(waitWrkMast.getIoPri()+10D); |
| | | } else { |
| | | waitWrkMast.setIoPri(999999999D); |
| | | waitWrkMast.setIoPri(9999D); |
| | | } |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 出库 ===>> 工作档信息写入led显示器 |
| | | */ |
| | | public synchronized void ledExecute() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | // 工作档集合 |
| | | List<WrkMast> wrkMasts = new ArrayList<>(); |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (null == staProtocol || null == staProtocol.getWorkNo() || 0 == staProtocol.getWorkNo() || !staProtocol.isLoading()) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 获取工作档数据 |
| | | WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo()); |
| | | if (null == wrkMast) { |
| | | if(staProtocol.getWorkNo() > 9999){ //异常退出 |
| | | String err = basDevpOptService.getErr(staProtocol.getWorkNo()); |
| | | MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, err)); |
| | | } |
| | | continue; |
| | | } |
| | | wrkMasts.add(wrkMast); |
| | | // 组装命令 |
| | | LedCommand ledCommand = new LedCommand(); |
| | | ledCommand.setWorkNo(wrkMast.getWrkNo()); |
| | | ledCommand.setIoType(wrkMast.getIoType()); |
| | | // 出库模式 |
| | | switch (wrkMast.getIoType()) { |
| | | case 1: |
| | | ledCommand.setTitle("全板入库"); |
| | | break; |
| | | case 10: |
| | | ledCommand.setTitle("空板入库"); |
| | | break; |
| | | case 12: |
| | | ledCommand.setTitle("物料衔接"); |
| | | break; |
| | | case 57: |
| | | ledCommand.setTitle("盘点再入库"); |
| | | break; |
| | | case 53: |
| | | ledCommand.setTitle("拣料再入库"); |
| | | break; |
| | | case 101: |
| | | ledCommand.setTitle("全板出库"); |
| | | break; |
| | | case 103: |
| | | ledCommand.setTitle("拣料出库"); |
| | | break; |
| | | case 104: |
| | | ledCommand.setTitle("并板出库"); |
| | | break; |
| | | case 107: |
| | | ledCommand.setTitle("盘点出库"); |
| | | break; |
| | | case 110: |
| | | ledCommand.setTitle("空板出库"); |
| | | ledCommand.setEmptyMk(true); |
| | | break; |
| | | default: |
| | | News.error("任务入出库类型错误!!![工作号:{}] [入出库类型:{}]", wrkMast.getWrkNo(), wrkMast.getIoType()); |
| | | break; |
| | | } |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(wrkMast.getBarcode()); |
| | | if(wrkMast.getIoType() == 12){ |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByBarcode(wrkMast.getBarcode()); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | Double total = 0.0; |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | LocDetl locDetl = locDetlService.selectOne(wrapper.eq("zpallet", wrkDetl.getZpallet()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | total = wrkDetl.getAnfme(); |
| | | } else { |
| | | total = locDetl.getAnfme(); |
| | | } |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getOrderNo(), wrkDetl.getSupp(), wrkDetl.getSku(),wrkDetl.getAnfme(),total)); |
| | | }); |
| | | } |
| | | if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | | |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | Double total = 0.0; |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | LocDetl locDetl = locDetlService.selectOne(wrapper.eq("zpallet", wrkDetl.getZpallet()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (Cools.isEmpty(locDetl)) { |
| | | total = wrkDetl.getAnfme(); |
| | | } else { |
| | | total = locDetl.getAnfme(); |
| | | } |
| | | if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 1) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getOrderNo(), wrkDetl.getSupp(), wrkDetl.getSku(),wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 103 && (null == wrkDetl.getInspect() || 0 == wrkDetl.getInspect())) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getOrderNo(), wrkDetl.getSupp(), wrkDetl.getSku(),wrkDetl.getAnfme(),total)); |
| | | } |
| | | if (wrkMast.getIoType() == 107) { |
| | | ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getOrderNo(), wrkDetl.getSupp(), wrkDetl.getSku(),wrkDetl.getAnfme(),total)); |
| | | } |
| | | }); |
| | | } |
| | | commands.add(ledCommand); |
| | | } |
| | | Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet()); |
| | | // 获取LED线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); |
| | | // 相同工作号集合则过滤 |
| | | if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { |
| | | continue; |
| | | } |
| | | // 命令下发 ------------------------------------------------------------------------------- |
| | | if (!commands.isEmpty()) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | News.error("{}号LED显示内容命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | try { |
| | | // 修改主档led标记 |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | wrkMast.setOveMk("Y"); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | throw new CoolException("更新工作档失败"); |
| | | } |
| | | } |
| | | |
| | | // 更新线程当前工作号集合 |
| | | ledThread.setWorkNos(workNos); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 其他 ===>> LED显示器复位,显示默认信息 |
| | | */ |
| | | public synchronized void ledReset() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | | boolean reset = true; |
| | | for (Integer staNo : led.getStaArr()) { |
| | | // System.out.println("staArr = " + staNo); |
| | | |
| | | // 获取叉车站点 |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | if (staProtocol == null) { continue; } |
| | | if (staProtocol.getWorkNo() != 0 || staProtocol.isErr()) { |
| | | reset = false; |
| | | break; |
| | | } |
| | | } |
| | | // 获取led线程 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId()); |
| | | // led显示默认内容 |
| | | if (reset) { |
| | | if (ledThread == null) { |
| | | continue; |
| | | } |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { |
| | | News.error("{}号LED显示默认命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | } |
| | | // if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) { |
| | | // News.error("{}号LED显示默认命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 堆垛机5分钟无任务则回到源点 |
| | | */ |
| | |
| | | if (!WrkMastLogList.isEmpty()) { |
| | | boolean signT = false; |
| | | for (WrkMast wrkMast : WrkMastLogList){ |
| | | Date completeTime = wrkMast.getIoTime(); |
| | | Date completeTime = wrkMast.getModiTime(); |
| | | if (completeTime==null){ |
| | | continue; |
| | | } |