| | |
| | | // 复检重量 |
| | | private double grossWeight; |
| | | |
| | | // 复检合格否 |
| | | private boolean reinspection; |
| | | |
| | | // 源站点 |
| | | private Integer sourceStaNo; |
| | | |
| | |
| | | |
| | | private double weight; |
| | | |
| | | private double grossWeight; |
| | | |
| | | private double length; |
| | | |
| | | private double volume; |
| | |
| | | private String memo; |
| | | |
| | | // 物料数量 |
| | | private Double count; |
| | | private Double anfme; |
| | | |
| | | private Double total; |
| | | |
| | | public MatDto() { |
| | | } |
| | | public MatDto(String matnr, String maknx, String batch, String specs, String manu, String memo, Double count, Double total) { |
| | | this.matnr = matnr; |
| | | this.maknx = maknx; |
| | | this.batch = batch; |
| | | this.specs = specs; |
| | | this.manu = manu; |
| | | this.memo = memo; |
| | | this.count = count; |
| | | this.total = total; |
| | | } |
| | | public MatDto(String matnr,String batch,String specs,String manuDate,String model,double weight, double length,double volume) { |
| | | this.matnr = matnr; |
| | |
| | | this.weight = weight; |
| | | this.length = length; |
| | | this.volume = volume; |
| | | } |
| | | |
| | | public MatDto(String matNo, String maknx, Double count) { |
| | | this.matnr = matNo; |
| | | this.maknx = maknx; |
| | | this.count = count; |
| | | } |
| | | public MatDto(String matNo, String maknx, Double count,String specs) { |
| | | this.specs = specs; |
| | | this.matnr = matNo; |
| | | this.maknx = maknx; |
| | | this.count = count; |
| | | } |
| | | public MatDto(String matNo, String maknx, Double count,Double total,String specs) { |
| | | this.specs = specs; |
| | | this.matnr = matNo; |
| | | this.maknx = maknx; |
| | | this.count = count; |
| | | this.total = total; |
| | | } |
| | | } |
| | |
| | | // 罐装线要桶 罐装线号-桶类型 |
| | | private List<WantBucket> wantBucketFlag; |
| | | |
| | | // 外形检测/称重报错,出到出库口1024 |
| | | private String errMsg; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | public static class WantBucket{ |
| | |
| | | "title='" + title + '\'' + |
| | | ", workNo=" + workNo + |
| | | ", staNo=" + staNo + |
| | | ", count=" + count + |
| | | ", error=" + error + |
| | | ", orderNo=" + orderNo + |
| | | ", cstmrName=" + cstmrName + |
| | | ", finish=" + finish + |
| | | ", sourceStaNo=" + sourceStaNo + |
| | | ", locNo='" + locNo + '\'' + |
| | | ", sourceLocNo='" + sourceLocNo + '\'' + |
| | |
| | | |
| | | private Integer staNo; |
| | | |
| | | private Integer count; |
| | | |
| | | private Integer finish; |
| | | |
| | | private String error; |
| | | |
| | | private String orderNo; |
| | | |
| | | private String cstmrName; |
| | | |
| | | private Integer sourceStaNo; |
| | | |
| | | private String locNo; |
| | |
| | | // 复检重量 |
| | | private double grossWeight; |
| | | |
| | | // 复检合格否 |
| | | private boolean reinspection; |
| | | |
| | | // 出罐装线任务完成,给罐装线写可放信号 1可放,2不可放------------------------------------- |
| | | private int placeableFlag; |
| | | |
| | |
| | | // 读罐装线反馈信息 |
| | | if (slave.getId() > 3) { |
| | | // log.info("读取{}号罐装线plc信息成功",slave.getId()); |
| | | OperateResultExOne<byte[]> read = siemensS7Net.Read("DB101.0", (short) 58); |
| | | OperateResultExOne<byte[]> read = siemensS7Net.Read("DB101.0", (short) 60); |
| | | if (read.IsSuccess) { |
| | | // 15秒打印一下日志 |
| | | if (System.currentTimeMillis() - lastLogTime >= 15000) { |
| | |
| | | if (staProtocol != null) { |
| | | staProtocol.setWantBucketFlag(siemensS7Net.getByteTransform().TransInt16(read.Content, 0));// 罐装线要桶型信号 |
| | | staProtocol.setWrkNo(siemensS7Net.getByteTransform().TransInt16(read.Content, 2)); |
| | | double weight208l1 = siemensS7Net.getByteTransform().TransInt32(read.Content, 4); // 200L桶1净重 |
| | | double weight208l2 = siemensS7Net.getByteTransform().TransInt32(read.Content, 8); // 200L桶2净重 |
| | | double weight208l3 = siemensS7Net.getByteTransform().TransInt32(read.Content, 12); // 200L桶3净重 |
| | | double weight208l4 = siemensS7Net.getByteTransform().TransInt32(read.Content, 16); // 200L桶4净重 |
| | | double weight1T = siemensS7Net.getByteTransform().TransInt32(read.Content, 20); // 1T桶净重 |
| | | double weight208l1 = siemensS7Net.getByteTransform().TransSingle(read.Content, 4); // 200L桶1净重 |
| | | double weight208l2 = siemensS7Net.getByteTransform().TransSingle(read.Content, 8); // 200L桶2净重 |
| | | double weight208l3 = siemensS7Net.getByteTransform().TransSingle(read.Content, 12); // 200L桶3净重 |
| | | double weight208l4 = siemensS7Net.getByteTransform().TransSingle(read.Content, 16); // 200L桶4净重 |
| | | double weight1T = siemensS7Net.getByteTransform().TransSingle(read.Content, 20); // 1T桶净重 |
| | | // log.info("读取工罐装线净重 200l桶1:{},200l桶2:{},200l桶3:{},200l桶4:{},1t桶:{}",weight208l1,weight208l2,weight208l3,weight208l4,weight1T); |
| | | staProtocol.setWeight(weight208l1 + weight208l2 + weight208l3 + weight208l4 + weight1T); |
| | | staProtocol.setGrossWeight(siemensS7Net.getByteTransform().TransInt32(read.Content, 24)); |
| | | staProtocol.setGrossWeight(siemensS7Net.getByteTransform().TransSingle(read.Content, 24)); |
| | | staProtocol.setMatnr(siemensS7Net.getByteTransform().TransString(read.Content, 28,12,"UTF-8")); |
| | | staProtocol.setBatch(siemensS7Net.getByteTransform().TransString(read.Content, 40,10,"UTF-8")); |
| | | staProtocol.setManuDate(siemensS7Net.getByteTransform().TransString(read.Content, 50,8,"UTF-8")); |
| | | staProtocol.setReinspection(siemensS7Net.getByteTransform().TransInt16(read.Content, 58) == 1); |
| | | } |
| | | return; |
| | | } |
| | |
| | | do { |
| | | write = siemensS7Net.Write("DB100.0", common); |
| | | Thread.sleep(200); |
| | | if(write.IsSuccess){ |
| | | OperateResultExOne<byte[]> read = siemensS7Net.Read("DB100.4", (short) 2); |
| | | if(write.IsSuccess && read.IsSuccess){ |
| | | short i = siemensS7Net.getByteTransform().TransInt16(read.Content, 0); |
| | | if ( i != staProtocol.getWorkNo().shortValue()) { |
| | | writeCount++; |
| | | log.error("给罐装线写入桶型信息成功,但回读失败:写入任务号:{},回读任务号:{},输送线plc编号={},写入次数={}",staProtocol.getWorkNo().shortValue(), i, slave.getId(), writeCount); |
| | | continue; |
| | | } |
| | | log.info("给罐装线写入桶型信息成功,回读成功:任务号:{},回读任务号:{},输送线plc编号={},写入次数={}",staProtocol.getWorkNo().shortValue(), i, slave.getId(), writeCount); |
| | | break; |
| | | } |
| | | else { |
| | |
| | | |
| | | taskStaNoToRgvStaNoMap.put(1050,1044);taskStaNoToRgvStaNoMap.put(1078,1044);taskStaNoToRgvStaNoMap.put(1064,1044);taskStaNoToRgvStaNoMap.put(1071,1044);taskStaNoToRgvStaNoMap.put(1096,1094); |
| | | taskStaNoToRgvStaNoMap.put(1104,1100);taskStaNoToRgvStaNoMap.put(1102,1100);taskStaNoToRgvStaNoMap.put(1090,1090);taskStaNoToRgvStaNoMap.put(1002,1001);taskStaNoToRgvStaNoMap.put(1016,1018); |
| | | taskStaNoToRgvStaNoMap.put(1020,1019);taskStaNoToRgvStaNoMap.put(1024,1022);taskStaNoToRgvStaNoMap.put(1035,1034);taskStaNoToRgvStaNoMap.put(1040,1033);taskStaNoToRgvStaNoMap.put(1043,1041); |
| | | taskStaNoToRgvStaNoMap.put(1020,1019);taskStaNoToRgvStaNoMap.put(1024,1022);taskStaNoToRgvStaNoMap.put(1031,1033);taskStaNoToRgvStaNoMap.put(1035,1034);taskStaNoToRgvStaNoMap.put(1040,1033);taskStaNoToRgvStaNoMap.put(1043,1041); |
| | | |
| | | canningLineRgvConnectionSiteList.add(1083);canningLineRgvConnectionSiteList.add(1086); |
| | | canningLineRgvConnectionSiteList.add(1089); |
| | |
| | | if (!staProtocol.isLoading()){ |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo); |
| | | log.error("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo); |
| | | return; |
| | | // 如果超限报警或超重等,出到1024 |
| | | if(errMsg.equals("扫码失败")) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | |
| | | ) { |
| | | if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode) || barcode.startsWith("ERROR")) { |
| | | log.error("{}号条码检测失败,条码信息:{}", inSta.getBarcode(), barcode); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "条码检测失败:"+barcode)); |
| | | continue; |
| | | } |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "条码已重复:" + barcode)); |
| | | continue; |
| | | } |
| | | |
| | |
| | | param.setBucketCount(staProtocol.getBucketCount()); |
| | | param.setTailSupportFlag(staProtocol.isTailSupportFlag()); |
| | | param.setWantBucketFlag(getWantBucketFlag()); |
| | | param.setErrMsg(errMsg); |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | |
| | | StaProtocol staProtocol1084 = devpThread.getStation().get(1084); |
| | | StaProtocol staProtocol1087 = devpThread.getStation().get(1087); |
| | | List<SearchLocParam.WantBucket> wantBucketList = new ArrayList<>(); |
| | | wantBucketList.add(new SearchLocParam.WantBucket(1071,staProtocol1081.getWantBucketFlag())); |
| | | wantBucketList.add(new SearchLocParam.WantBucket(1064,staProtocol1084.getWantBucketFlag())); |
| | | wantBucketList.add(new SearchLocParam.WantBucket(1071,staProtocol1081.getWantBucketFlag())); |
| | | wantBucketList.add(new SearchLocParam.WantBucket(1078,staProtocol1087.getWantBucketFlag())); |
| | | return wantBucketList; |
| | | } |
| | |
| | | break; |
| | | } |
| | | |
| | | if (crnStn.getStaNo() == 1093) { // 判断出库到到1093,判断1092是否有物,有物不可出 |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(1092); |
| | | if(!staProtocol2.isAutoing() || staProtocol2.isLoading() || staProtocol2.getWorkNo() != 0) { |
| | | log.warn("1号堆垛机出库取货前,判断1092站点信息自动:{},有物:{},工作号:{},不可入",staProtocol2.isAutoing(),staProtocol2.isLoading(),staProtocol2.getWorkNo()); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { |
| | | News.warnNoLog(""+mark+" - 2"+" - 6"+" - 双深库位且浅库位有货,则需先对浅库位进行库位移转 : 开始执行 任务号={}",wrkMast.getWrkNo()); |
| | |
| | | break; |
| | | } |
| | | ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | ledCommand.setLocNo(wrkMast.getLocNo()); |
| | | ledCommand.setSourceStaNo(wrkMast.getSourceStaNo()); |
| | | ledCommand.setStaNo(wrkMast.getStaNo()); |
| | | ledCommand.setBarcode(wrkMast.getBarcode()); |
| | | if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | // List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); |
| | | wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getSpecs(),wrkDetl.getManuDate(),wrkDetl.getModel(),wrkDetl.getWeight(),wrkDetl.getManLength(),wrkDetl.getVolume()))); |
| | | // wrkDetls.forEach(wrkDetl -> { |
| | | // Double total = 0.0; |
| | | // EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | // LocDetl locDetl = locDetlService.selectOne(wrapper.eq("zpallet", wrkDetl.getZpallet()).eq("matnr", wrkDetl.getMatnr())); |
| | | // if (Cools.isEmpty(locDetl)) { |
| | | // total = wrkDetl.getAnfme(); |
| | | // } else { |
| | | // total = locDetl.getAnfme(); |
| | | // } |
| | | // if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 1) { |
| | | // ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | // } |
| | | // if (wrkMast.getIoType() == 103 && (null == wrkDetl.getInspect() || 0 == wrkDetl.getInspect())) { |
| | | // ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | // } |
| | | // if (wrkMast.getIoType() == 107) { |
| | | // ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(),total)); |
| | | // } |
| | | // }); |
| | | MatDto matDto = new MatDto(); |
| | | // 明细 |
| | | WrkDetl wrkDetl1 = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkDetl1 != null) { |
| | | ledCommand.setOrderNo(wrkDetl1.getOrderNo()); |
| | | matDto.setMaknx(wrkDetl1.getMaktx()); |
| | | matDto.setMatnr(wrkDetl1.getMatnr()); |
| | | matDto.setBatch(wrkDetl1.getBatch()); |
| | | matDto.setManuDate(wrkDetl1.getManuDate()); |
| | | matDto.setAnfme(wrkDetl1.getAnfme()); |
| | | matDto.setWeight(wrkDetl1.getWeight()); |
| | | matDto.setGrossWeight(wrkDetl1.getManLength()); |
| | | ledCommand.getMatDtos().add(matDto); |
| | | } |
| | | commands.add(ledCommand); |
| | | // 订单 |
| | | // if(wrkDetl1 != null && !Cools.isEmpty(wrkDetl1.getOrderNo())) { |
| | | // |
| | | // } |
| | | commands.add(0,ledCommand); |
| | | } |
| | | Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet()); |
| | | // 获取LED线程 |
| | |
| | | log.warn("rgv放货完成,rgv未复位:rgv号{},任务号:{},任务状态{}",wrkMast.getRgvNo(),wrkMast.getWrkNo(),wrkMast.getWrkSts()); |
| | | continue; |
| | | } |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setWrkSts(5L); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | } else if(wrkMast.getIoType() == 101 && wrkMast.getWrkSts() == 2 && (wrkMast.getStaNo() == 1024 || wrkMast.getStaNo() == 1016 || wrkMast.getStaNo() == 1043)) { |
| | | } else if(wrkMast.getIoType() == 101 && (wrkMast.getStaNo() == 1024 || wrkMast.getStaNo() == 1016 || wrkMast.getStaNo() == 1043)) { |
| | | if(wrkMast.getWrkSts() != 2 ) { |
| | | log.warn("rgv放货完成,rgv未复位:rgv号{},任务号:{},任务状态{}", wrkMast.getRgvNo(), wrkMast.getWrkNo(), wrkMast.getWrkSts()); |
| | | continue; |
| | | } |
| | | wrkMast.setWrkSts(15L); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | |
| | | CanningLineInLocParam param = new CanningLineInLocParam(); |
| | | param.setWrkNo(staProtocol.getWrkNo()); |
| | | param.setMatnr(staProtocol.getMatnr().trim()); |
| | | param.setBatch(staProtocol.getBatch()); |
| | | param.setBatch(staProtocol.getBatch().trim()); |
| | | param.setManuDate(staProtocol.getManuDate()); |
| | | param.setWeight(staProtocol.getWeight()); |
| | | param.setGrossWeight(staProtocol.getGrossWeight()); |
| | | param.setReinspection(staProtocol.isReinspection()); |
| | | param.setSourceStaNo(site + 2); |
| | | param.setTbFlag(staProtocol2.isBarcodeErr()); |
| | | |
| | |
| | | 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() + "," + site + "," + staProtocol.getBucketType() +"," + staProtocol.getBucketCount()); |
| | | log.info("告诉罐装线入库桶信息命令队列推送成功:" + staProtocol.getWorkNo() + "," +"托盘码:" + wrkMast.getBarcode() +"," + site + "," + staProtocol.getBucketType() +"," + staProtocol.getBucketCount()); |
| | | News.info("告诉罐装线入库桶信息命令队列推送成功:" + staProtocol.getWorkNo() + "," + site + "," + staProtocol.getBucketType() +"," + staProtocol.getBucketCount()); |
| | | wrkMast.setWhsType(1); // 更新推送标识,避免重复推送 |
| | | wrkMastService.updateById(wrkMast); |
| | |
| | | inSta[0]: |
| | | staNo: 1006 |
| | | barcode: ${wcs-slave.barcode[0].id} |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[1].id} |
| | | # 入库口2 |
| | | inSta[1]: |
| | | staNo: 1012 |
| | | barcode: ${wcs-slave.barcode[1].id} |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[0].id} |
| | | # 入库口3 |
| | | inSta[2]: |
| | | staNo: 1018 |
| | |
| | | # 出库口1 |
| | | outSta[0]: |
| | | staNo: 1024 |
| | | led: ${wcs-slave.led[0].id} |
| | | led: ${wcs-slave.led[5].id} |
| | | # 出库口2 |
| | | outSta[1]: |
| | | staNo: 1040 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[4].id} |
| | | # 出库口3 |
| | | outSta[2]: |
| | | staNo: 1043 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[3].id} |
| | | # 出库口4 |
| | | outSta[3]: |
| | | staNo: 1016 |
| | | led: ${wcs-slave.led[1].id} |
| | | led: ${wcs-slave.led[2].id} |
| | | # 输送线2 |
| | | devp[1]: |
| | | id: 2 |
| | |
| | | port: 102 |
| | | rack: 0 |
| | | slot: 0 |
| | | # 入库口4 |
| | | inSta[0]: |
| | | staNo: 1090 |
| | | led: ${wcs-slave.led[6].id} |
| | | # 出库口1 |
| | | outSta[0]: |
| | | staNo: 1090 |
| | | led: ${wcs-slave.led[6].id} |
| | | # 输送线3 |
| | | devp[2]: |
| | | id: 3 |
| | |
| | | # LED1 |
| | | led[0]: |
| | | id: 1 |
| | | ip: 10.10.10.190 |
| | | ip: 192.168.2.221 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1024 |
| | | staArr: 1012 |
| | | # LED2 |
| | | led[1]: |
| | | id: 2 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.222 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1040 |
| | | staArr: 1006 |
| | | # LED3 |
| | | led[2]: |
| | | id: 3 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.223 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1042,1043 |
| | | staArr: 1018,1016 |
| | | # LED4 |
| | | led[3]: |
| | | id: 4 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.224 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1017,1016 |
| | | staArr: 1041,1043 |
| | | # LED5 |
| | | led[4]: |
| | | id: 5 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.225 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1007 |
| | | staArr: 1040 |
| | | # LED6 |
| | | led[5]: |
| | | id: 6 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.226 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1011 |
| | | staArr: 1024 |
| | | # LED7 |
| | | led[6]: |
| | | id: 7 |
| | | ip: 10.10.10.191 |
| | | ip: 192.168.2.227 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 1090 |