| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String wideInWidth; // 4.5μm×588mm matnr 中的 588 |
| | | private String thickness; //4.5μm×588mm matnr 中的 4.5 |
| | | |
| | | private String rollType = "FRP"; //木箱类型 brand brand$ |
| | | private String rollType = "FRP"; // |
| | | |
| | | private List<Roll> rolls; //卷集合 |
| | | |
| | |
| | | this.boxNo = sampleWrkDetl.getBatch(); |
| | | this.rollNo = sampleWrkDetl.getModel(); |
| | | this.specs = sampleWrkDetl.getMatnr(); |
| | | this.length = sampleWrkDetl.getPrice().toString(); |
| | | this.length = Cools.isEmpty(sampleWrkDetl.getPrice())? "0" : sampleWrkDetl.getPrice().toString(); |
| | | this.splices = sampleWrkDetl.getSpecs(); |
| | | this.netWeight = sampleWrkDetl.getWeight().toString(); |
| | | this.grossWeight = sampleWrkDetl.getVolume().toString(); |
| | | this.netWeight = Cools.isEmpty(sampleWrkDetl.getWeight())? "0" : sampleWrkDetl.getWeight().toString(); |
| | | this.grossWeight = Cools.isEmpty(sampleWrkDetl.getVolume())? "0" : sampleWrkDetl.getVolume().toString(); |
| | | this.orderSerialNumber = sampleWrkDetl.getOrderNo(); |
| | | } |
| | | |
| | | public Roll(LocDetl sampleLocDetl) { |
| | | this.boxNo = sampleLocDetl.getBatch(); |
| | | this.rollNo = sampleLocDetl.getModel(); |
| | | this.specs = sampleLocDetl.getMatnr(); |
| | | this.length = Cools.isEmpty(sampleLocDetl.getPrice())? "0" : sampleLocDetl.getPrice().toString(); |
| | | this.splices = sampleLocDetl.getSpecs(); |
| | | this.netWeight = Cools.isEmpty(sampleLocDetl.getWeight())? "0" : sampleLocDetl.getWeight().toString(); |
| | | this.grossWeight = Cools.isEmpty(sampleLocDetl.getVolume())? "0" : sampleLocDetl.getVolume().toString(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | boxPos = sampleWrkDetl.getOrigin(); |
| | | boxType = sampleWrkDetl.getBrand$(); |
| | | stockType = sampleWrkDetl.getManu(); |
| | | packageGroupNo = sampleWrkDetl.getDeadTime(); |
| | | packageGroupNo = sampleWrkDetl.getDeadTimeOther(); |
| | | OrderMesXGHYParam.Box.Roll roll = new OrderMesXGHYParam.Box.Roll(sampleWrkDetl); |
| | | |
| | | rollList.add(roll); |
| | |
| | | this.matList = boxList; |
| | | } |
| | | |
| | | public OrderMesXGHYParam(List<LocDetl> locDetls, String outOrIn,String stockType) { |
| | | // 按batch字段分组,每个batch对应一个Box |
| | | Map<String, List<LocDetl>> batchGroup = locDetls.stream() |
| | | .collect(Collectors.groupingBy(LocDetl::getBatch)); |
| | | |
| | | List<OrderMesXGHYParam.Box> boxList = new ArrayList<>(); |
| | | |
| | | // 处理每个batch分组 |
| | | for (Map.Entry<String, List<LocDetl>> entry : batchGroup.entrySet()) { |
| | | String batch = entry.getKey(); |
| | | List<LocDetl> batchWrkDetls = entry.getValue(); |
| | | |
| | | // 创建Box对象 |
| | | OrderMesXGHYParam.Box box = new OrderMesXGHYParam.Box(); |
| | | box.setBoxNo(batch); // batch对应boxNo |
| | | box.setOutOrIn(outOrIn); // batch对应boxNo |
| | | |
| | | // 按model字段分组,每个model对应一个roll |
| | | Map<String, List<LocDetl>> modelGroup = batchWrkDetls.stream() |
| | | .collect(Collectors.groupingBy(LocDetl::getModel)); |
| | | |
| | | List<OrderMesXGHYParam.Box.Roll> rollList = new ArrayList<>(); |
| | | String wideInWidth = null; |
| | | String thickness = null; |
| | | String boxPos = null; |
| | | String boxType = null; |
| | | String packageGroupNo = null; //包装组号(徐工没有,只有箱号卷号一对一) //null |
| | | |
| | | // 处理每个model分组 |
| | | for (Map.Entry<String, List<LocDetl>> modelEntry : modelGroup.entrySet()) { |
| | | List<LocDetl> modelWrkDetls = modelEntry.getValue(); |
| | | |
| | | LocDetl sampleWrkDetl = modelWrkDetls.get(0); |
| | | String matnr = sampleWrkDetl.getMatnr(); |
| | | |
| | | String[] firstSplit = matnr.split("μm×"); |
| | | if (firstSplit.length == 2) { |
| | | thickness = firstSplit[0]; // 5.2 |
| | | String[] secondSplit = firstSplit[1].split("mm"); |
| | | if (secondSplit.length > 0) { |
| | | wideInWidth = secondSplit[0]; // 834.1 |
| | | } else { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | boxPos = sampleWrkDetl.getOrigin(); |
| | | boxType = sampleWrkDetl.getBrand$(); |
| | | OrderMesXGHYParam.Box.Roll roll = new OrderMesXGHYParam.Box.Roll(sampleWrkDetl); |
| | | |
| | | rollList.add(roll); |
| | | } |
| | | box.setWideInWidth(wideInWidth); |
| | | box.setThickness(thickness); |
| | | box.setBoxPos(boxPos); |
| | | box.setBoxType(boxType); |
| | | box.setStockType(stockType); |
| | | |
| | | box.setRolls(rollList); |
| | | boxList.add(box); |
| | | } |
| | | |
| | | // 设置到主对象中 |
| | | this.matList = boxList; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder sb = new StringBuilder(); |