| | |
| | | |
| | | crnOutSiteToRgvSite.put(1093, (short) 1091);crnOutSiteToRgvSite.put(1099, (short) 1097);crnOutSiteToRgvSite.put(1107, (short) 1105); |
| | | |
| | | crnOutSiteToRgvSite2.put(1093, (short) 1091);crnOutSiteToRgvSite2.put(1099, (short) 1097);crnOutSiteToRgvSite2.put(1107, (short) 1105); |
| | | crnOutSiteToRgvSite2.put(1087, (short) 1089);crnOutSiteToRgvSite2.put(1084, (short) 1086);crnOutSiteToRgvSite2.put(1081, (short) 1083); |
| | | crnOutSiteToRgvSite2.put(1043, (short) 1041);crnOutSiteToRgvSite2.put(1016, (short) 1018);crnOutSiteToRgvSite2.put(1008, (short) 1006); |
| | | } |
| | |
| | | WrkDetl wrkDetl1 = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetl1 != null) { |
| | | // 出库任务的四个出库站点,判断当前物料一批出库的时间 获取当前已完成 / 总数 |
| | | if(wrkMast.getIoType() == 101 && (wrkMast.getStaNo() == 1024 ||wrkMast.getStaNo() == 1040 ||wrkMast.getStaNo() == 1043 ||wrkMast.getStaNo() == 1016) ) { |
| | | if(wrkMast.getIoType() == 101 && (wrkMast.getStaNo() == 1024 ||wrkMast.getStaNo() == 1031 ||wrkMast.getStaNo() == 1043 ||wrkMast.getStaNo() == 1016) ) { |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("io_type", 101).eq("io_time", wrkMast.getIoTime())); |
| | | int countHis = wrkMastMapper.selectCountHisByIoTypeAndIoTime(101, wrkMast.getIoTime()); |
| | | matDto.setOutTotal(count+countHis); |
| | |
| | | matDto.setWeight(wrkDetl1.getWeight()); |
| | | matDto.setGrossWeight(wrkDetl1.getManLength()); |
| | | ledCommand.getMatDtos().add(matDto); |
| | | } else { |
| | | // 入库空托盘,异常去异常口显示报警信息,给空工作明细 |
| | | if(wrkMast.getIoType() == 3) { |
| | | ledCommand.getMatDtos().add(matDto); |
| | | } |
| | | } |
| | | // 订单 |
| | | // if(wrkDetl1 != null && !Cools.isEmpty(wrkDetl1.getOrderNo())) { |
| | |
| | | // 根据罐装线反馈任务号查询工作档 |
| | | WrkMast wrkMast = wrkMastService.selectById(staProtocol.getWrkNo()); |
| | | if(wrkMast == null) { |
| | | log.error("出罐装线货物任务号工作档不存在:{}",staProtocol.getWrkNo()); |
| | | News.error("出罐装线货物任务号工作档不存在:{}",staProtocol.getWrkNo()); |
| | | continue; |
| | | } else if(wrkMast.getWrkSts() != 2) { |
| | | log.error("出罐装线货物任务号工作档状态异常,不为2:{}",staProtocol.getWrkNo()); |
| | |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.getWorkNo() != 0) { |
| | | // 查询工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectByWrkNo(staProtocol.getWorkNo()); |
| | | if (wrkMast != null && wrkMast.getWhsType() == null && wrkMast.getIoType() != 120) { |
| | | if (wrkMast != null && wrkMast.getWhsType() == null) { |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | staProtocol.setBucketType(wrkDetl.getMatnr()); |
| | | staProtocol.setBucketCount(wrkDetl.getAnfme().intValue()); |
| | | if(wrkMast.getIoType() == 120) { |
| | | staProtocol.setBucketType("1"); |
| | | staProtocol.setBucketCount(1); |
| | | } else { |
| | | staProtocol.setBucketType(wrkDetl.getMatnr()); |
| | | staProtocol.setBucketCount(wrkDetl.getAnfme().intValue()); |
| | | } |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, inGzxSiteList.indexOf(site) + 4, new Task(4, staProtocol)); |
| | | if (result) { |
| | | log.info("告诉罐装线入库桶信息命令队列推送成功:" + staProtocol.getWorkNo() + "," +"托盘码:" + wrkMast.getBarcode() +"," + site + "," + staProtocol.getBucketType() +"," + staProtocol.getBucketCount()); |
| | |
| | | } |
| | | |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() == 0 && staProtocol.isPakMk()) { |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() == 0) { |
| | | // 更新站点信息 且 下发plc命令 |
| | | StaProtocol staProtocolNew = new StaProtocol(); |
| | | staProtocolNew.setSiteId(staProtocol.getSiteId()); |
| | |
| | | staProtocolNew.setStaNo(crnOutSiteToRgvSite2.get(wrkMast.getSourceStaNo()) != null ? crnOutSiteToRgvSite2.get(wrkMast.getSourceStaNo()) :wrkMast.getSourceStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devpId, new Task(2, staProtocolNew)); |
| | | Integer siteId = staProtocol.getSiteId(); |
| | | if(siteId == 1081 || siteId == 1084 || siteId == 1087) { |
| | | staProtocol.setPlaceableFlag(1); |
| | | MessageQueue.offer(SlaveType.Devp, outGzxSiteList.indexOf(staProtocol.getSiteId()) + 4, new Task(5, staProtocol)); |
| | | } |
| | | log.info("手动站位转移输送线下发:" + staProtocolNew.getWorkNo() + "," + staProtocolNew.getSiteId() + "->" + staProtocolNew.getStaNo()); |
| | | if (!result) { |
| | | News.errorNoLog("" + " - 1" + " - 更新plc站点信息失败"); |