PBOM-正式列表搜索

This commit is contained in:
大米 2024-01-10 14:47:26 +08:00
parent e8d970d593
commit b502414d32
10 changed files with 46 additions and 13 deletions

View File

@ -147,9 +147,11 @@ public class PBomApi extends BaseApi {
@GetMapping("copyBomCheck")
@ApiOperation("复制前检查")
public ResultVO<List<BomCopyCheckResultVO>> copyBomCheck(@RequestParam("sourceBomRowId") Long sourceBomRowId , @RequestParam("targetFacCode") String targetFacCode ) throws ExecutionException, InterruptedException {
public ResultVO<List<BomCopyCheckResultVO>> copyBomCheck(@RequestParam("sourceBomRowId") Long sourceBomRowId ,
@RequestParam("targetFacCode") String targetFacCode ,
@RequestParam("rowId") Long rowId) throws ExecutionException, InterruptedException {
return ResultVO.success(bomNewPbomParentService.copyBomCheck(sourceBomRowId,targetFacCode));
return ResultVO.success(bomNewPbomParentService.copyBomCheck(sourceBomRowId,targetFacCode,rowId));
}

View File

@ -206,6 +206,10 @@ public class BomNewEbomChildEntity implements Serializable {
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType;
@TableField(value = "virtual_part_root_material_no")
@ApiModelProperty(value = "生成虚拟包跟物料编码")
private String virtualPartRootMaterialNo;
private static final long serialVersionUID = -14147430944632372L;
}

View File

@ -223,6 +223,10 @@ public class BomNewPbomChildEntity implements Serializable {
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType;
@TableField(value = "virtual_part_root_material_no")
@ApiModelProperty(value = "生成虚拟包跟物料编码")
private String virtualPartRootMaterialNo;
private static final long serialVersionUID = -76633783850936076L;
}

View File

@ -315,6 +315,9 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty("0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType;
@ApiModelProperty("生成虚拟包的跟节点物料编码")
private String virtualPartRootMaterialNo;
private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
private static final long serialVersionUID = 1L;

View File

@ -424,7 +424,16 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
* @param targetFacCode
* @return
*/
public List<BomCopyCheckResultVO> copyBomCheck(Long sourceBomRowId, String targetFacCode) throws ExecutionException, InterruptedException {
public List<BomCopyCheckResultVO> copyBomCheck(Long sourceBomRowId, String targetFacCode,Long rowId) throws ExecutionException, InterruptedException {
BomNewPbomParentEntity root = this.getById(sourceBomRowId);
VUtils.isTure(root.getMaterialNo().startsWith("31")).throwMessage("31码物料不能进行复制");
BomNewPbomChildEntity child = pbomChildService.getById(rowId);
if(child.getVirtualPartRootMaterialNo().startsWith("31") && child.getVirtualPartType()>0){
VUtils.isTure(true).throwMessage("31下的虚拟包不能删除");
}
checkCopyBomParam(sourceBomRowId, targetFacCode);
BomCopy bomCopy = new BomCopy(sourceBomRowId, targetFacCode, getAllBom(sourceBomRowId, 0));
bomCopy.check();
@ -434,6 +443,14 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
@Transactional(rollbackFor = Exception.class)
public void copyFrom(CopyPBomParam param) throws ExecutionException, InterruptedException {
BomNewPbomParentEntity root = this.getById(param.getSourceBomRowId());
VUtils.isTure(root.getMaterialNo().startsWith("31")).throwMessage("31码物料不能进行复制");
BomNewPbomChildEntity child = pbomChildService.getById(param.getRowId());
if(child.getVirtualPartRootMaterialNo().startsWith("31") && child.getVirtualPartType()>0){
VUtils.isTure(true).throwMessage("31下的虚拟包不能删除");
}
checkCopyBomParam(param.getSourceBomRowId(), param.getTargetFacCode());
BomCopy bomCopy = new BomCopy(param.getSourceBomRowId(), param.getTargetFacCode(), getAllBom(param.getSourceBomRowId(), 0));
bomCopy.copy(param.getCheckResult());

View File

@ -105,7 +105,7 @@ public abstract class VirtualPackageBase {
* 构建子级
* @return
*/
protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo,VirtualPackageTypeEnum virtualPackageTypeEnum){
protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo,VirtualPackageTypeEnum virtualPackageTypeEnum,String rootMaterialNo){
BomNewEbomChildEntity childEntity =new BomNewEbomChildEntity();
BeanUtil.copyProperties(parent,childEntity);
childEntity.setRowId(IdWorker.getId());
@ -119,6 +119,7 @@ public abstract class VirtualPackageBase {
childEntity.setProjectType("L");
childEntity.setMaterialUnit("PC");
childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
childEntity.setVirtualPartRootMaterialNo(rootMaterialNo);
this.childResult.add(childEntity);
return childEntity;
}

View File

@ -43,8 +43,8 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
//构建构建发货包下直发
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
//构建产品-子级为制作包合直发包
buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE);
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
}
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
@ -53,7 +53,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
makingPackage=getParentZhiZuo();
}
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
}
List<BomNewEbomParentVO> child = getChild();

View File

@ -50,11 +50,11 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(item.getDrawingNo(), item.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
//构建-产品下发货包-子级
buildChild(deliveryPackage, bomRowId, "001", VirtualPackageTypeEnum.DELIVERY_PACKAGE);
buildChild(deliveryPackage, bomRowId, "001", VirtualPackageTypeEnum.DELIVERY_PACKAGE,parent.getMaterialNo());
//构建发货包-子级
buildChild(makingPackage, deliveryPackage.getRowId(), "001", VirtualPackageTypeEnum.MAKING_PACKAGE);
buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
buildChild(makingPackage, deliveryPackage.getRowId(), "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
itemUp.setRowId(item.getRowId());
@ -68,7 +68,7 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
if(Objects.isNull(makingPackage)){
makingPackage=getParentZhiZuo();
}
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
}
}
parent.setVirtrualPackageEnum(getVPackageNum(parent));

View File

@ -30,6 +30,7 @@
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo" />
</resultMap>
<sql id="Base_Column_List">
@ -37,7 +38,7 @@
row_id, parent_row_id, identity_no, order_number, drawing_no, material_no, material_name, material_desc,
material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type,
project_type_input_type, created_by,virtual_part_is, created_time, modify_time, edit_status, exception_status, source,
source_row_id, remark,virtual_part_type
source_row_id, remark,virtual_part_type,virtual_part_root_material_no
</sql>

View File

@ -33,11 +33,12 @@
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="source_parent_material_no" property="sourceParentMaterialNo" jdbcType="VARCHAR"/>
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
row_id, parent_row_id, identity_no, fac_code, order_number, drawing_no, material_no, material_name, material_desc, material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type, production_factory_code,production_factory_code_input_type, set_production_factory_time, super_material_status, virtual_part_is, created_by, created_time, modify_time, source_row_id, remark, source_parent_material_no ,virtual_part_type </sql>
row_id, parent_row_id, identity_no, fac_code, order_number, drawing_no, material_no, material_name, material_desc, material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type, production_factory_code,production_factory_code_input_type, set_production_factory_time, super_material_status, virtual_part_is, created_by, created_time, modify_time, source_row_id, remark, source_parent_material_no ,virtual_part_type ,virtual_part_root_material_no </sql>
<delete id="delByRowId">