From c800257cb6c8b45e7edc20e2e9018cd90b230806 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期三, 09 七月 2025 19:50:00 +0800 Subject: [PATCH] art: 技术状态鉴定-基础代码生成 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java | 77 +++++++------------------------------- 1 files changed, 15 insertions(+), 62 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 cfc3b53..e6f9f67 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 @@ -6,26 +6,22 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; + 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.modules.eam.constant.BusinessCodeConst; -import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; + import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; import org.jeecg.modules.eam.entity.EamMaintenanceStandard; -import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; + import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; import org.jeecg.modules.eam.vo.EamMaintenanceStandardVo; import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.entity.ImportParams; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -33,10 +29,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; import java.util.*; -import java.util.stream.Collectors; /** * @Description: 淇濆吇鏍囧噯 @@ -241,7 +234,8 @@ List<String> list = Arrays.asList(ids.split(",")); list.forEach(id -> { EamMaintenanceStandard entity = eamMaintenanceStandardService.getById(id); - if (entity != null) { + if (entity != null&&entity.getStandardStatus().equals(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name())) { + //鍙垹闄ょ姸鎬佷负寰呮彁浜ょ殑 entity.setDelFlag(CommonConstant.DEL_FLAG_1); eamMaintenanceStandardService.updateById(entity); } @@ -288,17 +282,8 @@ for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { MultipartFile file = entity.getValue(); - String fileName = file.getOriginalFilename(); - - Result<?> importResult = eamMaintenanceStandardService.importPointInspectionExcel(file); - - if (importResult.isSuccess()) { - results.put(fileName, "鎴愬姛: " + importResult.getMessage()); - successCount++; - } else { - results.put(fileName, "澶辫触: " + importResult.getMessage()); - failureCount++; - } + file.getOriginalFilename(); + return eamMaintenanceStandardService.importPointInspectionExcel(file); } // 鏋勫缓鍝嶅簲 @@ -308,13 +293,7 @@ response.put("successCount", successCount); response.put("failureCount", failureCount); - if (failureCount == 0) { - return Result.ok("鎵�鏈夌偣妫�鏂囦欢瀵煎叆鎴愬姛"+response); - } else if (successCount == 0) { - return Result.error("鎵�鏈夌偣妫�鏂囦欢瀵煎叆澶辫触", response); - } else { - return Result.error("閮ㄥ垎鐐规鏂囦欢瀵煎叆澶辫触", response); - } + return Result.ok("瀵煎叆瀹屾垚" + response); } catch (Exception e) { log.error("鐐规瀵煎叆澶勭悊寮傚父", e); @@ -339,17 +318,8 @@ for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { MultipartFile file = entity.getValue(); - String fileName = file.getOriginalFilename(); - - Result<?> importResult = eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND"); - - if (importResult.isSuccess()) { - results.put(fileName, "鎴愬姛: " + importResult.getMessage()); - successCount++; - } else { - results.put(fileName, "澶辫触: " + importResult.getMessage()); - failureCount++; - } + file.getOriginalFilename(); + return eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND"); } // 鏋勫缓鏈�缁堝搷搴� @@ -359,11 +329,7 @@ response.put("successCount", successCount); response.put("failureCount", failureCount); - if (failureCount > 0) { - return Result.error("閮ㄥ垎鏂囦欢瀵煎叆澶辫触", response); - } - - return Result.ok("鎵�鏈夋枃浠跺鍏ユ垚鍔�"+response); + return Result.ok("瀵煎叆瀹屾垚"+response); } catch (Exception e) { log.error("瀵煎叆澶勭悊寮傚父", e); @@ -387,17 +353,8 @@ for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { MultipartFile file = entity.getValue(); - String fileName = file.getOriginalFilename(); - - Result<?> importResult = eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD"); - - if (importResult.isSuccess()) { - results.put(fileName, "鎴愬姛: " + importResult.getMessage()); - successCount++; - } else { - results.put(fileName, "澶辫触: " + importResult.getMessage()); - failureCount++; - } + file.getOriginalFilename(); + return eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD"); } // 鏋勫缓鏈�缁堝搷搴� @@ -407,11 +364,7 @@ response.put("successCount", successCount); response.put("failureCount", failureCount); - if (failureCount > 0) { - return Result.error("閮ㄥ垎鏂囦欢瀵煎叆澶辫触", response); - } - - return Result.ok("鎵�鏈夋枃浠跺鍏ユ垚鍔�"+response); + return Result.ok("瀵煎叆瀹屾垚"+response); } catch (Exception e) { log.error("瀵煎叆澶勭悊寮傚父", e); -- Gitblit v1.9.3