1、BUG修复
This commit is contained in:
parent
dc097a96cb
commit
a5e5dd1827
|
|
@ -7,7 +7,9 @@ import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
|
||||||
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
|
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* t_bom_new_original_parent 表数据库访问层
|
* t_bom_new_original_parent 表数据库访问层
|
||||||
|
|
@ -59,7 +61,14 @@ public interface BomNewOriginalParentMapper extends BaseMapper<BomNewOriginalPar
|
||||||
*/
|
*/
|
||||||
List<BomOriginalListVO> getParentForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos ,@Param("state") Integer state);
|
List<BomOriginalListVO> getParentForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos ,@Param("state") Integer state);
|
||||||
|
|
||||||
List<BomOriginalListVO> getChildForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos,@Param("state") Integer state);
|
List<BomOriginalListVO> getChildForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos,@Param("bomRowIds") Collection<Long> bomRowIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取父级图号
|
||||||
|
* @param drawingNos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Set<String> getMaterialParent(@Param("drawingNos") Collection<String> drawingNos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取父级物料 (包含查询物料本身)
|
* 获取父级物料 (包含查询物料本身)
|
||||||
|
*
|
||||||
* @param materialNoList
|
* @param materialNoList
|
||||||
* @param bomType
|
* @param bomType
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -402,6 +403,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成虚拟包时-获取子级
|
* 生成虚拟包时-获取子级
|
||||||
|
*
|
||||||
* @param rowId
|
* @param rowId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -769,21 +771,23 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
public void generateVirtualPackage(VirtualPackageParamDto paramDto) throws IOException {
|
public void generateVirtualPackage(VirtualPackageParamDto paramDto) throws IOException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BomNewEbomParentEntity root = this.getById(paramDto.getBomRowId());
|
BomNewEbomParentEntity root = this.getById(paramDto.getBomRowId());
|
||||||
|
|
||||||
VUtils.isTure(Objects.isNull(root)).throwMessage("Bom不存在");
|
VUtils.isTure(Objects.isNull(root)).throwMessage("Bom不存在");
|
||||||
//
|
|
||||||
// VUtils.isTure(root.getVirtrualPackageEnum()>0).throwMessage("已生成过虚拟包,不能2次生成");
|
//初始化虚拟包-判断枚举(不是手工生成虚拟包的情况)
|
||||||
|
checkAndInitVirtualPackageEnum(paramDto, root);
|
||||||
|
|
||||||
|
VUtils.isTure(root.getVirtrualPackageEnum() > 0).throwMessage("已生成过虚拟包,不能2次生成");
|
||||||
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue()))
|
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue()))
|
||||||
.throwMessage("异常状态下不允许生成虚拟包");
|
.throwMessage("异常状态下不允许生成虚拟包");
|
||||||
LogRecordContext.putVariable("gvbom", root);
|
LogRecordContext.putVariable("gvbom", root);
|
||||||
//初始化虚拟包-判断枚举(不是手工生成虚拟包的情况)
|
|
||||||
checkAndInitVirtualPackageEnum(paramDto, root);
|
// Boolean flag = true;
|
||||||
Boolean flag = true;
|
// for (Integer f : paramDto.getVirtualPackageValue()) {
|
||||||
for (Integer f : paramDto.getVirtualPackageValue()) {
|
// flag = flag & ((root.getVirtrualPackageEnum() & f) == f);
|
||||||
flag = flag & ((root.getVirtrualPackageEnum() & f) == f);
|
// }
|
||||||
}
|
// VUtils.isTure(flag).throwMessage("已生成虚拟包,无需重复生成");
|
||||||
VUtils.isTure(flag).throwMessage("已生成虚拟包,无需重复生成");
|
|
||||||
|
|
||||||
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, root);
|
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, root);
|
||||||
materialMainService.intiMaterialInfo(ImmutableList.of(parent), BomNewEbomParentVO::getMaterialNo);
|
materialMainService.intiMaterialInfo(ImmutableList.of(parent), BomNewEbomParentVO::getMaterialNo);
|
||||||
|
|
@ -1213,7 +1217,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* 退回设计,不用判断角色 工艺岗才能看见已复核数据
|
* 退回设计,不用判断角色 工艺岗才能看见已复核数据
|
||||||
* 1.已发布不能退
|
* 1.已发布不能退
|
||||||
* 2.被工艺岗位添加的物料,不可以退回。但是可以被删除(只能是当前工艺岗位的用户创建的物料)
|
* 2.被工艺岗位添加的物料,不可以退回。但是可以被删除(只能是当前工艺岗位的用户创建的物料)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void revertDesign(BomNewEBomRevertDTO dto) throws ExecutionException, InterruptedException {
|
public void revertDesign(BomNewEBomRevertDTO dto) throws ExecutionException, InterruptedException {
|
||||||
|
|
@ -1261,7 +1264,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
|
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(revertList)) {
|
if (CollectionUtil.isNotEmpty(revertList)) {
|
||||||
//parent表状态
|
//parent表状态
|
||||||
UpdateWrapper<BomNewEbomParentEntity> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<BomNewEbomParentEntity> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
@ -1291,8 +1293,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1403,13 +1403,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
public Boolean updateProjectType(BomNewEbomProjectTypeDTO dto) {
|
public Boolean updateProjectType(BomNewEbomProjectTypeDTO dto) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<Long> rowIdList = dto.getRowIdList().stream().map(BomNewEbomProjectTypeDTO.BomNewEbomChangeProjectType::getRowId).collect(Collectors.toList());
|
List<Long> rowIdList = dto.getRowIdList().stream().map(BomNewEbomProjectTypeDTO.BomNewEbomChangeProjectType::getRowId).collect(Collectors.toList());
|
||||||
List<Long> bomRowIdList = dto.getRowIdList().stream().filter(u -> u.getBomRowId() > 0).map(BomNewEbomProjectTypeDTO.BomNewEbomChangeProjectType::getBomRowId).collect(Collectors.toList());
|
List<Long> bomRowIdList = dto.getRowIdList().stream().filter(u -> u.getBomRowId() > 0).map(BomNewEbomProjectTypeDTO.BomNewEbomChangeProjectType::getBomRowId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (CollectionUtil.isNotEmpty(bomRowIdList)) {
|
// if (CollectionUtil.isNotEmpty(bomRowIdList)) {
|
||||||
// UpdateWrapper<BomNewEbomParentEntity> parentUpdate = new UpdateWrapper<>();
|
// UpdateWrapper<BomNewEbomParentEntity> parentUpdate = new UpdateWrapper<>();
|
||||||
// parentUpdate.lambda()
|
// parentUpdate.lambda()
|
||||||
|
|
@ -1505,7 +1502,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BomNewEbomChildEntity childEntity = null;
|
BomNewEbomChildEntity childEntity = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1529,9 +1525,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//编辑数据 新增或物料编码已变化
|
//编辑数据 新增或物料编码已变化
|
||||||
BomNewEbomParentEntity bomParent = null;
|
BomNewEbomParentEntity bomParent = null;
|
||||||
if (query.getBomRowId() != null && query.getBomRowId().longValue() != 0) {
|
if (query.getBomRowId() != null && query.getBomRowId().longValue() != 0) {
|
||||||
|
|
@ -1568,7 +1561,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(baseMaterialVO.getMaterialNo())
|
if (StrUtil.isNotBlank(baseMaterialVO.getMaterialNo())
|
||||||
&& (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(baseMaterialVO.getMaterialState())
|
&& (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(baseMaterialVO.getMaterialState())
|
||||||
|| MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(baseMaterialVO.getMaterialState()))) {
|
|| MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(baseMaterialVO.getMaterialState()))) {
|
||||||
|
|
@ -1665,7 +1657,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(eBomDel.getDelEBom())) {
|
if (CollectionUtil.isNotEmpty(eBomDel.getDelEBom())) {
|
||||||
|
|
||||||
//ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
//ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
||||||
|
|
@ -1717,9 +1708,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂存
|
* 暂存
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -1733,7 +1721,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
checkUserRoleAuth(dto.getParent().getCreatedBy());
|
checkUserRoleAuth(dto.getParent().getCreatedBy());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//暂存数据为空后面不处理
|
//暂存数据为空后面不处理
|
||||||
if (CollUtil.isEmpty(dto.getDatas())) {
|
if (CollUtil.isEmpty(dto.getDatas())) {
|
||||||
return dto.getParent();
|
return dto.getParent();
|
||||||
|
|
@ -1745,8 +1732,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
eBomEdit.handleBom(dto);
|
eBomEdit.handleBom(dto);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (eBomEdit.getParentEntity() != null) {
|
if (eBomEdit.getParentEntity() != null) {
|
||||||
|
|
||||||
eBomEdit.nextVersion();
|
eBomEdit.nextVersion();
|
||||||
|
|
@ -1771,8 +1756,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity());
|
BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity());
|
||||||
retParentVO.setBomRowId(retParentVO.getRowId());
|
retParentVO.setBomRowId(retParentVO.getRowId());
|
||||||
|
|
||||||
|
|
@ -1789,7 +1772,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
checkUserRoleAuth(dto.getParent().getCreatedBy());
|
checkUserRoleAuth(dto.getParent().getCreatedBy());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//无提交数据后面不处理
|
//无提交数据后面不处理
|
||||||
if (CollUtil.isEmpty(dto.getDatas())) {
|
if (CollUtil.isEmpty(dto.getDatas())) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -1879,7 +1861,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//原始bom不正常
|
//原始bom不正常
|
||||||
List<BomNewEbomChildEntity> s1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
List<BomNewEbomChildEntity> s1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
&& !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
&& !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,30 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取父级图号(包含查询的图号)
|
||||||
|
* @param drawingNos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<String> getParentMaterialByDrawingNo(List<String> drawingNos) {
|
||||||
|
Set<String> result = new HashSet<>();
|
||||||
|
result.addAll(drawingNos);
|
||||||
|
|
||||||
|
Set<String> useMaterialSku = this.getBaseMapper().getMaterialParent(drawingNos);
|
||||||
|
|
||||||
|
while (CollUtil.isNotEmpty(useMaterialSku)) {
|
||||||
|
//防止数据错误(循环依赖)-死循环
|
||||||
|
Set<String> difference = Sets.difference(useMaterialSku, result);
|
||||||
|
if (CollUtil.isNotEmpty(difference)) {
|
||||||
|
useMaterialSku = this.getBaseMapper().getMaterialParent(difference);
|
||||||
|
result.addAll(difference);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ArrayList<>(result);
|
||||||
|
}
|
||||||
|
|
||||||
private Page<BomOriginalListVO> handSeachToTree(List<BomOriginalListVO> parents, List<BomOriginalListVO> childs) {
|
private Page<BomOriginalListVO> handSeachToTree(List<BomOriginalListVO> parents, List<BomOriginalListVO> childs) {
|
||||||
Page<BomOriginalListVO> resutlData = new Page<>();
|
Page<BomOriginalListVO> resutlData = new Page<>();
|
||||||
Set<String> parentSet = parents.stream().map(u -> u.getDrawingNo()).collect(Collectors.toSet());
|
Set<String> parentSet = parents.stream().map(u -> u.getDrawingNo()).collect(Collectors.toSet());
|
||||||
|
|
@ -162,12 +186,12 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
// if(query.getStatus().equals(1) && CollUtil.isEmpty(materialBoms)){
|
// if(query.getStatus().equals(1) && CollUtil.isEmpty(materialBoms)){
|
||||||
// return result;
|
// return result;
|
||||||
// }
|
// }
|
||||||
List<String> parentDrawingNos = new ArrayList<>(getParentDrawingNoByMaterialNo(queryDrawingNos));
|
List<String> parentDrawingNos = new ArrayList<>(getParentMaterialByDrawingNo(queryDrawingNos));
|
||||||
parentDrawingNos.addAll(queryDrawingNos);
|
// parentDrawingNos.addAll(queryDrawingNos);
|
||||||
if (CollUtil.isNotEmpty(parentDrawingNos)) {
|
if (CollUtil.isNotEmpty(parentDrawingNos)) {
|
||||||
List<BomOriginalListVO> parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus());
|
List<BomOriginalListVO> parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus());
|
||||||
materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
materialMainService.intiMaterialInfo(parents, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||||
List<BomOriginalListVO> childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos,query.getStatus());
|
List<BomOriginalListVO> childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos,parents.stream().map(u->u.getRowId()).collect(Collectors.toSet()));
|
||||||
materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
materialMainService.intiMaterialInfo(childs, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||||
childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> {
|
childs.stream().filter(f -> StrUtil.isBlank(f.getCurrentVersion())).forEach(f -> {
|
||||||
if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) {
|
if (MaterialshouldBomExistUtil.checkShouldBomExist(f.getMaterialCategoryCode(), f.getMaterialGetType())) {
|
||||||
|
|
@ -499,6 +523,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public List<ImportOriginalBomVO> convertToEBom(List<Long> bomRowIds) throws ExecutionException, InterruptedException {
|
public List<ImportOriginalBomVO> convertToEBom(List<Long> bomRowIds) throws ExecutionException, InterruptedException {
|
||||||
List<BomNewOriginalParentEntity> bomNewOriginalParentEntities = this.getBaseMapper().selectBatchIds(bomRowIds);
|
List<BomNewOriginalParentEntity> bomNewOriginalParentEntities = this.getBaseMapper().selectBatchIds(bomRowIds);
|
||||||
|
|
||||||
|
|
@ -522,13 +547,13 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
|
|
||||||
try {
|
try {
|
||||||
convertToEBomDo(parent, ebomRowId);
|
convertToEBomDo(parent, ebomRowId);
|
||||||
} catch (Exception e) {
|
|
||||||
importOriginalBomVOList.add(new ImportOriginalBomVO(parent.getDrawingNo(), "操作失败:" + e.getMessage()));
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新并保存异常信息
|
//更新并保存异常信息
|
||||||
ebomParentService.checkAndSaveEBomException(ebomRowId);
|
ebomParentService.checkAndSaveEBomException(ebomRowId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
importOriginalBomVOList.add(new ImportOriginalBomVO(parent.getDrawingNo(), "操作失败:" + e.getMessage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return importOriginalBomVOList;
|
return importOriginalBomVOList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
||||||
BomNewEbomParentEntity parent = getParentByRowId(bomRowId);
|
BomNewEbomParentEntity parent = getParentByRowId(bomRowId);
|
||||||
BomNewEbomParentVO vo= Convert.convert(BomNewEbomParentVO.class,parent );
|
BomNewEbomParentVO vo= Convert.convert(BomNewEbomParentVO.class,parent );
|
||||||
|
|
||||||
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()){
|
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()&VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!= VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()){
|
||||||
generateVMNoF21(parent.getDrawingNo(), ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
generateVMNoF21(parent.getDrawingNo(), ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -58,7 +58,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
||||||
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
|
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
|
||||||
|
|
||||||
}
|
}
|
||||||
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
|
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()& VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
|
||||||
//构建构建发货前装配包
|
//构建构建发货前装配包
|
||||||
if(Objects.isNull(makingPackage)){
|
if(Objects.isNull(makingPackage)){
|
||||||
makingPackage=getParentZhiZuo(parent.getDrawingNo());
|
makingPackage=getParentZhiZuo(parent.getDrawingNo());
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,9 @@
|
||||||
</update>
|
</update>
|
||||||
<!--更新-待复核根节点-->
|
<!--更新-待复核根节点-->
|
||||||
<update id="updateRootForWaitReview">
|
<update id="updateRootForWaitReview">
|
||||||
|
update t_bom_new_ebom_parent set root_is_for_wait_review=0 ;
|
||||||
update t_bom_new_ebom_parent a left join (
|
update t_bom_new_ebom_parent a left join (
|
||||||
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` =2
|
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` in(1,3) and last_version_is=1
|
||||||
) b on a.material_no=b.material_no
|
) b on a.material_no=b.material_no
|
||||||
set a.root_is_for_wait_review=1
|
set a.root_is_for_wait_review=1
|
||||||
where a.`status` in (1,3) and last_version_is=1 and b.row_id is null ;
|
where a.`status` in (1,3) and last_version_is=1 and b.row_id is null ;
|
||||||
|
|
|
||||||
|
|
@ -192,40 +192,60 @@
|
||||||
|
|
||||||
<!--物料编码搜索-父级-->
|
<!--物料编码搜索-父级-->
|
||||||
<select id="getParentForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
<select id="getParentForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
||||||
SELECT if(#{state}=1 and status=2,3,status) as status, created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
SELECT status , created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
||||||
FROM t_bom_new_original_parent a where 1=1
|
FROM t_bom_new_original_parent a
|
||||||
<!-- <if test="state==1">-->
|
join (select drawing_no,max(current_version) current_version from t_bom_new_original_parent where status=#{state}
|
||||||
<!-- and a.last_version_is=1-->
|
|
||||||
<!-- <if test="InHasConvertBomIs">-->
|
|
||||||
<!-- and a.status=1-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<if test="state==2">
|
|
||||||
and current_version in ( select current_version from t_bom_new_original_parent where status >1 and drawing_no in
|
|
||||||
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
and drawing_no in
|
and drawing_no in
|
||||||
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
group by drawing_no ) b on a.drawing_no=b.drawing_no and a.current_version=b.current_version
|
||||||
order by created_time desc
|
order by created_time desc
|
||||||
</select>
|
</select>
|
||||||
<!--物料编码搜索-子级-->
|
<!--物料编码搜索-子级-->
|
||||||
<select id="getChildForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
<select id="getChildForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
||||||
select if(#{state}=1 and c.status=2,3,c.status) as status ,c.current_version , c.created_by as bomCreatedBy
|
select a.status ,a.current_version , a.created_by as bomCreatedBy,
|
||||||
,IFNULL(c.devise_name,a.devise_name) as devise_name,IFNULL(c.devise_user_code,a.devise_user_code) AS devise_user_code
|
a.devise_name ,a.devise_user_code
|
||||||
,IFNULL(c.dept_name,a.dept_name) AS dept_name,IFNULL(c.source,a.source) AS source,IFNULL(c.row_id,"0") as bomRowId
|
,a.dept_name,a.source,ifnull( a.row_id,0) as bomRowId
|
||||||
,IFNULL(c.row_id,"0") as childBomRowId, b.*
|
,ifnull( a.row_id,0) as childBomRowId, b.* from t_bom_new_original_child b
|
||||||
from t_bom_new_original_parent a
|
left join t_bom_new_original_parent a on a.drawing_no=b.drawing_no and a.row_id in
|
||||||
join t_bom_new_original_child b on a.row_id =b.parent_row_id
|
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">
|
||||||
left join t_bom_new_original_parent c on b.drawing_no=c.drawing_no and c.last_version_is=1
|
#{item}
|
||||||
where a.last_version_is=1 and b.drawing_no in
|
</foreach>
|
||||||
|
where b.parent_row_id in
|
||||||
|
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
and b.drawing_no in
|
||||||
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- <!–物料编码搜索-子级–>-->
|
||||||
|
<!-- <select id="getChildForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">-->
|
||||||
|
<!-- select c.status ,c.current_version , c.created_by as bomCreatedBy-->
|
||||||
|
<!-- ,IFNULL(c.devise_name,a.devise_name) as devise_name,IFNULL(c.devise_user_code,a.devise_user_code) AS devise_user_code-->
|
||||||
|
<!-- ,IFNULL(c.dept_name,a.dept_name) AS dept_name,IFNULL(c.source,a.source) AS source,IFNULL(c.row_id,"0") as bomRowId-->
|
||||||
|
<!-- ,IFNULL(c.row_id,"0") as childBomRowId, b.*-->
|
||||||
|
<!-- from t_bom_new_original_parent a-->
|
||||||
|
<!-- join t_bom_new_original_child b on a.row_id =b.parent_row_id-->
|
||||||
|
<!-- left join t_bom_new_original_parent c on b.drawing_no=c.drawing_no and c.last_version_is=1-->
|
||||||
|
<!-- where a.last_version_is=1 and b.drawing_no in-->
|
||||||
|
<!-- <foreach collection="drawingNos" item="item" open="(" separator="," close=")">-->
|
||||||
|
<!-- #{item}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<!--获取父级图号-->
|
||||||
|
<select id="getMaterialParent" resultType="java.lang.String">
|
||||||
|
select a.drawing_no from t_bom_new_original_parent a join t_bom_new_original_child b on a.row_id=b.parent_row_id
|
||||||
|
where a.last_version_is=1
|
||||||
|
and b.drawing_no in
|
||||||
|
<foreach collection="drawingNos" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package nflg.product.common.dto;
|
package nflg.product.common.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
//import org.omg.CORBA.PRIVATE_MEMBER;
|
//import org.omg.CORBA.PRIVATE_MEMBER;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -11,6 +12,7 @@ import java.util.List;
|
||||||
* @Date 2022/7/14 10:38
|
* @Date 2022/7/14 10:38
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class LoginUserInfoDTO {
|
public class LoginUserInfoDTO {
|
||||||
|
|
||||||
private Long rowId;
|
private Long rowId;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue