Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom

This commit is contained in:
jing's 2024-03-14 16:11:22 +08:00
commit 9627157746
5 changed files with 36 additions and 26 deletions

View File

@ -1,6 +1,5 @@
package com.nflg.product.material.pojo.vo; package com.nflg.product.material.pojo.vo;
import jdk.nashorn.internal.objects.annotations.Constructor;
import lombok.Data; import lombok.Data;
/** /**

View File

@ -1,6 +1,5 @@
package com.nflg.product.material.pojo.vo; package com.nflg.product.material.pojo.vo;
import jdk.nashorn.internal.objects.annotations.Constructor;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import org.ttzero.excel.annotation.ExcelColumn; import org.ttzero.excel.annotation.ExcelColumn;

View File

@ -10,27 +10,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.mzt.logapi.context.LogRecordContext; 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.conmon.util.SessionUtil;
import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.constant.*;
import com.nflg.product.bomnew.mapper.master.BomNewOriginalParentMapper; import com.nflg.product.bomnew.mapper.master.BomNewOriginalParentMapper;
import com.nflg.product.bomnew.pojo.dto.BomNewOriginalExcelDTO; import com.nflg.product.bomnew.pojo.dto.BomNewOriginalExcelDTO;
import com.nflg.product.bomnew.pojo.dto.OriginalSaveBomDTO; 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.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.BomOriginalListVO;
import com.nflg.product.bomnew.pojo.vo.BomOriginalPlmBomVO; import com.nflg.product.bomnew.pojo.vo.BomOriginalPlmBomVO;
import com.nflg.product.bomnew.pojo.vo.ImportOriginalBomVO; 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.OriginalBomDetailTask;
import com.nflg.product.bomnew.service.domain.OriginalBom.OriginalBomToEBomConvert; import com.nflg.product.bomnew.service.domain.OriginalBom.OriginalBomToEBomConvert;
import com.nflg.product.bomnew.service.domain.OriginalBom.PlmBomToOriginalConvert; import com.nflg.product.bomnew.service.domain.OriginalBom.PlmBomToOriginalConvert;
import com.nflg.product.bomnew.util.*; import com.nflg.product.bomnew.util.*;
import lombok.extern.slf4j.Slf4j; 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.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -46,7 +43,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask; import java.util.concurrent.ForkJoinTask;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
@ -618,6 +614,9 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
if (data.getChartNo().equals("")) { if (data.getChartNo().equals("")) {
data.setChartNo(""); data.setChartNo("");
} }
if (data.getMaterialNo().equals("")) {
data.setMaterialNo("");
}
rowNum.set(rowNum.get() + 1); rowNum.set(rowNum.get() + 1);
excelContextTL.get().add(data); excelContextTL.get().add(data);

View File

@ -49,7 +49,7 @@ public class PlmBomToOriginalConvert extends BaseConvert {
childs = Convert.toList(BomOriginalPlmBomVO.class, SpringUtil.getBean(BomOriginalCadChildService.class).lambdaQuery().eq(BomOriginalCadChildEntity::getParentRowId, inParent.getRowId()).list()); childs = Convert.toList(BomOriginalPlmBomVO.class, SpringUtil.getBean(BomOriginalCadChildService.class).lambdaQuery().eq(BomOriginalCadChildEntity::getParentRowId, inParent.getRowId()).list());
parent = Convert.convert(BomOriginalPlmBomVO.class, inParent); parent = Convert.convert(BomOriginalPlmBomVO.class, inParent);
//图号-初始化缺编码的物料 //图号-初始化缺编码的物料
if(StrUtil.isBlank(parent.getMaterialNo())){ if(StrUtil.isBlank(parent.getMaterialNo()) || parent.getMaterialNo().trim().equalsIgnoreCase("")){
SpringUtil.getBean(MaterialMainService.class).initMaterialForDrawdingNo(ImmutableList.of(parent) ,BomOriginalPlmBomVO::getDrawingNo,BomOriginalPlmBomVO::setMaterialNo,BomOriginalPlmBomVO::setMaterialName); SpringUtil.getBean(MaterialMainService.class).initMaterialForDrawdingNo(ImmutableList.of(parent) ,BomOriginalPlmBomVO::getDrawingNo,BomOriginalPlmBomVO::setMaterialNo,BomOriginalPlmBomVO::setMaterialName);
} }
List<BomOriginalPlmBomVO> noMaterialNoList = childs.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList()); List<BomOriginalPlmBomVO> noMaterialNoList = childs.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());

View File

@ -1,6 +1,5 @@
package com.nflg.product.base.core.exception; package com.nflg.product.base.core.exception;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import nflg.product.common.constant.STATE; import nflg.product.common.constant.STATE;
import nflg.product.common.vo.ResultVO; import nflg.product.common.vo.ResultVO;
@ -9,9 +8,9 @@ import org.springframework.dao.DuplicateKeyException;
import org.springframework.jdbc.BadSqlGrammarException; import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException; 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.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; 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.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MaxUploadSizeExceededException;
import org.springframework.web.servlet.NoHandlerFoundException; import org.springframework.web.servlet.NoHandlerFoundException;
@ -34,21 +33,24 @@ public class BaseGlobalExceptionHandle {
@ExceptionHandler(value = NflgBusinessException.class) @ExceptionHandler(value = NflgBusinessException.class)
@ResponseBody @ResponseBody
public ResultVO<String> handleJeecgBootException(NflgBusinessException e) { public ResultVO<String> 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) @ExceptionHandler(value = NoHandlerFoundException.class)
@ResponseBody @ResponseBody
public ResultVO<String> handlerNoFoundException(NoHandlerFoundException e) { public ResultVO<String> handlerNoFoundException(NoHandlerFoundException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return ResultVO.error(404, "路径不存在,请检查路径是否正确"); //return ResultVO.error(404, "路径不存在,请检查路径是否正确");
return ResultVO.error(STATE.AddressNotFound,"路径不存在,请检查路径是否正确");
} }
@ExceptionHandler(value = DuplicateKeyException.class) @ExceptionHandler(value = DuplicateKeyException.class)
@ResponseBody @ResponseBody
public ResultVO<String> handleDuplicateKeyException(DuplicateKeyException e) { public ResultVO<String> handleDuplicateKeyException(DuplicateKeyException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
//return ResultVO.error("已存在该记录,请勿重复操作");
return ResultVO.error("已存在该记录,请勿重复操作"); return ResultVO.error("已存在该记录,请勿重复操作");
} }
@ -57,6 +59,7 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleException(Exception e) { public ResultVO<String> handleException(Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
//return ResultVO.error("操作失败,请联系系统管理员");
return ResultVO.error("操作失败,请联系系统管理员"); return ResultVO.error("操作失败,请联系系统管理员");
} }
@ -68,7 +71,8 @@ public class BaseGlobalExceptionHandle {
@ExceptionHandler(value = HttpRequestMethodNotSupportedException.class) @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
@ResponseBody @ResponseBody
public ResultVO<String> HttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) { public ResultVO<String> HttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) {
StringBuffer sb = new StringBuffer(); log.error(e.getMessage(), e);
StringBuilder sb = new StringBuilder();
sb.append("不支持"); sb.append("不支持");
sb.append(e.getMethod()); sb.append(e.getMethod());
sb.append("请求方法,"); sb.append("请求方法,");
@ -81,8 +85,8 @@ public class BaseGlobalExceptionHandle {
} }
} }
log.error(sb.toString(), e); log.error(sb.toString(), e);
return ResultVO.error(STATE.PermissionDenied, "登录已过期,请重新登录"); //return ResultVO.error(STATE.PermissionDenied, "登录已过期,请重新登录");
// return ResultVO.error(STATE.PermissionDenied, sb.toString()); return ResultVO.error(STATE.PermissionDenied,"不支持的请求方法:"+e.getMethod());
} }
/** /**
@ -92,6 +96,7 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) { public ResultVO<String> handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
//return ResultVO.error("文件大小超出10MB限制, 请压缩或降低文件质量! ");
return ResultVO.error("文件大小超出10MB限制, 请压缩或降低文件质量! "); return ResultVO.error("文件大小超出10MB限制, 请压缩或降低文件质量! ");
} }
@ -99,6 +104,7 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleDataIntegrityViolationException(DataIntegrityViolationException e) { public ResultVO<String> handleDataIntegrityViolationException(DataIntegrityViolationException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
// return ResultVO.error("字段太长,超出数据库字段的长度");
return ResultVO.error("字段太长,超出数据库字段的长度"); return ResultVO.error("字段太长,超出数据库字段的长度");
} }
@ -106,6 +112,7 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleSQLException(SQLException e) { public ResultVO<String> handleSQLException(SQLException e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
//return ResultVO.error("sql执行过程出现错误");
return ResultVO.error("sql执行过程出现错误"); return ResultVO.error("sql执行过程出现错误");
} }
@ -113,16 +120,16 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleRuntimeExceptionException(RuntimeException e) { public ResultVO<String> handleRuntimeExceptionException(RuntimeException e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员"); //throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员");
return ResultVO.error("系统错误,请联系管理员");
} }
@ExceptionHandler(value = BadSqlGrammarException.class) @ExceptionHandler(value = BadSqlGrammarException.class)
@ResponseBody @ResponseBody
public ResultVO<String> handleDataAccessException(BadSqlGrammarException e) { public ResultVO<String> handleDataAccessException(BadSqlGrammarException e) {
log.error(e.getMessage(),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) @ExceptionHandler(value = MethodArgumentNotValidException.class)
@ -133,10 +140,16 @@ public class BaseGlobalExceptionHandle {
} }
@ExceptionHandler(NullPointerException.class) @ExceptionHandler(NullPointerException.class)
@ResponseBody
public ResultVO<String> handleNullPointerException(NullPointerException ex) { public ResultVO<String> handleNullPointerException(NullPointerException ex) {
log.error(ex.getMessage(),ex);
return ResultVO.error(STATE.Error, "系统错误,请联系管理员:"+ex.getMessage()) ; return ResultVO.error(STATE.Error, "系统错误,请联系管理员") ;
} }
@ExceptionHandler(MissingServletRequestParameterException.class)
@ResponseBody
public ResultVO<String> handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) {
log.error(ex.getMessage(),ex);
return ResultVO.error(STATE.ParamErr, ex.getParameterName()+"参数不能为空");
}
} }