Dict.java
8.77 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
package com.sitech.ismp.coll.busi.e2e.base;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.sitech.base.AgentProperties;
public class Dict {
private static Logger error = Logger.getLogger("ERROR");
private static Map<String,String> CRM_BUREAU_DICT = new HashMap<String, String>();
private static Map<String,String> IBP_BUREAU_DICT = new HashMap<String, String>();
private static Map<String,String> CA_BUREAU_DICT = new HashMap<String, String>();
private static Map<String,String> CA_STATUS_DICT = new HashMap<String, String>();
private static Map<String,String> CA_ACCESS_TYPE_DICT = new HashMap<String, String>();
private static Map<String,String> CA_VERSION_TYPE_DICT = new HashMap<String, String>();
private static Map<String,String> CA_PRODUCT_TYPE_DICT = new HashMap<String, String>();
private static Map<String,String> CA_OPER_TYPE_DICT = new HashMap<String, String>();
private static Map<String,String> CA_SUB_OPER_TYPE_DICT = new HashMap<String, String>();
static{
CA_SUB_OPER_TYPE_DICT.put("U01", "用户要求复机");
CA_SUB_OPER_TYPE_DICT.put("U05", "欠费复机");
CA_SUB_OPER_TYPE_DICT.put("X01", "改性能");
CA_SUB_OPER_TYPE_DICT.put("X02", "改地址");
CA_SUB_OPER_TYPE_DICT.put("X05", "改号");
CA_SUB_OPER_TYPE_DICT.put("X09", "过户装机");
CA_SUB_OPER_TYPE_DICT.put("X10", "改装装机");
CA_SUB_OPER_TYPE_DICT.put("X13", "续约互转变更");
CA_SUB_OPER_TYPE_DICT.put("Y02", "取消营销活动");
CA_SUB_OPER_TYPE_DICT.put("Z01", "新装");
CA_SUB_OPER_TYPE_DICT.put("X17", "铜转光平移");
CA_SUB_OPER_TYPE_DICT.put("C03", "欠费拆机");
CA_SUB_OPER_TYPE_DICT.put("V01", "直改中");
CA_SUB_OPER_TYPE_DICT.put("V02", "中改直");
CA_SUB_OPER_TYPE_DICT.put("C01", "用户要求拆机");
CA_SUB_OPER_TYPE_DICT.put("C02", "违章拆机");
CA_SUB_OPER_TYPE_DICT.put("I08", "分帐");
CA_SUB_OPER_TYPE_DICT.put("I28", "押金与普通互改");
CA_SUB_OPER_TYPE_DICT.put("I29", "移后装");
CA_SUB_OPER_TYPE_DICT.put("I31", "移先装");
CA_SUB_OPER_TYPE_DICT.put("I42", "宅内变更");
CA_SUB_OPER_TYPE_DICT.put("I44", "转帐");
}
public static String getCaSubOperType(String key) {
if(key != null && !key.equals("")){
String value = CA_SUB_OPER_TYPE_DICT.get(key);
return value == null ? key : value;
}else{
return "";
}
}
static{
CA_OPER_TYPE_DICT.put("1", "新装");
CA_OPER_TYPE_DICT.put("2", "拆机");
CA_OPER_TYPE_DICT.put("3", "移先装");
CA_OPER_TYPE_DICT.put("4", "移先拆");
CA_OPER_TYPE_DICT.put("5", "停机");
CA_OPER_TYPE_DICT.put("6", "复机");
CA_OPER_TYPE_DICT.put("7", "修改");
CA_OPER_TYPE_DICT.put("8", "移后装");
CA_OPER_TYPE_DICT.put("9", "移后拆");
CA_OPER_TYPE_DICT.put("10", "改性能");
CA_OPER_TYPE_DICT.put("11", "移机");
CA_OPER_TYPE_DICT.put("12", "中直互改");
CA_OPER_TYPE_DICT.put("13", "拆直留宽");
CA_OPER_TYPE_DICT.put("14", "拆宽留直");
CA_OPER_TYPE_DICT.put("16", "移先装(直线宽带同时移)");
CA_OPER_TYPE_DICT.put("17", "移后装(直线宽带同时移)");
CA_OPER_TYPE_DICT.put("18", "移先拆(直线宽带同时移)");
CA_OPER_TYPE_DICT.put("19", "移后拆(直线宽带同时移)");
CA_OPER_TYPE_DICT.put("20", "移先装(移宽留直)");
CA_OPER_TYPE_DICT.put("21", "移后装(移宽留直)");
CA_OPER_TYPE_DICT.put("22", "移先拆(移宽留直)");
CA_OPER_TYPE_DICT.put("23", "移后拆(移宽留直)");
CA_OPER_TYPE_DICT.put("24", "移先装(移直留宽)");
CA_OPER_TYPE_DICT.put("25", "移后装(移直留宽)");
CA_OPER_TYPE_DICT.put("26", "移先拆(移直留宽)");
CA_OPER_TYPE_DICT.put("27", "移后拆(移直留宽)");
CA_OPER_TYPE_DICT.put("28", "同区移机");
CA_OPER_TYPE_DICT.put("29", "拆宽移直");
CA_OPER_TYPE_DICT.put("30", "移先装(移直拆宽)");
CA_OPER_TYPE_DICT.put("31", "移后装(移直拆宽)");
CA_OPER_TYPE_DICT.put("32", "移先拆(移直拆宽)");
CA_OPER_TYPE_DICT.put("33", "移后拆(移直拆宽)");
CA_OPER_TYPE_DICT.put("34", "移先装(移宽拆直)");
CA_OPER_TYPE_DICT.put("35", "移后装(移宽拆直)");
CA_OPER_TYPE_DICT.put("36", "移先拆(移宽拆直)");
CA_OPER_TYPE_DICT.put("37", "移后拆(移宽拆直)");
}
public static String getCaOperType(String key) {
if(key != null && !key.equals("")){
String value = CA_OPER_TYPE_DICT.get(key);
return value == null ? key : value;
}else{
return "";
}
}
static{
CA_PRODUCT_TYPE_DICT.put("0057420", "ADSL");
CA_PRODUCT_TYPE_DICT.put("0057442", "普通直线");
CA_PRODUCT_TYPE_DICT.put("0057440", "LAN");
CA_PRODUCT_TYPE_DICT.put("0057432", "ADSL专线");
CA_PRODUCT_TYPE_DICT.put("0057450", "VPDN分点");
}
public static String getCaProductType(String key) {
if(key != null && !key.equals("")){
String value = CA_PRODUCT_TYPE_DICT.get(key);
return value == null ? key : value;
}else{
return "";
}
}
static{
CA_VERSION_TYPE_DICT.put("1", "正常单");
CA_VERSION_TYPE_DICT.put("2", "修改单");
}
public static String getCaVersionType(String key) {
if(key != null && !key.equals("")){
String value = CA_VERSION_TYPE_DICT.get(key);
return value == null ? key : value;
}else{
return "";
}
}
static{
CA_ACCESS_TYPE_DICT.put("0", "普通");
CA_ACCESS_TYPE_DICT.put("1", "PON");
CA_ACCESS_TYPE_DICT.put("2", "SIP语音");
CA_ACCESS_TYPE_DICT.put("3", "VPN");
CA_ACCESS_TYPE_DICT.put("4", "EPON");
}
public static String getCaAccessType(String key) {
if(key != null && !key.equals("")){
String value = CA_ACCESS_TYPE_DICT.get(key);
return value == null ? key : value;
}else{
return "";
}
}
static{
String crmBureauDataFile = AgentProperties.AGENT_HOME + "/config/crmBureau.data";
BufferedReader br = null;
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(crmBureauDataFile),"UTF-8"));
String line = null;
while ((line = br.readLine()) != null) {
if("".equals(line.trim())){
continue;
}
String[] elem = line.split("#@&@#");
CRM_BUREAU_DICT.put(elem[0], elem[1]);
}
}catch (Exception e) {
error.error("Exception while init CRM_BUREAU_DICT", e);
}finally{
if(br != null){
try {
br.close();
} catch (IOException e) {
}
}
}
}
static{
String caStatusDataFile = AgentProperties.AGENT_HOME + "/config/caOrderStatusDict.data";
BufferedReader br = null;
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(caStatusDataFile),"UTF-8"));
String line = null;
while ((line = br.readLine()) != null) {
if("".equals(line.trim())){
continue;
}
String[] elem = line.split("#@&@#");
CA_STATUS_DICT.put(elem[0], elem[1]);
System.out.println(elem[0]+"\t"+elem[1]);
}
}catch (Exception e) {
error.error("Exception while init CA_STATUS_DICT", e);
}finally{
if(br != null){
try {
br.close();
} catch (IOException e) {
}
}
}
}
static{
String crmBureauDataFile = AgentProperties.AGENT_HOME + "/config/ibpBureau.data";
BufferedReader br = null;
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(crmBureauDataFile),"UTF-8"));
String line = null;
while ((line = br.readLine()) != null) {
if("".equals(line.trim())){
continue;
}
String[] elem = line.split("#@&@#");
IBP_BUREAU_DICT.put(elem[0], elem[1]);
}
}catch (Exception e) {
error.error("Exception while init IBP_BUREAU_DICT", e);
}finally{
if(br != null){
try {
br.close();
} catch (IOException e) {
}
}
}
}
static{
String caBureauDataFile = AgentProperties.AGENT_HOME + "/config/caBureau.data";
BufferedReader br = null;
try{
br = new BufferedReader(new InputStreamReader(new FileInputStream(caBureauDataFile),"UTF-8"));
String line = null;
while ((line = br.readLine()) != null) {
if("".equals(line.trim())){
continue;
}
String[] elem = line.split("#@&@#");
CA_BUREAU_DICT.put(elem[0], elem[1]);
}
}catch (Exception e) {
error.error("Exception while init CA_BUREAU_DICT", e);
}finally{
if(br != null){
try {
br.close();
} catch (IOException e) {
}
}
}
}
public static String getCrmBureau(String key) {
String value = CRM_BUREAU_DICT.get(key);
return value == null ? key : value;
}
public static String getIbpBureau(String key) {
String value = IBP_BUREAU_DICT.get(key);
return value == null ? key : value;
}
public static String getCaBureau(String key) {
String value = CA_BUREAU_DICT.get(key);
return value == null ? key : value;
}
public static String getCaStatus(String key) {
String value = CA_STATUS_DICT.get(key);
return value == null ? key : value;
}
}