Merge branch 'refs/heads/feature/DM/nflg-bom-transition' into dev
This commit is contained in:
commit
16cb95df1e
|
|
@ -12,7 +12,8 @@ public enum EBomSourceEnum implements ValueEnum<Integer> {
|
|||
FROM_BOM(1, "原始BOM转换"),
|
||||
FROM_EXCE(2, "EXCE导入"),
|
||||
FROM_MDM(3, "MDM创建"),
|
||||
FROM_SAP(4, "从SAP导入");
|
||||
FROM_SAP(4, "从SAP导入"),
|
||||
FROM_CHANGE(5, "变更");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
|
|
|||
|
|
@ -1215,10 +1215,29 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
newParent.setChangeDesc(paramDTO.getChangeDesc());
|
||||
newParent.setNoticeNums(paramDTO.getNoticeNums());
|
||||
newParent.setStatus(EBomStatusEnum.WAIT_CHECK.getValue());
|
||||
newParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
newParent.setDeptRowId(SessionUtil.getDepartRowId());
|
||||
newParent.setDeptName(SessionUtil.getDepartName());
|
||||
newParent.setDeviseName(SessionUtil.getRealName());
|
||||
newParent.setDeviseUserCode(SessionUtil.getUserCode());
|
||||
newParent.setRemark("");
|
||||
newParent.setSource(EBomSourceEnum.FROM_CHANGE.getValue());
|
||||
newParent.setConvertToEbomTime(null);
|
||||
newParent.setReleaseUserName(null);
|
||||
newParent.setReleaseTime(null);
|
||||
newParent.setRevertDesc(null);
|
||||
newParent.setRevertTime(null);
|
||||
newParent.setRevertUserName(null);
|
||||
newParent.setAuditUserName(null);
|
||||
newParent.setAuditTime(null);
|
||||
newParent.setRootIs(1);
|
||||
newParent.setUserRootIs(1);
|
||||
newParent.setSapState(1);
|
||||
newParent.setSapTime(null);
|
||||
newParent.setModifyTime(null);
|
||||
newParent.setCreatedTime(LocalDateTime.now());
|
||||
newParent.setCreatedBy(SessionUtil.getUserCode());
|
||||
newParent.setCreatedJob(userRoleService.technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||
parent.setLastVersionIs(0);
|
||||
parentResult.add(newParent);
|
||||
parentResult.add(parent);
|
||||
|
|
@ -1227,6 +1246,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
BeanUtil.copyProperties(childEnt, newChild);
|
||||
newChild.setRowId(IdWorker.getId());
|
||||
newChild.setParentRowId(newParent.getRowId());
|
||||
newChild.setIdentityNo(newParent.getRowId() + "_" + newChild.getRowId());
|
||||
newChild.setCreatedBy(SessionUtil.getUserCode());
|
||||
newChild.setCreatedTime(LocalDateTime.now());
|
||||
newChild.setModifyTime(null);
|
||||
newChild.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
newChild.setSource(EBomSourceEnum.FROM_CHANGE.getValue());
|
||||
newChild.setRemark("");
|
||||
childResult.add(newChild);
|
||||
}
|
||||
|
||||
|
|
@ -2866,14 +2892,13 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
return bomRowIds.stream().map(bomRowId -> {
|
||||
CheckBomProjectTypeVO vo = new CheckBomProjectTypeVO();
|
||||
vo.setBomRowId(bomRowId);
|
||||
if (CollUtil.isEmpty(children)) {
|
||||
List<BomNewEbomChildEntity> cc = children.stream().filter(c -> c.getParentRowId().equals(bomRowId)).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(cc)) {
|
||||
vo.setExistsQ(false);
|
||||
vo.setAllIsF(false);
|
||||
} else {
|
||||
vo.setExistsQ(children.stream().anyMatch(c -> c.getParentRowId().equals(bomRowId)
|
||||
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())));
|
||||
vo.setAllIsF(children.stream().allMatch(c -> c.getParentRowId().equals(bomRowId)
|
||||
&& StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
|
||||
vo.setExistsQ(cc.stream().anyMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue())));
|
||||
vo.setAllIsF(cc.stream().allMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())));
|
||||
}
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ public class CheckEBomException {
|
|||
if (CollUtil.isNotEmpty(child) && child.stream()
|
||||
.allMatch(c -> StrUtil.equals(c.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue()))) {
|
||||
parent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_17.getValue());
|
||||
child.forEach(c -> c.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_17.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,11 +246,20 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
List<BomNewEbomChildEntity> oldParenChild = SpringUtil.getBean(BomNewEbomChildMapper.class).getChildByMaterialNo(parentEntity.getMaterialNo());
|
||||
//不存在EBom 时
|
||||
if (Objects.isNull(oldEBom)) {
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo, VersionUtil.getNextVersion(""));
|
||||
|
||||
buildCommonMaterialChildBom(childVo, materialBaseInfo, VersionUtil.getNextVersion(""));
|
||||
} else {
|
||||
if (!EBomStatusEnum.PUBLISHED.equalsValue(oldEBom.getStatus())) {
|
||||
BomNewEbomChildEntity newChild = buildCommonEbomChildEntity(materialBaseInfo, parentEntity);
|
||||
List<BomNewEbomChildEntity> oldChild = ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, oldEBom.getRowId()).list();
|
||||
if(CollUtil.isNotEmpty(oldChild)){
|
||||
List<BomNewEbomChildEntity> oldChildEntityList = oldChild.stream().filter(u->u.getMaterialNo().equals(materialBaseInfo.getMaterialNo())).collect(Collectors.toList());
|
||||
BomNewEbomChildEntity oldChildEntity=CollUtil.isNotEmpty(oldChildEntityList)?oldChildEntityList.get(0):null;
|
||||
if( Objects.nonNull(oldChildEntity) && Objects.nonNull(oldChildEntity.getNum()) && oldChildEntity.getNum().compareTo(childVo.getUnitWeight())>0){
|
||||
buildEBomChild(childVo, parentEntity);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
BomNewEbomChildEntity newChild = buildCommonEbomChildEntity(materialBaseInfo, childVo);
|
||||
//结构是否相同 且为同一个人
|
||||
if ( oldEBom.getCreatedBy().equals(parentEntity.getCreatedBy())) {
|
||||
ebomParentService.getBaseMapper().deleteById(oldEBom.getRowId());
|
||||
|
|
|
|||
|
|
@ -6,12 +6,15 @@ import cn.hutool.core.convert.Convert;
|
|||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.constant.PBomEditStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.PBomStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.PbomSourceEnum;
|
||||
import com.nflg.product.bomnew.constant.UserJobEnum;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO;
|
||||
import com.nflg.product.bomnew.service.BomNewPbomParentService;
|
||||
import com.nflg.product.bomnew.service.UserRoleService;
|
||||
import com.nflg.product.bomnew.util.ListCommonUtil;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import com.nflg.product.bomnew.util.VersionUtil;
|
||||
|
|
@ -87,12 +90,23 @@ public class PBomUpgrade {
|
|||
pbomParent.setRowId(IdWorker.getId());
|
||||
pbomParent.setCreatedTime(LocalDateTime.now());
|
||||
pbomParent.setCreatedBy(SessionUtil.getUserCode());
|
||||
pbomParent.setModifyTime(LocalDateTime.now());
|
||||
pbomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue());
|
||||
pbomParent.setEditStatus(PBomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
pbomParent.setCurrentVersion(VersionUtil.getNextVersion(parentVO.getCurrentVersion()));
|
||||
pbomParent.setModifyTime(LocalDateTime.now());
|
||||
pbomParent.setDeptRowId(SessionUtil.getDepartRowId());
|
||||
pbomParent.setDeptName(SessionUtil.getDepartName());
|
||||
pbomParent.setDeviseName(SessionUtil.getRealName());
|
||||
pbomParent.setDeviseUserCode(SessionUtil.getUserCode());
|
||||
pbomParent.setTechnologyUserName(SessionUtil.getUserName());
|
||||
pbomParent.setTechnologyUserCode(SessionUtil.getUserCode());
|
||||
pbomParent.setRemark("");
|
||||
pbomParent.setSource(PbomSourceEnum.FROM_CHANGE.getValue());
|
||||
pbomParent.setReleaseTime(null);
|
||||
pbomParent.setReleaseUserName(null);
|
||||
pbomParent.setSapState(1);
|
||||
pbomParent.setSapTime(null);
|
||||
pbomParent.setModifyTime(null);
|
||||
pbomParent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||
if (rootIs) {
|
||||
pbomParent.setRootIs(1);
|
||||
pbomParent.setUserRootIs(1);
|
||||
|
|
@ -118,10 +132,12 @@ public class PBomUpgrade {
|
|||
BeanUtil.copyProperties(childVO, child);
|
||||
child.setRowId(IdWorker.getId());
|
||||
child.setParentRowId(newParent.getRowId());
|
||||
child.setIdentityNo(newParent.getRowId() + "_" + child.getRowId());
|
||||
child.setCreatedTime(LocalDateTime.now());
|
||||
child.setCreatedBy(SessionUtil.getRealName());
|
||||
child.setModifyTime(LocalDateTime.now());
|
||||
|
||||
child.setCreatedBy(SessionUtil.getUserCode());
|
||||
child.setModifyTime(null);
|
||||
child.setSource(PbomSourceEnum.FROM_CHANGE.getValue());
|
||||
child.setRemark("");
|
||||
this.childResult.add(child);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue