diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/AdSyncSetInfoVO.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/AdSyncSetInfoVO.java index fe12ca6f..7edc5b1d 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/AdSyncSetInfoVO.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/AdSyncSetInfoVO.java @@ -1,6 +1,5 @@ package com.nflg.product.material.pojo.vo; -import jdk.nashorn.internal.objects.annotations.Constructor; import lombok.Data; /** diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/ExcelDictionariesApiVO.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/ExcelDictionariesApiVO.java index 3588c8d5..44715a6f 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/ExcelDictionariesApiVO.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/ExcelDictionariesApiVO.java @@ -1,6 +1,5 @@ package com.nflg.product.material.pojo.vo; -import jdk.nashorn.internal.objects.annotations.Constructor; import lombok.AllArgsConstructor; import lombok.Data; import org.ttzero.excel.annotation.ExcelColumn; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java index 8a726401..4ce3ab3e 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java @@ -10,27 +10,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Sets; import com.mzt.logapi.context.LogRecordContext; -import com.nflg.product.base.core.config.SpringContextUtils; import com.nflg.product.base.core.conmon.util.SessionUtil; -import com.nflg.product.base.core.exception.NflgBusinessException; import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.mapper.master.BomNewOriginalParentMapper; import com.nflg.product.bomnew.pojo.dto.BomNewOriginalExcelDTO; import com.nflg.product.bomnew.pojo.dto.OriginalSaveBomDTO; -import com.nflg.product.bomnew.pojo.entity.*; +import com.nflg.product.bomnew.pojo.entity.BomNewOriginalChildEntity; +import com.nflg.product.bomnew.pojo.entity.BomNewOriginalMaterialUseEntity; +import com.nflg.product.bomnew.pojo.entity.BomNewOriginalParentEntity; +import com.nflg.product.bomnew.pojo.entity.BomOriginalCadParentEntity; import com.nflg.product.bomnew.pojo.query.OriginalBomQuery; -import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO; import com.nflg.product.bomnew.pojo.vo.BomOriginalPlmBomVO; import com.nflg.product.bomnew.pojo.vo.ImportOriginalBomVO; -import com.nflg.product.bomnew.service.domain.EBom.CheckEBomException; import com.nflg.product.bomnew.service.domain.OriginalBom.OriginalBomDetailTask; import com.nflg.product.bomnew.service.domain.OriginalBom.OriginalBomToEBomConvert; import com.nflg.product.bomnew.service.domain.OriginalBom.PlmBomToOriginalConvert; import com.nflg.product.bomnew.util.*; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.map.LinkedMap; -import org.bouncycastle.cert.dane.DANEEntry; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; @@ -46,7 +43,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinTask; import java.util.stream.Collectors; -import java.util.stream.Stream; /** @@ -618,6 +614,9 @@ public class BomNewOriginalParentService extends ServiceImpl noMaterialNoList = childs.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList()); diff --git a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java index d773176d..8348eea3 100644 --- a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java +++ b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java @@ -1,6 +1,5 @@ package com.nflg.product.base.core.exception; -import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import nflg.product.common.constant.STATE; import nflg.product.common.vo.ResultVO; @@ -9,9 +8,9 @@ import org.springframework.dao.DuplicateKeyException; import org.springframework.jdbc.BadSqlGrammarException; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.MissingServletRequestParameterException; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.servlet.NoHandlerFoundException; @@ -34,21 +33,24 @@ public class BaseGlobalExceptionHandle { @ExceptionHandler(value = NflgBusinessException.class) @ResponseBody public ResultVO handleJeecgBootException(NflgBusinessException e) { - return ResultVO.error(e.getState(), e.getMessage()); - + log.error(e.getMessage(), e); + //return ResultVO.error(e.getState(), e.getMessage()); + return ResultVO.error(e.getState(),e.getMessage()); } @ExceptionHandler(value = NoHandlerFoundException.class) @ResponseBody public ResultVO handlerNoFoundException(NoHandlerFoundException e) { log.error(e.getMessage(), e); - return ResultVO.error(404, "路径不存在,请检查路径是否正确"); + //return ResultVO.error(404, "路径不存在,请检查路径是否正确"); + return ResultVO.error(STATE.AddressNotFound,"路径不存在,请检查路径是否正确"); } @ExceptionHandler(value = DuplicateKeyException.class) @ResponseBody public ResultVO handleDuplicateKeyException(DuplicateKeyException e) { log.error(e.getMessage(), e); + //return ResultVO.error("已存在该记录,请勿重复操作"); return ResultVO.error("已存在该记录,请勿重复操作"); } @@ -57,6 +59,7 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleException(Exception e) { log.error(e.getMessage(), e); + //return ResultVO.error("操作失败,请联系系统管理员"); return ResultVO.error("操作失败,请联系系统管理员"); } @@ -68,7 +71,8 @@ public class BaseGlobalExceptionHandle { @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class) @ResponseBody public ResultVO HttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) { - StringBuffer sb = new StringBuffer(); + log.error(e.getMessage(), e); + StringBuilder sb = new StringBuilder(); sb.append("不支持"); sb.append(e.getMethod()); sb.append("请求方法,"); @@ -81,8 +85,8 @@ public class BaseGlobalExceptionHandle { } } log.error(sb.toString(), e); - return ResultVO.error(STATE.PermissionDenied, "登录已过期,请重新登录"); -// return ResultVO.error(STATE.PermissionDenied, sb.toString()); + //return ResultVO.error(STATE.PermissionDenied, "登录已过期,请重新登录"); + return ResultVO.error(STATE.PermissionDenied,"不支持的请求方法:"+e.getMethod()); } /** @@ -92,6 +96,7 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) { log.error(e.getMessage(), e); + //return ResultVO.error("文件大小超出10MB限制, 请压缩或降低文件质量! "); return ResultVO.error("文件大小超出10MB限制, 请压缩或降低文件质量! "); } @@ -99,6 +104,7 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleDataIntegrityViolationException(DataIntegrityViolationException e) { log.error(e.getMessage(), e); +// return ResultVO.error("字段太长,超出数据库字段的长度"); return ResultVO.error("字段太长,超出数据库字段的长度"); } @@ -106,6 +112,7 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleSQLException(SQLException e) { log.error(e.getMessage(),e); + //return ResultVO.error("sql执行过程出现错误"); return ResultVO.error("sql执行过程出现错误"); } @@ -113,16 +120,16 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleRuntimeExceptionException(RuntimeException e) { log.error(e.getMessage(),e); - throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员"); + //throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员"); + return ResultVO.error("系统错误,请联系管理员"); } - - @ExceptionHandler(value = BadSqlGrammarException.class) @ResponseBody public ResultVO handleDataAccessException(BadSqlGrammarException e) { log.error(e.getMessage(),e); - throw new NflgBusinessException(STATE.Error, "sql 语法错误,系统错误,请联系管理员"); + //throw new NflgBusinessException(STATE.Error, "sql 语法错误,系统错误,请联系管理员"); + return ResultVO.error("sql 语法错误,系统错误,请联系管理员"); } @ExceptionHandler(value = MethodArgumentNotValidException.class) @@ -133,10 +140,16 @@ public class BaseGlobalExceptionHandle { } @ExceptionHandler(NullPointerException.class) + @ResponseBody public ResultVO handleNullPointerException(NullPointerException ex) { - - return ResultVO.error(STATE.Error, "系统错误,请联系管理员:"+ex.getMessage()) ; + log.error(ex.getMessage(),ex); + return ResultVO.error(STATE.Error, "系统错误,请联系管理员") ; } - + @ExceptionHandler(MissingServletRequestParameterException.class) + @ResponseBody + public ResultVO handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) { + log.error(ex.getMessage(),ex); + return ResultVO.error(STATE.ParamErr, ex.getParameterName()+"参数不能为空"); + } }