Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom
This commit is contained in:
commit
b684e161ca
|
|
@ -2,25 +2,28 @@ package com.nflg.product.bomnew.pojo.entity;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* t_bom_new_ebom_child
|
||||
*
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-14 11:50:34
|
||||
* @since 2023-12-29 14:01:47
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-entity-BomNewEbomChildEntity")
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-entity-BomNewEbomChildEntity")
|
||||
@TableName(value = "t_bom_new_ebom_child")
|
||||
public class BomNewEbomChildEntity implements Serializable {
|
||||
|
||||
|
|
@ -130,10 +133,10 @@ public class BomNewEbomChildEntity implements Serializable {
|
|||
private String projectType;
|
||||
|
||||
/**
|
||||
* 项目类别输入方式: 0-自动匹配 1-手工录入 3-来自物料主数据 4-来自历史统计
|
||||
* 项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计
|
||||
*/
|
||||
@TableField(value = "project_type_input_type")
|
||||
@ApiModelProperty(value = "项目类别输入方式: 0-自动匹配 1-手工录入 3-来自物料主数据 4-来自历史统计")
|
||||
@ApiModelProperty(value = "项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计")
|
||||
private Integer projectTypeInputType;
|
||||
|
||||
/**
|
||||
|
|
@ -143,6 +146,13 @@ public class BomNewEbomChildEntity implements Serializable {
|
|||
@ApiModelProperty(value = "创建人工号")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 是否虚拟件 0-否 1-是
|
||||
*/
|
||||
@TableField(value = "virtual_part_is")
|
||||
@ApiModelProperty(value = "是否虚拟件 0-否 1-是")
|
||||
private Integer virtualPartIs;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
|
@ -192,6 +202,6 @@ public class BomNewEbomChildEntity implements Serializable {
|
|||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 556727442146359439L;
|
||||
private static final long serialVersionUID = -14147430944632372L;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
package com.nflg.product.bomnew.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* t_bom_new_ebom_parent
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-14 10:49:34
|
||||
* @since 2023-12-29 14:00:31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -123,20 +125,6 @@ public class BomNewEbomParentEntity implements Serializable {
|
|||
@ApiModelProperty(value = "来源1-原BOM转换 2-EXCE导入 3-MDM创建")
|
||||
private Integer source;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
*/
|
||||
@TableField(value = "project_type")
|
||||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 项目类别输入方式: 0-自动匹配 1-手工录入 3-来自物料主数据 4-来自历史统计
|
||||
*/
|
||||
@TableField(value = "project_type_input_type")
|
||||
@ApiModelProperty(value = "项目类别输入方式: 0-自动匹配 1-手工录入 3-来自物料主数据 4-来自历史统计")
|
||||
private Integer projectTypeInputType;
|
||||
|
||||
/**
|
||||
* 是否跟节点 0-否 1-是
|
||||
*/
|
||||
|
|
@ -144,10 +132,6 @@ public class BomNewEbomParentEntity implements Serializable {
|
|||
@ApiModelProperty(value = "是否跟节点 0-否 1-是")
|
||||
private Integer rootIs;
|
||||
|
||||
@TableField(value = "virtrual_package_enum")
|
||||
@ApiModelProperty("已生成的虚拟包 0-无 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||
private Integer virtrualPackageEnum;
|
||||
|
||||
/**
|
||||
* 是否应该有BOM 0-否 1-是
|
||||
*/
|
||||
|
|
@ -198,14 +182,34 @@ public class BomNewEbomParentEntity implements Serializable {
|
|||
private Integer userRootIs;
|
||||
|
||||
/**
|
||||
* 异常状态:1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常
|
||||
* 已生成的虚拟包 0-无 1-发货包 2-制作包 4-直发包 8-发货前装配包
|
||||
*/
|
||||
@TableField(value = "virtrual_package_enum")
|
||||
@ApiModelProperty(value = "已生成的虚拟包 0-无 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||
private Integer virtrualPackageEnum;
|
||||
|
||||
/**
|
||||
* -1=初始状态 1=正常 2=冻结/完全弃用异常:物料的状态冻结或者完全弃用的状态 3=递归异常:出现子级包含父级的异常情况(打在子级物料中的那个父级物料编码)4=数据不完整异常:物料编号或数量没有填写 5=超级物料异常:超级物料待说明 6=重复异常:当前层级包含了相同的物料信息
|
||||
* 7=物料主数据不存在:当前的物料信息在主数据平台不存在 8=项目类别为空
|
||||
* 9=项目赋值异常:当父级物料的项目类型为Q时,子级中不能存在项目类别为Q的物料
|
||||
* <p>
|
||||
* 10=项目赋值异常:当父级物料的项目类型为F时,子级中不能存在项目类型为F的物料
|
||||
* <p>
|
||||
* 11=未填写变更原因和技术通知单
|
||||
* <p>
|
||||
* 12=数量需要用户确认
|
||||
* <p>
|
||||
* 13=项目类型需要用户确认
|
||||
*/
|
||||
@TableField(value = "exception_status")
|
||||
@ApiModelProperty(value = "异常状态:1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常")
|
||||
@ApiModelProperty(value = "-1=初始状态 1=正常 2=冻结/完全弃用异常:物料的状态冻结或者完全弃用的状态 3=递归异常:出现子级包含父级的异常情况(打在子级物料中的那个父级物料编码)4=数据不完整异常:物料编号或数量没有填写 5=超级物料异常:超级物料待说明 6=重复异常:当前层级包含了相同的物料信息 7= 物料主数据不存在:当前的物料信息在主数据平台不存在 8=项目类别为空 9=项目赋值异常:当父级物料的项目类型为Q时,子级中不能存在项目类别为Q的物料 10=项目赋值异常:当父级物料的项目类型为F时,子级中不能存在项目类型为F的物料 11=未填写变更原因和技术通知单 12=数量需要用户确认 13=项目类型需要用户确认")
|
||||
private Integer exceptionStatus;
|
||||
|
||||
/**
|
||||
* 是否虚拟包 0-否 1-是
|
||||
*/
|
||||
@TableField(value = "virtual_package_is")
|
||||
@ApiModelProperty("是否虚拟包 0-否 1-是")
|
||||
@ApiModelProperty(value = "是否虚拟包 0-否 1-是")
|
||||
private Integer virtualPackageIs;
|
||||
|
||||
/**
|
||||
|
|
@ -348,6 +352,5 @@ public class BomNewEbomParentEntity implements Serializable {
|
|||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
private static final long serialVersionUID = -84596616775263436L;
|
||||
|
||||
private static final long serialVersionUID = 265246823929418418L;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,6 +305,9 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
|
|||
|
||||
|
||||
|
||||
@ApiModelProperty("是否虚拟件")
|
||||
private Integer virtualPartIs;
|
||||
|
||||
private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -356,17 +356,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
task.initProjectType();
|
||||
List<BomNewEbomParentVO> allList = task.getAllChild();
|
||||
List<BomNewEbomParentVO> parentResult = allList.stream().filter(u -> u.getParentRowId() > 0 && StrUtil.isNotBlank(u.getProjectType())).collect(Collectors.toList());
|
||||
List<BomNewEbomParentEntity> parents = new ArrayList<>();
|
||||
List<BomNewEbomChildEntity> child = new ArrayList<>();
|
||||
parentResult.forEach(u -> {
|
||||
BomNewEbomParentEntity parentEntity = new BomNewEbomParentEntity();
|
||||
parentEntity.setRowId(u.getParentRowId());
|
||||
parentEntity.setProjectType(u.getProjectType());
|
||||
parentEntity.setProjectTypeInputType(u.getProjectTypeInputType());
|
||||
parents.add(parentEntity);
|
||||
});
|
||||
|
||||
List<BomNewEbomParentVO> childntResult = allList.stream().filter(u -> u.getBomRowId() > 0 && StrUtil.isNotBlank(u.getProjectType())).collect(Collectors.toList());
|
||||
parentResult.forEach(u -> {
|
||||
BomNewEbomChildEntity childEntity = new BomNewEbomChildEntity();
|
||||
childEntity.setRowId(u.getRowId());
|
||||
|
|
@ -374,9 +364,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
childEntity.setProjectTypeInputType(u.getProjectTypeInputType());
|
||||
child.add(childEntity);
|
||||
});
|
||||
if (CollUtil.isNotEmpty(parents)) {
|
||||
this.updateBatchById(parents);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(child)) {
|
||||
ebomChildService.updateBatchById(child);
|
||||
}
|
||||
|
|
@ -946,11 +934,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
if (CollectionUtil.isNotEmpty(bomRowIdList)) {
|
||||
UpdateWrapper<BomNewEbomParentEntity> parentUpdate = new UpdateWrapper<>();
|
||||
parentUpdate.lambda()
|
||||
.set(BomNewEbomParentEntity::getProjectType, dto.getProjectType())
|
||||
.set(BomNewEbomParentEntity::getModifyTime, LocalDateTime.now())
|
||||
.set(BomNewEbomParentEntity::getProjectTypeInputType, ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue())
|
||||
.in(BomNewEbomParentEntity::getRowId, bomRowIdList);
|
||||
// parentUpdate.lambda()
|
||||
// .set(BomNewEbomParentEntity::getProjectType, dto.getProjectType())
|
||||
// .set(BomNewEbomParentEntity::getModifyTime, LocalDateTime.now())
|
||||
// .set(BomNewEbomParentEntity::getProjectTypeInputType, ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue())
|
||||
// .in(BomNewEbomParentEntity::getRowId, bomRowIdList);
|
||||
this.update(parentUpdate);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||
<result column="project_type_input_type" property="projectTypeInputType" jdbcType="INTEGER"/>
|
||||
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
||||
<result column="virtual_part_is" property="virtualPartIs" jdbcType="INTEGER"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="edit_status" property="editStatus" jdbcType="INTEGER"/>
|
||||
|
|
@ -34,7 +35,7 @@
|
|||
<!--@mbg.generated-->
|
||||
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, 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
|
||||
</sql>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
<result column="current_version" property="currentVersion" jdbcType="VARCHAR"/>
|
||||
<result column="num" property="num" jdbcType="DECIMAL"/>
|
||||
<result column="source" property="source" jdbcType="INTEGER"/>
|
||||
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||
<result column="project_type_input_type" property="projectTypeInputType" jdbcType="INTEGER"/>
|
||||
<result column="root_is" property="rootIs" jdbcType="INTEGER"/>
|
||||
<result column="virtrual_package_enum" property="virtrualPackageEnum"/>
|
||||
<result column="should_bom_exist" property="shouldBomExist" jdbcType="INTEGER"/>
|
||||
|
|
@ -56,7 +54,7 @@
|
|||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
row_id, batch_no, drawing_no, material_no, order_number, material_name, material_desc, material_texture,
|
||||
material_unit, unit_weight, total_weight, current_version, num, source, project_type, project_type_input_type,
|
||||
material_unit, unit_weight, total_weight, current_version, num, source,
|
||||
root_is,virtrual_package_enum, should_bom_exist, super_material_status, bom_exist, last_version_is, edit_status,
|
||||
status, user_root_is, exception_status,virtual_package_is, source_row_id, devise_user_code, devise_name,
|
||||
created_by, created_time, created_job, audit_time, audit_user_name, release_time, release_user_name,
|
||||
|
|
@ -99,9 +97,6 @@
|
|||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
<!--物料编码搜索-子级-->
|
||||
<select id="getChildForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||
|
|
@ -114,7 +109,8 @@
|
|||
where a.last_version_is=1 and ( b.material_no in
|
||||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach> or b.material_no=#{materialNo})
|
||||
</foreach>
|
||||
or b.material_no=#{materialNo})
|
||||
</select>
|
||||
|
||||
<!--BOM-正式工作表-->
|
||||
|
|
@ -172,30 +168,35 @@
|
|||
</select>
|
||||
|
||||
<select id="getSelfParentMaterialNo" resultType="java.lang.String">
|
||||
select material_no from t_bom_new_ebom_parent where last_version_is=1 and created_by=#{createdBy} and material_no in
|
||||
select material_no from t_bom_new_ebom_parent where last_version_is=1 and created_by=#{createdBy} and
|
||||
material_no in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateRootState">
|
||||
update t_bom_new_ebom_parent set root_is=0,user_root_is=0 where last_version_is=1;
|
||||
update t_bom_new_ebom_parent
|
||||
set root_is=0,
|
||||
user_root_is=0
|
||||
where last_version_is = 1;
|
||||
update t_bom_new_ebom_parent a join (
|
||||
select a.row_id from t_bom_new_ebom_parent a
|
||||
left join t_bom_new_ebom_child b
|
||||
on a.material_no=b.material_no
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.root_is=1;
|
||||
where a.last_version_is=1 and b.row_id is null ) t
|
||||
on a.row_id=t.row_id set a.root_is=1;
|
||||
|
||||
|
||||
update t_bom_new_ebom_parent a join (
|
||||
select a.row_id from t_bom_new_ebom_parent a
|
||||
left join t_bom_new_ebom_child b
|
||||
on a.material_no=b.material_no and a.created_by=b.created_by
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.user_root_is=1;
|
||||
where a.last_version_is=1 and b.row_id is null ) t
|
||||
on a.row_id=t.row_id set a.user_root_is=1;
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<delete id="delBatch">
|
||||
delete from t_bom_new_ebom_parent where row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
|
|
@ -213,7 +214,4 @@
|
|||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue