|
@@ -307,6 +307,9 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
|
|
307
|
List<SysUser> sysUserListAll = sysUserService.selectUserAll();
|
307
|
List<SysUser> sysUserListAll = sysUserService.selectUserAll();
|
|
308
|
Map<String, Long> sysUserMap = sysUserListAll.stream().collect(Collectors.toMap(SysUser::getNickName, SysUser::getUserId, (oldValue, newValue) -> newValue));
|
308
|
Map<String, Long> sysUserMap = sysUserListAll.stream().collect(Collectors.toMap(SysUser::getNickName, SysUser::getUserId, (oldValue, newValue) -> newValue));
|
|
309
|
|
309
|
|
|
|
|
310
|
+ // 航站楼+区域+通道
|
|
|
|
311
|
+ List<BasePosition> basePositionList = basePositionService.selectBasePositionListTree(new BasePosition());
|
|
|
|
312
|
+
|
|
310
|
// 航站楼
|
313
|
// 航站楼
|
|
311
|
BasePosition terminlQuery = new BasePosition();
|
314
|
BasePosition terminlQuery = new BasePosition();
|
|
312
|
terminlQuery.setLevel(1);
|
315
|
terminlQuery.setLevel(1);
|
|
@@ -338,7 +341,7 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
|
|
338
|
|
341
|
|
|
339
|
for (EquipmentLedger data : list) {
|
342
|
for (EquipmentLedger data : list) {
|
|
340
|
// 根据名称填充ID字段
|
343
|
// 根据名称填充ID字段
|
|
341
|
- fillIdsByName(data, sysUserMap, terminlMap, regionalMap, channelMap, equipmentUsageStatusMap);
|
|
|
|
|
|
344
|
+ fillIdsByName(data, sysUserMap, basePositionList, terminlMap, regionalMap, channelMap, equipmentUsageStatusMap);
|
|
342
|
try {
|
345
|
try {
|
|
343
|
if (ObjUtil.isNull(data.getEquipmentSerialNumber())) {
|
346
|
if (ObjUtil.isNull(data.getEquipmentSerialNumber())) {
|
|
344
|
failureNum++;
|
347
|
failureNum++;
|
|
@@ -397,7 +400,7 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
|
|
397
|
*
|
400
|
*
|
|
398
|
* @param data 速率数据
|
401
|
* @param data 速率数据
|
|
399
|
*/
|
402
|
*/
|
|
400
|
- private void fillIdsByName(EquipmentLedger data, Map<String, Long> sysUserMap, Map<String, String> terminlMap, Map<String, String> regionalMap, Map<String, String> channelMap, Map<String, String> equipmentUsageStatusMap) {
|
|
|
|
|
|
403
|
+ private void fillIdsByName(EquipmentLedger data, Map<String, Long> sysUserMap, List<BasePosition> basePositionList, Map<String, String> terminlMap, Map<String, String> regionalMap, Map<String, String> channelMap, Map<String, String> equipmentUsageStatusMap) {
|
|
401
|
// 定/自检小组组长
|
404
|
// 定/自检小组组长
|
|
402
|
if (ObjUtil.isNotNull(data.getInspectionTeamLeaderName())) {
|
405
|
if (ObjUtil.isNotNull(data.getInspectionTeamLeaderName())) {
|
|
403
|
data.setInspectionTeamLeaderId(sysUserMap.get(data.getInspectionTeamLeaderName()));
|
406
|
data.setInspectionTeamLeaderId(sysUserMap.get(data.getInspectionTeamLeaderName()));
|
|
@@ -410,18 +413,35 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
|
|
410
|
if (ObjUtil.isNotNull(data.getInspectionTeamMember2Name())) {
|
413
|
if (ObjUtil.isNotNull(data.getInspectionTeamMember2Name())) {
|
|
411
|
data.setInspectionTeamMember2Id(sysUserMap.get(data.getInspectionTeamMember2Name()));
|
414
|
data.setInspectionTeamMember2Id(sysUserMap.get(data.getInspectionTeamMember2Name()));
|
|
412
|
}
|
415
|
}
|
|
413
|
- // 航站楼
|
|
|
|
|
|
416
|
+ // 航站楼+区域+通道
|
|
414
|
if (ObjUtil.isNotNull(data.getTerminlName())) {
|
417
|
if (ObjUtil.isNotNull(data.getTerminlName())) {
|
|
415
|
- data.setTerminlCode(terminlMap.get(data.getTerminlName()));
|
|
|
|
416
|
- }
|
|
|
|
417
|
- // 区域
|
|
|
|
418
|
- if (ObjUtil.isNotNull(data.getRegionalName())) {
|
|
|
|
419
|
- data.setRegionalCode(regionalMap.get(data.getRegionalName()));
|
|
|
|
420
|
- }
|
|
|
|
421
|
- // 通道
|
|
|
|
422
|
- if (ObjUtil.isNotNull(data.getChannelName())) {
|
|
|
|
423
|
- data.setChannelCode(channelMap.get(data.getChannelName()));
|
|
|
|
|
|
418
|
+ BasePosition terminl = basePositionList.stream().filter(basePosition -> StrUtil.equals(basePosition.getName(), data.getTerminlCode())).findFirst().orElse(null);
|
|
|
|
419
|
+ if (ObjUtil.isNotNull(terminl)) {
|
|
|
|
420
|
+ data.setTerminlCode(terminl.getCode());
|
|
|
|
421
|
+ List<BasePosition> regionalList = (List<BasePosition>) terminl.getChildren();
|
|
|
|
422
|
+ BasePosition regional = regionalList.stream().filter(basePosition -> StrUtil.equals(basePosition.getName(), data.getRegionalName())).findFirst().orElse(null);
|
|
|
|
423
|
+ if (ObjUtil.isNotNull(regional)) {
|
|
|
|
424
|
+ data.setRegionalCode(regional.getCode());
|
|
|
|
425
|
+ List<BasePosition> channelList = (List<BasePosition>) regional.getChildren();
|
|
|
|
426
|
+ BasePosition channel = channelList.stream().filter(basePosition -> StrUtil.equals(basePosition.getName(), data.getChannelName())).findFirst().orElse(null);
|
|
|
|
427
|
+ if (ObjUtil.isNotNull(channel)) {
|
|
|
|
428
|
+ data.setChannelCode(channel.getCode());
|
|
|
|
429
|
+ }
|
|
|
|
430
|
+ }
|
|
|
|
431
|
+ }
|
|
424
|
}
|
432
|
}
|
|
|
|
433
|
+// // 航站楼
|
|
|
|
434
|
+// if (ObjUtil.isNotNull(data.getTerminlName())) {
|
|
|
|
435
|
+// data.setTerminlCode(terminlMap.get(data.getTerminlName()));
|
|
|
|
436
|
+// }
|
|
|
|
437
|
+// // 区域
|
|
|
|
438
|
+// if (ObjUtil.isNotNull(data.getRegionalName())) {
|
|
|
|
439
|
+// data.setRegionalCode(regionalMap.get(data.getRegionalName()));
|
|
|
|
440
|
+// }
|
|
|
|
441
|
+// // 通道
|
|
|
|
442
|
+// if (ObjUtil.isNotNull(data.getChannelName())) {
|
|
|
|
443
|
+// data.setChannelCode(channelMap.get(data.getChannelName()));
|
|
|
|
444
|
+// }
|
|
425
|
}
|
445
|
}
|
|
426
|
|
446
|
|
|
427
|
/**
|
447
|
/**
|