| | |
| | | import cn.gistack.sm.jcsb.entity.DangerReport; |
| | | import cn.gistack.sm.jcsb.entity.DeviceReport; |
| | | import cn.gistack.sm.jcsb.service.IDangerReportService; |
| | | import cn.gistack.sm.jcsb.vo.DangerReportVO; |
| | | import cn.gistack.sm.jcsb.vo.DeviceReportVO; |
| | | import cn.gistack.system.user.entity.User; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | return R.data(pagelist); |
| | | } |
| | | |
| | | @GetMapping("/all") |
| | | @ApiOperation(value = "列表", notes = "传入实体类参数") |
| | | public R getAll(DangerReport dangerReport) { |
| | | List<DangerReportVO> list = dangerReportService.getAll(dangerReport); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", notes = "传入notice") |
| | | @ApiOperation(value = "详情", notes = "传入实体类参数") |
| | | public R<DangerReport> detail(@RequestParam(name="id",required=true) String id) { |
| | | return R.data(dangerReportService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增", notes = "传入实体类参数") |
| | | public R save(@RequestBody DangerReport dangerReport) { |
| | | return R.data(dangerReportService.save(dangerReport)); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改", notes = "传入实体类参数") |
| | | public R update(@RequestBody DangerReport dangerReport) { |
| | | return R.data(dangerReportService.updateById(dangerReport)); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperation(value = "新增或修改", notes = "传入实体类参数") |
| | | public R submit(@RequestBody DangerReport dangerReport) { |
| | | return R.data(dangerReportService.saveOrUpdate(dangerReport)); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入实体类参数") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | return R.data(dangerReportService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | } |