| | |
| | | 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; |
| | |
| | | @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子信息列表 |
| | | */ |