Commit e7660251 authored by wujipeng's avatar wujipeng
Browse files

删除报表

parent 8e3f15e9
package com.ruzhoukj.integration.controller;
import com.ruzhoukj.integration.pojo.dto.ReportDTO;
import com.ruzhoukj.integration.pojo.dto.TemplateDTO;
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.Result;
import com.ruzhoukj.integration.service.ReportService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -33,4 +29,9 @@ public class ReportController {
return reportService.getPageData(reportDTO);
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public Result<Boolean> deleteReport(@PathVariable String id) {
return Result.success(reportService.deleteReport(id));
}
}
......@@ -15,4 +15,6 @@ import com.ruzhoukj.integration.result.PageResult;
public interface ReportService extends IService<ReportEntity> {
PageResult<ReportVO> getPageData(ReportDTO reportDTO);
Boolean deleteReport(String id);
}
package com.ruzhoukj.integration.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruzhoukj.integration.mapper.ReportMapper;
import com.ruzhoukj.integration.pojo.dto.ReportDTO;
import com.ruzhoukj.integration.pojo.entity.ReportConfigEntity;
import com.ruzhoukj.integration.pojo.entity.ReportDetailBasicEntity;
import com.ruzhoukj.integration.pojo.entity.ReportDetailMergeEntity;
import com.ruzhoukj.integration.pojo.entity.ReportEntity;
import com.ruzhoukj.integration.pojo.vo.ReportVO;
import com.ruzhoukj.integration.pojo.vo.TemplateVO;
import com.ruzhoukj.integration.result.PageResult;
import com.ruzhoukj.integration.service.ReportConfigService;
import com.ruzhoukj.integration.service.ReportDetailBasicService;
import com.ruzhoukj.integration.service.ReportDetailMergeService;
import com.ruzhoukj.integration.service.ReportService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -22,6 +30,14 @@ import java.util.List;
*/
@Service
public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> implements ReportService {
@Resource
private ReportDetailBasicService reportDetailBasicService;
@Resource
private ReportDetailMergeService reportDetailMergeService;
@Resource
private ReportConfigService reportConfigService;
@Override
public PageResult<ReportVO> getPageData(ReportDTO reportDTO) {
//开启分页
......@@ -35,4 +51,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportEntity> i
page.getResult()
);
}
@Override
@Transactional
public Boolean deleteReport(String id) {
reportDetailBasicService.remove(new LambdaQueryWrapper<ReportDetailBasicEntity>().eq(ReportDetailBasicEntity::getReportId, id));
reportDetailMergeService.remove(new LambdaQueryWrapper<ReportDetailMergeEntity>().eq(ReportDetailMergeEntity::getReportId, id));
reportConfigService.remove(new LambdaQueryWrapper<ReportConfigEntity>().eq(ReportConfigEntity::getReportId, id));
return removeById(id);
}
}
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