jiazx0107@163.com
2023-06-21 d8047152e563ba7816208a3fe9cf1ffdc9cddc83
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
package com.ld.igds.m;
 
import com.ld.igds.models.InoutPlan;
import com.ld.igds.util.ContextUtil;
import java.util.List;
 
/**
 * 出入库--管理功能相关常量
 * 
 * @author:
 *
 */
public class InoutManageUtil {
 
    /**
     * 计划类型-采购计划
     */
    public static final String PLAN_TYPE_1 = "1";
    /**
     * 计划类型-销售计划
     */
    public static final String PLAN_TYPE_2 = "2";
    /**
     * 计划类型-轮换计划
     */
    public static final String PLAN_TYPE_3 = "3";
    
    /**
     * 计划类型-加工计划
     */
    public static final String PLAN_TYPE_4 = "4";
 
    /**
     * 计划详细类型-轮入
     */
    public static final String PLAN_TYPE_TURN_IN = "2";
    /**
     * 计划详细类型-轮出
     */
    public static final String PLAN_TYPE_TURN_OUT = "1";
 
    /**
     * 审核状态-待审核
     */
    public static final String AUDIT_NONE = "NONE";
    /**
     * 审核状态-通过
     */
    public static final String AUDIT_PASS = "PASS";
    /**
     * 审核状态-拒绝
     */
    public static final String AUDIT_UNPASS = "UNPASS";
 
    /**
     * 合同类型-轮换合同
     */
    public static final String CONTRACT_TYPE_3 = "3";
    /**
     * 合同类型-采购合同
     */
    public static final String CONTRACT_TYPE_2 = "2";
    /**
     * 合同类型-销售合同
     */
    public static final String CONTRACT_TYPE_1 = "1";
 
    /**
     * 客户类型 - 企业
     */
    public static final String CUSTOMER_TYPE_1 = "1";
    /**
     * 客户类型 - 个人
     */
    public static final String CUSTOMER_TYPE_2 = "2";
 
    /**
     * 根据类型创建计划ID
     * 
     * @param type
     */
    public static String createPlanId(String type, String year, List<InoutPlan> list) {
        String index = "001";
        if(list != null && list.size() > 0){
            String[] arr = list.get(0).getId().split("_");
            int temp = Integer.valueOf(arr[2]) + 1;
            index = temp + "";
        }
        if(index.length() == 1){
            index = "00" + index;
        }
        if(index.length() == 2){
            index = "0" + index;
        }
        if (PLAN_TYPE_1.equals(type)) {
            return "CGJH_" + year + "_" + index;
        }
        if (PLAN_TYPE_2.equals(type)) {
            return "XSJH_" + year + "_" + index;
        }
        if (PLAN_TYPE_3.equals(type)) {
            return "LHJH_" + year + "_" + index;
        }
        if (PLAN_TYPE_4.equals(type)) {
            return "JGJH_" + year + "_" + index;
        }
        return "QTJH" + year + "_" + index;
    }
 
    /**
     * 根据类型创建合同ID
     * @param type
     * @return
     */
    public static String createContractId(String type) {
        String id = ContextUtil.getTimeId();
        if (CONTRACT_TYPE_1.equals(type)) {
            return "XSHT_" + id;
        }
        if (CONTRACT_TYPE_2.equals(type)) {
            return "CGHT_" + id;
        }
        if (CONTRACT_TYPE_3.equals(type)) {
            return "LHHT_" + id;
        }
        return id;
    }
 
}