1、查询
This commit is contained in:
parent
046a0b4854
commit
ecbbe43059
|
|
@ -50,9 +50,16 @@ public interface BomNewOriginalParentMapper extends BaseMapper<BomNewOriginalPar
|
|||
|
||||
List<String> getDrawingNoByMaterialNos(@Param("materialNos") List<String> materialNos);
|
||||
|
||||
/**
|
||||
* 待转时,是否包含已审的
|
||||
* @param drawingNos
|
||||
* @param state
|
||||
* @param InHasConvertBomIs
|
||||
* @return
|
||||
*/
|
||||
List<BomOriginalListVO> getParentForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos ,@Param("state") Integer state);
|
||||
|
||||
List<BomOriginalListVO> getChildForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos);
|
||||
List<BomOriginalListVO> getChildForDrawingNoSeach(@Param("drawingNos") List<String> drawingNos,@Param("state") Integer state);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -114,11 +114,18 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(materialNo)) {
|
||||
List<BomNewEbomParentEntity> materialBoms = this.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo,materialNo).eq(BomNewEbomParentEntity::getLastVersionIs, 1)
|
||||
.ne(BomNewEbomParentEntity::getStatus,EBomStatusEnum.PUBLISHED.getValue()).list();
|
||||
if(query.getDataType().equals(0) && CollUtil.isEmpty(materialBoms) ){
|
||||
return returnResult;
|
||||
}
|
||||
List<String> materialNos=new ArrayList<>();
|
||||
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()).stream().collect(Collectors.toList());
|
||||
parentMaterialByMaterialNo.add(materialNo);
|
||||
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
||||
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo, query.getDataType());
|
||||
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo,query.getDataType());
|
||||
materialNos.add(materialNo);
|
||||
materialNos.addAll(parentMaterialByMaterialNo);
|
||||
if (CollUtil.isNotEmpty(materialNos)) {
|
||||
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(materialNos, query.getDataType());
|
||||
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(materialNos, materialNo,query.getDataType());
|
||||
List<BomNewEbomParentVO> data = new ArrayList<>();
|
||||
data.addAll(parents);
|
||||
data.addAll(childs);
|
||||
|
|
|
|||
|
|
@ -146,18 +146,24 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
if (CollUtil.isNotEmpty(query.getMaterialNos()) || CollUtil.isNotEmpty(query.getDrawingNos())) {
|
||||
List<String> queryDrawingNos = new ArrayList<>();
|
||||
queryDrawingNos.addAll(query.getDrawingNos());
|
||||
List<String> drawingParentNos=new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(query.getMaterialNos())) {
|
||||
List<String> drawingNos = this.getBaseMapper().getDrawingNoByMaterialNos(query.getMaterialNos());
|
||||
if (CollUtil.isNotEmpty(drawingNos)) {
|
||||
queryDrawingNos.addAll(drawingNos);
|
||||
drawingParentNos = this.getBaseMapper().getDrawingNoByMaterialNos(query.getMaterialNos());
|
||||
if (CollUtil.isNotEmpty(drawingParentNos)) {
|
||||
queryDrawingNos.addAll(drawingParentNos);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(queryDrawingNos)) {
|
||||
List<BomNewOriginalParentEntity> materialBoms = this.lambdaQuery().in(BomNewOriginalParentEntity::getDrawingNo, queryDrawingNos).eq(BomNewOriginalParentEntity::getLastVersionIs, 1)
|
||||
.eq(BomNewOriginalParentEntity::getStatus, OriginalStatusEnum.UN_CONVERT.getValue()).list();
|
||||
if(query.getStatus().equals(1) && CollUtil.isEmpty(materialBoms)){
|
||||
return result;
|
||||
}
|
||||
List<String> parentDrawingNos = getParentDrawingNoByMaterialNo(queryDrawingNos).stream().collect(Collectors.toList());
|
||||
parentDrawingNos.addAll(queryDrawingNos);
|
||||
if (CollUtil.isNotEmpty(parentDrawingNos)) {
|
||||
List<BomOriginalListVO> parents = this.getBaseMapper().getParentForDrawingNoSeach(parentDrawingNos, query.getStatus());
|
||||
List<BomOriginalListVO> childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos);
|
||||
List<BomOriginalListVO> childs = this.getBaseMapper().getChildForDrawingNoSeach(parentDrawingNos,query.getStatus());
|
||||
List<BomOriginalListVO> data = new ArrayList<>();
|
||||
data.addAll(parents);
|
||||
data.addAll(childs);
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@
|
|||
|
||||
<!--物料编码搜索-父级-->
|
||||
<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 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 a.status < 4
|
||||
</if>
|
||||
<if test="dataType=1">
|
||||
<!-- <if test="dataType!=1 and !hasParentIs" >-->
|
||||
<!-- and a.status < 4-->
|
||||
<!-- </if>-->
|
||||
<if test="dataType==1">
|
||||
and a.status = 4
|
||||
</if>
|
||||
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
</select>
|
||||
<!--物料编码搜索-子级-->
|
||||
<select id="getChildForMaterialNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||
select if(c.status=4,99,c.status) as status ,c.current_version , c.created_by as bomCreatedBy
|
||||
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
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
<if test="dataType!=1">
|
||||
and a.status < 4
|
||||
</if>
|
||||
<if test="dataType=1">
|
||||
<if test="dataType==1">
|
||||
and a.status = 4
|
||||
</if>
|
||||
and ( b.material_no in
|
||||
|
|
|
|||
|
|
@ -189,11 +189,14 @@
|
|||
|
||||
<!--物料编码搜索-父级-->
|
||||
<select id="getParentForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
||||
SELECT created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
||||
SELECT if(#{state}=1 and status=2,3,status) as status, created_by as bomCreatedBy , row_id as bomRowId, row_id as childBomRowId, a.*
|
||||
FROM t_bom_new_original_parent a where 1=1
|
||||
<if test="state==1">
|
||||
and a.last_version_is=1 and status=1
|
||||
</if>
|
||||
<!-- <if test="state==1">-->
|
||||
<!-- and a.last_version_is=1-->
|
||||
<!-- <if test="InHasConvertBomIs">-->
|
||||
<!-- and a.status=1-->
|
||||
<!-- </if>-->
|
||||
<!-- </if>-->
|
||||
<if test="state==2">
|
||||
and current_version in ( select current_version from t_bom_new_original_parent where status >1 and drawing_no in
|
||||
<foreach collection="drawingNos" item="item" open="(" separator="," close=")">
|
||||
|
|
@ -209,7 +212,7 @@
|
|||
</select>
|
||||
<!--物料编码搜索-子级-->
|
||||
<select id="getChildForDrawingNoSeach" resultType="com.nflg.product.bomnew.pojo.vo.BomOriginalListVO">
|
||||
select if(c.status=2,3,c.status) as status ,c.current_version , c.created_by as bomCreatedBy
|
||||
select if(#{state}=1 and c.status=2,3,c.status) as status ,c.current_version , c.created_by as bomCreatedBy
|
||||
,c.devise_name,c.devise_user_code,c.dept_name ,
|
||||
c.source, c.row_id as bomRowId, c.row_id as childBomRowId, b.*
|
||||
from t_bom_new_original_parent a
|
||||
|
|
|
|||
Loading…
Reference in New Issue