| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.platform.domain.query.ReportQuery; |
| | | import com.ycl.platform.domain.vo.ReportVO; |
| | | import com.ycl.platform.domain.vo.YwUnitVO; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.YwUnitForm; |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import com.ycl.platform.domain.query.YwUnitQuery; |
| | | import com.ycl.platform.service.YwUnitService; |
| | | import com.ycl.utils.poi.ExcelUtil; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | 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; |
| | |
| | | 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); |
| | | public Result remove(@PathVariable String ids) { |
| | | return ywUnitService.remove(Arrays.asList(ids.split(","))); |
| | | } |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('unit:list')") |
| | |
| | | public Result list() { |
| | | return ywUnitService.all(); |
| | | } |
| | | |
| | | @GetMapping("/work/list") |
| | | @ApiOperation(value = "工单列表", notes = "工单列表") |
| | | public Result workList() { |
| | | return ywUnitService.workList(); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, YwUnitQuery query) |
| | | { |
| | | List<YwUnitVO> list = ywUnitService.export(query); |
| | | ExcelUtil<YwUnitVO> util = new ExcelUtil<>(YwUnitVO.class); |
| | | util.exportExcel(response, list, "报备"); |
| | | } |
| | | } |