hdy
2025-03-12 f0d048fa2cba4f52066e14d1d31e4f7a2c7a9530
billion-main/src/main/java/com/billion/main/bs/controller/BsBomChildInfoController.java
@@ -11,6 +11,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -28,6 +29,21 @@
    @Autowired
    private IBsBomChildInfoService bsBomChildInfoService;
    @PostMapping("/importTemplate")
    public void importTemplate(HttpServletResponse response)
    {
        ExcelUtil<BsBomChildInfo> util = new ExcelUtil<BsBomChildInfo>(BsBomChildInfo.class);
        util.importTemplateExcel(response, "bom子表数据");
    }
    @PreAuthorize("@ss.hasPermi('bs:bomChildInfo:import')")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
    {
        ExcelUtil<BsBomChildInfo> util = new ExcelUtil<BsBomChildInfo>(BsBomChildInfo.class);
        List<BsBomChildInfo> bomChildList = util.importExcel(file.getInputStream());
        String message = bsBomChildInfoService.importBomChild(bomChildList, updateSupport, "1");
        return success(message);
    }
    /**
     * 查询基础BOM子信息列表
     */