|  |  |  | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | public synchronized void liftInExecute() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", WrkStsType.NEW_INBOUND.sts, WrkStsType.INBOUND_DEVICE_RUN.sts, WrkStsType.INBOUND_LIFT_RUN_COMPLETE.sts).in("source_sta_no", 1012, 1022)); | 
|---|
|  |  |  | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts", WrkStsType.NEW_INBOUND.sts, WrkStsType.INBOUND_DEVICE_RUN.sts, WrkStsType.INBOUND_LIFT_RUN_COMPLETE.sts).in("source_sta_no", 1012, 1022, 1031)); | 
|---|
|  |  |  | for (WrkMast wrkMast : wrkMasts) { | 
|---|
|  |  |  | boolean step0 = this.liftInExecuteStep0(wrkMast);//设备上走 | 
|---|
|  |  |  | if (!step0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | News.info("{}任务,{}站点,无托盘", wrkMast.getWrkNo(), staProtocol.getSiteId()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!staProtocol.getBarcode().equals(wrkMast.getBarcode())) { | 
|---|
|  |  |  | News.info("{}任务,{}站点,托盘码不匹配,站点托盘码:{},任务托盘码:{}", wrkMast.getWrkNo(), staProtocol.getSiteId(), staProtocol.getBarcode(), wrkMast.getBarcode()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | if (wrkMast.getSourceStaNo() != 1031) { | 
|---|
|  |  |  | if (!staProtocol.getBarcode().equals(wrkMast.getBarcode())) { | 
|---|
|  |  |  | News.info("{}任务,{}站点,托盘码不匹配,站点托盘码:{},任务托盘码:{}", wrkMast.getWrkNo(), staProtocol.getSiteId(), staProtocol.getBarcode(), wrkMast.getBarcode()); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //判断提升机是否有其他任务 | 
|---|
|  |  |  | WrkMast liftWrkMast = wrkMastService.selectLiftWrkMastAndWrkNo(1, wrkMast.getWrkNo(), wrkMast.getMainWrkNo()); | 
|---|
|  |  |  | if (liftWrkMast != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | News.error("输送线已确认且任务完成状态,复位失败,但未找到工作档。输送线号={},完结工作号={}", staProtocol.getSiteId(), staProtocol.getFinishWorkNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (staProtocol.getSiteId() == 1031) { | 
|---|
|  |  |  | wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", staProtocol.getFinishWorkNo()).eq("wrk_sts", WrkStsType.OUTBOUND_DEVP_RUN_2.sts)); | 
|---|
|  |  |  | if (wrkMast != null) { | 
|---|
|  |  |  | wrkMast.setWrkSts(WrkStsType.COMPLETE_OUTBOUND.sts); | 
|---|
|  |  |  | wrkMast.setModiTime(new Date()); | 
|---|
|  |  |  | if (wrkMastService.updateById(wrkMast)) { | 
|---|
|  |  |  | News.info("输送线已确认且任务完成状态。输送线号={},完结工作号={}", staProtocol.getSiteId(), staProtocol.getFinishWorkNo()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | News.error("输送线已确认且任务完成状态,复位失败,但未找到工作档。输送线号={},完结工作号={}", staProtocol.getSiteId(), staProtocol.getFinishWorkNo()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (liftThread == null) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, wrkMast1.getLiftNo()); | 
|---|
|  |  |  | String liftLocNo = liftThread.getLiftLocNo(Utils.getLev(wrkMast.getLocNo())); | 
|---|
|  |  |  | if (Utils.getRow(liftLocNo) == Utils.getRow(wrkMast.getSourceLocNo()) && Utils.getBay(liftLocNo) == Utils.getBay(wrkMast.getSourceLocNo())) { | 
|---|
|  |  |  | //取货位置是提升机 | 
|---|
|  |  |  | 
|---|
|  |  |  | OUTBOUND_LIFT_RUN(104, "提升机搬运中"), | 
|---|
|  |  |  | OUTBOUND_LIFT_RUN_COMPLETE(105, "提升机搬运完成"), | 
|---|
|  |  |  | OUTBOUND_DEVP_RUN(106, "输送线搬运中"), | 
|---|
|  |  |  | OUTBOUND_DEVP_RUN_2(107, "输送线搬运中"), | 
|---|
|  |  |  | COMPLETE_OUTBOUND(109, "出库完成"), | 
|---|
|  |  |  | SETTLE_OUTBOUND(110, "出库库存更新"), | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | if (this.ioModeOf2_5 != null && (this.ioModeOf2_5.id == 0 || this.ioModeOf2_5.id == 1)) { | 
|---|
|  |  |  | short[] array = new short[1]; | 
|---|
|  |  |  | array[0] = this.ioModeOf2_5.id; | 
|---|
|  |  |  | if (!siemensS7Net.Write("DB83.80", this.ioModeOf2_5.id).IsSuccess) { | 
|---|
|  |  |  | if (!siemensS7Net.Write("DB83.80", this.ioModeOf2_5.id == 1).IsSuccess) { | 
|---|
|  |  |  | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2.5F入出库模式失败", this.ioModeOf2_5)); | 
|---|
|  |  |  | log.error("【{0}】写入输送线2.5F入出库模式失败。输送线plc编号={}", this.ioModeOf2_5); | 
|---|
|  |  |  | } else { | 
|---|