Commit 4d233d1f authored by wujipeng's avatar wujipeng
Browse files

报表详情

parent 231a73cf
...@@ -47,4 +47,10 @@ public class ReportController { ...@@ -47,4 +47,10 @@ public class ReportController {
public Result<Boolean> saveOrUpdateReport(@RequestBody ReportDTO reportDTO) { public Result<Boolean> saveOrUpdateReport(@RequestBody ReportDTO reportDTO) {
return Result.success(reportService.saveOrUpdateReport(reportDTO)); return Result.success(reportService.saveOrUpdateReport(reportDTO));
} }
@ApiOperation("详情")
@GetMapping("/{id}")
public Result<ReportVO> getReportDetail(@PathVariable String id) {
return Result.success(reportService.getReportDetail(id));
}
} }
...@@ -5,6 +5,7 @@ import com.ruzhoukj.integration.pojo.dto.ReportDTO; ...@@ -5,6 +5,7 @@ import com.ruzhoukj.integration.pojo.dto.ReportDTO;
import com.ruzhoukj.integration.pojo.entity.ReportEntity; import com.ruzhoukj.integration.pojo.entity.ReportEntity;
import com.ruzhoukj.integration.pojo.vo.ReportVO; import com.ruzhoukj.integration.pojo.vo.ReportVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -18,4 +19,6 @@ import java.util.List; ...@@ -18,4 +19,6 @@ import java.util.List;
public interface ReportMapper extends BaseMapper<ReportEntity> { public interface ReportMapper extends BaseMapper<ReportEntity> {
List<ReportVO> getPageData(ReportDTO reportDTO); List<ReportVO> getPageData(ReportDTO reportDTO);
ReportVO getReportDetail(@Param("id") String id);
} }
...@@ -21,4 +21,6 @@ public interface ReportService extends IService<ReportEntity> { ...@@ -21,4 +21,6 @@ public interface ReportService extends IService<ReportEntity> {
Boolean saveOrUpdateReport(ReportDTO reportDTO); Boolean saveOrUpdateReport(ReportDTO reportDTO);
ReportVO getReportDetail(String id);
} }
...@@ -8,6 +8,7 @@ import com.ruzhoukj.integration.mapper.ReportMapper; ...@@ -8,6 +8,7 @@ import com.ruzhoukj.integration.mapper.ReportMapper;
import com.ruzhoukj.integration.pojo.dto.ReportDTO; import com.ruzhoukj.integration.pojo.dto.ReportDTO;
import com.ruzhoukj.integration.pojo.entity.*; import com.ruzhoukj.integration.pojo.entity.*;
import com.ruzhoukj.integration.pojo.vo.ReportVO; import com.ruzhoukj.integration.pojo.vo.ReportVO;
import com.ruzhoukj.integration.pojo.vo.TemplateVO;
import com.ruzhoukj.integration.result.PageResult; import com.ruzhoukj.integration.result.PageResult;
import com.ruzhoukj.integration.service.*; import com.ruzhoukj.integration.service.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -177,6 +178,39 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i ...@@ -177,6 +178,39 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
public ReportVO getReportDetail(String id) {
Map<String, ReportDetailBasicEntity> basic = new HashMap<>();
ReportVO result = baseMapper.getReportDetail(id);
//查询模板详情基础
List<ReportDetailBasicEntity> templateDetailList = reportDetailBasicService
.list(new LambdaQueryWrapper<ReportDetailBasicEntity>()
.eq(ReportDetailBasicEntity::getReportId, id));
for (ReportDetailBasicEntity reportDetailBasic : templateDetailList) {
basic.put(reportDetailBasic.getLocation(), reportDetailBasic);
}
result.setCells(basic);
//获取模板详情复合
List<ReportDetailMergeEntity> templateDetailMergeList = reportDetailMergeService.list(new LambdaQueryWrapper<ReportDetailMergeEntity>()
.eq(ReportDetailMergeEntity::getReportId, id));
result.setMerges(templateDetailMergeList);
//查询模板配置
List<ReportConfigEntity> templateConfigList = reportConfigService.list(new LambdaQueryWrapper<ReportConfigEntity>()
.eq(ReportConfigEntity::getReportId, id));
Map<String, ReportConfigEntity> rows = new HashMap<>();
Map<String, ReportConfigEntity> columns = new HashMap<>();
for (ReportConfigEntity reportConfig : templateConfigList) {
if ("row".equals(reportConfig.getType())) {
rows.put(reportConfig.getNum(), reportConfig);
} else {
columns.put(reportConfig.getNum(), reportConfig);
}
}
result.setRows(rows);
result.setColumns(columns);
return result;
}
private void handleUpdateReportDetail(Map<String, ReportDetailBasicEntity> basic, List<String> CellNumberList, String reportId, String templateId) { private void handleUpdateReportDetail(Map<String, ReportDetailBasicEntity> basic, List<String> CellNumberList, String reportId, String templateId) {
if (ObjectUtils.isEmpty(basic)) { if (ObjectUtils.isEmpty(basic)) {
return; return;
......
...@@ -17,4 +17,20 @@ ...@@ -17,4 +17,20 @@
from from
report report
</select> </select>
<select id="getReportDetail" resultType="com.ruzhoukj.integration.pojo.vo.ReportVO">
select
id,
template_id,
name,
line_number,
column_number,
version,
year,
month,
day
from
report
where
id = #{id}
</select>
</mapper> </mapper>
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