lyh
2025-07-05 ec8a22b7ea91d9e845216ef573d0436aaa9993ef
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导入数据
     *