From bf7a1371000b7e0cf45537cab3db5c6db6c0bdc7 Mon Sep 17 00:00:00 2001 From: qianming Date: Tue, 17 May 2022 16:30:46 +0800 Subject: [PATCH 1/2] update-0.9.7.2 --- report-ui/src/views/layout/components/Sidebar/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report-ui/src/views/layout/components/Sidebar/index.vue b/report-ui/src/views/layout/components/Sidebar/index.vue index 797636d1..1f84de8a 100644 --- a/report-ui/src/views/layout/components/Sidebar/index.vue +++ b/report-ui/src/views/layout/components/Sidebar/index.vue @@ -3,7 +3,7 @@
- V0.9.7 + V0.9.7.2
Date: Tue, 17 May 2022 16:57:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96----=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/controller/ReportController.java | 6 ++--- .../modules/report/service/ReportService.java | 4 +-- .../service/impl/ReportServiceImpl.java | 26 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java index 65c06afe..fa44a3a3 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java @@ -43,11 +43,11 @@ public class ReportController extends GaeaBaseController { /** * 复制大屏 - * @param reportId + * @param dto */ - void copy(Long reportId); + void copy(ReportDto dto); } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java index 4a36d9f0..e44400b0 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/service/impl/ReportServiceImpl.java @@ -3,7 +3,9 @@ package com.anjiplus.template.gaea.business.modules.report.service.impl; import com.anji.plus.gaea.constant.BaseOperationEnum; import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper; import com.anji.plus.gaea.exception.BusinessException; +import com.anji.plus.gaea.exception.BusinessExceptionBuilder; import com.anji.plus.gaea.utils.GaeaBeanUtils; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.anjiplus.template.gaea.business.enums.ReportTypeEnum; import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDashboard; import com.anjiplus.template.gaea.business.modules.dashboard.service.ReportDashboardService; @@ -16,6 +18,7 @@ import com.anjiplus.template.gaea.business.modules.report.service.ReportService; import com.anjiplus.template.gaea.business.modules.reportexcel.dao.entity.ReportExcel; import com.anjiplus.template.gaea.business.modules.reportexcel.service.ReportExcelService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -107,10 +110,16 @@ public class ReportServiceImpl implements ReportService { } @Override - public void copy(Long reportId) { - Report report = selectOne(reportId); + public void copy(ReportDto dto) { + if (null == dto.getId()) { + throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "id"); + } + if (StringUtils.isBlank(dto.getReportCode())) { + throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "报表编码"); + } + Report report = selectOne(dto.getId()); String reportCode = report.getReportCode(); - Report copyReport = copyReport(report); + Report copyReport = copyReport(report, dto); //复制主表数据 insert(copyReport); String copyReportCode = copyReport.getReportCode(); @@ -150,17 +159,12 @@ public class ReportServiceImpl implements ReportService { } } - private Report copyReport(Report report){ + private Report copyReport(Report report, ReportDto dto){ //复制主表数据 Report copyReport = new Report(); GaeaBeanUtils.copyAndFormatter(report, copyReport); - copyReport.setId(null); - String copyReportCode = copyReport.getReportCode().concat("_").concat(String.valueOf(System.currentTimeMillis())); - if (copyReportCode.length() >= 100) { - copyReportCode = copyReportCode.substring(0, 100); - } - copyReport.setReportCode(copyReportCode); - copyReport.setReportName(copyReport.getReportName().concat("_copy")); + copyReport.setReportCode(dto.getReportCode()); + copyReport.setReportName(dto.getReportName()); return copyReport; }