feat(ebom): 修复异常检查,如果不是检查根节点时,会出现项目类型为空的异常
This commit is contained in:
parent
4a2e64a657
commit
0dc234ff71
|
|
@ -678,7 +678,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* @param bomRowId bom行ID
|
* @param bomRowId bom行ID
|
||||||
*/
|
*/
|
||||||
public void initBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
public void initBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||||
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
|
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
|
||||||
checkEBomException.initException();
|
checkEBomException.initException();
|
||||||
|
|
||||||
//保存异常
|
//保存异常
|
||||||
|
|
@ -686,7 +686,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initBomException(Long bomRowId, List<Integer> ignoreCheckException) throws ExecutionException, InterruptedException {
|
public void initBomException(Long bomRowId, List<Integer> ignoreCheckException) throws ExecutionException, InterruptedException {
|
||||||
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
|
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
|
||||||
checkEBomException.initException(ignoreCheckException);
|
checkEBomException.initException(ignoreCheckException);
|
||||||
|
|
||||||
//保存异常
|
//保存异常
|
||||||
|
|
@ -731,7 +731,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* 检查 并保存异常信息
|
* 检查 并保存异常信息
|
||||||
*/
|
*/
|
||||||
public void checkAndSaveEBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
public void checkAndSaveEBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||||
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
|
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
|
||||||
checkEBomException.initException();
|
checkEBomException.initException();
|
||||||
|
|
||||||
//保存异常
|
//保存异常
|
||||||
|
|
@ -756,7 +756,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
*/
|
*/
|
||||||
public void batchCheckAndSaveEBomException(List<Long> bomRowIds) {
|
public void batchCheckAndSaveEBomException(List<Long> bomRowIds) {
|
||||||
for (Long bomRowId : bomRowIds) {
|
for (Long bomRowId : bomRowIds) {
|
||||||
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
|
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
|
||||||
checkEBomException.initException();
|
checkEBomException.initException();
|
||||||
|
|
||||||
//保存异常
|
//保存异常
|
||||||
|
|
@ -765,6 +765,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkAndSaveEBomException(Long bomRowId, Long childRowId) {
|
||||||
|
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, childRowId);
|
||||||
|
checkEBomException.initException();
|
||||||
|
|
||||||
|
//保存异常
|
||||||
|
saveException(checkEBomException);
|
||||||
|
}
|
||||||
|
|
||||||
public void checkAndInitVirtualPackageEnum(VirtualPackageParamDto paramDto, BomNewEbomParentEntity root) {
|
public void checkAndInitVirtualPackageEnum(VirtualPackageParamDto paramDto, BomNewEbomParentEntity root) {
|
||||||
if (root.getVirtrualPackageEnum() <= 0) {
|
if (root.getVirtrualPackageEnum() <= 0) {
|
||||||
if (root.getMaterialNo().startsWith("31")) {
|
if (root.getMaterialNo().startsWith("31")) {
|
||||||
|
|
@ -2381,7 +2389,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
BomExceptionQuery bom = query.get(index);
|
BomExceptionQuery bom = query.get(index);
|
||||||
BomExceptionVO vo = new BomExceptionVO();
|
BomExceptionVO vo = new BomExceptionVO();
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
batchCheckAndSaveEBomException(Collections.singletonList(bom.getBomRowId()));
|
checkAndSaveEBomException(bom.getBomRowId(), bom.getRowId());
|
||||||
|
|
||||||
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
||||||
vo.setMaterialNo(parent.getMaterialNo());
|
vo.setMaterialNo(parent.getMaterialNo());
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,11 @@ import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
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.pojo.entity.BomNewEbomChildEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||||
|
import com.nflg.product.bomnew.service.BomNewEbomChildService;
|
||||||
import com.nflg.product.bomnew.service.BomNewEbomParentService;
|
import com.nflg.product.bomnew.service.BomNewEbomParentService;
|
||||||
import com.nflg.product.bomnew.service.MaterialMainService;
|
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||||
import com.nflg.product.bomnew.util.*;
|
import com.nflg.product.bomnew.util.*;
|
||||||
|
|
@ -52,7 +54,7 @@ public class CheckEBomException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CheckEBomException(Long bomRowId) {
|
public CheckEBomException(Long bomRowId, Long childRowId) {
|
||||||
|
|
||||||
allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).getBomTree(bomRowId, true);
|
allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).getBomTree(bomRowId, true);
|
||||||
//只检查待复核和自己的
|
//只检查待复核和自己的
|
||||||
|
|
@ -65,6 +67,13 @@ public class CheckEBomException {
|
||||||
convert.setBomRowId(convert.getRowId());
|
convert.setBomRowId(convert.getRowId());
|
||||||
convert.setParentRowId(0L);
|
convert.setParentRowId(0L);
|
||||||
convert.setLevelNumber(BigDecimal.ZERO);
|
convert.setLevelNumber(BigDecimal.ZERO);
|
||||||
|
if (Objects.nonNull(childRowId) && childRowId > 0) {
|
||||||
|
BomNewEbomChildEntity c = SpringUtil.getBean(BomNewEbomChildService.class).getById(childRowId);
|
||||||
|
if (Objects.nonNull(c)) {
|
||||||
|
convert.setProjectType(c.getProjectType());
|
||||||
|
convert.setNum(c.getNum());
|
||||||
|
}
|
||||||
|
}
|
||||||
allBomDetail.add(convert);
|
allBomDetail.add(convert);
|
||||||
checkWaring=true;
|
checkWaring=true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue