Commit 935c5ad6 by 陶光胜

报表中心

parent 00a9fc99
......@@ -39,8 +39,9 @@ public enum DownloadReportStatusEnum {
*/
GENERATED(5, "已生成"),
ERROR(6, "生成异常")
;
ERROR(6, "生成异常"),
WAITLINE(7, "排队中");
private Integer code;
private String msg;
......
......@@ -61,7 +61,9 @@ public class DownloadReportServiceImpl implements DownloadReportService {
public Page<TabDownloadReport> listDownloadReport(DownloadReportQO downloadReportQO) {
PageHelper.startPage(downloadReportQO.getCurrentPage(), downloadReportQO.getPageSize());
if (downloadReportQO.getDownloadReportStatus() != null) {
switch (downloadReportQO.getDownloadReportStatus()) {
Integer downloadReportStatus = downloadReportQO.getDownloadReportStatus();
downloadReportQO.setDownloadReportStatus(null);
switch (downloadReportStatus) {
case 0:
downloadReportQO.setAuditResult(DataSecurityAuditEnum.WAIT.getCode());
downloadReportQO.setLtAuditExpireTime(new Date());
......@@ -84,6 +86,11 @@ public class DownloadReportServiceImpl implements DownloadReportService {
downloadReportQO.setAuditResult(DataSecurityAuditEnum.PASS.getCode());
downloadReportQO.setHasDownloadUrl(true);
break;
case 6:
downloadReportQO.setDownloadReportStatus(6);
break;
case 7:
downloadReportQO.setDownloadReportStatus(7);
default:
break;
}
......
......@@ -133,7 +133,12 @@ public class DownloadReportApiServiceImpl implements DownloadReportApiService {
DateUtil.dateToStr(downloadReportDTO.getReportEndTime(), DateUtil.FORMAT_DATE_10);
downloadReportDTO.setFileName(fileName);
}
if("hive".equals(downloadReportDTO.getDataSource())){
downloadReportDTO.setStatus(DownloadReportStatusEnum.WAITLINE.getCode());
} else {
//sdk下载没有任务队列 直接生成中状态
downloadReportDTO.setStatus(DownloadReportStatusEnum.BUILD.getCode());
}
Integer downloadReportId = downloadReportService.save(downloadReportDTO);
return EnterpriseServiceResponse.success(downloadReportId);
}
......@@ -162,11 +167,6 @@ public class DownloadReportApiServiceImpl implements DownloadReportApiService {
if (DataSecurityAuditEnum.WAIT.getCode().equals(downloadReportDTO.getAuditResult()) && DateUtil.compareDate(currDate, downloadReportDTO.getAuditExpireTime())) {
downloadReportDTO.setDownloadReportStatus(DownloadReportStatusEnum.OVER_TIME.getCode());
downloadReportDTO.setAuditReason("审核超时");
} else if (DataSecurityAuditEnum.PASS.getCode().equals(downloadReportDTO.getAuditResult())) {
// 判断生成状态
downloadReportDTO.setDownloadReportStatus(StringUtils.isNotBlank(downloadReportDTO.getDownloadUrl()) ? DownloadReportStatusEnum.GENERATED.getCode() : DownloadReportStatusEnum.BUILD.getCode());
} else {
downloadReportDTO.setDownloadReportStatus(downloadReportDTO.getAuditResult());
}
downloadReportDTO.setDownloadUrl(null);
}
......
......@@ -404,6 +404,9 @@
<if test="projectCode == null or projectCode == '' ">
and project_code in ('gic', 'mall')
</if>
<if test="downloadReportStatus != null">
and status=#{downloadReportStatus}
</if>
order by create_time desc
</select>
<select id="listUnfinishedTask" resultMap="BaseResultMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment