优化继续下载,重新下载,兼容jdk11

master
anthonyywj2 3 years ago
parent 41702743c9
commit 9fc60ad295

@ -180,6 +180,27 @@
<version>4.2.3</version> <version>4.2.3</version>
</dependency> </dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies> </dependencies>

@ -60,9 +60,18 @@ public class UdidlDeviceController {
@ApiImplicitParam(name = "day", value = "指定日期", required = true, dataType = "String") @ApiImplicitParam(name = "day", value = "指定日期", required = true, dataType = "String")
@AuthRuleAnnotation("udidl/device/dlByDay") @AuthRuleAnnotation("udidl/device/dlByDay")
@GetMapping("udidl/device/dlByDay") @GetMapping("udidl/device/dlByDay")
public BaseResponse dlByDay(String day) { public BaseResponse dlByDay(String day, String jobId) {
logger.info(day + "---按天开启下载"); logger.info(day + "---按天开启下载");
deviceSyncService.downloadUdi(day, "manual");
if (jobId != null) {
jobLogService.deleteById(jobId);
}
DeviceRequest deviceRequest = new DeviceRequest();
deviceRequest.setRequestType("1"); //按天请求
deviceRequest.setRangeValue(day);
deviceRequest.setDownloadType("manual"); //下载方式
deviceRequest.setDataType("3"); //全量下载
deviceSyncService.downloadUdiData(deviceRequest);
return ResultVOUtils.success("后台已开始下载!"); return ResultVOUtils.success("后台已开始下载!");
} }

@ -3,15 +3,14 @@ package com.glxp.udidl.admin.controller.info;
import com.glxp.udidl.admin.annotation.AuthRuleAnnotation; import com.glxp.udidl.admin.annotation.AuthRuleAnnotation;
import com.glxp.udidl.admin.entity.udid.JobLog; import com.glxp.udidl.admin.entity.udid.JobLog;
import com.glxp.udidl.admin.req.udid.JobLogFilterRequest; import com.glxp.udidl.admin.req.udid.JobLogFilterRequest;
import com.glxp.udidl.admin.req.udid.JobRequest;
import com.glxp.udidl.admin.res.BaseResponse; import com.glxp.udidl.admin.res.BaseResponse;
import com.glxp.udidl.admin.service.udi.JobLogService; import com.glxp.udidl.admin.service.udi.JobLogService;
import com.glxp.udidl.admin.util.ResultVOUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "任务日志接口") @Api(tags = "任务日志接口")
@RestController @RestController
@ -28,4 +27,16 @@ public class JobLogController {
return jobLogService.getList(jobLogFilterRequest); return jobLogService.getList(jobLogFilterRequest);
} }
@AuthRuleAnnotation("jobLog/delete")
@PostMapping("/delete")
public BaseResponse deleteById(@RequestBody JobRequest jobRequest) {
int result = jobLogService.deleteById(jobRequest.getJobId());
if (result != -1) {
return ResultVOUtils.success("删除成功");
} else {
return ResultVOUtils.error(500, "下载失败!");
}
}
} }

@ -329,7 +329,7 @@ public class DeviceDownloadService {
jobLog.setRealCount(jobLog.getRealCount() + dataSetResult.getDataSet().getDeviceInfo().size()); jobLog.setRealCount(jobLog.getRealCount() + dataSetResult.getDataSet().getDeviceInfo().size());
jobLog.setInsertCount(jobLog.getInsertCount() + insertCount); jobLog.setInsertCount(jobLog.getInsertCount() + insertCount);
jobLog.setTotalCount(dataSetResult.getTotalRecordCount()); jobLog.setTotalCount(dataSetResult.getTotalRecordCount());
jobLog.setMsg("下载中:" + "总条数:" + dataSetResult.getTotalRecordCount() + ";下载条数:" + jobLog.getInsertCount() + ";插入条数:" + jobLog.getInsertCount()); jobLog.setMsg("下载中:" + "总条数:" + dataSetResult.getTotalRecordCount() + ";下载条数:" + jobLog.getRealCount() + ";插入条数:" + jobLog.getInsertCount());
jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest)); jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest));
jobLogService.update(jobLog); jobLogService.update(jobLog);
} catch (Exception e) { } catch (Exception e) {

@ -7,7 +7,6 @@ import com.glxp.udidl.admin.res.BaseResponse;
public interface JobLogService { public interface JobLogService {
BaseResponse getList(JobLogFilterRequest param); BaseResponse getList(JobLogFilterRequest param);
JobLog findById(String jobId); JobLog findById(String jobId);
int insert(JobLog jobLog); int insert(JobLog jobLog);
@ -20,4 +19,7 @@ public interface JobLogService {
* @param jobLog * @param jobLog
*/ */
int insertLog(JobLog jobLog); int insertLog(JobLog jobLog);
int deleteById(String jobId);
} }

@ -58,4 +58,9 @@ public class JobLogServiceImpl implements JobLogService {
return insert; return insert;
} }
@Override
public int deleteById(String jobId) {
return jobLogMapper.deleteById(jobId);
}
} }

Loading…
Cancel
Save