| | |
| | | import com.vincent.rsf.server.manager.enums.TaskResouceType; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | import com.vincent.rsf.server.manager.service.LocService; |
| | | import com.vincent.rsf.server.manager.utils.buildPageRowsUtils; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | return R.ok().add(page); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | return R.ok().add(page); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return R.ok("任务生成成功").add(locItemService.genMoveTask(map, getLoginUserId())); |
| | | return R.ok("任务生成成功").add(buildPageRowsUtils.rowsMap(locItemService.genMoveTask(map, getLoginUserId()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | | @PostMapping("/locDeadReport/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(locItemService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locItemService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | | @PostMapping({"/locDeadReport/many/{ids}", "/locDeadReport/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(locItemService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locItemService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | | @GetMapping("/locDeadReport/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(locItemService.getById(id)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locItemService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:save')") |
| | |
| | | if (!locItemService.save(locItem)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(locItem); |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(locItem)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:update')") |
| | |
| | | if (!locItemService.updateById(locItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(locItem); |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(locItem)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:remove')") |
| | |
| | | if (!locItemService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | return R.ok("Delete Success").add(buildPageRowsUtils.rowsMap(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | |
| | | locItemService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(vos)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:statisticReport:list')") |
| | | @PostMapping("/locDeadReport/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(locItemService.list(), LocItem.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(locItemService.list()), LocItem.class), response); |
| | | } |
| | | |
| | | } |