1、BUG修复
This commit is contained in:
parent
a5e5dd1827
commit
840de12bfe
|
|
@ -54,7 +54,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
|
|
||||||
List<BomNewEbomParentVO> getParentForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList ,@Param("dataType") Integer dataType);
|
List<BomNewEbomParentVO> getParentForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList ,@Param("dataType") Integer dataType);
|
||||||
|
|
||||||
List<BomNewEbomParentVO> getChildForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList,@Param("materialNo") String materialNo,@Param("dataType") Integer dataType );
|
List<BomNewEbomParentVO> getChildForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList,@Param("bomRowIds") Collection<Long> bomRowIds );
|
||||||
|
|
||||||
void updateRootState();
|
void updateRootState();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
materialNos.addAll(parentMaterialByMaterialNo);
|
materialNos.addAll(parentMaterialByMaterialNo);
|
||||||
if (CollUtil.isNotEmpty(materialNos)) {
|
if (CollUtil.isNotEmpty(materialNos)) {
|
||||||
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(materialNos, query.getDataType());
|
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(materialNos, query.getDataType());
|
||||||
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(materialNos, materialNo, query.getDataType());
|
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(materialNos, parents.stream().map(u->u.getRowId()).collect(Collectors.toSet()));
|
||||||
List<BomNewEbomParentVO> data = new ArrayList<>();
|
List<BomNewEbomParentVO> data = new ArrayList<>();
|
||||||
data.addAll(parents);
|
data.addAll(parents);
|
||||||
data.addAll(childs);
|
data.addAll(childs);
|
||||||
|
|
|
||||||
|
|
@ -98,40 +98,80 @@
|
||||||
|
|
||||||
<!--物料编码搜索-父级-->
|
<!--物料编码搜索-父级-->
|
||||||
<select id="getParentForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
<select id="getParentForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||||
SELECT if(status=4 and #{dataType}!=1, 99,status) status, created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
SELECT status , created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
||||||
FROM t_bom_new_ebom_parent a where a.last_version_is=1
|
FROM t_bom_new_ebom_parent a
|
||||||
<!-- <if test="dataType!=1 and !hasParentIs" >-->
|
join (select material_no,max(current_version) current_version from t_bom_new_ebom_parent where
|
||||||
|
<if test="dataType==1" >
|
||||||
|
a.status = 4
|
||||||
|
</if>
|
||||||
|
<if test="dataType==0" >
|
||||||
|
and a.status < 4
|
||||||
|
</if>
|
||||||
|
and material_no in
|
||||||
|
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
group by material_no ) b on a.material_no=b.material_no and a.current_version=b.current_version
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- <!–物料编码搜索-父级–>-->
|
||||||
|
<!-- <select id="getParentForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">-->
|
||||||
|
<!-- SELECT if(status=4 and #{dataType}!=1, 99,status) status, created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*-->
|
||||||
|
<!-- FROM t_bom_new_ebom_parent a where a.last_version_is=1-->
|
||||||
|
<!--<!– <if test="dataType!=1 and !hasParentIs" >–>-->
|
||||||
|
<!--<!– and a.status < 4–>-->
|
||||||
|
<!--<!– </if>–>-->
|
||||||
|
<!-- <if test="dataType==1">-->
|
||||||
|
<!-- and a.status = 4-->
|
||||||
|
<!-- </if>-->
|
||||||
|
|
||||||
|
<!-- and material_no in-->
|
||||||
|
<!-- <foreach collection="materialNoList" item="item" open="(" separator="," close=")">-->
|
||||||
|
<!-- #{item}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- </select>-->
|
||||||
|
<!--物料编码搜索-子级-->
|
||||||
|
<!-- <select id="getChildForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">-->
|
||||||
|
<!-- select if(#{dataType}!=1 and c.status=4,99,c.status) as status ,c.current_version , c.created_by as bomCreatedBy-->
|
||||||
|
<!-- ,c.devise_name,c.devise_user_code,c.dept_name ,-->
|
||||||
|
<!-- c.source, if(c.row_id is null,0,c.row_id) as bomRowId, c.row_id as childBomRowId, b.*-->
|
||||||
|
<!-- from t_bom_new_ebom_parent a-->
|
||||||
|
<!-- join t_bom_new_ebom_child b on a.row_id =b.parent_row_id-->
|
||||||
|
<!-- left join t_bom_new_ebom_parent c on b.material_no=c.material_no and c.last_version_is=1-->
|
||||||
|
<!-- where a.last_version_is=1-->
|
||||||
|
<!-- <if test="dataType!=1">-->
|
||||||
<!-- and a.status < 4-->
|
<!-- and a.status < 4-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
<if test="dataType==1">
|
<!-- <if test="dataType==1">-->
|
||||||
and a.status = 4
|
<!-- and a.status = 4-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
<!-- and ( b.material_no in-->
|
||||||
|
<!-- <foreach collection="materialNoList" item="item" open="(" separator="," close=")">-->
|
||||||
|
<!-- #{item}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- or b.material_no=#{materialNo})-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
and material_no in
|
|
||||||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
<!--物料编码搜索-子级-->
|
<!--物料编码搜索-子级-->
|
||||||
<select id="getChildForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
<select id="getChildForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||||
select if(#{dataType}!=1 and c.status=4,99,c.status) as status ,c.current_version , c.created_by as bomCreatedBy
|
select a.status ,a.current_version , a.created_by as bomCreatedBy,
|
||||||
,c.devise_name,c.devise_user_code,c.dept_name ,
|
a.devise_name ,a.devise_user_code
|
||||||
c.source, if(c.row_id is null,0,c.row_id) as bomRowId, c.row_id as childBomRowId, b.*
|
,a.dept_name,a.source,ifnull( a.row_id,0) as bomRowId
|
||||||
from t_bom_new_ebom_parent a
|
,ifnull( a.row_id,0) as childBomRowId, b.* from t_bom_new_ebom_child b
|
||||||
join t_bom_new_ebom_child b on a.row_id =b.parent_row_id
|
left join t_bom_new_ebom_parent a on a.material_no=b.material_no and a.row_id in
|
||||||
left join t_bom_new_ebom_parent c on b.material_no=c.material_no and c.last_version_is=1
|
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">
|
||||||
where a.last_version_is=1
|
#{item}
|
||||||
<if test="dataType!=1">
|
</foreach>
|
||||||
and a.status < 4
|
where b.parent_row_id in
|
||||||
</if>
|
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">
|
||||||
<if test="dataType==1">
|
#{item}
|
||||||
and a.status = 4
|
</foreach>
|
||||||
</if>
|
and b.material_no in
|
||||||
and ( b.material_no in
|
|
||||||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
or b.material_no=#{materialNo})
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--BOM-正式工作表-->
|
<!--BOM-正式工作表-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue