Commit 3a9c378e authored by wujipeng's avatar wujipeng
Browse files

模板生成报表第二版

parent fd725ced
...@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* @author : wujipeng * @author : wujipeng
...@@ -15,6 +18,9 @@ import lombok.Data; ...@@ -15,6 +18,9 @@ import lombok.Data;
*/ */
@Data @Data
@TableName(value = "report_detail_merge") @TableName(value = "report_detail_merge")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ReportDetailMergeEntity { public class ReportDetailMergeEntity {
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
......
...@@ -84,10 +84,40 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i ...@@ -84,10 +84,40 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
List<ReportDetailBasicEntity> reportDetailBasicList = new ArrayList<>(); List<ReportDetailBasicEntity> reportDetailBasicList = new ArrayList<>();
List<TemplateDetailBasicEntity> templateDetailBasicList = templateDetailBasicService.list(new LambdaQueryWrapper<TemplateDetailBasicEntity>() List<TemplateDetailBasicEntity> templateDetailBasicList = templateDetailBasicService.list(new LambdaQueryWrapper<TemplateDetailBasicEntity>()
.eq(TemplateDetailBasicEntity::getTemplateId, template.getId())); .eq(TemplateDetailBasicEntity::getTemplateId, template.getId()));
for (TemplateDetailBasicEntity templateDetailBasicEntity : templateDetailBasicList) {
reportDetailBasicList.add(ReportDetailBasicEntity.builder()
.templateId(template.getId())
.reportId(report.getId())
.location(templateDetailBasicEntity.getLocation())
.value(templateDetailBasicEntity.getValue())
.type(templateDetailBasicEntity.getType())
.staticValue(templateDetailBasicEntity.getStaticValue())
.format(templateDetailBasicEntity.getFormat())
.metaId(templateDetailBasicEntity.getMetaId())
.metaName(templateDetailBasicEntity.getMetaName())
.formula(templateDetailBasicEntity.getFormula())
.useReportId(templateDetailBasicEntity.getUseReportId())
.useReportName(templateDetailBasicEntity.getUseReportName())
.useReportLocation(templateDetailBasicEntity.getUseReportLocation())
.offset(templateDetailBasicEntity.getOffset())
.offsetNumber(templateDetailBasicEntity.getOffsetNumber())
.build()
);
}
reportDetailBasicService.saveBatch(reportDetailBasicList);
//处理报表详情-复合 //处理报表详情-复合
List<ReportDetailMergeEntity> reportDetailMergeList = new ArrayList<>(); List<ReportDetailMergeEntity> reportDetailMergeList = new ArrayList<>();
List<TemplateDetailMergeEntity> templateDetailMergeList = templateDetailMergeService.list(new LambdaQueryWrapper<TemplateDetailMergeEntity>() List<TemplateDetailMergeEntity> templateDetailMergeList = templateDetailMergeService.list(new LambdaQueryWrapper<TemplateDetailMergeEntity>()
.eq(TemplateDetailMergeEntity::getTemplateId, template.getId())); .eq(TemplateDetailMergeEntity::getTemplateId, template.getId()));
for (TemplateDetailMergeEntity templateDetailMergeEntity : templateDetailMergeList) {
reportDetailMergeList.add(ReportDetailMergeEntity.builder()
.templateId(template.getId())
.reportId(report.getId())
.rangeCell(templateDetailMergeEntity.getRangeCell())
.masterCell(templateDetailMergeEntity.getMasterCell())
.build());
}
reportDetailMergeService.saveBatch(reportDetailMergeList);
//处理报表配置 //处理报表配置
List<ReportConfigEntity> reportConfigList = new ArrayList<>(); List<ReportConfigEntity> reportConfigList = new ArrayList<>();
List<TemplateConfigEntity> templateConfigList = templateConfigService.list(new LambdaQueryWrapper<TemplateConfigEntity>() List<TemplateConfigEntity> templateConfigList = templateConfigService.list(new LambdaQueryWrapper<TemplateConfigEntity>()
......
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