PBOM-正式列表搜索
This commit is contained in:
parent
e8d970d593
commit
b502414d32
|
|
@ -147,9 +147,11 @@ public class PBomApi extends BaseApi {
|
||||||
|
|
||||||
@GetMapping("copyBomCheck")
|
@GetMapping("copyBomCheck")
|
||||||
@ApiOperation("复制前检查")
|
@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));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,10 @@ public class BomNewEbomChildEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||||
private Integer virtualPartType;
|
private Integer virtualPartType;
|
||||||
|
|
||||||
|
@TableField(value = "virtual_part_root_material_no")
|
||||||
|
@ApiModelProperty(value = "生成虚拟包跟物料编码")
|
||||||
|
private String virtualPartRootMaterialNo;
|
||||||
|
|
||||||
private static final long serialVersionUID = -14147430944632372L;
|
private static final long serialVersionUID = -14147430944632372L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,10 @@ public class BomNewPbomChildEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||||
private Integer virtualPartType;
|
private Integer virtualPartType;
|
||||||
|
|
||||||
|
@TableField(value = "virtual_part_root_material_no")
|
||||||
|
@ApiModelProperty(value = "生成虚拟包跟物料编码")
|
||||||
|
private String virtualPartRootMaterialNo;
|
||||||
|
|
||||||
private static final long serialVersionUID = -76633783850936076L;
|
private static final long serialVersionUID = -76633783850936076L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,9 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
|
||||||
@ApiModelProperty("0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
@ApiModelProperty("0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||||
private Integer virtualPartType;
|
private Integer virtualPartType;
|
||||||
|
|
||||||
|
@ApiModelProperty("生成虚拟包的跟节点物料编码")
|
||||||
|
private String virtualPartRootMaterialNo;
|
||||||
|
|
||||||
private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
|
private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,16 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
* @param targetFacCode
|
* @param targetFacCode
|
||||||
* @return
|
* @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);
|
checkCopyBomParam(sourceBomRowId, targetFacCode);
|
||||||
BomCopy bomCopy = new BomCopy(sourceBomRowId, targetFacCode, getAllBom(sourceBomRowId, 0));
|
BomCopy bomCopy = new BomCopy(sourceBomRowId, targetFacCode, getAllBom(sourceBomRowId, 0));
|
||||||
bomCopy.check();
|
bomCopy.check();
|
||||||
|
|
@ -434,6 +443,14 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void copyFrom(CopyPBomParam param) throws ExecutionException, InterruptedException {
|
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());
|
checkCopyBomParam(param.getSourceBomRowId(), param.getTargetFacCode());
|
||||||
BomCopy bomCopy = new BomCopy(param.getSourceBomRowId(), param.getTargetFacCode(), getAllBom(param.getSourceBomRowId(), 0));
|
BomCopy bomCopy = new BomCopy(param.getSourceBomRowId(), param.getTargetFacCode(), getAllBom(param.getSourceBomRowId(), 0));
|
||||||
bomCopy.copy(param.getCheckResult());
|
bomCopy.copy(param.getCheckResult());
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public abstract class VirtualPackageBase {
|
||||||
* 构建子级
|
* 构建子级
|
||||||
* @return
|
* @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();
|
BomNewEbomChildEntity childEntity =new BomNewEbomChildEntity();
|
||||||
BeanUtil.copyProperties(parent,childEntity);
|
BeanUtil.copyProperties(parent,childEntity);
|
||||||
childEntity.setRowId(IdWorker.getId());
|
childEntity.setRowId(IdWorker.getId());
|
||||||
|
|
@ -119,6 +119,7 @@ public abstract class VirtualPackageBase {
|
||||||
childEntity.setProjectType("L");
|
childEntity.setProjectType("L");
|
||||||
childEntity.setMaterialUnit("PC");
|
childEntity.setMaterialUnit("PC");
|
||||||
childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
|
childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
|
||||||
|
childEntity.setVirtualPartRootMaterialNo(rootMaterialNo);
|
||||||
this.childResult.add(childEntity);
|
this.childResult.add(childEntity);
|
||||||
return childEntity;
|
return childEntity;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
||||||
//构建构建发货包下直发
|
//构建构建发货包下直发
|
||||||
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
||||||
//构建产品-子级为制作包合直发包
|
//构建产品-子级为制作包合直发包
|
||||||
buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE);
|
buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
|
||||||
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
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()) {
|
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();
|
makingPackage=getParentZhiZuo();
|
||||||
}
|
}
|
||||||
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
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();
|
List<BomNewEbomParentVO> child = getChild();
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,11 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
|
||||||
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(item.getDrawingNo(), item.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
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(makingPackage, deliveryPackage.getRowId(), "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
|
||||||
buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
|
||||||
|
|
||||||
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
|
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
|
||||||
itemUp.setRowId(item.getRowId());
|
itemUp.setRowId(item.getRowId());
|
||||||
|
|
@ -68,7 +68,7 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
|
||||||
if(Objects.isNull(makingPackage)){
|
if(Objects.isNull(makingPackage)){
|
||||||
makingPackage=getParentZhiZuo();
|
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));
|
parent.setVirtrualPackageEnum(getVPackageNum(parent));
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
||||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||||
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
|
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
|
||||||
|
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<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,
|
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,
|
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,
|
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>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,12 @@
|
||||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||||
<result column="source_parent_material_no" property="sourceParentMaterialNo" 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_type" property="virtualPartType" jdbcType="INTEGER"/>
|
||||||
|
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
<!--@mbg.generated-->
|
<!--@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">
|
<delete id="delByRowId">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue