1.替换项合并
This commit is contained in:
parent
47da3a9d58
commit
11c27f963e
|
|
@ -138,9 +138,15 @@ public class BomNewOriginalChildEntity implements Serializable {
|
|||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
|
||||
@TableField(value = "material_original_unit")
|
||||
@ApiModelProperty(value = "原始单位-来自cad")
|
||||
private String materialOriginalUnit;
|
||||
|
||||
|
||||
@TableField(value = "reg_replace_is")
|
||||
@ApiModelProperty(value = "原始单位-来自cad")
|
||||
private Integer regReplaceIs;
|
||||
public BigDecimal getTotalWeight() {
|
||||
return NumberUtil.mul(this.unitWeight, this.num);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,9 @@ public class BomOriginalListVO extends BaseMaterialVO {
|
|||
@ApiModelProperty("来源行ID,多个以逗号隔开")
|
||||
private String sourceRowId;
|
||||
|
||||
@ApiModelProperty("是否通过规则替换 0-否 1-是")
|
||||
private Integer regReplaceIs;
|
||||
|
||||
public Integer getVirtualPartType() {
|
||||
if( drawingNo.contains(VirtualPackageTypeEnum.DELIVERY_PACKAGE.getConMaterialName())){
|
||||
return VirtualPackageTypeEnum.DELIVERY_PACKAGE.getValue();
|
||||
|
|
|
|||
|
|
@ -146,6 +146,9 @@ public class BomOriginalPlmBomVO extends BaseMaterialVO implements Serializable
|
|||
|
||||
@ApiModelProperty(value = "原始单位-来自cad")
|
||||
private String materialOriginalUnit;
|
||||
|
||||
@ApiModelProperty("是否通过规则替换 0-否 1-是")
|
||||
private Integer regReplaceIs=0;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ public abstract class BaseConvert {
|
|||
childEntity.setTotalWeight(NumberUtil.mul(childEntity.getUnitWeight(),childEntity.getNum()));
|
||||
childEntity.setProjectType(StrUtil.isBlank(material.getProjectType())?"":material.getProjectType() );
|
||||
childEntity.setMaterialOriginalUnit(material.getMaterialOriginalUnit());
|
||||
childEntity.setRegReplaceIs(material.getRegReplaceIs());
|
||||
this.resultChild.add(childEntity);
|
||||
return childEntity;
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
|
||||
List<BomOriginalListVO> result = new ArrayList();
|
||||
//子级中,一般零部件
|
||||
List<BomOriginalListVO> commonPartList = list.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo()) && OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE.equals(u.getMaterialCategoryCode())).collect(Collectors.toList());
|
||||
List<BomOriginalListVO> commonPartList = list.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo()) && (OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE.equals(u.getMaterialCategoryCode())|| u.getRegReplaceIs().equals(1))).collect(Collectors.toList());
|
||||
|
||||
Map<String, List<BomOriginalListVO>> materialNoGroupMp =commonPartList.stream().collect(Collectors.groupingBy(BomOriginalListVO::getMaterialNo));
|
||||
for (Map.Entry<String, List<BomOriginalListVO>> entry : materialNoGroupMp.entrySet()) {
|
||||
|
|
@ -360,7 +360,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
|
|||
BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType");
|
||||
eBomParent.setRowId(parentEnt.getEBomRowId() > 0 ? parentEnt.getEBomRowId() : IdWorker.getId());
|
||||
eBomParent.setSource(EBomSourceEnum.FROM_BOM.getValue());
|
||||
eBomParent.setCurrentVersion(VersionUtil.getNextVersion(Objects.isNull(ebom) ? "" : VersionUtil.getNextVersion(ebom.getCurrentVersion())));
|
||||
eBomParent.setCurrentVersion(VersionUtil.getNextVersion(Objects.isNull(ebom) ? "" : ebom.getCurrentVersion()));
|
||||
eBomParent.setConvertToEbomTime(LocalDateTime.now());
|
||||
eBomParent.setSourceRowId(StrUtil.isNotBlank(parentEnt.getSourceRowId())?parentEnt.getSourceRowId(): parentEnt.getRowId().toString());
|
||||
eBomParent.setLastVersionIs(1);
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ public class PlmBomToOriginalConvertV2 extends BaseConvert {
|
|||
|
||||
private void handlerChild(BomNewOriginalParentEntity parentEntity, OriginalSourceEnum originalSourceEnum) {
|
||||
|
||||
|
||||
|
||||
for (BomOriginalPlmBomVO childVo : childs) {
|
||||
//一般零部件
|
||||
if (StrUtil.isNotBlank(childVo.getMaterialCategoryCode()) && childVo.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) {
|
||||
|
|
@ -199,6 +201,7 @@ public class PlmBomToOriginalConvertV2 extends BaseConvert {
|
|||
parentEntity.setMaterialDesc(baseMaterialVO.getMaterialDesc());
|
||||
parentEntity.setMaterialTexture(baseMaterialVO.getMaterialTexture());
|
||||
parentEntity.setProjectType("L");
|
||||
parentEntity.setRegReplaceIs(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,13 +23,14 @@
|
|||
<result column="should_bom_exist" property="shouldBomExist" jdbcType="INTEGER"/>
|
||||
<result column="bom_version_row_id" property="bomVersionRowId" jdbcType="BIGINT"/>
|
||||
<result column="project_type" property="parentRowId" jdbcType="VARCHAR" />
|
||||
<result column="reg_replace_is" property="regReplaceIs" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
row_id, parent_row_id, order_number, drawing_no, material_no, material_name, material_desc, unit_weight, num,
|
||||
total_weight ,remark,created_by,created_time ,edit_status ,material_texture ,should_bom_exist
|
||||
,bom_version_row_id,project_type
|
||||
,bom_version_row_id,project_type,reg_replace_is
|
||||
</sql>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue