Merge branch 'feature/DM/nflg-bom-transition' of http://192.168.0.40:3000/root/nflg_project into feature/DM/nflg-bom-transition
This commit is contained in:
commit
76685daaee
|
|
@ -66,6 +66,8 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo);
|
||||
|
||||
List<ReverseReportVO> eBomReverseReport(@Param("bomVersionRowId")Long bomVersionRowId,@Param("startDate") String startDate, @Param("endDate")String endDate, @Param("materialNo")String materialNo);
|
||||
|
||||
List<ReverseReportVO> eBomReverseReportNewst(@Param("materialNo")String materialNo);
|
||||
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
||||
|
||||
void updateRootForWaitReview();
|
||||
|
|
@ -109,4 +111,13 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
void updateLastVersionIs();
|
||||
|
||||
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
|
||||
|
||||
//判断是否跟节点
|
||||
Integer isRoot(@Param("materialNo") String materialNo);
|
||||
|
||||
//判断是否用户跟节点
|
||||
Integer isUserRoot(@Param("materialNo")String materialNo, @Param("createdBy") String createdBy);
|
||||
|
||||
//判断是否跟节点
|
||||
Integer isRootIsForWaitReview(@Param("materialNo") String materialNo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1249,8 +1249,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
newParent.setRevertUserName(null);
|
||||
newParent.setAuditUserName(null);
|
||||
newParent.setAuditTime(null);
|
||||
newParent.setRootIs(1);
|
||||
newParent.setUserRootIs(1);
|
||||
newParent.setRootIs(this.getBaseMapper().isRoot(parent.getMaterialNo())>0?0:1);
|
||||
newParent.setUserRootIs(this.getBaseMapper().isUserRoot(parent.getMaterialNo(),SessionUtil.getUserCode())>0?0:1);
|
||||
newParent.setRootIsForWaitReview(this.getBaseMapper().isRootIsForWaitReview(parent.getMaterialNo())>0?0:1);
|
||||
newParent.setSapState(1);
|
||||
newParent.setSapTime(null);
|
||||
newParent.setModifyTime(null);
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class EBomQueryService {
|
|||
public List<ReverseReportVO> singleLevelReport(ReverseReportQuery queryParam) {
|
||||
Long bomVersionRowId=0L;
|
||||
//指定版本
|
||||
List<ReverseReportVO> vos=new ArrayList<>();
|
||||
if (queryParam.getVersionStrategy().equals(2)
|
||||
|| (queryParam.getVersionStrategy().equals(1) && StrUtil.isNotBlank(queryParam.getBomVersion()))) {
|
||||
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery()
|
||||
|
|
@ -64,6 +65,8 @@ public class EBomQueryService {
|
|||
.eq(BomNewEbomParentFormalEntity::getCurrentVersion, queryParam.getBomVersion())
|
||||
.one();
|
||||
bomVersionRowId = Objects.nonNull(one) ? one.getRowId() : 0L;
|
||||
|
||||
vos = ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId, queryParam.getStartDate(), queryParam.getEndDate(), queryParam.getMaterialNo());
|
||||
}//最新版本
|
||||
else if (queryParam.getVersionStrategy().equals(0)) {
|
||||
BomNewEbomParentEntity one = ebomParentService.lambdaQuery()
|
||||
|
|
@ -73,8 +76,8 @@ public class EBomQueryService {
|
|||
if (Objects.nonNull(one)) {
|
||||
bomVersionRowId = one.getRowId();
|
||||
}
|
||||
vos = ebomParentService.getBaseMapper().eBomReverseReportNewst(queryParam.getMaterialNo());
|
||||
}
|
||||
List<ReverseReportVO> vos = ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId, queryParam.getStartDate(), queryParam.getEndDate(), queryParam.getMaterialNo());
|
||||
if (CollUtil.isNotEmpty(vos)) {
|
||||
List<BaseMaterialVO> materialVOS = materialMainService.getMaterialBaseInfo(vos.stream().map(ReverseReportVO::getMaterialNo).collect(Collectors.toList()));
|
||||
vos.forEach(it -> {
|
||||
|
|
|
|||
|
|
@ -365,6 +365,13 @@
|
|||
and a.material_no =#{materialNo}
|
||||
</select>
|
||||
|
||||
<!--ebom单层反查-->
|
||||
<select id="eBomReverseReportNewst" resultType="com.nflg.product.bomnew.pojo.vo.ReverseReportVO">
|
||||
select b.* , a.drawing_no as childDrawingNo from t_bom_new_ebom_child a
|
||||
join t_bom_new_ebom_parent b on a.parent_row_id=b.row_id
|
||||
where a.material_no =#{materialNo} and b.status=4
|
||||
</select>
|
||||
|
||||
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
||||
select COUNT(1)
|
||||
from t_bom_new_ebom_child
|
||||
|
|
@ -432,9 +439,9 @@
|
|||
created_by=#{userCode}
|
||||
</if>
|
||||
<if test="userJob==1">
|
||||
AND ((root_is=1 OR user_root_is=1) AND status=2) OR (status IN (1,3) AND (root_is=1 OR
|
||||
AND (((root_is=1 OR user_root_is=1) AND status=2) OR (status IN (1,3) AND (root_is=1 OR
|
||||
user_root_is=1 OR
|
||||
root_is_for_wait_review=1) AND created_by=#{userCode})
|
||||
root_is_for_wait_review=1) AND created_by=#{userCode}))
|
||||
</if>
|
||||
<if test="query.deviseName!=null and query.deviseName!=''">
|
||||
AND devise_name LIKE concat('%', #{query.deviseName}, '%')
|
||||
|
|
@ -616,4 +623,20 @@
|
|||
#{parentRowId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!--是否跟节点大于0为否-->
|
||||
<select id="isRoot" resultType="java.lang.Integer">
|
||||
select count(1) from t_bom_new_ebom_child where material_no=#{materialNo}
|
||||
</select>
|
||||
|
||||
<!--是否用户跟节点大于0为否-->
|
||||
<select id="isUserRoot">
|
||||
select count(1) from t_bom_new_ebom_child where material_no=#{materialNo} and created_by=#{createdBy}
|
||||
</select>
|
||||
|
||||
<!--是否工作表跟节点大于0就是否-->
|
||||
<select id="isRootIsForWaitReview">
|
||||
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
|
||||
where b.material_no=#{materialNo} and a.status < 4
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue