Explorar o código

同步台账优化

chenshudong hai 1 semana
pai
achega
6d76b95689

+ 0 - 16
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerSyncServiceImpl.java

@@ -213,7 +213,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
213 213
 
214 214
         for (LedgerSupervisionProblem row : list) {
215 215
             String src = "supervision_problem:" + row.getId();
216
-            if (existsBySrc(src)) { skip++; continue; }
217 216
             if (!hasName(row.getInspectedName())) { skip++; continue; }
218 217
             // 按问题层级选取L3指标和默认分值
219 218
             String level = row.getProblemLevel() != null ? row.getProblemLevel() : "";
@@ -260,7 +259,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
260 259
 
261 260
         for (LedgerRealtimeInterception row : list) {
262 261
             String src = "realtime_interception:" + row.getId();
263
-            if (existsBySrc(src)) { skip++; continue; }
264 262
             if (!hasName(row.getInspectorName())) { skip++; continue; }
265 263
             // 取【问题层级】字段,站层级扣1分,部门层级扣0.8分,其它层级跳过
266 264
             String level = row.getProblemLevel() != null ? row.getProblemLevel() : "";
@@ -313,7 +311,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
313 311
         
314 312
         for (LedgerSecurityTest row : list) {
315 313
             String src = "security_test:" + row.getId();
316
-            if (existsBySrc(src)) { skip++; continue; }
317 314
             if (!"未通过".equals(row.getTestResult())) { skip++; continue; }
318 315
             if (!hasName(row.getTestedName())) { skip++; continue; }
319 316
             // 取层级字段(scoreIndicator),而不是testType
@@ -360,7 +357,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
360 357
         
361 358
         for (LedgerUnsafeEvent row : list) {
362 359
             String src = "unsafe_event:" + row.getId();
363
-            if (existsBySrc(src)) { skip++; continue; }
364 360
             if (!hasName(row.getResponsibleName())) { skip++; continue; }
365 361
             String cat = row.getEventType() != null ? row.getEventType() : "";
366 362
             long l3Id; BigDecimal defaultSv;
@@ -407,7 +403,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
407 403
         
408 404
         for (LedgerSeizureStats row : list) {
409 405
             String src = "seizure_stats:" + row.getId();
410
-            if (existsBySrc(src)) { skip++; continue; }
411 406
             if (!hasName(row.getInspectorName())) { skip++; continue; }
412 407
             String cat = row.getItemCategory() != null ? row.getItemCategory() : "";
413 408
             long l3Id; BigDecimal sv;
@@ -455,7 +450,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
455 450
         
456 451
         for (LedgerRewardApproval row : list) {
457 452
             String src = "reward_approval:" + row.getId();
458
-            if (existsBySrc(src)) { skip++; continue; }
459 453
             if (!hasName(row.getPersonName())) { skip++; continue; }
460 454
             String result = row.getDisposalResult() != null ? row.getDisposalResult() : "";
461 455
             long l3Id; BigDecimal sv;
@@ -499,7 +493,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
499 493
         
500 494
         for (LedgerServicePatrol row : list) {
501 495
             String src = "service_patrol:" + row.getId();
502
-            if (existsBySrc(src)) { skip++; continue; }
503 496
             if (!hasName(row.getInspectedName())) { skip++; continue; }
504 497
             String level = row.getProblemLevel() != null ? row.getProblemLevel() : "";
505 498
             long l3Id; BigDecimal defaultSv;
@@ -545,7 +538,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
545 538
         
546 539
         for (LedgerComplaint row : list) {
547 540
             String src = "complaint:" + row.getId();
548
-            if (existsBySrc(src)) { skip++; continue; }
549 541
             if (!hasName(row.getResponsibleName())) { skip++; continue; }
550 542
             BigDecimal sv = row.getDeductScore() != null ? row.getDeductScore().negate() : NEG_TWO;
551 543
             ScoreEvent e = buildEvent(dimId, lv2, null, row.getResponsibleName(),
@@ -585,7 +577,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
585 577
         
586 578
         for (LedgerTerminalBonus row : list) {
587 579
             String src = "terminal_bonus:" + row.getId();
588
-            if (existsBySrc(src)) { skip++; continue; }
589 580
             if (!hasName(row.getPersonName())) { skip++; continue; }
590 581
             BigDecimal sv = lv3.getScoreValue() != null ? lv3.getScoreValue() : ZERO;
591 582
             ScoreEvent e = buildEvent(dimId, lv2, lv3, row.getPersonName(),
@@ -624,7 +615,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
624 615
         
625 616
         for (LedgerExamScore row : list) {
626 617
             String src = "exam_score:" + row.getId();
627
-            if (existsBySrc(src)) { skip++; continue; }
628 618
             if (!hasName(row.getPersonName())) { skip++; continue; }
629 619
             if (row.getTheoryScore() == null) { skip++; continue; }
630 620
             double score = row.getTheoryScore().doubleValue();
@@ -807,12 +797,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
807 797
         return indCache.computeIfAbsent(id, indicatorMapper::selectById);
808 798
     }
809 799
 
810
-    private boolean existsBySrc(String sourceLedger) {
811
-        return scoreEventService.count(
812
-                new LambdaQueryWrapper<ScoreEvent>()
813
-                        .eq(ScoreEvent::getSourceLedger, sourceLedger)) > 0;
814
-    }
815
-
816 800
     private boolean hasName(String name) {
817 801
         return StringUtils.hasText(name);
818 802
     }