PBOM-正式列表搜索

This commit is contained in:
大米 2024-01-10 12:05:32 +08:00
parent 71098f6fb5
commit e8d970d593
6 changed files with 26 additions and 25 deletions

View File

@ -627,9 +627,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())) {
upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
}
;
if (CollUtil.isNotEmpty(eBomToPBom.getHasConvertEBomRowIds())) {
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), eBomToPBom.getHasConvertEBomRowIds());
List<Long> bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList());
if (CollUtil.isNotEmpty(bomRowIds)) {
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), bomRowIds);
}

View File

@ -108,8 +108,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
if (StrUtil.isNotBlank(materialNo)) {
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo).stream().collect(Collectors.toList());
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(userRoleService.getUserFactory(),parentMaterialByMaterialNo );
List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(userRoleService.getUserFactory(),parentMaterialByMaterialNo, materialNo);
List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory())?userRoleService.getUserFactory():query.getFacCode(),parentMaterialByMaterialNo );
List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory())?userRoleService.getUserFactory():query.getFacCode(),parentMaterialByMaterialNo, materialNo);
List<BomNewPbomParentVO> data = new ArrayList<>();
data.addAll(parents);
data.addAll(childs);
@ -117,7 +117,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return handSeachToTree(parents, childs);
}
}
return null;
return new Page<BomNewPbomParentVO>() ;
} else {
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);

View File

@ -60,11 +60,12 @@ public class UserRoleService {
*/
public String getUserFactory(){
Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId());
if(userMultiplantFacRoleCount>0){
return "";
}else {
return SessionUtil.getFullDeptName().contains("仙桃公司")?"1020":"1010";
}
return "";
// if(userMultiplantFacRoleCount>0){
// return "";
// }else {
// return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010;
// }
}

View File

@ -26,6 +26,7 @@ import lombok.Setter;
import nflg.product.common.constant.STATE;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
@ -185,23 +186,22 @@ public class CheckEBomException {
* @param list
*/
public void initExceptionYellowWarn(List<BomNewEbomParentVO> list) {
List<BomNewEbomParentVO> exceptionList = allBomDetail.stream().filter(u -> u.getExceptionStatus() > 1).collect(Collectors.toList());
List<BomNewEbomParentVO> exceptionList = allBomDetail.stream().filter(u -> u.getExceptionStatus() > EBomExceptionStatusEnum.OK.getValue()).collect(Collectors.toList());
// List<String> exceptionMaterialNos = exceptionList.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
if (CollUtil.isEmpty(exceptionList)) {
return;
}
for (BomNewEbomParentVO exItem : list) {
try {
List<BomNewEbomParentVO> warnList = allBomDetail.stream().filter(u -> exItem.getBomRowId() != null && exItem.getBomRowId() > 0 && u.getLevelNumber().compareTo(exItem.getLevelNumber()) < 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
warnList.forEach(k -> {
k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
});
}catch ( Exception e){
e.printStackTrace();
}
List<BomNewEbomParentVO> warnList = allBomDetail.stream().filter(u -> u.getBomRowId() > 0 && u.getLevelNumber().compareTo(exItem.getLevelNumber().setScale(0, RoundingMode.FLOOR))>=0 && u.getRowId()!=exItem.getRowId() && u.getLevelNumber().compareTo(exItem.getLevelNumber()) < 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
warnList.forEach(k -> {
k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
});
}
List<BomNewEbomParentVO> root = allBomDetail.stream().filter(u -> u.getLevelNumber().compareTo(BigDecimal.ZERO) == 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
root.forEach(k->{
k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
});
// List<String> allErrorParent = SpringUtil.getBean(BomNewEbomParentService.class).getBatchParentMaterialByMaterialNo(exceptionMaterialNos);

View File

@ -61,8 +61,8 @@ public class EBomToPBom {
@Getter
private List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
@Getter
private List<Long> hasConvertEBomRowIds=new ArrayList<>();
// @Getter
// private List<Long> hasConvertEBomRowIds=new ArrayList<>();
private Map<String, String> generateDrawingNoMap = new HashMap<>();
@ -152,7 +152,7 @@ public class EBomToPBom {
.eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, facCode).one();
this.hasConvertEBomRowIds.add(parentVo.getRowId());
// this.hasConvertEBomRowIds.add(parentVo.getRowId());
if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) {
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
oldParent.setCurrentVersion(parentVo.getCurrentVersion());

View File

@ -154,7 +154,7 @@
c.row_id as bomRowId, c.row_id as childBomRowId, b.*
from t_bom_new_pbom_parent a
join t_bom_new_pbom_child b on a.row_id =b.parent_row_id
left join t_bom_new_pbom_parent c on b.material_no=c.material_no and c.last_version_is=1
left join t_bom_new_pbom_parent c on b.material_no=c.material_no and b.fac_code=c.fac_code and c.last_version_is=1
where a.last_version_is=1
<if test="userFac!=null and userFac!=''">
and a.fac_code=#{userFac}