|
|
@@ -1,95 +1,92 @@
|
|
|
-package cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace;
|
|
|
-
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import jakarta.annotation.Resource;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
-import io.swagger.v3.oas.annotations.Operation;
|
|
|
-
|
|
|
-import jakarta.validation.constraints.*;
|
|
|
-import jakarta.validation.*;
|
|
|
-import jakarta.servlet.http.*;
|
|
|
-import java.util.*;
|
|
|
-import java.io.IOException;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
-import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
-
|
|
|
-import cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace.vo.*;
|
|
|
-import cn.iocoder.yudao.module.iscs.dal.dataobject.exceptionmisplace.ExceptionMisplaceDO;
|
|
|
-import cn.iocoder.yudao.module.iscs.service.exceptionmisplace.ExceptionMisplaceService;
|
|
|
-
|
|
|
-@Tag(name = "管理后台 - 物资归还异常")
|
|
|
-@RestController
|
|
|
-@RequestMapping("/iscs/exception-misplace")
|
|
|
-@Validated
|
|
|
-public class ExceptionMisplaceController {
|
|
|
-
|
|
|
- @Resource
|
|
|
- private ExceptionMisplaceService exceptionMisplaceService;
|
|
|
-
|
|
|
- @PostMapping("/insertExceptionMisplace")
|
|
|
- @Operation(summary = "创建物资归还异常")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:create')")
|
|
|
- public CommonResult<Long> insertExceptionMisplace(@Valid @RequestBody ExceptionMisplaceSaveReqVO createReqVO) {
|
|
|
- return success(exceptionMisplaceService.createExceptionMisplace(createReqVO));
|
|
|
- }
|
|
|
-
|
|
|
- @PutMapping("/updateExceptionMisplace")
|
|
|
- @Operation(summary = "更新物资归还异常")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:update')")
|
|
|
- public CommonResult<Boolean> updateExceptionMisplace(@Valid @RequestBody ExceptionMisplaceSaveReqVO updateReqVO) {
|
|
|
- exceptionMisplaceService.updateExceptionMisplace(updateReqVO);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
- @DeleteMapping("/deleteExceptionMisplaceList")
|
|
|
- @Parameter(name = "ids", description = "编号", required = true)
|
|
|
- @Operation(summary = "批量删除物资归还异常")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:delete')")
|
|
|
- public CommonResult<Boolean> deleteExceptionMisplaceList(@RequestParam("ids") List<Long> ids) {
|
|
|
- exceptionMisplaceService.deleteExceptionMisplaceListByIds(ids);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/selectExceptionMisplaceById")
|
|
|
- @Operation(summary = "获得物资归还异常")
|
|
|
- @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:query')")
|
|
|
- public CommonResult<ExceptionMisplaceRespVO> selectExceptionMisplaceById(@RequestParam("id") Long id) {
|
|
|
- ExceptionMisplaceDO exceptionMisplace = exceptionMisplaceService.getExceptionMisplace(id);
|
|
|
- return success(BeanUtils.toBean(exceptionMisplace, ExceptionMisplaceRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/getExceptionMisplacePage")
|
|
|
- @Operation(summary = "获得物资归还异常分页")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:query')")
|
|
|
- public CommonResult<PageResult<ExceptionMisplaceRespVO>> getExceptionMisplacePage(@Valid ExceptionMisplacePageReqVO pageReqVO) {
|
|
|
- PageResult<ExceptionMisplaceDO> pageResult = exceptionMisplaceService.getExceptionMisplacePage(pageReqVO);
|
|
|
- return success(BeanUtils.toBean(pageResult, ExceptionMisplaceRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/exportExceptionMisplaceExcel")
|
|
|
- @Operation(summary = "导出物资归还异常 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:export')")
|
|
|
- @ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportExceptionMisplaceExcel(@Valid ExceptionMisplacePageReqVO pageReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
- pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<ExceptionMisplaceDO> list = exceptionMisplaceService.getExceptionMisplacePage(pageReqVO).getList();
|
|
|
- // 导出 Excel
|
|
|
- ExcelUtils.write(response, "物资归还异常.xls", "数据", ExceptionMisplaceRespVO.class,
|
|
|
- BeanUtils.toBean(list, ExceptionMisplaceRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+package cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace.vo.ExceptionMisplacePageReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace.vo.ExceptionMisplaceRespVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.controller.admin.exceptionmisplace.vo.ExceptionMisplaceSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.iscs.dal.dataobject.exceptionmisplace.ExceptionMisplaceDO;
|
|
|
+import cn.iocoder.yudao.module.iscs.service.exceptionmisplace.ExceptionMisplaceService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 物资归还异常")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iscs/exception-misplace")
|
|
|
+@Validated
|
|
|
+public class ExceptionMisplaceController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ExceptionMisplaceService exceptionMisplaceService;
|
|
|
+
|
|
|
+ @PostMapping("/insertExceptionMisplace")
|
|
|
+ @Operation(summary = "创建物资归还异常")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:create')")
|
|
|
+ public CommonResult<Long> insertExceptionMisplace(@Valid @RequestBody ExceptionMisplaceSaveReqVO createReqVO) {
|
|
|
+ return success(exceptionMisplaceService.createExceptionMisplace(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/updateExceptionMisplace")
|
|
|
+ @Operation(summary = "更新物资归还异常")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:update')")
|
|
|
+ public CommonResult<Boolean> updateExceptionMisplace(@Valid @RequestBody ExceptionMisplaceSaveReqVO updateReqVO) {
|
|
|
+ exceptionMisplaceService.updateExceptionMisplace(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deleteExceptionMisplaceList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除物资归还异常")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:delete')")
|
|
|
+ public CommonResult<Boolean> deleteExceptionMisplaceList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ exceptionMisplaceService.deleteExceptionMisplaceListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/selectExceptionMisplaceById")
|
|
|
+ @Operation(summary = "获得物资归还异常")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:query')")
|
|
|
+ public CommonResult<ExceptionMisplaceRespVO> selectExceptionMisplaceById(@RequestParam("id") Long id) {
|
|
|
+ ExceptionMisplaceDO exceptionMisplace = exceptionMisplaceService.getExceptionMisplace(id);
|
|
|
+ return success(BeanUtils.toBean(exceptionMisplace, ExceptionMisplaceRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getExceptionMisplacePage")
|
|
|
+ @Operation(summary = "获得物资归还异常分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:query')")
|
|
|
+ public CommonResult<PageResult<ExceptionMisplaceRespVO>> getExceptionMisplacePage(@Valid ExceptionMisplacePageReqVO pageReqVO) {
|
|
|
+ PageResult<ExceptionMisplaceRespVO> pageResult = exceptionMisplaceService.getExceptionMisplacePage(pageReqVO);
|
|
|
+ return success(pageResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/exportExceptionMisplaceExcel")
|
|
|
+ @Operation(summary = "导出物资归还异常 Excel")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:exception-misplace:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportExceptionMisplaceExcel(@Valid ExceptionMisplacePageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<ExceptionMisplaceRespVO> list = exceptionMisplaceService.getExceptionMisplacePage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "物资归还异常.xls", "数据", ExceptionMisplaceRespVO.class, list);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|