优化
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
package top.wms.admin.controller.materialProcess;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import top.continew.starter.core.validation.ValidationUtils;
|
||||
import top.continew.starter.extension.crud.enums.Api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -11,11 +19,15 @@ import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.log.annotation.Log;
|
||||
import top.wms.admin.common.controller.BaseController;
|
||||
import top.wms.admin.material.model.req.MaterialInfoImportReq;
|
||||
import top.wms.admin.material.model.resp.MaterialImportParseResp;
|
||||
import top.wms.admin.material.model.resp.MaterialInfoImportResp;
|
||||
import top.wms.admin.materialProcess.model.query.MaterialProcessQuery;
|
||||
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
|
||||
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
|
||||
import top.wms.admin.materialProcess.service.MaterialProcessService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -37,4 +49,28 @@ public class MaterialProcessController extends BaseController<MaterialProcessSer
|
||||
return baseService.getSelectList();
|
||||
}
|
||||
|
||||
@Log(ignore = true)
|
||||
@Operation(summary = "下载导入模板", description = "下载导入模板")
|
||||
@SaCheckPermission("materialProcess:materialProcess:import")
|
||||
@GetMapping(value = "/import/template", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void downloadImportTemplate(HttpServletResponse response) throws Exception {
|
||||
baseService.downloadImportTemplate(response);
|
||||
}
|
||||
|
||||
@Log(ignore = true)
|
||||
@Operation(summary = "解析导入数据", description = "解析导入数据")
|
||||
@SaCheckPermission("materialProcess:materialProcess:import")
|
||||
@PostMapping("/import/parse")
|
||||
public MaterialImportParseResp parseImport(@NotNull(message = "文件不能为空") MultipartFile file) {
|
||||
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
|
||||
return baseService.parseImport(file);
|
||||
}
|
||||
|
||||
@Operation(summary = "导入数据", description = "导入数据")
|
||||
@SaCheckPermission("materialProcess:materialProcess:import")
|
||||
@PostMapping(value = "/import")
|
||||
public MaterialInfoImportResp importUser(@Validated @RequestBody MaterialInfoImportReq req) {
|
||||
return baseService.importMaterial(req);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||
import top.continew.starter.log.annotation.Log;
|
||||
import top.continew.starter.web.model.R;
|
||||
import top.wms.admin.common.controller.BaseController;
|
||||
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
||||
@@ -59,6 +60,7 @@ public class MaterialInfoController extends BaseController<MaterialInfoService,
|
||||
return materialInfoResp;
|
||||
}
|
||||
|
||||
@Log(ignore = true)
|
||||
@Operation(summary = "下载导入模板", description = "下载导入模板")
|
||||
@SaCheckPermission("admin:materialInfo:import")
|
||||
@GetMapping(value = "/import/template", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@@ -66,6 +68,7 @@ public class MaterialInfoController extends BaseController<MaterialInfoService,
|
||||
baseService.downloadImportTemplate(response);
|
||||
}
|
||||
|
||||
@Log(ignore = true)
|
||||
@Operation(summary = "解析导入数据", description = "解析导入数据")
|
||||
@SaCheckPermission("admin:materialInfo:import")
|
||||
@PostMapping("/import/parse")
|
||||
@@ -92,6 +95,7 @@ public class MaterialInfoController extends BaseController<MaterialInfoService,
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Log(ignore = true)
|
||||
@Operation(summary = "照片抓取", description = "照片抓取")
|
||||
@PostMapping("/import/catch")
|
||||
public String catchPhoto(@RequestParam("file") MultipartFile file) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user