PBOM已发布列表

This commit is contained in:
大米 2024-01-06 18:37:04 +08:00
parent 52afb0fd1c
commit 460ca0b864
2 changed files with 71 additions and 6 deletions

View File

@ -55,6 +55,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask; import java.util.concurrent.ForkJoinTask;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream;
/** /**
@ -534,7 +535,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
*/ */
public void generateVirtualPackage(VirtualPackageParamDto paramDto) { public void generateVirtualPackage(VirtualPackageParamDto paramDto) {
try { try {
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(paramDto.getBomRowId())); BomNewEbomParentEntity root= this.getById(paramDto.getBomRowId());
Boolean flag=true;
for (Integer f :paramDto.getVirtualPackageValue()) {
flag=flag & ( (root.getVirtrualPackageEnum() & f)==f);
}
VUtils.isTure(flag).throwMessage("已生成虚拟包,无需重复生成");
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, root);
materialMainService.intiMaterialInfo(ImmutableList.of(parent), BomNewEbomParentVO::getMaterialNo); materialMainService.intiMaterialInfo(ImmutableList.of(parent), BomNewEbomParentVO::getMaterialNo);
if (parent.getMaterialCategoryCode().startsWith("30") || parent.getMaterialCategoryCode().equals("200401")) { if (parent.getMaterialCategoryCode().startsWith("30") || parent.getMaterialCategoryCode().equals("200401")) {
VirtualPackageBase generate; VirtualPackageBase generate;

View File

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.conmon.util.SessionUtil;
import com.nflg.product.base.core.exception.NflgBusinessException; import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.constant.*;
@ -85,13 +86,69 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
* @return * @return
*/ */
public IPage<BomNewPbomParentVO> workDetailsListByPage(BomNewPbomParentQuery query) { public IPage<BomNewPbomParentVO> workDetailsListByPage(BomNewPbomParentQuery query) {
//物料编码搜索或图号搜索
// if (StrUtil.isNotBlank(query.getMaterialNo()) || StrUtil.isNotBlank(query.getDrawingNo())) {
// String materialNo = query.getMaterialNo();
// if (StrUtil.isBlank(materialNo)) {
// List<MaterialMainEntity> materialList = materialMainService.lambdaQuery().eq(MaterialMainEntity::getDrawingNo, query.getDrawingNo()).list();
// if (CollUtil.isNotEmpty(materialList)) {
// materialNo = materialList.get(0).getMaterialNo();
// }
// }
// if (StrUtil.isNotBlank(materialNo)) {
// List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList());
// if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
// List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo);
// List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo);
// List<BomNewEbomParentVO> data = new ArrayList<>();
// data.addAll(parents);
// data.addAll(childs);
// materialMainService.intiMaterialInfo(data, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
// returnResult = handSeachToTree(parents, childs);
// }
// }
// return null;
// }
// else {
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserFactory()); Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserFactory());
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
return result; return result;
// }
} }
/**
* 获取物料所有子级
* @param materialNo
* @param selfIs
* @return
*/
// public Set<String> getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) {
// BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one();
// Set<String> result = new HashSet<>();
// if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) {
// Set<String> relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ","));
// if (selfIs && CollUtil.isNotEmpty(relSkuNo)) {
// relSkuNo = getSelfMaterialNo(relSkuNo);
// }
// while (CollUtil.isNotEmpty(relSkuNo)) {
// result.addAll(relSkuNo);
// List<BomNewEbomMaterialUseEntity> relSkuList = bomNewEbomMaterialUseService.lambdaQuery().in(BomNewEbomMaterialUseEntity::getMaterialNo, relSkuNo).list();
// relSkuNo.clear();
// Set<String> finalRelSkuNo = relSkuNo;
// relSkuList.forEach(k -> {
// if (StrUtil.isNotBlank(k.getParentMaterialNo())) {
// finalRelSkuNo.addAll(Sets.newHashSet(StrUtil.split(k.getParentMaterialNo(), ",")));
// }
// });
// relSkuNo = finalRelSkuNo;
// if (CollUtil.isNotEmpty(relSkuNo) && selfIs) {
// relSkuNo = getSelfMaterialNo(relSkuNo);
// }
// }
// }
// return result;
// }
/** /**
* *
* @param query * @param query