From 8c749e090970219c1642158b4eed341dfe9031ab Mon Sep 17 00:00:00 2001 From: yangyang Date: Fri, 6 Mar 2026 15:12:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=90=8C=E6=AD=A5en?= =?UTF-8?q?c=E5=BC=82=E5=B8=B8=E6=95=B0=E6=8D=AE=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LyricInternalNewServiceImpl.java | 6 ++---- .../impl/SimulationTaskExtraServiceImpl.java | 20 +++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/project/src/main/java/com/sdm/project/service/impl/LyricInternalNewServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/LyricInternalNewServiceImpl.java index 97288982..56ca5bbc 100644 --- a/project/src/main/java/com/sdm/project/service/impl/LyricInternalNewServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/LyricInternalNewServiceImpl.java @@ -121,11 +121,11 @@ public class LyricInternalNewServiceImpl { syncCount = simulationTaskExtraService.batchRemoveAndSaveExceptionData(newExceptionModels); } catch (Exception e) { log.error("batchRemoveAndSaveExceptionData error:{}", e.getMessage()); + processedCount += unsyncedExceptionTasks.size(); continue; } syncTotalCount += syncCount; - log.info("同步异常任务:第{}批次同步完成,本次同步{}条,累计同步{}条", - pageNum, syncCount, syncTotalCount); + log.info("同步异常任务:第{}批次同步完成,本次同步{}条,累计同步{}条", pageNum, syncCount, syncTotalCount); // 更新已处理数量和页码 processedCount += unsyncedExceptionTasks.size(); pageNum++; @@ -135,9 +135,7 @@ public class LyricInternalNewServiceImpl { } catch (Exception e) { log.error("batchRemoveSaveTaskEcns error:{}", e.getMessage()); } - } - log.info("同步异常任务全部完成,总任务数{}条,累计同步异常数据{}条", total, syncTotalCount); return SdmResponse.success("同步成功,总任务数" + total + "条,累计同步了" + syncTotalCount + "条异常数据"); } catch (Exception e) { diff --git a/project/src/main/java/com/sdm/project/service/impl/SimulationTaskExtraServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/SimulationTaskExtraServiceImpl.java index 380656f1..926be1eb 100644 --- a/project/src/main/java/com/sdm/project/service/impl/SimulationTaskExtraServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/SimulationTaskExtraServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -93,11 +94,11 @@ public class SimulationTaskExtraServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(SimulationTaskExtra::getTaskId, taskIdList); // 3. 执行删除 - boolean remove = this.remove(queryWrapper); - log.warn("batchSaveExceptionData before delete: {}", remove); - if(!remove) { - log.error("batchSaveExceptionData before delete failed"); - throw new RuntimeException("batchSaveExceptionData before delete failed"); + try { + this.remove(queryWrapper); + } catch (Exception e) { + log.error("batchSaveExceptionData before delete exception:{}",e.getMessage()); + throw new RuntimeException(e); } // 构建扩展表数据 List abnormalExtraList = new ArrayList<>(); @@ -112,6 +113,9 @@ public class SimulationTaskExtraServiceImpl extends ServiceImpl