手动调用同步数据

master
wj 2 years ago
parent 725142ff47
commit 932bb96b2f

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log; import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*; import com.glxp.api.constant.*;
@ -13,16 +14,21 @@ import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity; import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
import com.glxp.api.req.sync.BasicExportStatusRequest; import com.glxp.api.req.sync.BasicExportStatusRequest;
import com.glxp.api.req.sync.BasicExportTimeRequest; import com.glxp.api.req.sync.BasicExportTimeRequest;
import com.glxp.api.req.sync.ManualSyncDataReq;
import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.sync.SpSyncUdiResponse; import com.glxp.api.res.sync.SpSyncUdiResponse;
import com.glxp.api.res.sync.SpsSyncBusResponse; import com.glxp.api.res.sync.SpsSyncBusResponse;
import com.glxp.api.res.sync.SpsSyncDataResponse; import com.glxp.api.res.sync.SpsSyncDataResponse;
import com.glxp.api.res.sync.SpsSyncOrderResponse; import com.glxp.api.res.sync.SpsSyncOrderResponse;
import com.glxp.api.res.system.SyncDataSetResponse;
import com.glxp.api.service.sync.BasicExportService; import com.glxp.api.service.sync.BasicExportService;
import com.glxp.api.service.sync.BasicExportTimeService; import com.glxp.api.service.sync.BasicExportTimeService;
import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.service.sync.SyncDataSetService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.RedisUtil; import com.glxp.api.util.RedisUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -38,6 +44,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
@RestController @RestController
@RequiredArgsConstructor
public class SpsSyncExportStatusController { public class SpsSyncExportStatusController {
@ -229,6 +236,31 @@ public class SpsSyncExportStatusController {
} }
private final SpsSyncDownloadService spsSyncDownloadService;
private final SyncDataSetService syncDataSetService;
/**
*
*
* @param req
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/spssync/udiinfo/syncData")
public BaseResponse syncData(@RequestBody ManualSyncDataReq req) {
if (req.getExportType() == null || req.getSyncTime() == null) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet();
if (syncDataSetEntity.getSyncTime() == null) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), "缺少初始化数据");
}
spsSyncDownloadService.syncData(syncDataSetEntity, req.getExportType(), req.getSyncTime());
return ResultVOUtils.success();
}
} }

@ -0,0 +1,18 @@
package com.glxp.api.req.sync;
import com.glxp.api.constant.BasicExportTypeEnum;
import lombok.Data;
import java.util.Date;
/**
*
*/
@Data
public class ManualSyncDataReq {
private BasicExportTypeEnum exportType;
private Date syncTime;
}
Loading…
Cancel
Save