Mbom搜索查询调整

This commit is contained in:
jing's 2024-03-15 18:18:58 +08:00
parent c89e9f34cd
commit eba677e7a4
5 changed files with 88 additions and 4 deletions

View File

@ -0,0 +1,44 @@
package com.nflg.product.bomnew.pojo.vo;
import cn.hutool.core.util.StrUtil;
import com.nflg.product.bomnew.constant.FactoryCodeEnum;
import com.nflg.product.bomnew.constant.MBomConstantEnum;
import com.nflg.product.bomnew.util.EnumUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* t_bom_new_mbom_parent
*
*
* @author makejava
* @since 2024-01-01 10:53:26
*/
@Data
@Accessors(chain = true)
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewMbomMiddleVO")
public class BomNewMbomIndexVO implements Serializable {
@ApiModelProperty(value = "主键行ID-雪花")
private String rowIds;
/**
* bom版本行ID,和mbom_parent表row_id关联
*/
@ApiModelProperty(value = "bom版本行ID,和mbom_parent表row_id关联")
private Long bomRowId;
}

View File

@ -36,6 +36,9 @@ public class BomNewMbomMiddleVO extends BaseMaterialVO implements Serializable {
private Long rowId;
private String rowIds;
/**
* bom版本行ID,和mbom_parent表row_id关联
*/
@ -296,4 +299,22 @@ public class BomNewMbomMiddleVO extends BaseMaterialVO implements Serializable {
private List<BomNewMbomMiddleVO> childNodes = Collections.emptyList();
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BomNewMbomMiddleVO vo = (BomNewMbomMiddleVO) o;
return Objects.equals(rowId, vo.rowId);
}
@Override
public int hashCode() {
return rowId != null ? rowId.hashCode() : 0;
}
}

View File

@ -22,6 +22,7 @@ import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomIndexVO;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
import com.nflg.product.bomnew.pojo.vo.ForwardReportVO;
import com.nflg.product.bomnew.service.domain.MBom.IndexListTree;
@ -86,9 +87,18 @@ public class BomNewMbomParentService extends ServiceImpl<BomNewMbomParentMapper,
parent.setBomRowId(parent.getRowId());
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(ImmutableList.of(parent), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
List<BomNewMbomMiddleVO> childList = this.getBaseMapper().searchList(item.getRowId());
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(childList, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
List<String> rowIds= new ArrayList<>(Arrays.asList(StrUtil.split(item.getRowIds(),",")));
List<BomNewMbomMiddleVO> childList=new ArrayList<>();
for(String rowId:rowIds) {
List<BomNewMbomMiddleVO> child= this.getBaseMapper().searchList(Long.valueOf(rowId));
childList.addAll(child);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(child, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
}
childList= childList .stream().distinct().collect(Collectors.toList());
IndexListTree.listToTree(parent, childList);
page.getRecords().add(parent);
}

View File

@ -802,6 +802,15 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
convertToMBomFor1020(bomRowId);
}
/*
父级索引
*/
public void parentIndex(List<Long> bomRowId){
}
/**
* 发布MBOM

View File

@ -141,9 +141,9 @@
<!--max(t1.row_id) -->
<select id="indexListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
SELECT max(t1.row_id) as row_id ,t1.bom_row_id from t_bom_new_mbom_detail t1 left JOIN
SELECT GROUP_CONCAT(t1.row_id) as row_ids ,t1.bom_row_id from t_bom_new_mbom_detail t1 left JOIN
t_bom_new_mbom_parent t2
on t1.bom_row_id=t2.row_id
where t1.bom_row_id=t2.row_id and t2.last_version_is=1