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} + + )