1、变更影响及同步formal表优化
This commit is contained in:
parent
cce1aef1d7
commit
51febf0ef7
|
|
@ -2530,9 +2530,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
if(CollUtil.isNotEmpty(addRowIds)) {
|
if(CollUtil.isNotEmpty(addRowIds)) {
|
||||||
this.getBaseMapper().insertEBomFormalParent(addRowIds);
|
this.getBaseMapper().insertEBomFormalParent(addRowIds);
|
||||||
this.getBaseMapper().insertEBomFormalChild(addRowIds);
|
this.getBaseMapper().insertEBomFormalChild(addRowIds);
|
||||||
|
}
|
||||||
|
if(CollUtil.isNotEmpty(delRowIds)){
|
||||||
//转移后删除
|
//转移后删除
|
||||||
this.getBaseMapper().delEBomHistory(delRowIds);
|
this.getBaseMapper().delEBomHistory(delRowIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@
|
||||||
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
||||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||||
<result column="root_is_for_wait_review" property="rootIsForWaitReview" jdbcType="INTEGER"/>
|
<result column="root_is_for_wait_review" property="rootIsForWaitReview" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
|
|
@ -87,13 +86,16 @@
|
||||||
<!--Ebom工作列表-->
|
<!--Ebom工作列表-->
|
||||||
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||||
<if test="job==0">
|
<if test="job==0">
|
||||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where created_by=#{createdBy} and (user_root_is=1 or root_is_for_wait_review=1) and
|
select * ,row_id as bomRowId from t_bom_new_ebom_parent where created_by=#{createdBy} and (user_root_is=1 or
|
||||||
|
root_is_for_wait_review=1) and
|
||||||
(status=1 or status=3)
|
(status=1 or status=3)
|
||||||
<include refid="whr"/>
|
<include refid="whr"/>
|
||||||
order by created_time desc
|
order by created_time desc
|
||||||
</if>
|
</if>
|
||||||
<if test="job==1">
|
<if test="job==1">
|
||||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where ((((user_root_is=1 and created_by=#{createdBy}) or root_is=1) and status=2) or (created_by=#{createdBy} and user_root_is=1 and (status=1 or status=3)))
|
select * ,row_id as bomRowId from t_bom_new_ebom_parent where ((((user_root_is=1 and
|
||||||
|
created_by=#{createdBy}) or root_is=1) and status=2) or (created_by=#{createdBy} and user_root_is=1 and
|
||||||
|
(status=1 or status=3)))
|
||||||
<include refid="whr"/>
|
<include refid="whr"/>
|
||||||
order by created_time desc
|
order by created_time desc
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -114,14 +116,12 @@
|
||||||
<if test="technicianIs==1 ">
|
<if test="technicianIs==1 ">
|
||||||
(created_by=#{createdBy} or status=2 )
|
(created_by=#{createdBy} or status=2 )
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
and material_no in
|
and material_no in
|
||||||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
group by material_no ) b on a.material_no=b.material_no and a.current_version=b.current_version
|
group by material_no ) b on a.material_no=b.material_no and a.current_version=b.current_version
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- <!–物料编码搜索-父级–>-->
|
<!-- <!–物料编码搜索-父级–>-->
|
||||||
|
|
@ -183,11 +183,9 @@
|
||||||
<if test="createdBy!=null and createdBy!=''">
|
<if test="createdBy!=null and createdBy!=''">
|
||||||
and b.created_by=#{createdBy}
|
and b.created_by=#{createdBy}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--BOM-正式工作表-->
|
<!--BOM-正式工作表-->
|
||||||
<select id="formalWorksheet" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
<select id="formalWorksheet" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||||
select * , row_id as bomRowId
|
select * , row_id as bomRowId
|
||||||
|
|
@ -263,8 +261,10 @@
|
||||||
|
|
||||||
<update id="updateRootState">
|
<update id="updateRootState">
|
||||||
update t_bom_new_ebom_parent
|
update t_bom_new_ebom_parent
|
||||||
set root_is=0, user_root_is=0
|
set root_is=0,
|
||||||
where last_version_is = 1 AND `status` < 4;
|
user_root_is=0
|
||||||
|
where last_version_is = 1
|
||||||
|
AND `status` < 4;
|
||||||
|
|
||||||
|
|
||||||
update t_bom_new_ebom_parent a left join (
|
update t_bom_new_ebom_parent a left join (
|
||||||
|
|
@ -282,18 +282,20 @@
|
||||||
) b
|
) b
|
||||||
on a.material_no=b.material_no and a.created_by=b.created_by
|
on a.material_no=b.material_no and a.created_by=b.created_by
|
||||||
set a.user_root_is=1
|
set a.user_root_is=1
|
||||||
where a.`status` < 4
|
where a.`status`
|
||||||
|
< 4
|
||||||
and b.row_id is null
|
and b.row_id is null
|
||||||
and a.last_version_is = 1
|
and a.last_version_is = 1
|
||||||
AND a.virtual_package_is = 0;
|
AND a.virtual_package_is = 0;
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
<!--更新-待复核根节点-->
|
<!--更新-待复核根节点-->
|
||||||
<update id="updateRootForWaitReview">
|
<update id="updateRootForWaitReview">
|
||||||
update t_bom_new_ebom_parent set root_is_for_wait_review=0 ;
|
update t_bom_new_ebom_parent
|
||||||
|
set root_is_for_wait_review=0;
|
||||||
update t_bom_new_ebom_parent a left join (
|
update t_bom_new_ebom_parent a left join (
|
||||||
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` in (1,3) and last_version_is=1
|
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` in (1,3) and last_version_is=1
|
||||||
) b on a.material_no=b.material_no
|
) b
|
||||||
|
on a.material_no=b.material_no
|
||||||
set a.root_is_for_wait_review=1
|
set a.root_is_for_wait_review=1
|
||||||
where a.`status` in (1, 3) and last_version_is=1 and b.row_id is null;
|
where a.`status` in (1, 3) and last_version_is=1 and b.row_id is null;
|
||||||
</update>
|
</update>
|
||||||
|
|
@ -325,13 +327,17 @@
|
||||||
|
|
||||||
<!--检查是否已发布数据的跟节点-->
|
<!--检查是否已发布数据的跟节点-->
|
||||||
<select id="checkIsRoot" resultType="java.lang.Integer">
|
<select id="checkIsRoot" resultType="java.lang.Integer">
|
||||||
select COUNT(1) from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status`=4
|
select COUNT(1)
|
||||||
|
from t_bom_new_ebom_parent a
|
||||||
|
join t_bom_new_ebom_child b on a.row_id = b.parent_row_id and a.`status` = 4
|
||||||
and b.material_no = #{materialNo}
|
and b.material_no = #{materialNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--检查是否已发布数据的用户跟节点-->
|
<!--检查是否已发布数据的用户跟节点-->
|
||||||
<select id="checkIsUserRoot" resultType="java.lang.Integer">
|
<select id="checkIsUserRoot" resultType="java.lang.Integer">
|
||||||
select COUNT(1) from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status`=4
|
select COUNT(1)
|
||||||
|
from t_bom_new_ebom_parent a
|
||||||
|
join t_bom_new_ebom_child b on a.row_id = b.parent_row_id and a.`status` = 4
|
||||||
and b.material_no = #{materialNo} and b.created_by = #{jobNo}
|
and b.material_no = #{materialNo} and b.created_by = #{jobNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -351,7 +357,10 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
||||||
select COUNT(1) from t_bom_new_ebom_child where material_no=#{materialNo} and edit_status=1
|
select COUNT(1)
|
||||||
|
from t_bom_new_ebom_child
|
||||||
|
where material_no = #{materialNo}
|
||||||
|
and edit_status = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaterialParent" resultType="java.lang.String">
|
<select id="getMaterialParent" resultType="java.lang.String">
|
||||||
|
|
@ -380,7 +389,8 @@
|
||||||
|
|
||||||
<select id="getEBomParentByMaterialNos" resultType="com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity">
|
<select id="getEBomParentByMaterialNos" resultType="com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity">
|
||||||
<if test="job==0">
|
<if test="job==0">
|
||||||
select * from t_bom_new_ebom_parent where created_by=#{createdBy} and last_version_is=1 and status in (1 ,3) and material_no in
|
select * from t_bom_new_ebom_parent where created_by=#{createdBy} and last_version_is=1 and status in (1 ,3)
|
||||||
|
and material_no in
|
||||||
<foreach collection="materialNos" item="item" open="(" close=")" separator=",">
|
<foreach collection="materialNos" item="item" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
@ -533,18 +543,24 @@
|
||||||
<foreach collection="parentRowIds" item="item" index="index" open="(" close=")" separator=",">
|
<foreach collection="parentRowIds" item="item" index="index" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertEBomFormalChild">
|
<insert id="insertEBomFormalChild">
|
||||||
INSERT INTO `t_bom_new_ebom_child_formal` (`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`, `virtual_part_root_material_no`, `bom_version_row_id`)
|
INSERT INTO `t_bom_new_ebom_child_formal` (`row_id`, `parent_row_id`, `identity_no`, `order_number`,
|
||||||
select `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`, `virtual_part_root_material_no`, `bom_version_row_id`
|
`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`, `virtual_part_root_material_no`, `bom_version_row_id`)
|
||||||
|
select `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`,
|
||||||
|
`virtual_part_root_material_no`, `bom_version_row_id`
|
||||||
from t_bom_new_ebom_child a
|
from t_bom_new_ebom_child a
|
||||||
where parent_row_id in
|
where parent_row_id in
|
||||||
<foreach collection="parentRowIds" item="parentRowId" open="(" separator="," close=")">
|
<foreach collection="parentRowIds" item="parentRowId" open="(" separator="," close=")">
|
||||||
#{parentRowId}
|
#{parentRowId}
|
||||||
</foreach>
|
</foreach>
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<delete id="delEBomHistory">
|
<delete id="delEBomHistory">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue