| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.platform.domain.query.DistributeWorkOrderQuery; |
| | | import com.ycl.platform.domain.query.ReportQuery; |
| | | import com.ycl.platform.domain.vo.ReportVO; |
| | | import com.ycl.platform.domain.vo.YwUnitVO; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import jakarta.validation.constraints.NotEmpty; |
| | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | @PreAuthorize("@ss.hasPermi('unit:add')") |
| | | public Result add(@RequestBody @Validated(Add.class) YwUnitForm form) { |
| | | return ywUnitService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | @PreAuthorize("@ss.hasPermi('unit:edit')") |
| | | public Result update(@RequestBody @Validated(Update.class) YwUnitForm form) { |
| | | return ywUnitService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return ywUnitService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @DeleteMapping("/{ids}") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return ywUnitService.remove(ids); |
| | | @PreAuthorize("@ss.hasPermi('unit:remove')") |
| | | public Result remove(@PathVariable String ids) { |
| | | return ywUnitService.remove(Arrays.asList(ids.split(","))); |
| | | } |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('unit:list')") |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | @PreAuthorize("@ss.hasPermi('unit:page')") |
| | | public Result page(@RequestBody YwUnitQuery query) { |
| | | return ywUnitService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | @PreAuthorize("@ss.hasPermi('unit:query')") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return ywUnitService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | // @PreAuthorize("@ss.hasPermi('unit:list')") |
| | | public Result list() { |
| | | return ywUnitService.all(); |
| | | } |
| | | |
| | | @GetMapping("/work/list") |
| | | @ApiOperation(value = "统计运维单位工单数量", notes = "统计运维单位工单数量") |
| | | public Result workList(DistributeWorkOrderQuery query) { |
| | | return ywUnitService.workList(query); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导出", notes = "导出") |
| | | @PreAuthorize("@ss.hasPermi('unit:export')") |
| | | public void export(HttpServletResponse response, YwUnitQuery query) |
| | | { |
| | | List<YwUnitVO> list = ywUnitService.export(query); |