Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
93a34b0f5c
|
|
@ -170,5 +170,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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.util.*;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -274,6 +275,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
}
|
||||
|
||||
public List<BomNewEbomParentVO> buildBomTree(Long rowId) throws Exception{
|
||||
return getBomTree(rowId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 初始化-项目类别
|
||||
*/
|
||||
|
|
@ -488,4 +495,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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue