| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.LedErrorAreaType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.*; |
| | |
| | | public class MainServiceImpl { |
| | | |
| | | public static final long COMMAND_TIMEOUT = 5 * 1000; |
| | | // private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}}; |
| | | |
| | | // private static final Integer jarMaxLoc1 = 7; |
| | | private static Integer jarMaxLoc = 0; |
| | | private static final Float jarTemperature = 50F; |
| | | @Autowired |
| | |
| | | // 退回 |
| | | if (back) { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,238); |
| | | 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站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | 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 { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = "异常:"; |
| | | String errMsg = inSta.getStaNo()+"站点:"; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = errMsg+"前超限;"; |
| | | back = true; |
| | |
| | | // 退回 |
| | | if (back) { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,422); |
| | | 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站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,467); |
| | | 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 if (jsonObject.getInteger("code").equals(700)){ |
| | |
| | | } |
| | | } else { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库请求失败"+jsonObject.getInteger("code")); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = "异常:"; |
| | | String errMsg = inSta.getStaNo()+"站点:"; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = errMsg+"前超限;"; |
| | | back = true; |
| | |
| | | // 退回 |
| | | if (back) { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | // if (!result) { |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | String msg =inSta.getStaNo()+"站点条码异常,条码="+barcode; |
| | | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | if (wrkMast111 != null) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast111.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast111.getStaNo()); |
| | | StaProtocol staProtocol1 = new StaProtocol(); |
| | | staProtocol1.setSiteId(staProtocol.getSiteId()); |
| | | staProtocol1.setWorkNo(wrkMast111.getWrkNo()); |
| | | staProtocol1.setStaNo(wrkMast111.getStaNo()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,637); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | devpThread.setPakMk(staProtocol1.getSiteId(), false,637); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); |
| | | if (!result) { |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | String msg ="工作档中已存在"+inSta.getStaNo()+"站点数据,工作号="+wrkMast.getWrkNo(); |
| | | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(),LedErrorAreaType.TWO_PAKIN.getDesc()); |
| | | continue; |
| | | } |
| | | // // 获取入库通知档 |
| | |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | StaProtocol staProtocol1 = new StaProtocol(); |
| | | staProtocol1.setSiteId(staProtocol.getSiteId()); |
| | | |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol1.setWorkNo(dto.getWorkNo()); |
| | | |
| | | if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { |
| | | staProtocol.setStaNo(dto.getStaNo()); |
| | | staProtocol1.setStaNo(dto.getStaNo()); |
| | | } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 |
| | | staProtocol.setStaNo(dto.getRgvSstaNo()); |
| | | staProtocol1.setStaNo(dto.getRgvSstaNo()); |
| | | } |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,695); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | devpThread.setPakMk(staProtocol1.getSiteId(), false,695); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(),LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | try{ |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } catch (Exception e){ |
| | | log.error("入库成功!电视机信息更新失败,小料箱入库!!!request:{};response:{}",JSON.toJSONString(param), response); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/pair/station/single/loc/v1", JSON.toJSONString(param), response); |
| | | String msg = inSta.getStaNo()+"站点:"+jsonObject.getString("msg"); |
| | | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(), LedErrorAreaType.TWO_PAKIN.getDesc()); |
| | | Thread.sleep(1000); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = "异常:"; |
| | | String errMsg = inSta.getStaNo()+"站点:"; |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = errMsg+"前超限;"; |
| | | back = true; |
| | |
| | | // 退回 |
| | | if (back) { |
| | | // led 异常显示 |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg(errMsg); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread(errMsg,inSta.getLed(), LedErrorAreaType.FOUR_BARCODE.getDesc()); |
| | | continue; |
| | | } |
| | | |
| | |
| | | if (wrkMast != null) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo()); |
| | | StaProtocol staProtocol1 = new StaProtocol(); |
| | | staProtocol1.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol1.setStaNo(wrkMast.getStaNo()); |
| | | staProtocol1.setSiteId(staProtocol.getSiteId()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,843); |
| | | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol.getSiteId(),staProtocol.getWorkNo(),barcode); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | devpThread.setPakMk(staProtocol1.getSiteId(), false,843); |
| | | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol1.getSiteId(),staProtocol1.getWorkNo(),barcode); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); |
| | | if (!result) { |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("更新plc站点信息失败!站点好:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | StaProtocol staProtocol1 = new StaProtocol(); |
| | | staProtocol1.setSiteId(staProtocol.getSiteId()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(dto.getWorkNo()); |
| | | staProtocol1.setWorkNo(dto.getWorkNo()); |
| | | |
| | | if(Cools.isEmpty(dto.getRgvNo()) || dto.getRgvNo() <= 0) { |
| | | staProtocol.setStaNo(dto.getStaNo()); |
| | | staProtocol1.setStaNo(dto.getStaNo()); |
| | | } else {//如果存在RGV编号,说明需要RGV接驳,先下发任务到RGV源站 |
| | | staProtocol.setStaNo(dto.getRgvSstaNo()); |
| | | staProtocol1.setStaNo(dto.getRgvSstaNo()); |
| | | } |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,892); |
| | | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol.getStaNo(),staProtocol.getWorkNo(),barcode); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | devpThread.setPakMk(staProtocol1.getSiteId(), false,892); |
| | | log.info("锁定标记flase===》N===》站点号:{},工作号:{},条码:{}",staProtocol1.getStaNo(),staProtocol1.getWorkNo(),barcode); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol1)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (jsonObject.getInteger("code").equals(700)){ |
| | | SearchLocParam param2 = new SearchLocParam(); |
| | | param2.setBarcode(barcode); |
| | | param2.setSourceStaNo(inSta.getStaNo()); |
| | | param2.setLocType1(locTypeDto.getLocType1()); |
| | | String response2 = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/yx/loc/v33") |
| | | .setJson(JSON.toJSONString(param2)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | if (jsonObject2.getInteger("code").equals(200)) { |
| | | log.info("大料箱自动组托成功!!"); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | try{ |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("入库成功!电视机信息更新失败,大料箱入库!!!request:{};response:{}",JSON.toJSONString(param), response); |
| | | } |
| | | |
| | | // } else if (jsonObject.getInteger("code").equals(700)){ |
| | | // SearchLocParam param2 = new SearchLocParam(); |
| | | // param2.setBarcode(barcode); |
| | | // param2.setSourceStaNo(inSta.getStaNo()); |
| | | // param2.setLocType1(locTypeDto.getLocType1()); |
| | | // String response2 = new HttpHandler.Builder() |
| | | // .setUri(wmsUrl) |
| | | // .setPath("/rpc/pakin/yx/loc/v33") |
| | | // .setJson(JSON.toJSONString(param2)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | // if (jsonObject2.getInteger("code").equals(200)) { |
| | | // log.info("大料箱自动组托成功!!"); |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // |
| | | // LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | // |
| | | // if (ledThread != null) { |
| | | // ErrMsg errMsg1 = new ErrMsg(); |
| | | // errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | // errMsg1.setArea("1"); |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | // } |
| | | // } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | ErrMsg errMsg1 = new ErrMsg(); |
| | | errMsg1.setErrMsg("入库失败!站点号:"+inSta.getStaNo()); |
| | | errMsg1.setArea("1"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errMsg1)); |
| | | } |
| | | String msg = inSta.getStaNo()+"站点:"+jsonObject.getString("msg"); |
| | | LedErrorThreadUtil.ledErrorThread(msg,inSta.getLed(),LedErrorAreaType.TWO_PAKIN.getDesc()); |
| | | Thread.sleep(1000); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | |
| | | |
| | | String barcode = wrkMast.getBarcode(); |
| | | if(!Cools.isEmpty(barcode)) { |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { |
| | | if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || "empty".equals(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // 此标记避免多次执行移库任务 |
| | | if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | // boolean moveLocForDeepLoc = moveLocForDeepLoc(slave, shallowLoc); |
| | | // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | } |
| | | continue; |
| | | } else if (shallowLoc.getLocSts().equals("Q")) { |
| | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // 此标记避免多次执行移库任务 |
| | | if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); |
| | | } |
| | |
| | | log.error("入库 ===>> 堆垛机站点在数据库不存在, 站点编号={}", crnStn.getStaNoOther()); |
| | | continue; |
| | | } |
| | | boolean signStanOther81 = false; |
| | | if (staProtocolOther.getWorkNo()!=0){ |
| | | WrkMast wrkMastOther = wrkMastMapper.selectPakInStep3(staProtocolOther.getWorkNo()); |
| | | if (Cools.isEmpty(wrkMastOther)){ |
| | |
| | | return; |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | return; |
| | | signStanOther81 = true; |
| | | crnStation=2; |
| | | } |
| | | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); |
| | | if (staProtocolOther1 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther1 = staProtocolOther1.clone(); |
| | | } |
| | | if (!signStanOther81){ |
| | | StaProtocol staProtocolOther1 = devpThread.getStation().get(crnStn.getStaNoOther1()); |
| | | if (staProtocolOther1 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther1 = staProtocolOther1.clone(); |
| | | } |
| | | |
| | | if (staProtocolOther1.isAutoing() && staProtocolOther1.getWorkNo()!=0){ |
| | | return; |
| | | } |
| | | if (staProtocolOther1.isLoading() || !staProtocolOther1.getWorkNo().equals(0)){ |
| | | return; |
| | | } |
| | | |
| | | |
| | | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); |
| | | if (staProtocolOther2 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther2 = staProtocolOther2.clone(); |
| | | } |
| | | if (staProtocolOther2.isAutoing() && staProtocolOther2.getWorkNo()!=0){ |
| | | return; |
| | | StaProtocol staProtocolOther2 = devpThread.getStation().get(crnStn.getStaNoOther2()); |
| | | if (staProtocolOther2 == null) { |
| | | continue; |
| | | } else { |
| | | staProtocolOther2 = staProtocolOther2.clone(); |
| | | } |
| | | if (staProtocolOther2.isLoading() || !staProtocolOther2.getWorkNo().equals(0)){ |
| | | return; |
| | | } |
| | | } |
| | | crnStation = 2; |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // 此标记避免多次执行移库任务 |
| | | if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | // 生成工作档、改变浅库位的源库/目标库 库位状态、下发堆垛机命令(立马执行) |
| | | // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); |
| | | } |
| | |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk()) |
| | | // || Cools.isEmpty(waitWrkMast)) { |
| | | if (Cools.isEmpty(waitWrkMast)) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk()) |
| | | // || Cools.isEmpty(waitWrkMast)) { |
| | | if (Cools.isEmpty(waitWrkMast)) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | try{ |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } catch (Exception e){ |
| | | log.error("{}任务出库失败,浅库位堵塞!异常", wrkMast.getWrkNo(), e); |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | | } |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | | // if (wrkMast.getStaNoSign().equals(signBigTurn)){ |
| | | // continue; |
| | | // } |
| | | |
| | | |
| | | crnStation = crnStation1; |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (wrkMast.getStaNo()>309){ |
| | | int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 110).gt("sta_no", 309).lt("sta_no", 314).gt("wrk_sts",11L)); |
| | | if (wrkCount>=12){ |
| | | continue; |
| | | } |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocolEnt = devpThread.getStation().get(212); |
| | | if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ |
| | | Integer turnBigInt = 0; |
| | | if (wrkMast.booleanStaNoSign() && wrkMast.getIoPri()<99D){ |
| | | Date now = new Date(); |
| | | long differenceInSeconds = now.getTime() - wrkMast.getModiTime().getTime(); |
| | | if (differenceInSeconds<=2000){ |
| | | continue; |
| | | } |
| | | } |
| | | // if (wrkMast.booleanStaNoSign()){ |
| | | // RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign("LineUp"+wrkMast.getStaNo()); |
| | | // if (Cools.isEmpty(rgvOneSign)){ |
| | | // continue; |
| | | // } |
| | | // RgvOneSign trunBig = rgvOneSignMapper.selectOneSign("TrunBig"+wrkMast.getStaNo()); |
| | | // if (Cools.isEmpty(trunBig)){ |
| | | // continue; |
| | | // } |
| | | // turnBigInt = trunBig.getRgvOneSign(); |
| | | // int wrkCount = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", wrkMast.getStaNo()).eq("wrk_sts",12L)); |
| | | // |
| | | // if (trunBig.getRgvOneSign()+wrkCount+rgvOneSign.getRgvOneSign()>2){ |
| | | // continue; |
| | | // } |
| | | // int wrkCountGt = wrkMastMapper.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", wrkMast.getStaNo()).gt("wrk_sts",11L)); |
| | | // if (wrkCountGt > 2){ |
| | | // continue; |
| | | // } |
| | | //// RgvOneSign bigTurn = rgvOneSignMapper.selectOneSign("bigTurn"); |
| | | //// if (Cools.isEmpty(bigTurn)){ |
| | | //// continue; |
| | | //// } |
| | | //// if (bigTurn.getRgvOneSign()>13){ |
| | | //// continue; |
| | | //// } |
| | | //// DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | //// StaProtocol staProtocolEnt = devpThread.getStation().get(wrkMast.getStaNoBying()); |
| | | //// if (staProtocolEnt.isLoading() || staProtocolEnt.getWorkNo()!=0){ |
| | | //// continue; |
| | | //// } |
| | | // } |
| | | |
| | | // 工作档状态判断 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null) { |
| | |
| | | // if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk()) |
| | | // || Cools.isEmpty(waitWrkMast)) { |
| | | if (Cools.isEmpty(waitWrkMast)) { |
| | | wrkMast.setUpdMk("Y"); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | // 生成工作档,将浅库位移转到新的库位中 |
| | | moveLocForDeepLoc(slave, shallowLoc); |
| | | if (moveLocForDeepLoc(slave, shallowLoc)){ |
| | | wrkMast.setUpdMk("Y"); |
| | | // wrkMast.setIoPri(14D); |
| | | wrkMastMapper.updateById(wrkMast); |
| | | } |
| | | // wrkMast.setUpdMk("Y"); |
| | | // wrkMastMapper.updateById(wrkMast); |
| | | // // 生成工作档,将浅库位移转到新的库位中 |
| | | // moveLocForDeepLoc(slave, shallowLoc); |
| | | } |
| | | log.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | |
| | | crnCommand.setDestinationPosX((short)0); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short)0); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short)0); // 目标库位层 |
| | | if (wrkMast.booleanStaNoSign()){ |
| | | updateRgvOneSign("TrunBig"+wrkMast.getStaNo(),turnBigInt+1); |
| | | } |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(crnStation==1? 2:5, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSONString(crnCommand)); |
| | | } else { |
| | |
| | | // } |
| | | } |
| | | } |
| | | // signBigTurn++; |
| | | // if (signBigTurn > 2){ |
| | | // signBigTurn = 0; |
| | | // } |
| | | |
| | | } |
| | | |
| | | public void updateRgvOneSign(String signType,Integer oneSign){ |
| | | RgvOneSignMapper rgvOneSignMapper = SpringUtils.getBean(RgvOneSignMapper.class); |
| | | |
| | | try{ |
| | | RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign(signType); |
| | | if (!Cools.isEmpty(rgvOneSign)){ |
| | | rgvOneSign.setRgvOneSign(oneSign); |
| | | rgvOneSignMapper.updateById(rgvOneSign); |
| | | } |
| | | } catch (Exception e){ |
| | | RgvOneSign rgvOneSign = rgvOneSignMapper.selectOneSign(signType); |
| | | if (!Cools.isEmpty(rgvOneSign)){ |
| | | rgvOneSign.setRgvOneSign(999); |
| | | rgvOneSignMapper.updateById(rgvOneSign); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==0 && staProtocol.getWorkNo()==0 |
| | | if (emptyInSta.getStaNo()==607 && staProtocol.getStaNo()==0 && staProtocol.getWorkNo().equals(0) |
| | | && staProtocol.isLoading() && staProtocol.isAutoing() && staProtocol.isInEnable()){ |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | continue; |
| | | } |
| | | } else { |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,4087); |
| | | 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 { |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,4150); |
| | | 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 { |
| | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false,4213); |
| | | 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 { |
| | |
| | | * 因双深库位阻塞,对浅库位进行移转(立即执行版) |
| | | * tip:同步 |
| | | */ |
| | | private synchronized void moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc) { |
| | | private synchronized boolean moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc) { |
| | | try { |
| | | log.info("移库:CrnSlave:{}、LocMast:{}",JSON.toJSON(crn),JSON.toJSON(shallowLoc)); |
| | | List<Integer> rows = locMastService.queryDistinctRow(crn.getId()); |
| | | LocMast loc = null; |
| | | for (Integer row : rows) { |
| | |
| | | |
| | | if (null == loc) { |
| | | log.error("双深库位 --- 浅库位阻塞异常! 待移转浅库位:" + shallowLoc.getLocNo()); |
| | | throw new CoolException("双深库位 --- 浅库位阻塞异常! 待移转浅库位:" + shallowLoc.getLocNo()); |
| | | } |
| | | |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | // 保存工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(shallowLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | int res = wrkMastMapper.insert(wrkMast); |
| | | if (res == 0) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 工作档明细保存 |
| | | if (shallowLoc.getLocSts().equals("F")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", shallowLoc.getLocNo())); |
| | | for (LocDetl locDetl : locDetls) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setAnfme(locDetl.getAnfme()); |
| | | VersionUtils.setWrkDetl(wrkDetl, locDetl); // 版本控制 |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setModiTime(new Date()); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | return false; |
| | | // throw new CoolException("双深库位 --- 浅库位阻塞异常! 待移转浅库位:" + shallowLoc.getLocNo()); |
| | | } else { |
| | | try { |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(0); |
| | | // 保存工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setIoPri(13D); |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getLocSts().equals("D") ? "N" : "Y"); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(shallowLoc.getBarcode()); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | int res = wrkMastMapper.insert(wrkMast); |
| | | if (res == 0) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 工作档明细保存 |
| | | if (shallowLoc.getLocSts().equals("F")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", shallowLoc.getLocNo())); |
| | | for (LocDetl locDetl : locDetls) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setAnfme(locDetl.getAnfme()); |
| | | VersionUtils.setWrkDetl(wrkDetl, locDetl); // 版本控制 |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setModiTime(new Date()); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | } |
| | | // 修改源库位状态 |
| | | if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("F")) { |
| | | shallowLoc.setLocSts("R"); // R.出库预约 |
| | | shallowLoc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(shallowLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败"); |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("双深库位阻塞,对浅库位进行移转失败", e); |
| | | } |
| | | } |
| | | // 修改源库位状态 |
| | | if (shallowLoc.getLocSts().equals("D") || shallowLoc.getLocSts().equals("F")) { |
| | | shallowLoc.setLocSts("R"); // R.出库预约 |
| | | shallowLoc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(shallowLoc)) { |
| | | throw new CoolException("更新源库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("源库位出库失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | | if (loc.getLocSts().equals("O")) { |
| | | loc.setLocSts("S"); // S.入库预约 |
| | | loc.setModiTime(new Date()); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("更新目标库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException("移转失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("双深库位阻塞,对浅库位进行移转失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // e.printStackTrace(); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | |
| | | break; |
| | | } |
| | | BasJar basJar = basJarMapper.selectById(jarSlave.getId()); |
| | | BasJar basJarOther = basJarMapper.selectById(jarSlave.getJarOtherId()); |
| | | jarMaxLoc = basJar.getJarCount(); |
| | | if (jarMaxLoc == 0) { |
| | | if (jarMaxLoc == 0 || basJarOther.getJarCount() == 0) { |
| | | break; |
| | | } |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11)); |
| | | if (count>0){ |
| | | int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 5)); |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | break; |
| | | } |
| | | if (count>0){ |
| | | if (jarOtherProtocol.getJarTemperature()<jarTemperature && jarOtherProtocol.modeType == JarModeType.AUTO){ |
| | | break; |
| | | } |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(jarMaxLoc)){ |
| | | JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | if (jarOtherProtocol == null) { |
| | | break; |
| | | } |
| | | if (jarOtherProtocol.getJarTemperature()>jarTemperature){ |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(basJarOther.getJarCount())){ |
| | | // JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId()); |
| | | // JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol(); |
| | | // if (jarOtherProtocol == null) { |
| | | // break; |
| | | // } |
| | | if (jarOtherProtocol.getJarTemperature()>jarTemperature || jarOtherProtocol.modeType != JarModeType.AUTO){ |
| | | log.info("{}号硫化罐查询设备温度过高,等待降温....先执行入罐任务!!!",jarOtherProtocol.getJarNo()); |
| | | } else { |
| | | if (basJarMastService.getJarMastByJarIdCount(jarSlave.getId())>0){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | //自动、空闲、右门关闭、 Other左门关闭 |
| | | if (jarProtocol.isAutoing() && jarProtocol.jarErr==0 |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | if (jarProtocol.statusType != JarStatusType.SOS){ |
| | | if (jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2){ |
| | | log.error("Jar任务创建===》执行===>行={}",4537); |
| | | BasJarMast basJarMast = new BasJarMast(basJar, wrkMast, jarLocDigit); |
| | | basJarMast.setJarEnterStaNo(staNo);//入硫化罐站点 |
| | |
| | | case 4: |
| | | signExecute = jarWrkMastExecuteGenerateJar(signExecute,sign);//硫化罐任务 |
| | | // case 5: |
| | | // signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//冷却槽取输送线 |
| | | // signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//冷却槽去输送线 |
| | | default: |
| | | // jarWrkMastExecuteGenerateSte(signExecute,sign);//小车移动 |
| | | signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//冷却槽取输送线 |
| | | jarWrkMastExecuteGenerateSte(signExecute,sign);//小车移动 |
| | | // signExecute = jarWrkMastExecuteGenerateBurial(signExecute, sign);//冷却槽取输送线 |
| | | |
| | | } |
| | | if (!signExecute[0] && !signExecute[1]){ |
| | |
| | | signExecute[i] = true; |
| | | break;//开门任务 生成入硫化罐任务 |
| | | } |
| | | case 3: |
| | | if (jarWrkMastExecuteGenerate3(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//开出料门 |
| | | } |
| | | case 2: |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); |
| | |
| | | if (jarWrkMastExecuteGenerate2(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//关进料门 |
| | | } |
| | | case 3: |
| | | if (jarWrkMastExecuteGenerate3(jarSlave,sign)){ |
| | | signExecute[i] = true; |
| | | break;//开出料门 |
| | | } |
| | | case 4: |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | //门作业 无 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.jarErr==0 |
| | | if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType!= JarStatusType.SOS2 && jarProtocol.jarErr==0 |
| | | && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | //关进料门 |
| | |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(6); |
| | | }}); |
| | | // if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0 |
| | | // && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc |
| | | // && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc*2){ |
| | | // return false; |
| | | // } |
| | | if (basJarMastList.isEmpty()){ |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | log.error("JarWrkMastExecute任务创建===>执行异常===》异常数据:BasJar:"+ JSON.toJSONString(basJar)+";BasJarMast:"+JSON.toJSONString(basJarMastSign)); |
| | | } |
| | | return true; |
| | | } else if (jarProtocol.isAutoing() && jarProtocol.statusType != JarStatusType.SOS && jarProtocol.statusType != JarStatusType.SOS2 |
| | | && jarProtocol.statusType != JarStatusType.WAITING2 && jarProtocol.jarErr==0 |
| | | && jarProtocol.isLeftDoor() && jarProtocol.isRightDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0){ |
| | | Integer integer = basJarMastService.updateStatus(jarProtocol.getJarNo(), 6, 8); |
| | | if (basJarMastList.size()!=integer){ |
| | | log.error("{}号硫化罐硫化完成后开门完成修改硫化档案状态结果数量不一致!!!查询资料数量={},更新返回数量={}",jarProtocol.getJarNo(),basJarMastList.size(),integer); |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } else { |
| | |
| | | if (!basJarMastList1.isEmpty()){ |
| | | return false; |
| | | } |
| | | BasJar basJarOther11 = basJarMapper.selectById(jarSlave.getJarOtherId()); |
| | | if (!Cools.isEmpty(basJarOther11)){ |
| | | List<BasJarMast> basJarMastList2 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getJarOtherId(), new ArrayList<Integer>() {{ |
| | | add(8);add(9);add(10);add(11);add(12); |
| | | }}); |
| | | if (!basJarMastList2.isEmpty() && basJarMastList2.size()!=basJarOther11.getJarCount()){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(8); |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | return false; |
| | | } |
| | | |
| | | StaProtocol staProtocolEnd = new StaProtocol(); |
| | | staProtocolEnd.setAutoing(false); |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | if (devp.getId() == 1){ |
| | | continue; |
| | | } |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getOutJarInSta()) { |
| | | if (jarSlave.getId() == 1 || jarSlave.getId() == 2){ |
| | | if (inSta.getStaNo() == 627){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | break; |
| | | } |
| | | staProtocolEnd = staProtocol; |
| | | break; |
| | | } |
| | | } else if (jarSlave.getId() == 3 || jarSlave.getId() == 4){ |
| | | if (inSta.getStaNo() == 628){ |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | break; |
| | | } |
| | | staProtocolEnd = staProtocol; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (!staProtocolEnd.isAutoing() || staProtocolEnd.isLoading()){ |
| | | return false; |
| | | } |
| | | List<BasJarMast> basJarMastList10 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (basJarMastList10.size()==jarMaxLoc){ |
| | | return false; |
| | | } |
| | | if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(jarMaxLoc)){ |
| | | |
| | | BasJar basJarOther = basJarMapper.selectById(jarSlave.getJarOtherId()); |
| | | if (Cools.isEmpty(basJarOther)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarSlave.getJarOtherId()); |
| | | return false; |
| | | } |
| | | |
| | | if (basJarOther.getJarCount() == 0) { |
| | | return false; |
| | | } |
| | | |
| | | List<BasJarMast> basJarMastListOther = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getJarOtherId(), new ArrayList<Integer>() {{ |
| | | add(8); |
| | | }}); |
| | | if (!basJarMastListOther.isEmpty() && basJarMastListOther.size() < basJarOther.getJarCount()){ |
| | | return false; |
| | | } |
| | | // if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(basJarOther.getJarCount() )){ |
| | | // return false; |
| | | // } |
| | | |
| | | // //临时 |
| | | // if (basJar.getJarCode()==1){ |
| | |
| | | if (jarWrkMastExecuteActionExecute5Three(wrkMastExecute,sign)){ |
| | | break; |
| | | } |
| | | return; |
| | | continue; |
| | | case 6: |
| | | if (jarWrkMastExecuteActionExecute6Three(wrkMastExecute,sign)){ |
| | | break; |
| | | } |
| | | return; |
| | | continue; |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.WAITING2) || jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | return false; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | //调车 == > 取货 |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT25.id,SteTaskModeType.STE_WFFH_13,false,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){ |
| | | if (!jarSteTake(wrkMastExecute,SteLocaType.POINT23.id,SteLocaType.POINT26.id,SteTaskModeType.STE_WFFH_13,false,SteAndJarUtil.getBJarNo(wrkMastExecute.getJarId()))){ |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getJarId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(jarProtocol),sign); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (jarProtocolOther.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocolOther.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | // log.error("{}号硫化罐查询设备正在硫化中,任务异常!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | |
| | | // 下发站点信息 |
| | | if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(9, staProtocol))) { |
| | | log.error("平衡车Rgv命令下发失败,堆垛机号={},任务数据={},下发数据={}", wrkMastExecute.getRgvId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol)); |
| | | Thread.sleep(500); |
| | | return false; |
| | | } |
| | | Thread.sleep(500); |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("平衡车Rgv命令下发失败,Rgv号={},任务数据={},endRow={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(endRow)); |
| | |
| | | // 下发站点信息 |
| | | if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(10, staProtocol))) { |
| | | log.error("平衡车Rgv命令下发失败,堆垛机号={},任务数据={},下发数据={}", wrkMastExecute.getRgvId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol)); |
| | | Thread.sleep(500); |
| | | return false; |
| | | } |
| | | Thread.sleep(500); |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("平衡车Rgv命令下发失败,Rgv号={},任务数据={},RGV4={},RGV5={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(RGV4), JSON.toJSON(RGV5)); |
| | |
| | | // 下发站点信息 |
| | | if (!MessageQueue.offer(SlaveType.Devp, 2, new Task(11, staProtocol))) { |
| | | log.error("平衡车Rgv命令下发失败,堆垛机号={},任务数据={},下发数据={}", wrkMastExecute.getRgvId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(staProtocol)); |
| | | Thread.sleep(500); |
| | | return false; |
| | | } |
| | | Thread.sleep(500); |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("平衡车Rgv命令下发失败,Rgv号={},任务数据={},RGV6={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(RGV6)); |
| | |
| | | steCommand.setJarNo(siteId.shortValue()); |
| | | if (!MessageQueue.offer(SlaveType.Ste, steCommand.getSteNo(), new Task(2, steCommand))) { |
| | | log.error("穿梭车Ste命令下发失败,堆垛机号={},任务数据={},下发数据={},complete={}", steCommand.getSteNo(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steCommand),complete); |
| | | Thread.sleep(500); |
| | | return false; |
| | | } |
| | | Thread.sleep(500); |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("穿梭车Ste命令下发失败,堆垛机号={},任务数据={},complete={}", wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(complete)); |
| | |
| | | jarCommand.setTaskModeType(jarTaskModeType); |
| | | if (!MessageQueue.offer(SlaveType.Jar, jarCommand.getJarNo(), new Task(2, jarCommand))) { |
| | | log.error("硫化罐Jar命令下发失败,堆垛机号={},任务数据={},下发数据={}", jarCommand.getJarNo(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarCommand)); |
| | | Thread.sleep(500); |
| | | return false; |
| | | } |
| | | Thread.sleep(500); |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("硫化罐Jar命令下发失败,堆垛机号={},任务数据={},下发数据={}", wrkMastExecute.getJarId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarTaskModeType)); |
| | |
| | | try{ |
| | | switch (sign){ |
| | | case 1: |
| | | case 5: |
| | | case 9: |
| | | if (jarWrkMastExecuteGenerateSteComplete(sign)){ |
| | | break; |
| | | return; |
| | | } |
| | | case 2: |
| | | case 6: |
| | | case 10: |
| | | if (jarWrkMastExecuteGenerateJarComplete(sign)){ |
| | | break; |
| | | return; |
| | | } |
| | | case 3: |
| | | case 7: |
| | | case 11: |
| | | if (jarWrkMastExecuteGenerateRgvComplete1(sign)){ |
| | | break; |
| | | return; |
| | | } |
| | | case 4: |
| | | case 8: |
| | | case 12: |
| | | if (jarWrkMastExecuteGenerateRgvComplete2(sign)){ |
| | | break; |
| | | return; |
| | | } |
| | | default: |
| | | return; |
| | | break; |
| | | } |
| | | jarWrkMastExecuteGenerateDevComplete(sign); |
| | | }catch (Exception e){ |
| | | log.error("JarWrkMastExecute任务完成报错!"+e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * JarWrkMastExecute任务完成 ===>Devp //完成 |
| | | */ |
| | | public synchronized boolean jarWrkMastExecuteGenerateDevComplete(Integer sign) { |
| | | try{ |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历入库口 |
| | | for (DevpSlave.Sta inSta : devp.getOutJarInSta()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | // 判断是否满足条件 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.getWorkNo() == 0 |
| | | && staProtocol.isPakMk()) { |
| | | for (DevpSlave.Jar jar : inSta.getJarList()) { |
| | | // 判断重复工作档 |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListB(jar.getBurial(), new ArrayList<Integer>() {{ |
| | | add(9); |
| | | add(11); |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | continue; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastList.get(0); |
| | | jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete(6)); |
| | | |
| | | |
| | | StaProtocol staProtocolNew = new StaProtocol(); |
| | | staProtocolNew.setSiteId(staProtocol.getSiteId()); |
| | | staProtocolNew.setWorkNo(basJarMastList.get(0).getWrkNo().intValue()); |
| | | staProtocolNew.setStaNo(jar.getEndStaNo()); |
| | | devpThread.setPakMk(staProtocolNew.getSiteId(), false,7989); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocolNew)); |
| | | if (!result) { |
| | | LedErrorThreadUtil.ledErrorThread("更新plc站点信息失败!站点号:"+inSta.getStaNo(),inSta.getLed(), LedErrorAreaType.ONE_OTHER.getDesc()); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | if (!basJarMastService.updateById(jarMastByWrkNo)){ |
| | | log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败"); |
| | | throw new CoolException("更新basJarMast失败"); |
| | | } |
| | | break; |
| | | } |
| | | } else if (staProtocol.isAutoing() |
| | | && !staProtocol.isLoading() |
| | | && staProtocol.getWorkNo() == 0 |
| | | && staProtocol.isPakMk()) { |
| | | for (DevpSlave.Jar jar : inSta.getJarList()) { |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, jar.getJarNo()<3? 1:2); |
| | | if (steThread == null) { |
| | | continue; |
| | | } |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(steProtocol.getLocaType()) && !steProtocol.getLocaType().equals(SteLocaType.NONE) && steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | // 判断重复工作档 |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusListB(jar.getBurial(), new ArrayList<Integer>() {{ |
| | | add(9); |
| | | add(11); |
| | | }}); |
| | | if (basJarMastList.isEmpty()){ |
| | | continue; |
| | | } |
| | | BasJarMast jarMastByWrkNo = basJarMastList.get(0); |
| | | WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectOne(new EntityWrapper<WrkMastExecute>().eq("wrk_no", jarMastByWrkNo.getWrkNo())); |
| | | if (Cools.isEmpty(wrkMastExecute)){ |
| | | jarMastByWrkNo.setStatus(jarMastByWrkNo.getStatusComplete(6)); |
| | | if (!basJarMastService.updateById(jarMastByWrkNo)){ |
| | | log.error("硫化区域分段任务完成异常,BasJarMast={},异常信息={}",JSON.toJSONString(jarMastByWrkNo),"更新basJarMast失败"); |
| | | // throw new CoolException("更新basJarMast失败"); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | }catch (Exception e){ |
| | | log.error("JarWrkMastExecute任务完成 ===>Ste报错!"+e); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | // |
| | | // } |
| | | List<WrkMastExecute> wrkMastExecuteByWrkNoList = wrkMastExecuteService.getWrkMastExecuteByWrkNoList(steProtocol.getTaskNo().longValue()); |
| | | steReturn: |
| | | for (WrkMastExecute wrkMastExecute : wrkMastExecuteByWrkNoList){ |
| | | if (!Cools.isEmpty(wrkMastExecute)){ |
| | | switch (wrkMastExecute.getIoType()){ |
| | |
| | | log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | } |
| | | return true; |
| | | // Thread.sleep(500); |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | } |
| | | log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(steProtocol),sign); |
| | | return true; |
| | | // log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | // wrkMastExecute.getSteId(), JSON.toJSONString(wrkMastExecute), JSON.toJSONString(steProtocol),sign); |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | case 5: |
| | | if (wrkMastExecute.getWrkSts()==5){ |
| | |
| | | log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | } |
| | | return true; |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | } |
| | | log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | return true; |
| | | // log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | // wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | continue; |
| | | case 7: |
| | |
| | | log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | } |
| | | return true; |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | } |
| | | log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | return true; |
| | | // log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | // wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | continue; |
| | | case 9: |
| | |
| | | log.error("穿梭车Ste命令下发失败===>更新wrkMastExecute失败,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | } |
| | | return true; |
| | | // return true; |
| | | break steReturn; |
| | | } |
| | | } |
| | | log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | // log.error("穿梭车Ste命令下发失败===>下发异常,jar号={},任务数据={},穿梭车数据={},sign={}", |
| | | // wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(steProtocol),sign); |
| | | continue; |
| | | } |
| | | default: continue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | if (Cools.isEmpty(basJar)){ |
| | | log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo()); |
| | | continue; |
| | | } |
| | | if (jarProtocol.leftDoorOpen==1 || jarProtocol.leftDoorClose==1 || |
| | | jarProtocol.rightDoorOpen==1 || jarProtocol.rightDoorClose==1 |
| | | ){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarErr()==0 && (jarProtocol.getStatusType().equals(JarStatusType.WAITING1) || jarProtocol.getStatusType().equals(JarStatusType.MOVING)) |
| | | && jarProtocol.isRightDoor() && jarProtocol.isLeftDoor() |
| | | && jarProtocol.leftDoorOpen==0 && jarProtocol.leftDoorClose==0 && jarProtocol.rightDoorOpen==0 && jarProtocol.rightDoorClose==0 |
| | | ){ |
| | | List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{ |
| | | add(6);//硫化完成 |
| | | }}); |
| | | if (!basJarMastList.isEmpty()){ |
| | | WrkMastExecute wrkMastExecuteSou = new WrkMastExecute(); |
| | | wrkMastExecuteSou.setWrkSts(3); |
| | | List<WrkMastExecute> wrkMastExecuteList = wrkMastExecuteService.selectWrkMastExecuteByWrk(wrkMastExecuteSou); |
| | | for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){ |
| | | if (wrkMastExecute.getIoType() == 3){ |
| | | wrkMastExecute.setWrkSts(4); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecute)){ |
| | | log.error("硫化罐Jar命令修改失败===>更新wrkMastExecute失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //WAITING2(4, "硫化完成"), |
| | | if (jarProtocol.getJarErr()==0 && jarProtocol.getStatusType().equals(JarStatusType.WAITING2) |
| | |
| | | && (jarProtocol.leftDoorClose==2 || jarProtocol.rightDoorClose==2)){ |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | | log.error("{}号硫化罐查询设备温度过高,等待降温....!!!",jarProtocol.getJarNo()); |
| | | return false; |
| | | continue; |
| | | } |
| | | WrkMastExecute wrkMastExecuteSou = new WrkMastExecute(); |
| | | wrkMastExecuteSou.setWrkSts(3); |
| | |
| | | log.error("硫化罐Jar命令下发失败,jar号={},任务数据={},硫化罐数据={},sign={}", |
| | | execute.getJarId(), JSON.toJSON(execute), JSON.toJSON(jarProtocol),sign); |
| | | } |
| | | return true; |
| | | continue; |
| | | } |
| | | for (WrkMastExecute wrkMastExecute : wrkMastExecuteList){ |
| | | if (wrkMastExecute.getIoType() == 2 || wrkMastExecute.getIoType() == 4){ |
| | |
| | | wrkMastExecute.getSteId(), JSON.toJSON(wrkMastExecute), JSON.toJSON(jarProtocol),sign); |
| | | return false; |
| | | } |
| | | return true; |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * ste充电任务创建 //完成 |
| | | */ |
| | | public synchronized void signTrunBig() { |
| | | updateRgvOneSign("TrunSma126",0); |
| | | updateRgvOneSign("TrunSma131",0); |
| | | updateRgvOneSign("TrunBig310",0); |
| | | updateRgvOneSign("TrunBig312",0); |
| | | } |
| | | |
| | | public synchronized boolean jarChargeGenerate() { |
| | | try{ |
| | | //80%电量 无任务 充电 >50电量 有任务 断电 |
| | |
| | | add(5); |
| | | add(11); |
| | | add(17); |
| | | add(99); |
| | | add(100); |
| | | add(999); |
| | | }}); |
| | | if(!basJarMastList.isEmpty()){ |
| | | continue; |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING3) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING4) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING5) |
| | | || jarProtocol.statusType .equals(JarStatusType.OFF_LINE)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | add(5); |
| | | add(11); |
| | | add(17); |
| | | add(99); |
| | | add(100); |
| | | add(999); |
| | | }}); |
| | | if(basJarMastList.isEmpty()){ |
| | | if (wrkMastExecuteService.selectNoStartCharge(steSlave.getId())==0){ |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING3) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING4) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING5) |
| | | || jarProtocol.statusType .equals(JarStatusType.OFF_LINE)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | log.error("穿梭板Ste命令下发失败,ste号={},任务数据={}", |
| | | wrkMastExecuteByCharge.getSteId(), JSON.toJSONString(wrkMastExecuteByCharge)); |
| | | } |
| | | try{ |
| | | Thread.sleep(1000); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | wrkMastExecuteByCharge.setWrkType(2); |
| | | wrkMastExecuteByCharge.setWrkSts(100); |
| | | if (!wrkMastExecuteService.updateById(wrkMastExecuteByCharge)){ |
| | |
| | | String barcode = staProtocol607.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | // log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | return; |
| | | } |
| | | } else { |
| | |
| | | && staProtocol607.getStaNo() == 0 && staProtocol607.isInEnable()){ |
| | | WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | staProtocol607.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol607.setStaNo(staNo1); |
| | | boolean result2 = MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocol607)); |
| | | |
| | | StaProtocol staProtocolNew = new StaProtocol(); |
| | | staProtocolNew.setSiteId(staProtocol607.getSiteId()); |
| | | staProtocolNew.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocolNew.setStaNo(staNo1); |
| | | // devpThread.setPakMk(staProtocolNew.getSiteId(), false,7989); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocolNew)); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | public synchronized void stackingCompletionDriveTray2() { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocol = devpThread.getStation().get(518); |
| | | if (Cools.isEmpty(staProtocol)) { |
| | | return; |
| | | } |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (!Cools.isEmpty(barcode)) { |
| | | if ("NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || !CodeDetectionUtil.barcodeDetection(barcode)) { |
| | | return; |
| | | } |
| | | } else { |
| | | return; |
| | | } |
| | | if (staProtocol.getWorkNo()==0 && staProtocol.isLoading() && staProtocol.isAutoing() |
| | | && staProtocol.getStaNo() == 0 && staProtocol.isInEnable()){ |
| | | WrkMast wrkMast = wrkMastMapper.selectByBarcodeTwo(barcode); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | StaProtocol staProtocolNew = new StaProtocol(); |
| | | staProtocolNew.setSiteId(staProtocol.getSiteId()); |
| | | staProtocolNew.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocolNew.setStaNo(wrkMast.getStaNo()); |
| | | devpThread.setPakMk(staProtocolNew.getSiteId(), false,7989); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, 2, new Task(2, staProtocolNew)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public synchronized Integer jarGetStartStaNo(Integer staNo) { |
| | | try { |
| | | int[] jarNos=new int[]{3,1,4,2};//(607分配硫化罐) |
| | | ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | add(607);add(608);add(609);add(610);add(611);add(612); |
| | | add(608);add(609);add(610);add(611);add(612); |
| | | add(613);add(614);add(615);add(616);add(617);add(618); |
| | | add(619);add(620);add(621);add(622); |
| | | }}; |
| | |
| | | if (jarProtocol.modeType != JarModeType.AUTO){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS) || jarProtocol.statusType .equals(JarStatusType.SOS2) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING3) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING4) |
| | | || jarProtocol.statusType .equals(JarStatusType.WAITING5) |
| | | || jarProtocol.statusType .equals(JarStatusType.OFF_LINE)){ |
| | | continue; |
| | | } |
| | | if (jarProtocol.getJarTemperature()>jarTemperature){ |
| | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2); |
| | | StaProtocol staProtocolEnt = devpThread.getStation().get(staNoEnt); |
| | | if (staProtocolEnt == null || (staProtocolEnt.isLoading() && staProtocolEnt.getWorkNo()==0)){ |
| | | log.error("站点异常,计数加一,站点号:"+staNoEnt); |
| | | // log.error("站点异常,计数加一,站点号:"+staNoEnt); |
| | | count++; |
| | | } else if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){ |
| | | if (staProtocolEnt.getStaNo().equals(basJar.getEntStaNo$())){ |