手动同步调整

pro
wj 2 years ago
parent 907d19d0d1
commit 9f436e8aa6

@ -117,10 +117,12 @@ public class SpsSyncDownloadController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@GetMapping("sps/sync/order") @GetMapping("sps/sync/order")
public BaseResponse getOrder(SpsSyncDataRequest spsSyncDataRequest) { public BaseResponse getOrder(SpsSyncDataRequest spsSyncDataRequest) {
BaseResponse<SpsSyncOrderResponse> baseResponse = spsSyncDownloadService.findOrder(spsSyncDataRequest);
BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 3); BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 3);
String logs = ""; String logs = "";
if (basicExportStatusEntity != null&&StrUtil.isBlank(basicExportStatusEntity.getCacheFilePath())) { BaseResponse<SpsSyncOrderResponse> baseResponse = new BaseResponse<>();
if (basicExportStatusEntity != null) {
if (StrUtil.isBlank(basicExportStatusEntity.getCacheFilePath())) {
baseResponse = spsSyncDownloadService.findOrder(spsSyncDataRequest);
String fileFullPath = null; String fileFullPath = null;
try { try {
fileFullPath = writeFile(filePrefix, BasicProcessStatus.NEW_ALL_BUS_ORDER, JSONUtil.toJsonStr(baseResponse.getData())); fileFullPath = writeFile(filePrefix, BasicProcessStatus.NEW_ALL_BUS_ORDER, JSONUtil.toJsonStr(baseResponse.getData()));
@ -130,6 +132,10 @@ public class SpsSyncDownloadController {
basicExportStatusEntity.setCacheFilePath(fileFullPath); basicExportStatusEntity.setCacheFilePath(fileFullPath);
basicExportStatusEntity.setRemark(baseResponse.getData().getSyncRemark()); basicExportStatusEntity.setRemark(baseResponse.getData().getSyncRemark());
basicExportService.updateExportStatus(basicExportStatusEntity); basicExportService.updateExportStatus(basicExportStatusEntity);
} else {
String content = readDataFile(basicExportStatusEntity.getCacheFilePath());
baseResponse.setData(JSONUtil.toBean(content, SpsSyncOrderResponse.class));
}
SpsSyncOrderResponse spsSyncOrderResponse = baseResponse.getData(); SpsSyncOrderResponse spsSyncOrderResponse = baseResponse.getData();
spsSyncOrderResponse.setTaskId(basicExportStatusEntity.getId()); spsSyncOrderResponse.setTaskId(basicExportStatusEntity.getId());
baseResponse.setData(spsSyncOrderResponse); baseResponse.setData(spsSyncOrderResponse);

Loading…
Cancel
Save