| | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | @Value("${open-door.site}") |
| | | private String openDoorSite; |
| | | |
| | | public Integer wrkNo = 9901; |
| | | |
| | | /** |
| | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | News.warnNoLog(""+mark+" - 2"+" - 6"+" - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}",wrkMast.getWrkNo()); |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | String shallowLocNo = ""; |
| | | if (Utils.getRow(wrkMast.getSourceLocNo()) == 11 && Utils.getBay(wrkMast.getSourceLocNo()) <= 18){ |
| | | shallowLocNo = "10" + Utils.getBay(wrkMast.getSourceLocNo()) + Utils.getLev(wrkMast.getSourceLocNo()); |
| | | }else { |
| | | shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); |
| | | } |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // O.空库位、Q.拣料/盘点/并板再入库、S.入库预约、X.禁用 直接搬! |
| | | if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { |
| | |
| | | |
| | | if (loc != null) { |
| | | if (Utils.isDeepLoc(slaveProperties, loc.getLocNo())) { |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo()); |
| | | String shallowLocNo = ""; |
| | | if (row == 11){ |
| | | shallowLocNo = "10" + loc.getBay1() + loc.getLev1(); |
| | | }else { |
| | | shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo()); |
| | | } |
| | | LocMast shallowLoc1 = locMastService.selectById(shallowLocNo); |
| | | if (!shallowLoc1.getLocSts().equals("O")) { |
| | | loc = null; |
| | |
| | | if (Utils.isShallowLoc(slaveProperties, row)) { |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType2()); |
| | | |
| | | if (null != loc) {//对应深库位非在库状态,不能移库 |
| | | if (null != loc && row != 9 && row != 10) {//对应深库位非在库状态,不能移库 |
| | | String deepLoc = Utils.getDeepLoc(slaveProperties, loc.getLocNo()); |
| | | LocMast deepLoc1 = locMastService.selectById(deepLoc); |
| | | if (!deepLoc1.getLocSts().equals("F") && !deepLoc1.getLocSts().equals("D")) { |
| | |
| | | wrkMast.setCrnNo(crn.getId()); |
| | | wrkMast.setSourceLocNo(shallowLoc.getLocNo()); // 源库位 |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt(shallowLoc.getFullPlt()); // 满板 |
| | | wrkMast.setFullPlt(shallowLoc.getLocSts().equals("F") ? "Y" : "N"); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk(shallowLoc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | |
| | | } |
| | | |
| | | public synchronized void writePlc305() { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305)); |
| | | if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) { |
| | | WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol305 = devpThread.getStation().get(305); |
| | | if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开 |
| | | // 请求打开 |
| | | if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){ |
| | | log.error("请求开门失败"); |
| | | String[] sites = openDoorSite.split(","); |
| | | for (String site : sites) { |
| | | Integer sta = Integer.valueOf(site); |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", sta)); |
| | | if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) { |
| | | WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol305 = devpThread.getStation().get(sta); |
| | | if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开 |
| | | // 请求打开 |
| | | // if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){ |
| | | if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, site))){ // data为需要开门的站点 通知PLC需要开哪个门 |
| | | log.error("请求开门失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 305)); |
| | | // if (basDevp.getWrkNo() != 0 && basDevp.getWrkNo() != 9999) { |
| | | // WrkMast wrkMast = wrkMastService.selectById(basDevp.getWrkNo()); |
| | | // if(wrkMast != null && wrkMast.getWhsType() != null && wrkMast.getWhsType() == 2) { |
| | | // SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | // StaProtocol staProtocol305 = devpThread.getStation().get(305); |
| | | // if (!staProtocol305.getOpenAskDoor() && !staProtocol305.getIfOpenDoor()) { // 没请求打开 |
| | | // // 请求打开 |
| | | // if(!MessageQueue.offer(SlaveType.Devp, 1, new Task(3, 1))){ |
| | | // log.error("请求开门失败"); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | public synchronized void readPlc305() { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_sts", 16L)); |
| | |
| | | // return; |
| | | // } |
| | | List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L).eq("io_type", 1) |
| | | .eq("source_sta_no", 305).orderBy("appe_time",true)); |
| | | .in("source_sta_no", 305, 1202).orderBy("appe_time",true)); |
| | | for (WrkMast wrkMast : wrkMastList) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol= devpThread.getStation().get(wrkMast.getStaNo()); |