| | |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | Integer outCount=wrkMastService.selectOutCount(); |
| | | // 检测是否有出库任务 如果有出库任务 入库就停止 |
| | | List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",1).in("wrk_sts", 11, 12)); |
| | | // 检测104站(堆垛机出库站 入库站)是否有物 如果有物没有工作号 入库停止 如果有物工作号是出库 入库停止 如果有物工作号是入库 可以入库 如果有物工作号不存在 入库停止 |
| | | StaProtocol staProtocol104 = devpThread.getStation().get(104); |
| | | if (staProtocol104 == null){ |
| | | log.error("104站点信息未获取"); |
| | | continue; |
| | | } |
| | | //104站有物 有工作号 判断这个任务的类型 |
| | | WrkMast wrkMast1 = new WrkMast(); |
| | | if (staProtocol104.isLoading() && staProtocol104.getWorkNo() != 0){ |
| | | wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", staProtocol104.getWorkNo())); |
| | | } |
| | | |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | if (!back && outCount > 0) { |
| | | errMsg = "当前为出库时段,入库暂停"; |
| | | // 判断托盘码格式 |
| | | if (!back &&(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode))){ |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && (!barcode.startsWith("5") && !barcode.startsWith("6") && !barcode.startsWith("7") && !barcode.startsWith("8"))) { |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && !wrkMastList.isEmpty()) { |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && staProtocol104.isLoading() && staProtocol104.getWorkNo() == 0 && (barcode.startsWith("6") || barcode.startsWith("5"))){ |
| | | errMsg = "104站有物但是无工作号,请检查"; |
| | | back = true; |
| | | }if (!back && (!Cools.isEmpty(wrkMast1) && wrkMast1.getIoType() > 100)){ |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && (staProtocol104.isLoading() && Cools.isEmpty(wrkMast1)) && (barcode.startsWith("5") || barcode.startsWith("6"))){ |
| | | errMsg = "104站有物但是对应的工作号无工作档,请检查"; |
| | | back = true; |
| | | } |
| | | |
| | |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发(超限全板退回):" + wrkNo + "," + inSta.getBackSta()); |
| | | log.error("输送线下发(全板退回):" + wrkNo + "," + inSta.getBackSta()); |
| | | break;//超限托盘退回不生成工作档 |
| | | } |
| | | |
| | |
| | | param.setBarcode(barcode); |
| | | param.setIoType(1); |
| | | param.setSourceStaNo(inSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setLocType1(locTypeDto.getLocType1()); // 高低 |
| | | param.setWeight(staProtocol.getWeight()); |
| | | String response = new HttpHandler.Builder() |
| | | .setTimeout(30,TimeUnit.SECONDS) |
| | |
| | | // News.error("站点信息未获得"); |
| | | continue; |
| | | } |
| | | // 检测是否有出库任务 如果有出库任务 入库就停止 |
| | | List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", 1).in("wrk_sts", 11, 12)); |
| | | // 检测104站(堆垛机出库站 入库站)是否有物 如果有物没有工作号 入库停止 如果有物工作号是出库 入库停止 如果有物工作号是入库 可以入库 如果有物工作号不存在 入库停止 |
| | | StaProtocol staProtocol104 = devpThread.getStation().get(104); |
| | | if (staProtocol104 == null){ |
| | | log.error("104站点信息未获取"); |
| | | continue; |
| | | } |
| | | //104站有物 有工作号 判断这个任务的类型 |
| | | WrkMast wrkMast1 = new WrkMast(); |
| | | if (staProtocol104.isLoading() && staProtocol104.getWorkNo() != 0){ |
| | | wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", staProtocol104.getWorkNo())); |
| | | } |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (!back && staProtocol.isFrontErr()) { |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | | } |
| | |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | // 判断托盘码格式 |
| | | if (!back &&(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode))){ |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && (!barcode.startsWith("5") && !barcode.startsWith("6") && !barcode.startsWith("7") && !barcode.startsWith("8"))) { |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && !wrkMastList.isEmpty()) { |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && staProtocol104.isLoading() && staProtocol104.getWorkNo() == 0 && (barcode.startsWith("6") || barcode.startsWith("5"))){ |
| | | errMsg = "104站有物但是无工作号,请检查"; |
| | | back = true; |
| | | }if (!back && (!Cools.isEmpty(wrkMast1) && wrkMast1.getIoType() > 100)){ |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && (staProtocol104.isLoading() && Cools.isEmpty(wrkMast1)) && (barcode.startsWith("5") || barcode.startsWith("6"))){ |
| | | errMsg = "104站有物但是对应的工作号无工作档,请检查"; |
| | | back = true; |
| | | } |
| | | |
| | | // 退回 |
| | | if (back) { |
| | | log.info("errmsg: " + errMsg); |
| | | News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", pickSta.getStaNo(), errMsg); |
| | | News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", pickSta.getStaNo(), errMsg); |
| | | MessageQueue.offer(SlaveType.Led, pickSta.getLed(), new Task(5, errMsg)); |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | |
| | | && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) { |
| | | News.warnNoLog("" + mark + " - 0" + " - 开始执行堆垛机入出库作业下发"); |
| | | // 如果最近一次是入库模式 |
| | | // if (crnProtocol.getLastIo().equals("I")) { |
| | | // if (basCrnp.getInEnable().equals("Y")) { |
| | | // //mark - 1 - .... |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // crnProtocol.setLastIo("O"); |
| | | // } else if (basCrnp.getOutEnable().equals("Y")) { |
| | | // //mark - 2 - .... |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // crnProtocol.setLastIo("I"); |
| | | // } |
| | | // } |
| | | // 如果最近一次是出库模式 |
| | | // else if (crnProtocol.getLastIo().equals("O")) { |
| | | // if (basCrnp.getOutEnable().equals("Y")) { |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // crnProtocol.setLastIo("I"); |
| | | // } else if (basCrnp.getInEnable().equals("Y")) { |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // crnProtocol.setLastIo("O"); |
| | | // } |
| | | // } |
| | | if (ioControl==1){ |
| | | //入库优先 先执行入库再执行出库 |
| | | Integer inCount=wrkMastService.selectIn(); |
| | | if (inCount == 0 && basCrnp.getOutEnable().equals("Y")){ |
| | | this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | } |
| | | if (basCrnp.getInEnable().equals("Y")){ |
| | | this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | } |
| | | }else if (ioControl==2){ |
| | | //出库优先 先执行出库再执行入库 |
| | | Integer outCount=wrkMastService.selectOut(); |
| | | if (outCount==0 && basCrnp.getInEnable().equals("Y")){ |
| | | this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | } |
| | | if (basCrnp.getOutEnable().equals("Y")){ |
| | | this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | } |
| | | }else if(ioControl==3){ |
| | | //入出库交替执行 不做限制 |
| | | // 如果最近一次是入库模式 |
| | | if (crnProtocol.getLastIo().equals("I")) { |
| | | if (basCrnp.getInEnable().equals("Y")) { |
| | | if (crnProtocol.getLastIo().equals("I")) { |
| | | if (basCrnp.getInEnable().equals("Y")) { |
| | | //mark - 1 - .... |
| | | this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | crnProtocol.setLastIo("O"); |
| | | } else if (basCrnp.getOutEnable().equals("Y")) { |
| | | } else if (basCrnp.getOutEnable().equals("Y")) { |
| | | //mark - 2 - .... |
| | | this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | crnProtocol.setLastIo("I"); |
| | | } |
| | | } |
| | | // 如果最近一次是出库模式 |
| | | else if (crnProtocol.getLastIo().equals("O")) { |
| | | if (basCrnp.getOutEnable().equals("Y")) { |
| | | this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | crnProtocol.setLastIo("I"); |
| | | } else if (basCrnp.getInEnable().equals("Y")) { |
| | | this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | } |
| | | } |
| | | // 如果最近一次是出库模式 |
| | | else if (crnProtocol.getLastIo().equals("O")) { |
| | | if (basCrnp.getOutEnable().equals("Y")) { |
| | | this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | crnProtocol.setLastIo("I"); |
| | | } else if (basCrnp.getInEnable().equals("Y")) { |
| | | this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // if (ioControl==1){ |
| | | // //入库优先 先执行入库再执行出库 |
| | | // Integer inCount=wrkMastService.selectIn(); |
| | | // if (inCount == 0 && basCrnp.getOutEnable().equals("Y")){ |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // } |
| | | // if (basCrnp.getInEnable().equals("Y")){ |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // } |
| | | // }else if (ioControl==2){ |
| | | // //出库优先 先执行出库再执行入库 |
| | | // Integer outCount=wrkMastService.selectOut(); |
| | | // if (outCount==0 && basCrnp.getInEnable().equals("Y")){ |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // } |
| | | // if (basCrnp.getOutEnable().equals("Y")){ |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // } |
| | | // }else if(ioControl==3){ |
| | | // //入出库交替执行 不做限制 |
| | | // // 如果最近一次是入库模式 |
| | | // if (crnProtocol.getLastIo().equals("I")) { |
| | | // if (basCrnp.getInEnable().equals("Y")) { |
| | | // //mark - 1 - .... |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // crnProtocol.setLastIo("O"); |
| | | // } else if (basCrnp.getOutEnable().equals("Y")) { |
| | | // //mark - 2 - .... |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // crnProtocol.setLastIo("I"); |
| | | // } |
| | | // } |
| | | // // 如果最近一次是出库模式 |
| | | // else if (crnProtocol.getLastIo().equals("O")) { |
| | | // if (basCrnp.getOutEnable().equals("Y")) { |
| | | // this.locToCrnStn(crn, crnProtocol, mark); // 出库 |
| | | // crnProtocol.setLastIo("I"); |
| | | // } else if (basCrnp.getInEnable().equals("Y")) { |
| | | // this.crnStnToLoc(crn, crnProtocol, mark); // 入库 |
| | | // crnProtocol.setLastIo("O"); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 库位移转 |
| | | //mark - 3 - .... |
| | | this.locToLoc(crn, crnProtocol, mark); |
| | |
| | | break; |
| | | // continue; |
| | | } |
| | | |
| | | // 堆垛机出库站可出信号校验参数 |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "OutStationVerify")); |
| | | boolean out = false; |
| | | if (config != null){ |
| | | if (config.getValue().equals("Y")){ |
| | | if (staProtocol.isOutEnable()){ |
| | | out = true; // 校验堆垛机出库站可出信号 出库站可出 |
| | | }else { |
| | | out = false; // 校验堆垛机出库站信号 出库站不可出 |
| | | } |
| | | }else if (config.getValue().equals("N")){ |
| | | out = true; // 不校验堆垛机出库站可出信号 |
| | | }else { |
| | | throw new CoolException("校验堆垛机出库站可出信号参数异常 请马上检查参数对应的值"); |
| | | } |
| | | } |
| | | |
| | | // 判断堆垛机出库站状态 |
| | | if (staProtocol.isAutoing() && !staProtocol.isLoading() && staDetl.getCanouting() != null && staDetl.getCanouting().equals("Y") |
| | | && staProtocol.getWorkNo() == 0 && staProtocol.isOutEnable()) { |
| | | && staProtocol.getWorkNo() == 0 && out) { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | // 堆垛机控制过滤 |
| | |
| | | } |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | News.warnNoLog("" + mark + " - 2" + " - 6" + " - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}", wrkMast.getWrkNo()); |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬! |
| | | if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | News.warnNoLog("" + mark + " - 2" + " - 7" + " - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位状态={}", shallowLoc.getLocSts()); |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | if (null == waitWrkMast) { |
| | | News.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | } else { |
| | | if (waitWrkMast.getWrkSts() == 11) { |
| | | waitWrkMast.setIoPri(15D); |
| | | waitWrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | News.error("" + mark + " - 2" + " - 8" + " - 调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | } |
| | | continue; |
| | | } else { |
| | | |
| | | } |
| | | } |
| | | } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | News.warnNoLog("" + mark + " - 2" + " - 9" + " - // F、D 库位状态={}", shallowLoc.getLocSts()); |
| | | // if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | // News.warnNoLog("" + mark + " - 2" + " - 6" + " - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}", wrkMast.getWrkNo()); |
| | | // String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | // LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬! |
| | | // if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | | // News.warnNoLog("" + mark + " - 2" + " - 7" + " - // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬!库位状态={}", shallowLoc.getLocSts()); |
| | | // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | //2022-08-16 modify,不根据updmk标记移库任务(容易被取消导致堵塞),查询工作档是否存在任务 |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | // 此标记避免多次执行移库任务 |
| | | // 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, mark); |
| | | } |
| | | News.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | continue; |
| | | } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { |
| | | News.warnNoLog("" + mark + " - 2" + " - 10" + " - // Q、S 库位状态={}", shallowLoc.getLocSts()); |
| | | WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { |
| | | News.infoNoLog("" + mark + " - 2" + " - 11" + " - // F、D 工作状态(判断条件为==4)={}", waitWrkMast.getWrkSts()); |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | // if (null == waitWrkMast) { |
| | | // News.error("{}库位异常,未检索到相应工作档!", shallowLocNo); |
| | | // } else { |
| | | // if (waitWrkMast.getWrkSts() == 11) { |
| | | // waitWrkMast.setIoPri(15D); |
| | | // waitWrkMast.setModiTime(new Date()); |
| | | // if (wrkMastMapper.updateById(waitWrkMast) == 0) { |
| | | // News.error("" + mark + " - 2" + " - 8" + " - 调整工作档优先级失败!工作号={}", waitWrkMast.getWrkNo()); |
| | | // } |
| | | // continue; |
| | | // } else { |
| | | // |
| | | // } |
| | | // } |
| | | // } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { |
| | | // News.warnNoLog("" + mark + " - 2" + " - 9" + " - // F、D 库位状态={}", shallowLoc.getLocSts()); |
| | | //// WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); |
| | | // //2022-08-16 modify,不根据updmk标记移库任务(容易被取消导致堵塞),查询工作档是否存在任务 |
| | | // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | // // 此标记避免多次执行移库任务 |
| | | //// 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, mark); |
| | | // } |
| | | // News.error("{}任务出库失败,浅库位堵塞!浅库位号:{}", wrkMast.getWrkNo(), shallowLocNo); |
| | | // continue; |
| | | // } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { |
| | | // News.warnNoLog("" + mark + " - 2" + " - 10" + " - // Q、S 库位状态={}", shallowLoc.getLocSts()); |
| | | // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); |
| | | // if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { |
| | | // News.infoNoLog("" + mark + " - 2" + " - 11" + " - // F、D 工作状态(判断条件为==4)={}", waitWrkMast.getWrkSts()); |
| | | // continue; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, emptyInSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | String barcode = barcodeThread.getBarcode(); |
| | | // 获取空板入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo()); |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | // 检测是否有出库任务 如果有出库任务 入库就停止 |
| | | List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",1).in("wrk_sts", 11, 12)); |
| | | // 检测104站(堆垛机出库站 入库站)是否有物 如果有物没有工作号 入库停止 如果有物工作号是出库 入库停止 如果有物工作号是入库 可以入库 如果有物工作号不存在 入库停止 |
| | | StaProtocol staProtocol104 = devpThread.getStation().get(104); |
| | | if (staProtocol104 == null){ |
| | | log.error("104站点信息未获取"); |
| | | continue; |
| | | } |
| | | //104站有物 有工作号 判断这个任务的类型 |
| | | WrkMast wrkMast1 = new WrkMast(); |
| | | if (staProtocol104.isLoading() && staProtocol104.getWorkNo() != 0){ |
| | | wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", staProtocol104.getWorkNo())); |
| | | } |
| | | // 判断托盘码格式 |
| | | if (Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)){ |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && (!barcode.startsWith("5") && !barcode.startsWith("6") && !barcode.startsWith("7") && !barcode.startsWith("8"))) { |
| | | errMsg = "托盘码格式有误--->" + barcode; |
| | | back = true; |
| | | } |
| | | if (!back && !wrkMastList.isEmpty()) { |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && staProtocol104.isLoading() && staProtocol104.getWorkNo() == 0 && (barcode.startsWith("5") || barcode.startsWith("6"))){ // 104虽然有物没有工作号 但是如果102的货物要进的是2号堆垛机 不能阻拦 (1号堆垛机条码 5xxx 6xxx 2号堆垛机 7xxx 8xxx) |
| | | errMsg = "104站有物但是无工作号,请检查"; |
| | | back = true; |
| | | }if (!back && (!Cools.isEmpty(wrkMast1) && wrkMast1.getIoType() > 100)){ |
| | | errMsg = "有出库任务,入库停止"; |
| | | back = true; |
| | | }if (!back && (staProtocol104.isLoading() && Cools.isEmpty(wrkMast1)) && (barcode.startsWith("5") || barcode.startsWith("6"))){ // 同上 |
| | | errMsg = "104站有物但是对应的工作号无工作档,请检查"; |
| | | back = true; |
| | | } |
| | | |
| | | // 退回 |
| | | if (back) { |
| | | log.info("errmsg: " + errMsg); |
| | | MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(3, errMsg)); |
| | | |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | staProtocol.setWorkNo(wrkNo);//退回 工作号:10000 |
| | | News.info("{}PLC入库回退:{},任务号:{}", emptyInSta.getStaNo(), errMsg, wrkNo); |
| | | staProtocol.setStaNo(emptyInSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("输送线下发(正在执行出库任务 空板入库暂停):" + wrkNo + "," + emptyInSta.getBackSta()); |
| | | break;//托盘退回不生成工作档 |
| | | } |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() |
| | | && staProtocol.isLoading() |
| | |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setBarcode(barcode); // 空托盘入库需要根据托盘码分库位 |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | basDevp.setLoading(loading?"Y":"N"); |
| | | basDevp.setInEnable(inEnable?"Y":"N"); |
| | | basDevp.setOutEnable(outEnable?"Y":"N"); |
| | | basDevp.setLocType1((short) 0); // 高低类型{0:未知,1:低库位,2:高库位,5:中库位} |
| | | basDevp.setLocType1((short) 0); // 高低类型{0:未知,1:低库位,2:高库位} |
| | | basDevp.setLocType2((short) 0); // 宽窄类型{0:未知,1:窄库位,2:宽库位} |
| | | basDevp.setLocType3((short) 0); // 轻重类型{0:未知,1:轻库位,2:重库位} |
| | | basDevp.setLocType1(high != low && low ? (short) 1 : (short) 2); |
| | |
| | | private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>(); |
| | | private short heartBeatVal = 1; |
| | | private StaError1 staError1; |
| | | // public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{ |
| | | // |
| | | // }}; |
| | | public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103); |
| | | add(104);add(105); |
| | | add(104);add(105);add(106); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | |
| | | }};*/ |
| | | |
| | | public static final ArrayList<Integer> BarcodeList1 = new ArrayList<Integer>() {{ |
| | | add(1); add(2);add(3);add(4);add(5); |
| | | add(1); add(2);add(3);add(4);add(5);add(6); |
| | | }}; |
| | | |
| | | /* public static final ArrayList<Integer> BarcodeList2 = new ArrayList<Integer>() {{ |
| | |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> staNoWeight1 = new ArrayList<Integer>() {{ |
| | | add(101);add(102);add(103);add(104);add(105); |
| | | add(101);add(102);add(103);add(104);add(105);add(106); |
| | | }}; |
| | | |
| | | /*public static final ArrayList<Integer> staNoWeight2 = new ArrayList<Integer>() {{ |
| | |
| | | staProtocol.setHigh(status[6]); // 高库位 |
| | | staProtocol.setLow(status[7]); // 低库位 |
| | | |
| | | status = siemensS7Net.getByteTransform().TransBool(result.Content, i * 8 + 7, 1); |
| | | staProtocol.setMid(status[0]); // 中库位 |
| | | |
| | | if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { |
| | | staProtocol.setPakMk(true); |
| | | } |
| | |
| | | |
| | | //条码扫描器 |
| | | ArrayList<Integer> barcodeList = getBarcodeList(); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.200", (short) (barcodeList.size() * 8)); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840", (short) (barcodeList.size() * 8)); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeList.size(); i++) { |
| | | Integer barcodeId = barcodeList.get(i); |
| | |
| | | //外形检测 |
| | | ArrayList<Integer> staNoErrs = staNosErrList; |
| | | int staNoErrsSize = staNoErrs.size(); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.102", (short) (staNoErrsSize * 7)); |
| | | OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.802", (short) (staNoErrsSize * 7)); |
| | | if (resultErr.IsSuccess) { |
| | | for (int i = 0; i < staNoErrsSize; i++) { |
| | | Integer siteId = staNoErrs.get(i); // 站点编号 |
| | |
| | | # field-strategy: 0 |
| | | |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | | path: ./stock/out/@pom.build.finalName@/logs |
| | | |
| | | super: |
| | | pwd: xltys1995 |
| | |
| | | enable: false |
| | | |
| | | wms: |
| | | url: 127.0.0.1:8080/zjhlasrs |
| | | url: 127.0.0.1:8080/wms |
| | | |
| | | # 下位机配置 |
| | | wcs-slave: |
| | |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | staNo: 104 |
| | | row: 2 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机入库站点 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 105 |
| | | row: 3 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | staNo: 104 |
| | | row: 2 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 105 |
| | | row: 3 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机2 |
| | |
| | | # 堆垛机入库站点 |
| | | crnInStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 2 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机入库站点 |
| | | crnInStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 105 |
| | | staNo: 103 |
| | | row: 3 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[0]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 101 |
| | | row: 2 |
| | | bay: 1 |
| | | lev: 1 |
| | | # 堆垛机出库站点 |
| | | crnOutStn[1]: |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staNo: 105 |
| | | row: 3 |
| | | staNo: 106 |
| | | row: 4 |
| | | bay: 1 |
| | | lev: 1 |
| | | # plc |
| | |
| | | inSta[0]: |
| | | staNo: 102 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 103 |
| | | backSta: 101 |
| | | led: ${wcs-slave.led[0].id} |
| | | # # 入库口2 |
| | | # inSta[1]: |
| | | # staNo: 223 |
| | | # barcode: ${wcs-slave.barcode[1].id} |
| | | # backSta: 222 |
| | | # led: ${wcs-slave.led[1].id} |
| | | # 拣料入库口1 |
| | | # 拣料入库口 |
| | | pickSta[0]: |
| | | staNo: 104 |
| | | staNo: 102 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | led: ${wcs-slave.led[1].id} |
| | | backSta: 104 |
| | | # # 拣料入库口2 |
| | | # pickSta[1]: |
| | | # staNo: 225 |
| | | # barcode: ${wcs-slave.barcode[1].id} |
| | | # led: ${wcs-slave.led[1].id} |
| | | # backSta: 224 |
| | | # 空板入库口1 |
| | | led: ${wcs-slave.led[0].id} |
| | | backSta: 101 |
| | | # 空板入库口 |
| | | emptyInSta[0]: |
| | | staNo: 102 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 103 |
| | | backSta: 101 |
| | | led: ${wcs-slave.led[0].id} |
| | | # 空板入库口1 |
| | | emptyInSta[1]: |
| | | staNo: 104 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | backSta: 104 |
| | | led: ${wcs-slave.led[0].id} |
| | | # 空板入库口2 |
| | | #emptyInSta[1]: |
| | | #staNo: 223 |
| | | #barcode: ${wcs-slave.barcode[0].id} |
| | | #backSta: 222 |
| | | #led: ${wcs-slave.led[1].id} |
| | | # 出库口1 |
| | | # 出库口 |
| | | outSta[0]: |
| | | staNo: 104 |
| | | staNo: 105 |
| | | # 出库口1 |
| | | outSta[1]: |
| | | staNo: 106 |
| | | # 条码扫描仪1 |
| | | barcode[0]: |
| | | id: 1 |
| | |
| | | # LED1 |
| | | led[0]: |
| | | id: 121 |
| | | ip: 10.10.10.150 |
| | | ip: 127.0.0.1 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 102 |
| | |
| | | # LED2 |
| | | led[1]: |
| | | id: 123 |
| | | ip: 10.10.10.151 |
| | | ip: 127.0.0.1 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 104 |
| | | staArr: 105 |
| | | crnId: 1 |
| | | |
| | |
| | | { |
| | | "type": "rackDescs", |
| | | "id": "lb_desc2", |
| | | "text": "#1", |
| | | "text": "#4", |
| | | "top": 160, |
| | | "left": 460, |
| | | "width": 30, |
| | |
| | | { |
| | | "type": "rackDescs", |
| | | "id": "lb_desc3", |
| | | "text": "#2", |
| | | "text": "#3", |
| | | "top": 210, |
| | | "left": 460, |
| | | "width": 30, |
| | |
| | | { |
| | | "type": "rackDescs", |
| | | "id": "lb_desc4", |
| | | "text": "#3", |
| | | "text": "#2", |
| | | "top": 300, |
| | | "left": 460, |
| | | "width": 30, |
| | |
| | | { |
| | | "type": "rackDescs", |
| | | "id": "lb_desc4", |
| | | "text": "#4", |
| | | "text": "#1", |
| | | "top": 350, |
| | | "left": 460, |
| | | "width": 30, |
| | |
| | | "crns": [ |
| | | { |
| | | "type": "crane", |
| | | "id": "crn-1", |
| | | "id": "crn-2", |
| | | "text": "1", |
| | | "top": 187, |
| | | "left": 1250, |
| | |
| | | }, |
| | | { |
| | | "type": "crane", |
| | | "id": "crn-2", |
| | | "id": "crn-1", |
| | | "text": "1", |
| | | "top": 327, |
| | | "left": 1250, |
| | |
| | | "width": 2900, |
| | | "height": 600, |
| | | "stns": [ |
| | | // { "type": "stn", "id": "site-100", "text": "100", "top": 80, "left": 94, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-103", "text": "103", "top": 160, "left": 1430, "width": 60, "height": 23 }, |
| | | // { "type": "stn", "id": "site-102", "text": "102", "top": 160, "left": 1365, "width": 60, "height": 23 }, |
| | | // { "type": "stn", "id": "site-101", "text": "101", "top": 160, "left": 1301, "width": 60, "height": 23 }, |
| | | // { "type": "stn", "id": "site-110", "text": "110", "top": 130, "left": 1784, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-111", "text": "111", "top": 130, "left": 1826, "width": 40, "height": 23 }, |
| | | // |
| | | // { "type": "stn", "id": "site-112", "text": "112", "top": 160, "left": 94, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-113", "text": "113", "top": 160, "left": 52, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-114", "text": "114", "top": 160, "left": 10, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-115", "text": "115", "top": 160, "left": 1742, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-116", "text": "116", "top": 160, "left": 1784, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-117", "text": "117", "top": 160, "left": 1826, "width": 40, "height": 23 }, |
| | | // |
| | | // { "type": "stn", "id": "site-118", "text": "118", "top": 240, "left": 94, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-119", "text": "119", "top": 240, "left": 52, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-120", "text": "120", "top": 240, "left": 10, "width": 40, "height": 23 }, |
| | | { "type": "stn", "id": "site-105", "text": "105", "top": 130, "left": 1430, "width": 120, "height": 70 }, |
| | | { "type": "stn", "id": "site-101", "text": "101", "top": 210, "left": 1559, "width": 120, "height": 23 }, |
| | | { "type": "stn", "id": "site-102", "text": "102", "top": 210, "left": 1430, "width": 120, "height": 23 }, |
| | | { "type": "stn", "id": "site-106", "text": "106", "top": 163, "left": 1301, "width": 120, "height": 23 }, |
| | | { "type": "stn", "id": "site-103", "text": "103", "top": 210, "left": 1301, "width": 120, "height": 23 }, |
| | | { "type": "stn", "id": "site-104", "text": "104", "top": 260, "left": 1430, "width": 120, "height": 70 }, |
| | | // { "type": "stn", "id": "site-123", "text": "123", "top": 210, "left": 1301, "width": 60, "height": 23 }, |
| | | |
| | | // { "type": "stn", "id": "site-124", "text": "124", "top": 160, "left": 1742, "width": 120, "height": 23 }, |
| | | // { "type": "stn", "id": "site-125", "text": "125", "top": 240, "left": 1742, "width": 120, "height": 23 }, |
| | | // { "type": "stn", "id": "site-126", "text": "126", "top": 320, "left": 1742, "width": 120, "height": 23 }, |
| | | // { "type": "stn", "id": "site-127", "text": "127", "top": 320, "left": 1742, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-128", "text": "128", "top": 320, "left": 1784, "width": 40, "height": 23 }, |
| | | // { "type": "stn", "id": "site-129", "text": "129", "top": 320, "left": 1826, "width": 40, "height": 23 } |
| | | { "type": "stn", "id": "site-105", "text": "105", "top": 130, "left": 1400, "width": 90, "height": 70 }, |
| | | { "type": "stn", "id": "site-101", "text": "101", "top": 210, "left": 1500, "width": 90, "height": 23 }, |
| | | { "type": "stn", "id": "site-102", "text": "102", "top": 210, "left": 1400, "width": 90, "height": 23 }, |
| | | { "type": "stn", "id": "site-106", "text": "106", "top": 163, "left": 1301, "width": 90, "height": 23 }, |
| | | { "type": "stn", "id": "site-103", "text": "103", "top": 210, "left": 1301, "width": 90, "height": 23 }, |
| | | { "type": "stn", "id": "site-104", "text": "104", "top": 260, "left": 1400, "width": 90, "height": 70 }, |
| | | ], |
| | | "barcode": [] |
| | | } |
| | |
| | | <!-- <img src="../static/images/zy-logo.png" alt="徐工汉云" height="44" width="80">--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null"></span>当前任务模式</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="value" lay-verify="required"> |
| | | <option value="1">入库优先</option> |
| | | <option value="2">出库优先</option> |
| | | <option value="3">出入库交替执行</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- 货架 + 堆垛机 + 入库站点 --> |
| | | <div class="main-part"> |
| | | |