提交 e8673b7a authored 作者: ozoz's avatar ozoz

feat(check): 核查过滤功能

上级 d0fdb050
......@@ -352,9 +352,18 @@ public class DeviceCheckController {
log.info("[核查] 刷新在库/不在库,bill id :{}", id);
refreshDetail(id);
}
CheckDetailVo detailVoList = detailRepo.findById(id)
.map(transUtil::CheckDetailDo2Vo)
.orElse(null);
DeviceCheckDetail byId = detailRepo.findById(id).orElse(new DeviceCheckDetail());
Integer filter = byId.getFilter();
if (filter == null) {
filter = 0;
}
CheckDetailVo detailVoList = transUtil.CheckDetailDo2Vo(byId);
// byId
// .map(transUtil::CheckDetailDo2Vo)
// .orElse(null);
List<DeviceInLibVo> mapTemp = confirmCheckTask.hisInLib.get(id);
......
......@@ -267,9 +267,9 @@ public class ExamController {
cityStatTask = taskService.start(cityStatTask);
// 获取所有在库装备 ls == 2 or ls == 14
Map<String, List<DeviceLibrary>> devInLib = dcService.getAllDeviceLibraryList().stream()
.filter(d -> d.getLifeStatus() == 2 || d.getLifeStatus() == 14)
.collect(groupingBy(DeviceLibrary::getOwnUnit));
Stream<DeviceLibrary> deviceLibraryStream1 = dcService.getAllDeviceLibraryList().stream()
.filter(d -> d.getLifeStatus() == 2 || d.getLifeStatus() == 14);
Map<String, List<DeviceLibrary>> devInLib = new HashMap<>();
// 非在库装备 ls !=2 and ls !=14
Stream<DeviceLibrary> deviceLibraryStream = dcService.getAllDeviceLibraryList().stream()
......@@ -279,13 +279,16 @@ public class ExamController {
switch (filter) {
case 1:
// 维修状态 4
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
case 2:
// 过滤退役中 16
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 16).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 16).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
case 3:
devInLib = deviceLibraryStream1.filter(d -> d.getLifeStatus() != 16).filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
devNotInLib = deviceLibraryStream.filter(d -> d.getLifeStatus() != 16).filter(d -> d.getLifeStatus() != 4).collect(groupingBy(DeviceLibrary::getOwnUnit));
break;
default:
......
......@@ -356,6 +356,27 @@ public class ObjTransUtil {
.orElseThrow(() -> new ApiException(
ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
Integer filter = detailDo.getFilter();
if (filter == null) {
filter = 0;
}
switch (filter) {
case 1:
if (device.getLifeStatus() == 4 ) {
continue;
}
case 2:
if (device.getLifeStatus() == 16 ) {
continue;
}
case 3:
if (device.getLifeStatus() == 4 || device.getLifeStatus() == 16 ) {
continue;
}
default:
}
// DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow(
// () -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
//依据proofResult的个位数 判断是否是在库装备
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论