1、315问题修复

This commit is contained in:
大米 2024-03-15 18:51:38 +08:00
parent 6a5062cede
commit 72eb9aa439
3 changed files with 21 additions and 6 deletions

View File

@ -54,9 +54,9 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
Set<String> getSelfParentMaterialNo(@Param("createdBy") String createdBy ,@Param("list") Set<String> list); Set<String> getSelfParentMaterialNo(@Param("createdBy") String createdBy ,@Param("list") Set<String> list);
List<BomNewEbomParentVO> getParentForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList); List<BomNewEbomParentVO> getParentForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList ,@Param("dataType") Integer dataType);
List<BomNewEbomParentVO> getChildForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList,@Param("materialNo") String materialNo); List<BomNewEbomParentVO> getChildForMaterialNoSeach(@Param("materialNoList") List<String> materialNoList,@Param("materialNo") String materialNo,@Param("dataType") Integer dataType );
void updateRootState(); void updateRootState();

View File

@ -117,8 +117,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList()); List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList());
parentMaterialByMaterialNo.add(materialNo); parentMaterialByMaterialNo.add(materialNo);
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) { if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo); List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo, query.getDataType());
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo); List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo,query.getDataType());
List<BomNewEbomParentVO> data = new ArrayList<>(); List<BomNewEbomParentVO> data = new ArrayList<>();
data.addAll(parents); data.addAll(parents);
data.addAll(childs); data.addAll(childs);

View File

@ -95,7 +95,15 @@
<!--物料编码搜索-父级--> <!--物料编码搜索-父级-->
<select id="getParentForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO"> <select id="getParentForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
SELECT created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.* SELECT 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 and a.status &lt; 4 and material_no in FROM t_bom_new_ebom_parent a where a.last_version_is=1
<if test="dataType!=1">
and a.status &lt; 4
</if>
<if test="dataType=1">
and a.status = 4
</if>
and material_no in
<foreach collection="materialNoList" item="item" open="(" separator="," close=")"> <foreach collection="materialNoList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
@ -108,7 +116,14 @@
from t_bom_new_ebom_parent a from t_bom_new_ebom_parent a
join t_bom_new_ebom_child b on a.row_id =b.parent_row_id 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 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 and a.status &lt; 4 and ( b.material_no in where a.last_version_is=1
<if test="dataType!=1">
and a.status &lt; 4
</if>
<if test="dataType=1">
and a.status = 4
</if>
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>