自动化立体仓库 - WMS系统
18516761980
2021-12-06 3d57910ed5c971d143b71af4f9bfb4c18dcf6e9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package com.zy.asrs.utils;
 
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.common.model.LocTypeDto;
import com.zy.common.utils.excel.matcode.MatCodeExcel;
 
/**
 * Created by vincent on 2020/7/14
 */
public class VersionUtils {
 
    // 业务 ----------------------------------------------------------------------
 
    public static void setWrkDetl(WrkDetl wrkDetl, MatCode matCode) {
        wrkDetl.setMatNo(matCode.getMatNo()); // 产品编码
        wrkDetl.setMatName(matCode.getMatName()); // 产品名称
        wrkDetl.setSpecs(matCode.getSpecs()); // 规格
        wrkDetl.setUnit(matCode.getUnit()); // 单位
        wrkDetl.setSize(matCode.getSize()); // 尺寸
        wrkDetl.setColor(matCode.getColor()); // 颜色
        wrkDetl.setWeight(matCode.getWeight()); // 单重
    }
 
    public static void setWrkDetl(WrkDetl wrkDetl, LocDetl locDetl) {
        wrkDetl.setMatNo(locDetl.getMatNo()); // 产品编号
        wrkDetl.setMatName(locDetl.getMatName()); // 产品描述
        wrkDetl.setSpecs(locDetl.getSpecs()); // 规格
        wrkDetl.setUnit(locDetl.getUnit()); // 单位
        wrkDetl.setSize(locDetl.getSize()); // 尺寸
        wrkDetl.setColor(locDetl.getColor()); // 颜色
        wrkDetl.setWeight(locDetl.getWeight()); // 单重
        wrkDetl.setZpallet(locDetl.getZpallet()); // 托盘条码
    }
 
    public static void setLocDetl(LocDetl locDetl, MatCode matCode) {
        locDetl.setMatNo(matCode.getMatNo()); // 产品编号
        locDetl.setMatName(matCode.getMatName()); // 产品描述
        locDetl.setSpecs(matCode.getSpecs()); // 规格
        locDetl.setUnit(matCode.getUnit()); // 单位
        locDetl.setSize(matCode.getSize()); // 尺寸
        locDetl.setColor(matCode.getColor()); // 颜色
        locDetl.setWeight(matCode.getWeight()); // 单重
    }
 
    public static void setLocDetl(LocDetl locDetl, WrkDetl wrkDetl) {
        locDetl.setMatNo(wrkDetl.getMatNo()); // 产品编号
        locDetl.setMatName(wrkDetl.getMatName()); // 产品描述
        locDetl.setSpecs(wrkDetl.getSpecs()); // 规格
        locDetl.setUnit(wrkDetl.getUnit()); // 单位
        locDetl.setSize(wrkDetl.getSize()); // 尺寸
        locDetl.setColor(wrkDetl.getColor()); // 颜色
        locDetl.setQty(wrkDetl.getQty()); // 数量
        locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
    }
 
    public static void setWaitPakIn(WaitPakin waitPakIn, MatCode matCode) {
        waitPakIn.setMatnr(matCode.getMatNo()); // 产品编号
        waitPakIn.setMaktx(matCode.getMatName()); // 产品描述
        waitPakIn.setLgnum(matCode.getSpecs()); // 规格
        waitPakIn.setAltme(matCode.getUnit()); // 单位
        waitPakIn.setType(matCode.getSize()); // 尺寸
        waitPakIn.setColor(matCode.getColor()); // 颜色
        //waitPakIn.setWeight(matCode.getWeight()); // 单重
    }
 
    // excel ----------------------------------------------------------------------
 
    public static MatCodeExcel getExcel(MatCode matCode) {
        return new MatCodeExcel(
                matCode.getMatNo(),
                matCode.getBarcode(),
                matCode.getMatName(),
                matCode.getSpecs(),
                matCode.getUnit(),
                matCode.getSize(),
                matCode.getColor(),
                matCode.getWeight(),
                matCode.getStr1(),
                matCode.getStr2(),
                matCode.getStr3(),
                matCode.getStr4(),
                matCode.getStr5(),
                matCode.getStr6(),
                matCode.getStr7(),
                matCode.getStr8(),
                matCode.getStr9(),
                matCode.getStr10(),
                matCode.getNum1(),
                matCode.getNum2(),
                matCode.getNum3(),
                matCode.getNum4(),
                matCode.getNum5()
        );
    }
 
    public static void setMatCode(MatCode matCode, MatCodeExcel excel) {
        matCode.setMatNo(excel.getMatNo());
        matCode.setMatName(excel.getMatName());
        matCode.setBarcode(excel.getBarcode());
        matCode.setSpecs(excel.getSpecs());
        matCode.setUnit(excel.getUnit());
        matCode.setSize(excel.getSize());
        matCode.setColor(excel.getColor());
        matCode.setWeight(excel.getWeight());
        matCode.setStr1(excel.getStr1());
        matCode.setStr2(excel.getStr2());
        matCode.setStr3(excel.getStr3());
        matCode.setStr4(excel.getStr4());
        matCode.setStr5(excel.getStr5());
        matCode.setStr6(excel.getStr6());
        matCode.setStr7(excel.getStr7());
        matCode.setStr8(excel.getStr8());
        matCode.setStr9(excel.getStr9());
        matCode.setStr10(excel.getStr10());
        matCode.setNum1(excel.getNum1());
        matCode.setNum2(excel.getNum2());
        matCode.setNum3(excel.getNum3());
        matCode.setNum4(excel.getNum4());
        matCode.setNum5(excel.getNum5());
    }
 
    /**
     *  库位移转时类型检测
     **/
    public static void locMoveCheckLocType(LocMast sourceLoc, LocMast loc){
        // 如果源库位是高库位,目标库位是低库位
        if (sourceLoc.getLocType1() == 2 && loc.getLocType1() == 1) {
            throw new CoolException("高库位不能移转至低库位");
        }
//        // 如果源库位是宽库位,目标库位是窄库位
//        if (sourceLoc.getLocType2() == 2 && loc.getLocType2() == 1) {
//            throw new CoolException("宽库位不能移转至窄库位");
//        }
//        // 如果源库位是重库位,目标库位是轻库位
//        if (sourceLoc.getLocType3() == 2 && loc.getLocType3() == 1) {
//            throw new CoolException("重库位不能移转至轻库位");
//        }
    }
 
    /**
     *  库位移转时类型检测
     **/
    public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto){
        // 如果源库位是高库位,目标库位是低库位
        if (dto.getLocType1() == 2 && loc.getLocType1() == 1) {
            return false;
        }
//        // 如果源库位是宽库位,目标库位是窄库位
//        if (dto.getLocType2() == 2 && loc.getLocType2() == 1) {
//            return false;
//        }
//        // 如果源库位是重库位,目标库位是轻库位
//        if (dto.getLocType3() == 2 && loc.getLocType3() == 1) {
//            return false;
//        }
        return true;
    }
 
}