自动化立体仓库 - WMS系统
*
lsh
11 小时以前 9d831229b5a8c238ce55f4ee8de7433c56cbe3a8
src/main/java/com/zy/asrs/entity/param/OrderMesXGHYParam.java
@@ -1,6 +1,7 @@
package com.zy.asrs.entity.param;
import com.core.common.DateUtils;
import com.zy.asrs.entity.LocDetl;
import com.zy.asrs.entity.WrkDetl;
import lombok.Data;
@@ -41,10 +42,10 @@
        private String boxNo;   //箱号
        private String boxPos;   //位置  1  2  3   origin 木箱位置
        private String boxType;   //木箱类型  木箱类型  brand  brand$
        private String wideInWidth;   // 4.5μm×588mm  matnr  中的  4.5
        private String thickness;   //4.5μm×588mm  matnr  中的  588
        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;   //卷集合
@@ -74,6 +75,16 @@
                this.netWeight = sampleWrkDetl.getWeight().toString();
                this.grossWeight = 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 = sampleLocDetl.getPrice().toString();
                this.splices = sampleLocDetl.getSpecs();
                this.netWeight = sampleLocDetl.getWeight().toString();
                this.grossWeight = sampleLocDetl.getVolume().toString();
            }
            @Override
@@ -170,6 +181,76 @@
        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$();
                stockType = sampleWrkDetl.getManu();
                packageGroupNo = sampleWrkDetl.getDeadTime();
                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.setPackageGroupNo(packageGroupNo);
            box.setRolls(rollList);
            boxList.add(box);
        }
        // 设置到主对象中
        this.matList = boxList;
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();