| | |
| | | package com.example.jz.controller; |
| | | |
| | | |
| | | 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.CauseDto; |
| | | import com.example.jz.modle.dto.ReportParamDto; |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | import com.example.jz.service.CauseService; |
| | | import com.example.jz.service.ReportService; |
| | | import com.example.jz.service.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 案件表(Cause)表控制层 |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("cause") |
| | | @Api(tags = "案件区-案件录入") |
| | | @Api(tags = "案件区") |
| | | public class CauseController extends ApiController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CauseService causeService; |
| | | private ReportService reportService; |
| | | |
| | | @Autowired |
| | | public void setReportService(ReportService reportService) { |
| | | this.reportService = reportService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setCauseService(CauseService causeService) { |
| | | this.causeService = causeService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "添加案件") |
| | | @PostMapping("/addCause") |
| | |
| | | causeService.deleteCause(id); |
| | | return R.ok(); |
| | | } |
| | | // TODO: 2022/7/15 导入 |
| | | |
| | | @ApiOperation(httpMethod = "GET", value = "根据群组id查询案件分页") |
| | | @GetMapping("/getAllReportList") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R<IPage<ReportListVo>> get(Page<ReportListVo> page, ReportParamDto reportParamDto, Integer groupId) { |
| | | return R.ok(reportService.getPageByGroupId(page, reportParamDto, groupId)); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "添加人员") |
| | | @PostMapping("/addReporter") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R<Boolean> get(AddReportDto addReportDto) { |
| | | if (addReportDto.getReporterName() == null || addReportDto.getReporterName().equals("")) { |
| | | return R.failed("报案人员不能为空"); |
| | | } |
| | | if (addReportDto.getMobile() == null || addReportDto.getMobile().equals("")) { |
| | | return R.failed("报案人员电话不能为空"); |
| | | } |
| | | if (addReportDto.getIdcard() == null || addReportDto.getIdcard().equals("")) { |
| | | return R.failed("报案人员身份证不能为空"); |
| | | } |
| | | return R.ok(causeService.addReportPeople(addReportDto)); |
| | | } |
| | | } |
| | | |