|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public synchronized void generateStoreWrkFile7() { | 
|---|
|  |  |  | // 根据输送线plc遍历 | 
|---|
|  |  |  | for (DevpSlave devp : slaveProperties.getDevp()) { | 
|---|
|  |  |  | // 遍历入库口 | 
|---|
|  |  |  | for (DevpSlave.Sta inSta : devp.getInSta7()) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 获取入库站信息 | 
|---|
|  |  |  | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); | 
|---|
|  |  |  | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); | 
|---|
|  |  |  | if (staProtocol == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | staProtocol = staProtocol.clone(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 获取条码扫描仪信息 | 
|---|
|  |  |  | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); | 
|---|
|  |  |  | if (barcodeThread == null) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String barcode = barcodeThread.getBarcode(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 尺寸检测异常 | 
|---|
|  |  |  | boolean back = false; | 
|---|
|  |  |  | String errMsg = "异常:"; | 
|---|
|  |  |  | if (staProtocol.isFrontErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"前超限;"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocol.isBackErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"后超限"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocol.isHighErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"高超限"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocol.isLeftErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"左超限"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocol.isRightErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"右超限"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (staProtocol.isWeightErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"超重"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (staProtocol.isBan()){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (staProtocol.getStaNoEnd() != 2001){ | 
|---|
|  |  |  | log.error(staProtocol.getStaNo()+"站点,空桶,非法目标站!!!!!!"+staProtocol.getStaNoEnd().toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer workNo1 = commonService.getWorkNo(3); | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 保存工作档 | 
|---|
|  |  |  | WrkMast wrkMast = new WrkMast(); | 
|---|
|  |  |  | wrkMast.setWrkNo(workNo1); | 
|---|
|  |  |  | wrkMast.setIoTime(now); | 
|---|
|  |  |  | wrkMast.setWrkSts(101L); // 工作状态:101.初始 | 
|---|
|  |  |  | wrkMast.setIoType(199); // 入出库状态: 199.转移 | 
|---|
|  |  |  | wrkMast.setIoPri(15D); | 
|---|
|  |  |  | wrkMast.setCrnNo(0); | 
|---|
|  |  |  | wrkMast.setSourceStaNo(staProtocol.getStaNo().intValue()); // 源站 | 
|---|
|  |  |  | wrkMast.setStaNo(staProtocol.getStaNoEnd().intValue()); // 目标站 | 
|---|
|  |  |  | wrkMast.setFullPlt("N"); // 满板 | 
|---|
|  |  |  | wrkMast.setPicking("N"); // 拣料 | 
|---|
|  |  |  | wrkMast.setExitMk("N"); // 退出 | 
|---|
|  |  |  | wrkMast.setEmptyMk("Y"); // 空板 | 
|---|
|  |  |  | wrkMast.setBarcode("KB888888"); // 托盘码 | 
|---|
|  |  |  | wrkMast.setLinkMis("N"); | 
|---|
|  |  |  | wrkMast.setCtnNo("Y");  // 入库阻塞库位移转标记 | 
|---|
|  |  |  | wrkMast.setAppeTime(now); | 
|---|
|  |  |  | wrkMast.setModiTime(now); | 
|---|
|  |  |  | int res = wrkMastMapper.insert(wrkMast); | 
|---|
|  |  |  | if (res == 0) { | 
|---|
|  |  |  | //                                throw new CoolException(""); | 
|---|
|  |  |  | log.error(staProtocol.getStaNo()+"站点,空桶,保存工作档主档失败!!!!!!"+now.toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //                    StaProtocol staProtocol1 = new StaProtocol(); | 
|---|
|  |  |  | staProtocol.setWorkNo(workNo1.shortValue()); | 
|---|
|  |  |  | staProtocol.setStaNo((short)3001); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false); | 
|---|
|  |  |  | ledThread.errorReset(); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (staProtocol.isBarcodeErr()) { | 
|---|
|  |  |  | errMsg = errMsg+"扫码失败"; | 
|---|
|  |  |  | back = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 退回 | 
|---|
|  |  |  | if (back) { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(barcode)) { | 
|---|
|  |  |  | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); | 
|---|
|  |  |  | if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | //                    LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | //                    if (ledThread != null) { | 
|---|
|  |  |  | //                        String errorMsg = "扫码失败,请重试"; | 
|---|
|  |  |  | //                        MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 判断是否满足入库条件 | 
|---|
|  |  |  | if (staProtocol.isAutoing() | 
|---|
|  |  |  | && staProtocol.isLoading() | 
|---|
|  |  |  | && staProtocol.isInEnable() | 
|---|
|  |  |  | && !staProtocol.isEmptyMk() | 
|---|
|  |  |  | && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) | 
|---|
|  |  |  | && staProtocol.isPakMk()) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) { | 
|---|
|  |  |  | log.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode); | 
|---|
|  |  |  | //条码为空或者不符合,退库到 | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | String errorMsg = "扫码失败,请重试"; | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                        staProtocol.setWorkNo((short)9999); | 
|---|
|  |  |  | //                        staProtocol.setStaNo((short)(staProtocol.getStaNo()-1)); | 
|---|
|  |  |  | //                        devpThread.setPakMk(staProtocol.getSiteId(), false); | 
|---|
|  |  |  | //                        boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | //                        if (!result) { | 
|---|
|  |  |  | //                            throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | //                        } | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 判断重复工作档 | 
|---|
|  |  |  | WrkMast wrkMast = new WrkMast(); | 
|---|
|  |  |  | if (barcode.length() == 8) { | 
|---|
|  |  |  | wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); | 
|---|
|  |  |  | if (wrkMast != null) { | 
|---|
|  |  |  | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //                     获取入库通知档 | 
|---|
|  |  |  | //                    List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); | 
|---|
|  |  |  | //                    if (waitPakins.isEmpty()) { | 
|---|
|  |  |  | //                        log.error("无此入库条码数据。条码号={}", barcode); | 
|---|
|  |  |  | //                        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()); | 
|---|
|  |  |  | String response = new HttpHandler.Builder() | 
|---|
|  |  |  | .setUri(wmsUrl) | 
|---|
|  |  |  | .setPath("/rpc/pakin/loc/v1") | 
|---|
|  |  |  | .setJson(JSON.toJSONString(param)) | 
|---|
|  |  |  | .build() | 
|---|
|  |  |  | .doPost(); | 
|---|
|  |  |  | JSONObject jsonObject = JSON.parseObject(response); | 
|---|
|  |  |  | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | StartupDto dto = jsonObject.getObject("data", StartupDto.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | barcodeThread.setBarcode(""); | 
|---|
|  |  |  | staProtocol.setWorkNo(dto.getWorkNo().shortValue()); | 
|---|
|  |  |  | staProtocol.setStaNo(dto.getStaNo().shortValue()); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false); | 
|---|
|  |  |  | ledThread.errorReset(); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | if (!result) { | 
|---|
|  |  |  | throw new CoolException("更新plc站点信息失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if(jsonObject.getInteger("code").equals(700)) { | 
|---|
|  |  |  | //                            staProtocol.setWorkNo((short) 9999); | 
|---|
|  |  |  | //                            staProtocol.setStaNo(inSta.getBackSta().shortValue()); | 
|---|
|  |  |  | //                            devpThread.setPakMk(staProtocol.getSiteId(), false); | 
|---|
|  |  |  | //                            MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | //                            // led 异常显示 | 
|---|
|  |  |  | //                            if (ledThread != null) { | 
|---|
|  |  |  | //                                String errorMsg = barcode + "托盘识别异常,请先进行组托!"; | 
|---|
|  |  |  | //                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); | 
|---|
|  |  |  | //                            } | 
|---|
|  |  |  | log.error(barcode + "托盘识别异常,请先进行组托!"); | 
|---|
|  |  |  | // led 异常显示 | 
|---|
|  |  |  | ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); | 
|---|
|  |  |  | if (ledThread != null) { | 
|---|
|  |  |  | String errorMsg = barcode + "托盘识别异常,请先进行组托!"; | 
|---|
|  |  |  | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * wms入库 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //工位一任务 | 
|---|
|  |  |  | for (RgvSlave.Sta inStn :  inStn1){ | 
|---|
|  |  |  | work1 = false; | 
|---|
|  |  |  | workNo1 = 0; | 
|---|
|  |  |  | souSta1 = 0; | 
|---|
|  |  |  | sta1 = 0; | 
|---|
|  |  |  | type = 0; | 
|---|
|  |  |  | if (rgvSlave.getId() == 1 && inStn.getSourceStaNo() == 2114){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | workNo1 = wrkMast.getWrkNo(); | 
|---|
|  |  |  | souSta1 = Utils.getRgvStaNo(rgvSlave.getId(),staProtocol.getSiteId()); | 
|---|
|  |  |  | sta1 = Utils.getRgvEndStaNo(rgvSlave.getId(),wrkMast.getStaNo()); | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta1); | 
|---|
|  |  |  | BasDevp devp = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp.getWrkNo()!=0 || devp.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | work1 = true; | 
|---|
|  |  |  | devpThread.setPakMk(inStn.getSourceStaNo(),false); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | sta1 = Utils.getRgvStaNo(rgvSlave.getId(),2002); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("4007站点,桶型4,非法目标站!!!!!!"+staProtocol.getStaNoEnd().toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta1); | 
|---|
|  |  |  | BasDevp devp = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp.getWrkNo()!=0 || devp.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | workNo1 = commonService.getWorkNo(3); | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("4007站点,桶型4,保存工作档主档失败!!!!!!"+now.toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | type = 2; | 
|---|
|  |  |  | } else if (inStn.getSourceStaNo() == 2102 && staProtocol.isFullPlt()) { | 
|---|
|  |  |  | sta1 = Utils.getRgvStaNo(rgvSlave.getId(),2301); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  | if(inStn.getSourceStaNo() == 2102){ | 
|---|
|  |  |  | weight = staProtocol.getWeight().doubleValue()/10; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta1); | 
|---|
|  |  |  | BasDevp devp = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp.getWrkNo()!=0 || devp.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | work1 = true; | 
|---|
|  |  |  | if (inStn.getSourcePlcId() == 4 || inStn.getSourcePlcId() ==5){ //灌装站需要获取输送线物料代码 | 
|---|
|  |  |  | matnr = staProtocol.getMatnr(); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (rgvSlave.getId() != 3){ | 
|---|
|  |  |  | //工位二任务 | 
|---|
|  |  |  | for (RgvSlave.Sta inStn :  rgvSlave.getInStn()){ | 
|---|
|  |  |  | work2 = false; | 
|---|
|  |  |  | workNo2 = 0; | 
|---|
|  |  |  | souSta2 = 0; | 
|---|
|  |  |  | sta2 = 0; | 
|---|
|  |  |  | type2 = 0; | 
|---|
|  |  |  | if (souSta1 == inStn.getSourceStaNo()){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | workNo2 = wrkMast.getWrkNo(); | 
|---|
|  |  |  | souSta2 = Utils.getRgvStaNo(rgvSlave.getId(),staProtocol.getSiteId()); | 
|---|
|  |  |  | sta2 = Utils.getRgvEndStaNo(rgvSlave.getId(),wrkMast.getStaNo()); | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta2); | 
|---|
|  |  |  | BasDevp devp2 = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp2.getWrkNo()!=0 || devp2.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | work2 = true; | 
|---|
|  |  |  | devpThread.setPakMk(inStn.getSourceStaNo(),false); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | sta2 = Utils.getRgvStaNo(rgvSlave.getId(),2002); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("4007站点,桶型4,非法目标站!!!!!!"+staProtocol.getStaNoEnd().toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta2); | 
|---|
|  |  |  | BasDevp devp2 = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp2.getWrkNo()!=0 || devp2.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | workNo2 = commonService.getWorkNo(3); | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("4007站点,桶型4,保存工作档主档失败!!!!!!"+now.toString()); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | type2 = 2; | 
|---|
|  |  |  | } else if (inStn.getSourceStaNo() == 2102 && staProtocol.isFullPlt()) { | 
|---|
|  |  |  | sta2 = Utils.getRgvStaNo(rgvSlave.getId(),2301); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(inStn.getSourceStaNo() == 2102){ | 
|---|
|  |  |  | weight2 = staProtocol.getWeight().doubleValue()/10; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer staNo = Utils.getStaNo(rgvSlave.getId(), (int) sta2); | 
|---|
|  |  |  | BasDevp devp2 = basDevpService.selectById(staNo); | 
|---|
|  |  |  | if (devp2.getWrkNo()!=0 || devp2.getLoading().equals("Y")){ | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | work2 = true; | 
|---|
|  |  |  | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkMastSta.getWrkNo().shortValue()); | 
|---|
|  |  |  | if (wrkMastSta.getType() == 1){ | 
|---|
|  |  |  | staProtocol.setStaNo((short) 9999); | 
|---|
|  |  |  | } else if (wrkMastSta.getType() == 2){//转运 | 
|---|
|  |  |  | staProtocol.setStaNo((short) 2114); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | staProtocol.setStaNo((short) 2106); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkMastSta.getWrkNo2().shortValue()); | 
|---|
|  |  |  | if (wrkMastSta.getType2() == 1){ | 
|---|
|  |  |  | staProtocol.setStaNo((short) 9999); | 
|---|
|  |  |  | } else if (wrkMastSta.getType() == 2){//转运 | 
|---|
|  |  |  | staProtocol.setStaNo((short) 2114); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | staProtocol.setStaNo((short) 2106); | 
|---|
|  |  |  | } | 
|---|