设计复核

This commit is contained in:
jing's 2023-12-17 23:39:42 +08:00
parent ddaa164e63
commit af8b0c5f24
2 changed files with 75 additions and 0 deletions

View File

@ -159,5 +159,19 @@ public class EbomApi extends BaseApi {
} }
@PostMapping("reviewDesign")
@ApiOperation("设计复核")
public ResultVO<Boolean> reviewDesign(@RequestBody BomNewEBomRevertDTO dto) {
if (CollectionUtil.isEmpty(dto.getRowIdList())) {
return ResultVO.error(STATE.ParamErr, "请选择要复核的数据");
}
dto.setRevertUserName(SessionUtil.getUserName());
bomNewEbomParentService.designReview(dto);
return ResultVO.success(true);
}
} }

View File

@ -29,6 +29,7 @@ import com.nflg.product.bomnew.pojo.vo.EbomExcelVO;
import com.nflg.product.bomnew.service.domain.EBom.*; import com.nflg.product.bomnew.service.domain.EBom.*;
import com.nflg.product.bomnew.util.*; import com.nflg.product.bomnew.util.*;
import nflg.product.common.constant.STATE; import nflg.product.common.constant.STATE;
import nflg.product.common.vo.ResultVO;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -273,6 +274,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
public List<BomNewEbomParentVO> buildBomTree(Long rowId) throws Exception{
return getBomTree(rowId);
}
/** /**
* 初始化-项目类别 * 初始化-项目类别
*/ */
@ -487,4 +494,58 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
} }
/**
* 设计复核
* 1. 是否存在空物料编号空数量的数据信息;
* 2. 是否存在在主数据平台的物料信息没有的数据
* 3. 同一层级是否存在相同的物料编码数据
* 4. 是否存在子级物料BOM引用父级物料编码是否存在循环引用
* 5. 项目类别是否填写正确项目类别请参照项目类别自动赋值规则
* 6. 是否存在已冻结/永久禁用的物料
*/
// @Transactional(rollbackFor = Exception.class)
public ResultVO<Boolean> designReview(BomNewEBomRevertDTO dto){
List<Long> rowIds = dto.getRowIdList();
List<BomNewEbomParentEntity> bomNewEbomParentEntityList = this.getBaseMapper().selectBatchIds(rowIds);
if (CollUtil.isEmpty(bomNewEbomParentEntityList)) {
return ResultVO.error("下级BOM无法进行复核");
}
if (rowIds.size() != bomNewEbomParentEntityList.size()) {
return ResultVO.error("选择数据中包含有下级BOM无法进行复核");
}
for (BomNewEbomParentEntity item:
bomNewEbomParentEntityList) {
if(item.getStatus().equals(EBomStatusEnum.CHECKED.getValue())){
continue;
}
if( item.getNum().equals(EBomExceptionStatusEnum.INIT.getValue())){
return ResultVO.error("请调整数据后进行复核");
}
if(StrUtil.isEmpty(item.getMaterialNo()) || (item.getNum()==null||item.getNum().floatValue()==0) ){
return ResultVO.error(EBomExceptionStatusEnum.EXCEPT_NO_4.getDescription());
}
}
return ResultVO.success(true);
}
} }