|
|
@@ -2,6 +2,7 @@ package com.sundot.airport.ledger.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import cn.hutool.core.util.StrUtil;
|
|
4
|
4
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
5
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
5
|
6
|
import com.sundot.airport.common.core.domain.entity.SysDept;
|
|
6
|
7
|
import com.sundot.airport.common.core.domain.entity.SysUser;
|
|
7
|
8
|
import com.sundot.airport.common.enums.LedgerSyncFlagEnum;
|
|
|
@@ -192,6 +193,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
192
|
193
|
ScoreIndicator lv2 = getIndicator(IND_SUPERVISION_L2);
|
|
193
|
194
|
int ins = 0, skip = 0;
|
|
194
|
195
|
for (LedgerSupervisionProblem row : list) {
|
|
|
196
|
+ LambdaUpdateWrapper<LedgerSupervisionProblem> uw = new LambdaUpdateWrapper<>();
|
|
|
197
|
+ uw.eq(LedgerSupervisionProblem::getId, row.getId())
|
|
|
198
|
+ .set(LedgerSupervisionProblem::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
199
|
+ supervisionMapper.update(null, uw);
|
|
195
|
200
|
String src = "supervision_problem:" + row.getId();
|
|
196
|
201
|
if (existsBySrc(src)) { skip++; continue; }
|
|
197
|
202
|
if (!hasName(row.getInspectedName())) { skip++; continue; }
|
|
|
@@ -211,11 +216,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
211
|
216
|
scoreEventMapper.insert(e);
|
|
212
|
217
|
ins++;
|
|
213
|
218
|
}
|
|
214
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
215
|
|
- int updatedRows;
|
|
216
|
|
- do {
|
|
217
|
|
- updatedRows = supervisionMapper.updateSyncFlag();
|
|
218
|
|
- } while (updatedRows > 0);
|
|
219
|
219
|
return new SyncResult(ins, skip, "");
|
|
220
|
220
|
}
|
|
221
|
221
|
|
|
|
@@ -228,6 +228,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
228
|
228
|
ScoreIndicator lv2 = getIndicator(IND_INTERCEPT_L2);
|
|
229
|
229
|
int ins = 0, skip = 0;
|
|
230
|
230
|
for (LedgerRealtimeInterception row : list) {
|
|
|
231
|
+ LambdaUpdateWrapper<LedgerRealtimeInterception> uw = new LambdaUpdateWrapper<>();
|
|
|
232
|
+ uw.eq(LedgerRealtimeInterception::getId, row.getId())
|
|
|
233
|
+ .set(LedgerRealtimeInterception::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
234
|
+ interceptionMapper.update(null, uw);
|
|
231
|
235
|
String src = "realtime_interception:" + row.getId();
|
|
232
|
236
|
if (existsBySrc(src)) { skip++; continue; }
|
|
233
|
237
|
if (!hasName(row.getInspectorName())) { skip++; continue; }
|
|
|
@@ -253,11 +257,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
253
|
257
|
scoreEventMapper.insert(e);
|
|
254
|
258
|
ins++;
|
|
255
|
259
|
}
|
|
256
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
257
|
|
- int updatedRows;
|
|
258
|
|
- do {
|
|
259
|
|
- updatedRows = interceptionMapper.updateSyncFlag();
|
|
260
|
|
- } while (updatedRows > 0);
|
|
261
|
260
|
return new SyncResult(ins, skip, "");
|
|
262
|
261
|
}
|
|
263
|
262
|
|
|
|
@@ -270,6 +269,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
270
|
269
|
ScoreIndicator lv2 = getIndicator(IND_SECTEST_L2);
|
|
271
|
270
|
int ins = 0, skip = 0;
|
|
272
|
271
|
for (LedgerSecurityTest row : list) {
|
|
|
272
|
+ LambdaUpdateWrapper<LedgerSecurityTest> uw = new LambdaUpdateWrapper<>();
|
|
|
273
|
+ uw.eq(LedgerSecurityTest::getId, row.getId())
|
|
|
274
|
+ .set(LedgerSecurityTest::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
275
|
+ securityTestMapper.update(null, uw);
|
|
273
|
276
|
String src = "security_test:" + row.getId();
|
|
274
|
277
|
if (existsBySrc(src)) { skip++; continue; }
|
|
275
|
278
|
if (!"未通过".equals(row.getTestResult())) { skip++; continue; }
|
|
|
@@ -289,11 +292,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
289
|
292
|
scoreEventMapper.insert(e);
|
|
290
|
293
|
ins++;
|
|
291
|
294
|
}
|
|
292
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
293
|
|
- int updatedRows;
|
|
294
|
|
- do {
|
|
295
|
|
- updatedRows = securityTestMapper.updateSyncFlag();
|
|
296
|
|
- } while (updatedRows > 0);
|
|
297
|
295
|
return new SyncResult(ins, skip, "");
|
|
298
|
296
|
}
|
|
299
|
297
|
|
|
|
@@ -306,6 +304,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
306
|
304
|
ScoreIndicator lv2 = getIndicator(IND_UNSAFE_L2);
|
|
307
|
305
|
int ins = 0, skip = 0;
|
|
308
|
306
|
for (LedgerUnsafeEvent row : list) {
|
|
|
307
|
+ LambdaUpdateWrapper<LedgerUnsafeEvent> uw = new LambdaUpdateWrapper<>();
|
|
|
308
|
+ uw.eq(LedgerUnsafeEvent::getId, row.getId())
|
|
|
309
|
+ .set(LedgerUnsafeEvent::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
310
|
+ unsafeEventMapper.update(null, uw);
|
|
309
|
311
|
String src = "unsafe_event:" + row.getId();
|
|
310
|
312
|
if (existsBySrc(src)) { skip++; continue; }
|
|
311
|
313
|
if (!hasName(row.getResponsibleName())) { skip++; continue; }
|
|
|
@@ -325,11 +327,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
325
|
327
|
scoreEventMapper.insert(e);
|
|
326
|
328
|
ins++;
|
|
327
|
329
|
}
|
|
328
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
329
|
|
- int updatedRows;
|
|
330
|
|
- do {
|
|
331
|
|
- updatedRows = unsafeEventMapper.updateSyncFlag();
|
|
332
|
|
- } while (updatedRows > 0);
|
|
333
|
330
|
return new SyncResult(ins, skip, "");
|
|
334
|
331
|
}
|
|
335
|
332
|
|
|
|
@@ -342,6 +339,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
342
|
339
|
ScoreIndicator lv2 = getIndicator(IND_SEIZURE_L2);
|
|
343
|
340
|
int ins = 0, skip = 0;
|
|
344
|
341
|
for (LedgerSeizureStats row : list) {
|
|
|
342
|
+ LambdaUpdateWrapper<LedgerSeizureStats> uw = new LambdaUpdateWrapper<>();
|
|
|
343
|
+ uw.eq(LedgerSeizureStats::getId, row.getId())
|
|
|
344
|
+ .set(LedgerSeizureStats::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
345
|
+ seizureMapper.update(null, uw);
|
|
345
|
346
|
String src = "seizure_stats:" + row.getId();
|
|
346
|
347
|
if (existsBySrc(src)) { skip++; continue; }
|
|
347
|
348
|
if (!hasName(row.getInspectorName())) { skip++; continue; }
|
|
|
@@ -358,11 +359,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
358
|
359
|
scoreEventMapper.insert(e);
|
|
359
|
360
|
ins++;
|
|
360
|
361
|
}
|
|
361
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
362
|
|
- int updatedRows;
|
|
363
|
|
- do {
|
|
364
|
|
- updatedRows = seizureMapper.updateSyncFlag();
|
|
365
|
|
- } while (updatedRows > 0);
|
|
366
|
362
|
return new SyncResult(ins, skip, "");
|
|
367
|
363
|
}
|
|
368
|
364
|
|
|
|
@@ -379,6 +375,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
379
|
375
|
ScoreIndicator lv2 = getIndicator(IND_SEIZURE_L2);
|
|
380
|
376
|
int ins = 0, skip = 0;
|
|
381
|
377
|
for (LedgerRewardApproval row : list) {
|
|
|
378
|
+ LambdaUpdateWrapper<LedgerRewardApproval> uw = new LambdaUpdateWrapper<>();
|
|
|
379
|
+ uw.eq(LedgerRewardApproval::getId, row.getId())
|
|
|
380
|
+ .set(LedgerRewardApproval::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
381
|
+ rewardApprovalMapper.update(null, uw);
|
|
382
|
382
|
String src = "reward_approval:" + row.getId();
|
|
383
|
383
|
if (existsBySrc(src)) { skip++; continue; }
|
|
384
|
384
|
if (!hasName(row.getPersonName())) { skip++; continue; }
|
|
|
@@ -395,11 +395,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
395
|
395
|
scoreEventMapper.insert(e);
|
|
396
|
396
|
ins++;
|
|
397
|
397
|
}
|
|
398
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
399
|
|
- int updatedRows;
|
|
400
|
|
- do {
|
|
401
|
|
- updatedRows = rewardApprovalMapper.updateSyncFlag();
|
|
402
|
|
- } while (updatedRows > 0);
|
|
403
|
398
|
return new SyncResult(ins, skip, "");
|
|
404
|
399
|
}
|
|
405
|
400
|
|
|
|
@@ -412,6 +407,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
412
|
407
|
ScoreIndicator lv2 = getIndicator(IND_SVCPATROL_L2);
|
|
413
|
408
|
int ins = 0, skip = 0;
|
|
414
|
409
|
for (LedgerServicePatrol row : list) {
|
|
|
410
|
+ LambdaUpdateWrapper<LedgerServicePatrol> uw = new LambdaUpdateWrapper<>();
|
|
|
411
|
+ uw.eq(LedgerServicePatrol::getId, row.getId())
|
|
|
412
|
+ .set(LedgerServicePatrol::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
413
|
+ servicePatrolMapper.update(null, uw);
|
|
415
|
414
|
String src = "service_patrol:" + row.getId();
|
|
416
|
415
|
if (existsBySrc(src)) { skip++; continue; }
|
|
417
|
416
|
if (!hasName(row.getInspectedName())) { skip++; continue; }
|
|
|
@@ -430,11 +429,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
430
|
429
|
scoreEventMapper.insert(e);
|
|
431
|
430
|
ins++;
|
|
432
|
431
|
}
|
|
433
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
434
|
|
- int updatedRows;
|
|
435
|
|
- do {
|
|
436
|
|
- updatedRows = servicePatrolMapper.updateSyncFlag();
|
|
437
|
|
- } while (updatedRows > 0);
|
|
438
|
432
|
return new SyncResult(ins, skip, "");
|
|
439
|
433
|
}
|
|
440
|
434
|
|
|
|
@@ -447,6 +441,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
447
|
441
|
ScoreIndicator lv2 = getIndicator(IND_COMPLAINT_L2);
|
|
448
|
442
|
int ins = 0, skip = 0;
|
|
449
|
443
|
for (LedgerComplaint row : list) {
|
|
|
444
|
+ LambdaUpdateWrapper<LedgerComplaint> uw = new LambdaUpdateWrapper<>();
|
|
|
445
|
+ uw.eq(LedgerComplaint::getId, row.getId())
|
|
|
446
|
+ .set(LedgerComplaint::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
447
|
+ complaintMapper.update(null, uw);
|
|
450
|
448
|
String src = "complaint:" + row.getId();
|
|
451
|
449
|
if (existsBySrc(src)) { skip++; continue; }
|
|
452
|
450
|
if (!hasName(row.getResponsibleName())) { skip++; continue; }
|
|
|
@@ -458,11 +456,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
458
|
456
|
scoreEventMapper.insert(e);
|
|
459
|
457
|
ins++;
|
|
460
|
458
|
}
|
|
461
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
462
|
|
- int updatedRows;
|
|
463
|
|
- do {
|
|
464
|
|
- updatedRows = complaintMapper.updateSyncFlag();
|
|
465
|
|
- } while (updatedRows > 0);
|
|
466
|
459
|
return new SyncResult(ins, skip, "");
|
|
467
|
460
|
}
|
|
468
|
461
|
|
|
|
@@ -476,6 +469,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
476
|
469
|
ScoreIndicator lv3 = getIndicator(IND_TYPCASE_L3);
|
|
477
|
470
|
int ins = 0, skip = 0;
|
|
478
|
471
|
for (LedgerTerminalBonus row : list) {
|
|
|
472
|
+ LambdaUpdateWrapper<LedgerTerminalBonus> uw = new LambdaUpdateWrapper<>();
|
|
|
473
|
+ uw.eq(LedgerTerminalBonus::getId, row.getId())
|
|
|
474
|
+ .set(LedgerTerminalBonus::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
475
|
+ terminalBonusMapper.update(null, uw);
|
|
479
|
476
|
String src = "terminal_bonus:" + row.getId();
|
|
480
|
477
|
if (existsBySrc(src)) { skip++; continue; }
|
|
481
|
478
|
if (!hasName(row.getPersonName())) { skip++; continue; }
|
|
|
@@ -487,11 +484,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
487
|
484
|
scoreEventMapper.insert(e);
|
|
488
|
485
|
ins++;
|
|
489
|
486
|
}
|
|
490
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
491
|
|
- int updatedRows;
|
|
492
|
|
- do {
|
|
493
|
|
- updatedRows = terminalBonusMapper.updateSyncFlag();
|
|
494
|
|
- } while (updatedRows > 0);
|
|
495
|
487
|
return new SyncResult(ins, skip, "");
|
|
496
|
488
|
}
|
|
497
|
489
|
|
|
|
@@ -504,6 +496,10 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
504
|
496
|
ScoreIndicator lv2 = getIndicator(IND_EXAM_L2);
|
|
505
|
497
|
int ins = 0, skip = 0;
|
|
506
|
498
|
for (LedgerExamScore row : list) {
|
|
|
499
|
+ LambdaUpdateWrapper<LedgerExamScore> uw = new LambdaUpdateWrapper<>();
|
|
|
500
|
+ uw.eq(LedgerExamScore::getId, row.getId())
|
|
|
501
|
+ .set(LedgerExamScore::getSyncFlag, LedgerSyncFlagEnum.ONE.getCode());
|
|
|
502
|
+ examScoreMapper.update(null, uw);
|
|
507
|
503
|
String src = "exam_score:" + row.getId();
|
|
508
|
504
|
if (existsBySrc(src)) { skip++; continue; }
|
|
509
|
505
|
if (!hasName(row.getPersonName())) { skip++; continue; }
|
|
|
@@ -523,11 +519,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
|
|
523
|
519
|
scoreEventMapper.insert(e);
|
|
524
|
520
|
ins++;
|
|
525
|
521
|
}
|
|
526
|
|
- // 分批更新 sync_flag,避免锁等待超时
|
|
527
|
|
- int updatedRows;
|
|
528
|
|
- do {
|
|
529
|
|
- updatedRows = examScoreMapper.updateSyncFlag();
|
|
530
|
|
- } while (updatedRows > 0);
|
|
531
|
522
|
return new SyncResult(ins, skip, "");
|
|
532
|
523
|
}
|
|
533
|
524
|
|