CheckKPIHelper.java
5.4 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
package com.sitech.ismp.coll.i2000;
import java.io.File;
import java.util.Vector;
import java.io.*;
import org.apache.log4j.Logger;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import com.sitech.ismp.coll.basic.TblATO_KPIDETAIL;
public class CheckKPIHelper {
public static Logger logger = Logger.getLogger("I2000");
public static void WriteKPIValue2File(Vector collResult,String filename)throws Exception
{
WritableWorkbook workbook = Workbook.createWorkbook(new File(filename));
WritableSheet sheet = workbook.createSheet("First Sheet",0);
for(int i=0;i<collResult.size();i++)
{
TblATO_KPIDETAIL kpidetail = (TblATO_KPIDETAIL)collResult.elementAt(i);
Label label1 = new Label(0,i,kpidetail.UNIT_ID);
Label label2 = new Label(1,i,kpidetail.KPI_ID);
Label label3 = new Label(2,i,kpidetail.KPI_VALUE);
Label label4 = new Label(3,i,kpidetail.CLL_TIME_STR);
sheet.addCell(label1);
sheet.addCell(label2);
sheet.addCell(label3);
sheet.addCell(label4);
}
workbook.write();
workbook.close();
System.out.println(filename + " write successful!");
}
public static String [][] CheckQueuerKPI(Vector collResult)
{
String Queuer_KPI [][] = new String [][]{
{"PM-00-17-011-01","inexistence"},
{"PM-00-17-012-01","inexistence"},
{"PM-00-17-012-02","inexistence"},
{"PM-00-17-013-01","inexistence"},
{"PM-00-17-013-02","inexistence"},
{"PM-00-17-013-03","inexistence"},
//{"PM-00-17-014-01","inexistence"},
//{"FM-00-17-011-01","inexistence"},
//{"FM-00-17-011-02","inexistence"},
//{"FM-00-17-011-03","inexistence"},
//{"FM-00-17-011-04","inexistence"},
//{"FM-00-17-011-05","inexistence"},
//{"FM-00-17-011-06","inexistence"},
//{"FM-00-17-011-07","inexistence"},
//{"FM-00-17-011-08","inexistence"},
//{"FM-00-17-011-09","inexistence"},
{"CM-00-17-011-01","inexistence"},
{"CM-00-17-011-02","inexistence"},
{"CM-00-17-011-03","inexistence"},
{"CM-00-17-011-04","inexistence"},
{"CM-00-17-011-05","inexistence"}
//{"CM-00-17-011-06","inexistence"}
};
for(int i=0;i<collResult.size();i++)
{
TblATO_KPIDETAIL kpidetail = (TblATO_KPIDETAIL)collResult.elementAt(i);
for(int j=0;j<Queuer_KPI.length;j++)
{
if(kpidetail.KPI_ID.indexOf(Queuer_KPI[j][0])>-1 && Queuer_KPI[j][1].equals("inexistence"))
{
Queuer_KPI[j][1]="exist";
}
}
}
return Queuer_KPI;
}
public static String [][] CheckCTIServerKPI(Vector collResult)
{
String CTIServer_KPI [][] = new String [][]{
{"PM-02-17-011-01","inexistence"},
{"PM-02-17-011-02","inexistence"},
{"PM-02-17-011-03","inexistence"},
{"PM-02-17-011-04","inexistence"},
{"PM-02-17-011-05","inexistence"},
//{"PM-02-17-011-06","inexistence"},
{"PM-02-17-011-07","inexistence"},
{"PM-02-17-011-08","inexistence"},
{"PM-02-17-011-09","inexistence"},
{"PM-02-17-011-10","inexistence"},
//{"FM-02-17-011-01","inexistence"},
//{"FM-02-17-011-04","inexistence"},
//{"FM-02-17-011-06","inexistence"},
//{"FM-02-17-011-07","inexistence"},
{"CM-02-17-011-01","inexistence"}
//{"CM-02-17-011-02","inexistence"},
//{"CM-02-17-011-03","inexistence"},
//{"CM-02-17-011-04","inexistence"}
};
for(int i=0;i<collResult.size();i++)
{
TblATO_KPIDETAIL kpidetail = (TblATO_KPIDETAIL)collResult.elementAt(i);
for(int j=0;j<CTIServer_KPI.length;j++)
{
if(kpidetail.KPI_ID.indexOf(CTIServer_KPI[j][0])>-1 && CTIServer_KPI[j][1].equals("inexistence"))
{
CTIServer_KPI[j][1]="exist";
}
}
}
return CTIServer_KPI;
}
public static String [][] CheckIVRServerKPI(Vector collResult)
{
logger.info("======CheckIVRServerKPI======");
String IVRServer_KPI [][] = new String [][]{
{"PM-02-17-012-01","inexistence"},
{"PM-02-17-012-02","inexistence"},
//{"PM-02-17-012-03","inexistence"},
{"PM-02-17-013-01","inexistence"},
{"PM-02-17-013-02","inexistence"},
{"PM-02-17-014-01","inexistence"},
{"PM-02-17-014-02","inexistence"},
{"PM-02-17-014-03","inexistence"}
//{"PM-02-17-014-04","inexistence"},
//{"PM-02-17-015-01","inexistence"},
//{"PM-02-17-015-02","inexistence"},
//{"PM-02-17-015-03","inexistence"},
//{"PM-02-17-016-01","inexistence"},
//{"PM-02-17-016-02","inexistence"},
//{"PM-02-17-017-01","inexistence"},
//{"PM-02-17-017-02","inexistence"},
//{"PM-02-17-018-01","inexistence"},
//{"PM-02-17-018-02","inexistence"},
//{"PM-02-17-019-01","inexistence"},
//{"PM-02-17-019-02","inexistence"},
//{"PM-02-17-019-03","inexistence"},
//{"PM-02-17-020-01","inexistence"},
//{"PM-02-17-020-02","inexistence"},
//{"PM-02-17-020-03","inexistence"},
//{"FM-02-17-012-01","inexistence"},
//{"FM-02-17-012-02","inexistence"},
//{"FM-02-17-012-03","inexistence"},
//{"FM-02-17-012-04","inexistence"},
//{"FM-02-17-020-01","inexistence"},
//{"FM-02-17-020-02","inexistence"},
//{"FM-02-17-020-03","inexistence"},
//{"FM-02-17-020-04","inexistence"}
};
for(int i=0;i<collResult.size();i++)
{
TblATO_KPIDETAIL kpidetail = (TblATO_KPIDETAIL)collResult.elementAt(i);
for(int j=0;j<IVRServer_KPI.length;j++)
{
if(kpidetail.KPI_ID.indexOf(IVRServer_KPI[j][0])>-1 && IVRServer_KPI[j][1].equals("inexistence"))
{
IVRServer_KPI[j][1]="exist";
}
}
}
return IVRServer_KPI;
}
}