UnitUtils.java
4.9 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
package com.skua.modules.equipment.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class UnitUtils {
public static String getRepairStatus(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "finish":
index.append("已验收");
break;
case "sbbxxg":
index.append("设备报修修改");
break;
case "sbwx":
index.append("设备维修");
break;
case "sbwxys":
index.append("设备维修验收");
break;
case "wwwx":
index.append("委外维修");
break;
case "wxdd":
index.append("维修等待");
break;
default:
index.append("设备接修");
break;
}
return index.toString();
}
public static String getCycleUnitName(String cycle) {
StringBuilder index = new StringBuilder();
switch (cycle) {
case "2":
index.append("周");
break;
case "3":
index.append("月");
break;
case "4":
index.append("年");
break;
default:
index.append("天");
break;
}
return index.toString();
}
public static String getMaintainTaskStatusName(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "1":
index.append("未开始");
break;
case "2":
index.append("任务中");
break;
case "3":
index.append("已完成");
break;
default:
index.append("已验收");
break;
}
return index.toString();
}
public static String getInspectionTaskStatusName(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "0":
index.append("未开始");
break;
case "1":
index.append("进行中");
break;
case "2":
index.append("已完成");
break;
}
return index.toString();
}
public static String getRepairTaskStatusName(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "sbjx":
index.append("设备接修");
break;
case "sbbxxg":
index.append("设备报修修改");
break;
case "wxdd":
index.append("维修等待");
break;
case "sbwx":
index.append("设备维修");
break;
case "wwwx":
index.append("委外维修");
break;
case "sbwxys":
index.append("设备维修验收");
break;
case "finish":
index.append("维修完成");
break;
}
return index.toString();
}
public static String getEquipmentStatusName(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "1":
index.append("运行");
break;
case "2":
index.append("备用");
break;
case "3":
index.append("在修");
break;
case "4":
index.append("待修");
break;
default:
index.append("停运");
break;
}
return index.toString();
}
public static String getInspectionStatus(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "1":
index.append("超期");
break;
default:
index.append("正常");
break;
}
return index.toString();
}
public static String getInspectionResult(String status) {
StringBuilder index = new StringBuilder();
switch (status) {
case "1":
index.append("不合格");
break;
default:
index.append("合格");
break;
}
return index.toString();
}
public static boolean isContainChinese(String str) {
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
Matcher m = p.matcher(str);
if (m.find()) {
return true;
}
return false;
}
}