1.替换项合并

This commit is contained in:
大米 2024-05-16 17:36:24 +08:00
parent 47da3a9d58
commit 11c27f963e
7 changed files with 20 additions and 3 deletions

View File

@ -138,9 +138,15 @@ public class BomNewOriginalChildEntity implements Serializable {
@ApiModelProperty(value = "项目类别") @ApiModelProperty(value = "项目类别")
private String projectType; private String projectType;
@TableField(value = "material_original_unit")
@ApiModelProperty(value = "原始单位-来自cad") @ApiModelProperty(value = "原始单位-来自cad")
private String materialOriginalUnit; private String materialOriginalUnit;
@TableField(value = "reg_replace_is")
@ApiModelProperty(value = "原始单位-来自cad")
private Integer regReplaceIs;
public BigDecimal getTotalWeight() { public BigDecimal getTotalWeight() {
return NumberUtil.mul(this.unitWeight, this.num); return NumberUtil.mul(this.unitWeight, this.num);
} }

View File

@ -192,6 +192,9 @@ public class BomOriginalListVO extends BaseMaterialVO {
@ApiModelProperty("来源行ID,多个以逗号隔开") @ApiModelProperty("来源行ID,多个以逗号隔开")
private String sourceRowId; private String sourceRowId;
@ApiModelProperty("是否通过规则替换 0-否 1-是")
private Integer regReplaceIs;
public Integer getVirtualPartType() { public Integer getVirtualPartType() {
if( drawingNo.contains(VirtualPackageTypeEnum.DELIVERY_PACKAGE.getConMaterialName())){ if( drawingNo.contains(VirtualPackageTypeEnum.DELIVERY_PACKAGE.getConMaterialName())){
return VirtualPackageTypeEnum.DELIVERY_PACKAGE.getValue(); return VirtualPackageTypeEnum.DELIVERY_PACKAGE.getValue();

View File

@ -147,5 +147,8 @@ public class BomOriginalPlmBomVO extends BaseMaterialVO implements Serializable
@ApiModelProperty(value = "原始单位-来自cad") @ApiModelProperty(value = "原始单位-来自cad")
private String materialOriginalUnit; private String materialOriginalUnit;
@ApiModelProperty("是否通过规则替换 0-否 1-是")
private Integer regReplaceIs=0;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -167,6 +167,7 @@ public abstract class BaseConvert {
childEntity.setTotalWeight(NumberUtil.mul(childEntity.getUnitWeight(),childEntity.getNum())); childEntity.setTotalWeight(NumberUtil.mul(childEntity.getUnitWeight(),childEntity.getNum()));
childEntity.setProjectType(StrUtil.isBlank(material.getProjectType())?"":material.getProjectType() ); childEntity.setProjectType(StrUtil.isBlank(material.getProjectType())?"":material.getProjectType() );
childEntity.setMaterialOriginalUnit(material.getMaterialOriginalUnit()); childEntity.setMaterialOriginalUnit(material.getMaterialOriginalUnit());
childEntity.setRegReplaceIs(material.getRegReplaceIs());
this.resultChild.add(childEntity); this.resultChild.add(childEntity);
return childEntity; return childEntity;

View File

@ -106,7 +106,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
List<BomOriginalListVO> result = new ArrayList(); 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)); Map<String, List<BomOriginalListVO>> materialNoGroupMp =commonPartList.stream().collect(Collectors.groupingBy(BomOriginalListVO::getMaterialNo));
for (Map.Entry<String, List<BomOriginalListVO>> entry : materialNoGroupMp.entrySet()) { for (Map.Entry<String, List<BomOriginalListVO>> entry : materialNoGroupMp.entrySet()) {
@ -360,7 +360,7 @@ public class OriginalBomToEBomV2Convert extends BaseConvert {
BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType"); BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType");
eBomParent.setRowId(parentEnt.getEBomRowId() > 0 ? parentEnt.getEBomRowId() : IdWorker.getId()); eBomParent.setRowId(parentEnt.getEBomRowId() > 0 ? parentEnt.getEBomRowId() : IdWorker.getId());
eBomParent.setSource(EBomSourceEnum.FROM_BOM.getValue()); 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.setConvertToEbomTime(LocalDateTime.now());
eBomParent.setSourceRowId(StrUtil.isNotBlank(parentEnt.getSourceRowId())?parentEnt.getSourceRowId(): parentEnt.getRowId().toString()); eBomParent.setSourceRowId(StrUtil.isNotBlank(parentEnt.getSourceRowId())?parentEnt.getSourceRowId(): parentEnt.getRowId().toString());
eBomParent.setLastVersionIs(1); eBomParent.setLastVersionIs(1);

View File

@ -137,6 +137,8 @@ public class PlmBomToOriginalConvertV2 extends BaseConvert {
private void handlerChild(BomNewOriginalParentEntity parentEntity, OriginalSourceEnum originalSourceEnum) { private void handlerChild(BomNewOriginalParentEntity parentEntity, OriginalSourceEnum originalSourceEnum) {
for (BomOriginalPlmBomVO childVo : childs) { for (BomOriginalPlmBomVO childVo : childs) {
//一般零部件 //一般零部件
if (StrUtil.isNotBlank(childVo.getMaterialCategoryCode()) && childVo.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) { 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.setMaterialDesc(baseMaterialVO.getMaterialDesc());
parentEntity.setMaterialTexture(baseMaterialVO.getMaterialTexture()); parentEntity.setMaterialTexture(baseMaterialVO.getMaterialTexture());
parentEntity.setProjectType("L"); parentEntity.setProjectType("L");
parentEntity.setRegReplaceIs(1);
} }
} }

View File

@ -23,13 +23,14 @@
<result column="should_bom_exist" property="shouldBomExist" jdbcType="INTEGER"/> <result column="should_bom_exist" property="shouldBomExist" jdbcType="INTEGER"/>
<result column="bom_version_row_id" property="bomVersionRowId" jdbcType="BIGINT"/> <result column="bom_version_row_id" property="bomVersionRowId" jdbcType="BIGINT"/>
<result column="project_type" property="parentRowId" jdbcType="VARCHAR" /> <result column="project_type" property="parentRowId" jdbcType="VARCHAR" />
<result column="reg_replace_is" property="regReplaceIs" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
row_id, parent_row_id, order_number, drawing_no, material_no, material_name, material_desc, unit_weight, num, 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 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> </sql>