【工艺路线】获取PBOM所有子级,保存校验
This commit is contained in:
parent
07b313d9e2
commit
587a3d6eda
|
|
@ -109,5 +109,8 @@ public class BomNewPBomVO extends BaseMaterialVO {
|
|||
}
|
||||
}
|
||||
|
||||
private String parentMaterialNo;
|
||||
|
||||
private String parentMaterialDesc;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,7 @@ public class ProcessRouteTaskVO extends BaseMaterialVO implements Serializable {
|
|||
|
||||
// 组件分配列表
|
||||
private List<ProcessRouteTaskAssemblyVO> assemblyVOList;
|
||||
|
||||
// 保存类型 tempSave 不校验, validSave 校验
|
||||
private String saveType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,12 +92,26 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ProcessRouteTaskVO processRouteTaskVO) {
|
||||
if (!"tempSave".equals(processRouteTaskVO.getSaveType())) {
|
||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getFactory())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "工厂不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getMaterialNo())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "物料号不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getUsefulness())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "用途不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getStatus())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "状态不能为空");
|
||||
}
|
||||
if (CollUtil.isEmpty(processRouteTaskVO.getProcessesVOList())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "工序列表不能为空");
|
||||
}
|
||||
if (CollUtil.isEmpty(processRouteTaskVO.getAssemblyVOList())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "组件分配列表不能为空");
|
||||
}
|
||||
}
|
||||
List<ProcessRouteTaskEntity> existsTaskList = this.lambdaQuery().eq(ProcessRouteTaskEntity::getFactory, processRouteTaskVO.getFactory())
|
||||
.eq(ProcessRouteTaskEntity::getMaterialNo, processRouteTaskVO.getMaterialNo())
|
||||
.list();
|
||||
|
|
@ -178,15 +192,19 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
|||
List<BomNewPBomVO> nodeList = showDataStyle(convertBomList, rootParent.getRowId());
|
||||
for (BomNewPBomVO vo: nodeList) {
|
||||
vo.setBomVersion(rootParent.getCurrentVersion());
|
||||
// vo.setDeviseName(parentFormal.getDeviseName());
|
||||
// vo.setCreatedTime(parentFormal.getCreatedTime());
|
||||
// vo.setExpireEndTime(parentFormal.getReleaseTime());
|
||||
// 10、40、50、60、70大类以及200201小类这些不需要BOM的物料,版本号显示B00 by 10002327 241101
|
||||
// if(MaterialshouldBomExistUtil.checkNoNeedBom(vo) || Objects.equals("T",vo.getProjectType())){
|
||||
// vo.setCurrentVersion(OriginalConstant.NO_NEED_BOM);
|
||||
// }
|
||||
}
|
||||
nodesList.addAll(nodeList);
|
||||
if (CollUtil.isNotEmpty(nodesList)) {
|
||||
nodesList.forEach(item -> {
|
||||
List<BomNewPBomVO> parents = nodesList.stream().filter(parent -> item.getParentRowId().equals(parent.getRowId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(parents)) {
|
||||
item.setParentMaterialNo(parents.get(0).getMaterialNo());
|
||||
item.setParentMaterialDesc(parents.get(0).getMaterialDesc());
|
||||
}
|
||||
});
|
||||
// 最顶级不返回
|
||||
nodesList.remove(0);
|
||||
}
|
||||
return nodesList;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,13 @@
|
|||
AND updated_by LIKE concat('%', #{query.updatedBy}, '%')
|
||||
</if>
|
||||
<if test="query.delFlag != null">
|
||||
AND del_flag = #{delFlag}
|
||||
AND del_flag = #{query.delFlag}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
AND `status` = #{query.status}
|
||||
</if>
|
||||
<if test="query.usefulness != null">
|
||||
AND usefulness = #{query.usefulness}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
|
|
|||
Loading…
Reference in New Issue