提交 99bb2aad authored 作者: Matrix's avatar Matrix

[核查模块] 逾期,丢失,销毁,任务数量统计bug fix

上级 d6f71b75
...@@ -157,17 +157,27 @@ public class DeviceCheckController { ...@@ -157,17 +157,27 @@ public class DeviceCheckController {
String checkUnit = detail.getCheckUnit(); String checkUnit = detail.getCheckUnit();
//查出所有装备 分为4类 A 所在是本单位 B 所属是本单位 其中 //查出所有装备 分为4类 A 所在是本单位 B 所属是本单位 其中
List<DeviceLibrary> allDevices = deviceRepo.findAll(); List<DeviceLibrary> allDevices = deviceRepo.findAll();
//在库 = A and B & not B //在库 = A and B & not B 去除掉ls = 10 的装备 把ls = 11 的装备加入到非在库
Map<Boolean, List<DeviceLibrary>> locationMap = allDevices.stream() Map<Boolean, List<DeviceLibrary>> locationMap = allDevices.stream()
.collect(partitioningBy(d -> d.getLocationUnit().equals(checkUnit))); .collect(partitioningBy(d -> d.getLocationUnit().equals(checkUnit)));
List<DeviceLibrary> devInLib = locationMap.get(true); List<DeviceLibrary> devInLib = locationMap.get(true);
// filter ls == 11 join to 非在库
List<DeviceLibrary> ls11Lib = devInLib.stream().filter(d -> d.getLifeStatus() == 11).collect(toList());
// filter ls == 10
devInLib = devInLib.stream()
.filter(d -> d.getLifeStatus() != 10 && d.getLifeStatus() != 11)
.collect(toList());
// 非在库 = not A and in B // 非在库 = not A and in B
List<DeviceLibrary> devNotInLib = locationMap.get(false) List<DeviceLibrary> devNotInLib = locationMap.get(false)
.stream().filter(d -> d.getOwnUnit().equals(checkUnit)) .stream().filter(d -> d.getOwnUnit().equals(checkUnit))
.collect(toList()); .collect(toList());
devNotInLib.addAll(ls11Lib);
// 更新detail // 更新detail
detail.updateDevice(devInLib, devNotInLib); detail.updateDevice(devInLib, devNotInLib);
...@@ -206,8 +216,14 @@ public class DeviceCheckController { ...@@ -206,8 +216,14 @@ public class DeviceCheckController {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
long finalTime = System.currentTimeMillis(); long finalTime = System.currentTimeMillis();
for (Task child : childTask) { for (Task child : childTask) {
// 将子节点任务中的 统计数据确认任务 给过滤掉
if (child.getTitle().contains("统计数据确认任务")) {
continue;
}
Integer childBusType = child.getBusinessType(); Integer childBusType = child.getBusinessType();
Integer childBusId = child.getBillId(); Integer childBusId = child.getBillId();
// 处理子节点,子节点有两种类型 - 检查类统计与自查类数据 // 处理子节点,子节点有两种类型 - 检查类统计与自查类数据
if (childBusType.equals(CONFIRM_CHECK_STAT.id)) { if (childBusType.equals(CONFIRM_CHECK_STAT.id)) {
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
...@@ -387,17 +403,21 @@ public class DeviceCheckController { ...@@ -387,17 +403,21 @@ public class DeviceCheckController {
} }
//核查结果 //核查结果
// if (endTime.isBefore(LocalDateTime.now())) {
// if (revAreaStat.getComProgress() ==1){
// lcd.setCheckResult("逾期进行中");
// }else if (task.getBillStatus() != 9999 || revAreaStat.getComProgress() != 2) {
// lcd.setCheckResult("逾期");
// } else {
// lcd.setCheckResult("逾期完成");
// }
// } else {
if (task.getBillStatus() == 9999) {
if (endTime.isBefore(LocalDateTime.now())) { if (endTime.isBefore(LocalDateTime.now())) {
if (revAreaStat.getComProgress() ==1){
lcd.setCheckResult("逾期进行中");
}else if (task.getBillStatus() != 9999 || revAreaStat.getComProgress() != 2) {
lcd.setCheckResult("逾期");
} else {
lcd.setCheckResult("逾期完成"); lcd.setCheckResult("逾期完成");
}
} else { } else {
if (task.getBillStatus() == 9999) {
lcd.setCheckResult("完成"); lcd.setCheckResult("完成");
}
} else if (revAreaStat.getComProgress() == 0) { } else if (revAreaStat.getComProgress() == 0) {
lcd.setCheckResult("未开始"); lcd.setCheckResult("未开始");
} else if (revAreaStat.getComProgress() == 1) { } else if (revAreaStat.getComProgress() == 1) {
...@@ -407,6 +427,9 @@ public class DeviceCheckController { ...@@ -407,6 +427,9 @@ public class DeviceCheckController {
} else if (revAreaStat.getComProgress() == 2 && task.getBillStatus() % 10 == 1) { } else if (revAreaStat.getComProgress() == 2 && task.getBillStatus() % 10 == 1) {
lcd.setCheckResult("进行中"); lcd.setCheckResult("进行中");
} else if (revAreaStat.getComProgress() == 2) { } else if (revAreaStat.getComProgress() == 2) {
if (endTime.isBefore(LocalDateTime.now())) {
lcd.setCheckResult("逾期完成");
} else {
lcd.setCheckResult("完成"); lcd.setCheckResult("完成");
} }
} }
...@@ -438,17 +461,12 @@ public class DeviceCheckController { ...@@ -438,17 +461,12 @@ public class DeviceCheckController {
} }
//核查结果 //核查结果
if (task.getBillStatus() == 9999) {
if (endTime.isBefore(LocalDateTime.now())) { if (endTime.isBefore(LocalDateTime.now())) {
if (revAreaStat.getComProgress() ==1){
led.setCheckResult("逾期进行中");
}else if (task.getBillStatus() != 9999 || revAreaStat.getComProgress() != 2) {
led.setCheckResult("逾期");
} else {
led.setCheckResult("逾期完成"); led.setCheckResult("逾期完成");
}
} else { } else {
if (task.getBillStatus() == 9999) {
led.setCheckResult("完成"); led.setCheckResult("完成");
}
} else if (revAreaStat.getComProgress() == 0) { } else if (revAreaStat.getComProgress() == 0) {
led.setCheckResult("未开始"); led.setCheckResult("未开始");
} else if (revAreaStat.getComProgress() == 1) { } else if (revAreaStat.getComProgress() == 1) {
...@@ -458,6 +476,9 @@ public class DeviceCheckController { ...@@ -458,6 +476,9 @@ public class DeviceCheckController {
} else if (revAreaStat.getComProgress() == 2 && task.getBillStatus() % 10 == 1) { } else if (revAreaStat.getComProgress() == 2 && task.getBillStatus() % 10 == 1) {
led.setCheckResult("进行中"); led.setCheckResult("进行中");
} else if (revAreaStat.getComProgress() == 2) { } else if (revAreaStat.getComProgress() == 2) {
if (endTime.isBefore(LocalDateTime.now())) {
led.setCheckResult("逾期完成");
} else {
led.setCheckResult("完成"); led.setCheckResult("完成");
} }
} }
......
...@@ -129,6 +129,7 @@ public class ObjTransUtil { ...@@ -129,6 +129,7 @@ public class ObjTransUtil {
// 构建完成情况参数 未完成数量/总数 // 构建完成情况参数 未完成数量/总数
// 获得当前节点的子节点总数 = 总数 其中状态为9999的为已完成 // 获得当前节点的子节点总数 = 总数 其中状态为9999的为已完成
//
TaskBto fatherTask = taskService.get(stat.getId(), BusinessEnum.CONFIRM_CHECK_STAT.id); TaskBto fatherTask = taskService.get(stat.getId(), BusinessEnum.CONFIRM_CHECK_STAT.id);
Integer fatherTaskId = fatherTask.getId(); Integer fatherTaskId = fatherTask.getId();
...@@ -137,7 +138,7 @@ public class ObjTransUtil { ...@@ -137,7 +138,7 @@ public class ObjTransUtil {
boolean flag = false; boolean flag = false;
boolean confirmTaskisDone = false; boolean confirmTaskisDone = false;
for (Task task : childTask) { for (Task task : childTask) {
if (task.getTitle().contains("统计确认待办任务")) { if (task.getTitle().contains("统计数据确认任务")) {
if (task.getBillStatus() != 9999) { if (task.getBillStatus() != 9999) {
flag = true; flag = true;
} else { } else {
...@@ -148,7 +149,9 @@ public class ObjTransUtil { ...@@ -148,7 +149,9 @@ public class ObjTransUtil {
// 3/3 -> 统计待确认 -> 省统计任务待完结 // 3/3 -> 统计待确认 -> 省统计任务待完结
childTask = childTask.stream().filter(task -> !task.getTitle().contains("统计确认待办任务")) childTask = childTask.stream()
.filter(task -> !task.getTitle().contains("统计数据待办任务"))
.filter(task -> !task.getTitle().contains("统计数据确认任务"))
.collect(toList()); .collect(toList());
long total = childTask.size(); long total = childTask.size();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论