|
|
|
@ -20,12 +20,14 @@ import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.system.SyncDataSetResponse;
|
|
|
|
|
import com.glxp.api.service.sync.*;
|
|
|
|
|
import com.glxp.api.task.TaskExecutorConfig;
|
|
|
|
|
import com.glxp.api.util.BeanCopyUtils;
|
|
|
|
|
import com.glxp.api.util.DateUtil;
|
|
|
|
|
import com.glxp.api.util.RedisUtil;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
@ -41,6 +43,7 @@ import java.net.URLEncoder;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
@ -193,6 +196,7 @@ public class SpsSyncExportStatusController {
|
|
|
|
|
|
|
|
|
|
private final SyncDataSetDao syncDataSetDao;
|
|
|
|
|
private final HeartService heartService;
|
|
|
|
|
private final ThreadPoolTaskExecutor executorConfig;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 手动上传数据
|
|
|
|
@ -212,14 +216,16 @@ public class SpsSyncExportStatusController {
|
|
|
|
|
if (syncDataSetEntity.getSyncTime() == null) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), "缺少初始化数据");
|
|
|
|
|
}
|
|
|
|
|
switch (req.getExportType()){
|
|
|
|
|
case IO_ORDER:
|
|
|
|
|
heartService.uploadAllBusOrder(DateUtil.formatDateTime(req.getSyncTime()));
|
|
|
|
|
heartService.uploadAllOrder(DateUtil.formatDateTime(req.getSyncTime()));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
heartService.pushData(syncDataSetEntity, req.getSyncTime(), req.getExportType());
|
|
|
|
|
}
|
|
|
|
|
CompletableFuture future = CompletableFuture.runAsync(() -> {
|
|
|
|
|
switch (req.getExportType()) {
|
|
|
|
|
case IO_ORDER:
|
|
|
|
|
heartService.uploadAllBusOrder(DateUtil.formatDateTime(req.getSyncTime()));
|
|
|
|
|
heartService.uploadAllOrder(DateUtil.formatDateTime(req.getSyncTime()));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
heartService.pushData(syncDataSetEntity, req.getSyncTime(), req.getExportType());
|
|
|
|
|
}
|
|
|
|
|
}, executorConfig);
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|