From ec8a22b7ea91d9e845216ef573d0436aaa9993ef Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期六, 05 七月 2025 20:45:33 +0800 Subject: [PATCH] 保养规范点检导入 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java index 317a494..e8d2bc8 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java @@ -7,18 +7,13 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.jeecg.common.api.vo.FileUploadResult; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.util.FileUtil; import org.jeecg.modules.eam.constant.BusinessCodeConst; import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; @@ -36,7 +31,6 @@ import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.util.PoiPublicUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -281,6 +275,18 @@ return super.exportXls(request, eamMaintenanceStandard, EamMaintenanceStandard.class, "淇濆吇鏍囧噯"); } + @PostMapping("/import") + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); + for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { + // 鑾峰彇涓婁紶鏂囦欢瀵硅薄 + MultipartFile file = entity.getValue(); + eamMaintenanceStandardService.importPointInspectionExcel(file); + } + return Result.ok("瀵煎叆鎴愬姛"); + } + /** * 閫氳繃excel瀵煎叆鏁版嵁 * -- Gitblit v1.9.3