From 0318f9fae6b6646ffcd0d36cc8167f8b961f9348 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 25 Apr 2023 17:33:48 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++----- .../sync/SpsSyncDownloadController.java | 2 +- .../sync/SpsSyncExportStatusController.java | 27 ++++++++++++++++++- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 60b4213e..4f606609 100644 --- a/pom.xml +++ b/pom.xml @@ -54,12 +54,12 @@ - - javax.servlet - javax.servlet-api - 3.1.0 - provided - + + + + + + org.springframework.boot diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index 2f24bd8a..7ca43545 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -159,7 +159,7 @@ public class SpsSyncDownloadController { BaseResponse baseResponse = new BaseResponse<>(); BasicExportStatusEntity one = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) .eq(BasicExportStatusEntity::getType, exportType.getRemark()) - .orderByAsc(BasicExportStatusEntity::getStartTime) + .orderByDesc(BasicExportStatusEntity::getStartTime) .last("limit 1") ); RelaySyncResponse relaySyncResponse = null; diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncExportStatusController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncExportStatusController.java index e63a0e55..14dc7bbe 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncExportStatusController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncExportStatusController.java @@ -150,7 +150,7 @@ public class SpsSyncExportStatusController { } @AuthRuleAnnotation("") - @PostMapping("/spssync/basic/udiinfo/finishTask") + @PostMapping("/spssync/udiinfo/finishTask") @Log(title = "定时任务", businessType = BusinessType.UPDATE) public BaseResponse finishTask(@RequestBody BasicExportStatusEntity basicExportStatusEntity) { @@ -176,6 +176,31 @@ public class SpsSyncExportStatusController { return ResultVOUtils.error(500, "更新成功!"); } + @AuthRuleAnnotation("") + @PostMapping("/spssync/udiinfo/receiveTask") + @Log(title = "定时任务", businessType = BusinessType.UPDATE) + public BaseResponse receiveTask(@RequestBody BasicExportStatusEntity basicExportStatusEntity) { + + if (StrUtil.isBlank(basicExportStatusEntity.getId())) { + return ResultVOUtils.error(500, "缺少唯一标识!"); + } + if (StrUtil.isEmpty(basicExportStatusEntity.getReceiveStatus())) { + basicExportStatusEntity.setEndTime(new Date()); + } + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(BasicExportStatusEnum.COMPLETED.getCode()); + boolean b = basicExportService.update(Wrappers.lambdaUpdate(BasicExportStatusEntity.class) + .set(BasicExportStatusEntity::getUpdateTime, new Date()) + .set(BasicExportStatusEntity::getReceiveStatus, 1) + .eq(BasicExportStatusEntity::getId, basicExportStatusEntity.getId()) + .eq(BasicExportStatusEntity::getStatus, BasicExportStatusEnum.COMPLETED.getCode()) + ); + if (b) + return ResultVOUtils.success("更新成功!"); + else + return ResultVOUtils.error(500, "更新成功!"); + } + @AuthRuleAnnotation("") @GetMapping("/spssync/basic/schedule/lastTime")