From f5397a245e3f6b48db6feb76c7678b028ae226c2 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Mon, 8 May 2023 18:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=90=8C=E6=AD=A5=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/sync/SpsSyncDownloadController.java | 2 +- .../api/service/sync/SpsSyncDownloadService.java | 12 ++++++++++++ .../resources/mybatis/mapper/sync/BasicExportDao.xml | 12 +++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) 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 e7e2e008..7b714423 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -120,7 +120,7 @@ public class SpsSyncDownloadController { BaseResponse baseResponse = spsSyncDownloadService.findOrder(spsSyncDataRequest); BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 3); String logs = ""; - if (basicExportStatusEntity != null) { + if (basicExportStatusEntity != null&&StrUtil.isBlank(basicExportStatusEntity.getCacheFilePath())) { String fileFullPath = null; try { fileFullPath = writeFile(filePrefix, BasicProcessStatus.NEW_ALL_BUS_ORDER, JSONUtil.toJsonStr(baseResponse.getData())); diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index 9bc74118..2f17afd4 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -115,6 +116,17 @@ public class SpsSyncDownloadService { orderStatusEntity.setStatus(BasicExportStatusEnum.WAIT_SYNC.getCode()); orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + + if (lastUpdateTime != null) { + String fileFullPath = null; + try { + fileFullPath = writeFile(filePath, BasicProcessStatus.NEW_ALL_BUS_ORDER, JSONUtil.toJsonStr(baseResponse.getData())); + orderStatusEntity.setCacheFilePath(fileFullPath); + orderStatusEntity.setRemark(baseResponse.getData().getSyncRemark()); + } catch (IOException e) { + e.printStackTrace(); + } + } basicExportService.insertExportStatus(orderStatusEntity); } } diff --git a/src/main/resources/mybatis/mapper/sync/BasicExportDao.xml b/src/main/resources/mybatis/mapper/sync/BasicExportDao.xml index 6878841f..62b5f9fe 100644 --- a/src/main/resources/mybatis/mapper/sync/BasicExportDao.xml +++ b/src/main/resources/mybatis/mapper/sync/BasicExportDao.xml @@ -49,7 +49,13 @@ parameterType="com.glxp.api.entity.sync.BasicExportStatusEntity"> replace INTO basic_export_status(id, idDatas, status, `type`, updateTime, scheduleType, startTime, endTime, - remark, receiveStatus) + remark, receiveStatus + + + ,cacheFilePath + + + ) values (#{id}, #{idDatas}, #{status}, @@ -60,6 +66,10 @@ #{endTime}, #{remark}, #{receiveStatus}) + + ,#{cacheFilePath} + + )