代码更新
This commit is contained in:
@@ -983,6 +983,37 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject jsonObject = content.getJSONObject(i);
|
||||
String real_start_date = jsonObject.getString("real_start_date");
|
||||
String estimaterepair_times = jsonObject.getString("estimaterepair_times");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(real_start_date) && ObjectUtil.isNotEmpty(estimaterepair_times)) {
|
||||
// 超过预计时间:(开始时间+预计修复时间) - 当前时间 > 0 且结束为正常
|
||||
int minute = NumberUtil.mul(estimaterepair_times, "60").intValue();
|
||||
DateTime date = DateUtil.parse(real_start_date);
|
||||
|
||||
DateTime date1 = DateUtil.parse(DateUtil.offsetMinute(date, minute).toString());
|
||||
DateTime date2 = DateUtil.parse(DateUtil.now());
|
||||
|
||||
long between = DateUtil.between(date2, date1, DateUnit.MINUTE,false);
|
||||
|
||||
if (between < 0) {
|
||||
if ("01,02,03,04,05".contains(jsonObject.getString("invstatus"))) {
|
||||
jsonObject.put("is_red", "1");
|
||||
} else {
|
||||
jsonObject.put("is_red", "0");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
jsonObject.put("is_red", "0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user