青羊经侦大队-数据平台
wl
2022-12-27 8b26fa15912e355e57990946ac52f699130788c2
src/main/java/com/example/jz/controller/ReportController.java
@@ -1,14 +1,19 @@
package com.example.jz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.jz.modle.R;
import com.example.jz.modle.dto.AddReportDto;
import com.example.jz.modle.dto.ReportParamDto;
import com.example.jz.modle.entity.GroupUser;
import com.example.jz.modle.entity.Message;
import com.example.jz.modle.entity.Report;
import com.example.jz.modle.vo.ReportListVo;
import com.example.jz.service.GroupUserService;
import com.example.jz.service.MessageService;
import com.example.jz.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -18,7 +23,6 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.Date;
/**
 * 报案表(Report)表控制层
@@ -35,6 +39,10 @@
     */
    @Resource
    private ReportService reportService;
    @Resource
    GroupUserService groupUserService;
    @Resource
    MessageService messageService;
    /**
     * 分页查询所有数据
@@ -64,13 +72,12 @@
    /**
     * 报案
     *
     * @param AddReportDto 实体对象
     * @param addReportDto 实体对象
     * @return 新增结果
     */
    @PostMapping
    @ApiOperation(value = "报案")
    public R<Boolean> insert(@RequestBody AddReportDto addReportDto) {
        return R.ok(reportService.addReport(addReportDto));
    }
@@ -86,15 +93,16 @@
        return R.ok(reportService.audit(report));
    }
    @ApiOperation(httpMethod = "PUT", value = "报案人编辑")
    @ApiOperation(httpMethod = "PUT", value = "案件台-报案人员-编辑")
    @PutMapping("/updateReport")
    @ApiResponse(message = "执行成功", code = 200)
    public R updateReport(@RequestBody Report report) {
        report.setPic(null);
        reportService.updateById(report);
        return R.ok();
    }
    @ApiOperation(httpMethod = "DELETE", value = "报案人人员退群")
    @ApiOperation(httpMethod = "DELETE", value = "案件台-报案人员-退群")
    @DeleteMapping("/leaveGroup")
    @ApiResponse(message = "执行成功", code = 200)
    public R leaveGroup(@RequestParam(value = "id") Integer id, @RequestParam(value = "groupId") Integer groupId) {
@@ -102,15 +110,17 @@
        return R.ok();
    }
    @ApiOperation(httpMethod = "DELETE", value = "删除报案人")
    @ApiOperation(httpMethod = "DELETE", value = "案件台-报案人员-删除")
    @DeleteMapping("/deleteReporter")
    @ApiResponse(message = "执行成功", code = 200)
    public R deleteReporter(@RequestParam(value = "id") Integer id) {
        groupUserService.remove(new LambdaQueryWrapper<GroupUser>().eq(GroupUser::getUserId, id));
        messageService.remove(new LambdaQueryWrapper<Message>().eq(Message::getUserId, id));
        reportService.removeById(id);
        return R.ok();
    }
    @ApiOperation(httpMethod = "POST", value = "导出材料")
    @ApiOperation(httpMethod = "POST", value = "案件台-报案人员-报案材料导出")
    @PostMapping("/exportReporter")
    @ApiResponse(message = "执行成功", code = 200)
    public void exportReport(@RequestParam(value = "id") Integer id, HttpServletResponse response) {