rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/MatnrController.java
@@ -12,6 +12,7 @@
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.entity.Matnr;
import com.vincent.rsf.server.manager.entity.excel.MatnrsTemplate;
import com.vincent.rsf.server.manager.service.MatnrService;
import com.vincent.rsf.server.system.controller.BaseController;
import io.swagger.annotations.Api;
@@ -24,6 +25,8 @@
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.*;
@RestController
@@ -109,7 +112,6 @@
        return R.ok().add(vos);
    }
    @SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
    @PreAuthorize("hasAuthority('manager:matnr:list')")
    @ApiOperation(value = "获取分类物料明细列表")
    @PostMapping("/matnr/group")
@@ -129,12 +131,27 @@
    }
    @PreAuthorize("hasAuthority('manager:matnr:list')")
    @ApiOperation("导出物料信息")
    @PostMapping("/matnr/export")
    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(matnrService.list(), Matnr.class), response);
        List<Matnr> matnrs = new ArrayList<>();
        if (!Objects.isNull(map.get("ids"))) {
            matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().in(Matnr::getId, map.get("ids")).eq(Matnr::getStatus, 1));
        } else {
            matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().last("limit 1"));
        }
        ExcelUtil.build(ExcelUtil.create(null, MatnrsTemplate.class, true), response);
    }
    @PreAuthorize("hasAuthority('manager:matnr:save')")
    @PreAuthorize("hasAuthority('manager:matnr:list')")
    @ApiOperation("下载物料模板")
    @PostMapping("/matnr/template/download")
    public void download(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(null, MatnrsTemplate.class, true), response);
    }
    @PreAuthorize("hasAuthority('manager:matnr:update')")
    @ApiOperation(value = "excel表格导入物料信息")
    @PostMapping("/matnr/import")
    public R listImport(MultipartFile file) throws Exception {