|
@@ -0,0 +1,84 @@
|
|
|
+package org.eco.system.controller.system;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.eco.common.core.core.domain.CommonResult;
|
|
|
+import org.eco.common.core.core.page.PageResult;
|
|
|
+import org.eco.common.excel.utils.ExcelUtil;
|
|
|
+import org.eco.common.log.annotation.Log;
|
|
|
+import org.eco.common.log.enums.BusinessType;
|
|
|
+import org.eco.common.web.annotation.RepeatSubmit;
|
|
|
+import org.eco.common.web.core.BaseController;
|
|
|
+import org.eco.system.domain.bo.ImportExportBo;
|
|
|
+import org.eco.system.domain.vo.ImportExportVo;
|
|
|
+import org.eco.system.service.IImportExportService;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 导入导出日志Controller
|
|
|
+ *
|
|
|
+ * @author wgk
|
|
|
+ * @date 2024-06-24
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/importExport")
|
|
|
+public class ImportExportController extends BaseController {
|
|
|
+ @Resource
|
|
|
+ private IImportExportService importExportService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询导入导出日志列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("system:importExport:list")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public CommonResult<PageResult<ImportExportVo>> list(ImportExportBo importExportBo) {
|
|
|
+ return CommonResult.success(importExportService.selectPage(importExportBo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出导入导出日志列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("system:importExport:export")
|
|
|
+ @Log(title = "导入导出日志" , businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, ImportExportBo importExportBo) {
|
|
|
+ List<ImportExportVo> list = importExportService.selectList(importExportBo);
|
|
|
+ ExcelUtil.exportExcel(list, "导入导出日志" , ImportExportVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取导入导出日志详细信息
|
|
|
+ */
|
|
|
+ @SaCheckPermission("system:importExport:query")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public CommonResult<ImportExportVo> getInfo(@PathVariable Long id) {
|
|
|
+ return CommonResult.success(importExportService.selectById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增导入导出日志
|
|
|
+ */
|
|
|
+ @SaCheckPermission("system:importExport:add")
|
|
|
+ @Log(title = "导入导出日志" , businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping
|
|
|
+ public CommonResult<Void> add(@Validated @RequestBody ImportExportBo importExportBo) {
|
|
|
+ boolean inserted = importExportService.insert(importExportBo);
|
|
|
+ if (!inserted) {
|
|
|
+ return CommonResult.fail("新增导入导出日志记录失败!");
|
|
|
+ }
|
|
|
+ return CommonResult.success();
|
|
|
+ }
|
|
|
+}
|