This commit is contained in:
zc
2026-03-20 18:06:45 +08:00
parent 18dbf7a042
commit 3b8d01b673
14 changed files with 578 additions and 73 deletions

View File

@@ -2,32 +2,31 @@ package top.wms.admin.controller.materialProcess;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
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;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import top.continew.starter.extension.crud.enums.Api;
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.MaterialProcessImportReq;
import top.wms.admin.materialProcess.model.req.MaterialProcessReq;
import top.wms.admin.materialProcess.model.resp.MaterialProcessImportParseResp;
import top.wms.admin.materialProcess.model.resp.MaterialProcessImportResp;
import top.wms.admin.materialProcess.model.resp.MaterialProcessResp;
import top.wms.admin.materialProcess.service.MaterialProcessService;
import java.io.IOException;
import java.util.List;
/**
@@ -61,7 +60,7 @@ public class MaterialProcessController extends BaseController<MaterialProcessSer
@Operation(summary = "解析导入数据", description = "解析导入数据")
@SaCheckPermission("materialProcess:materialProcess:import")
@PostMapping("/import/parse")
public MaterialImportParseResp parseImport(@NotNull(message = "文件不能为空") MultipartFile file) {
public MaterialProcessImportParseResp parseImport(@NotNull(message = "文件不能为空") MultipartFile file) {
ValidationUtils.throwIf(file::isEmpty, "文件不能为空");
return baseService.parseImport(file);
}
@@ -69,8 +68,8 @@ public class MaterialProcessController extends BaseController<MaterialProcessSer
@Operation(summary = "导入数据", description = "导入数据")
@SaCheckPermission("materialProcess:materialProcess:import")
@PostMapping(value = "/import")
public MaterialInfoImportResp importUser(@Validated @RequestBody MaterialInfoImportReq req) {
return baseService.importMaterial(req);
public MaterialProcessImportResp importUser(@Validated @RequestBody MaterialProcessImportReq req) {
return baseService.importMaterialProcess(req);
}
}