修复-待复核根节点问题

This commit is contained in:
luoliming 2024-04-05 17:00:53 +08:00
parent c915a629bb
commit 8537b3f15d
7 changed files with 38 additions and 5 deletions

View File

@ -260,6 +260,8 @@ public class EbomApi extends BaseApi {
dto.setRevertUserName(SessionUtil.getUserName());
dto.setUserCode(SessionUtil.getUserCode());
bomNewEbomParentService.revertDesign(dto);
//更新-待复核根节点
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
return ResultVO.success(true);
@ -364,7 +366,9 @@ public class EbomApi extends BaseApi {
checkDeleteRule(dto);
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
return ResultVO.success(bomNewEbomParentService.temporary(dto));
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
return ResultVO.success(temporary);
}
@PostMapping("temporaryAdd")
@ -373,7 +377,9 @@ public class EbomApi extends BaseApi {
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
checkDeleteRule(dto);
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
return ResultVO.success(bomNewEbomParentService.temporary(dto));
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
return ResultVO.success(temporary);
}
@PostMapping("submitAdd")

View File

@ -174,6 +174,7 @@ public class OriginalBomApi extends BaseApi {
//跟新EBom 根节点
ebomParentService.getBaseMapper().updateRootState();
ebomParentService.getBaseMapper().updateRootForWaitReview();
return ResultVO.success(result);
}

View File

@ -66,4 +66,7 @@ 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("materialNos")List<String> materialNos);
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
void updateRootForWaitReview();
}

View File

@ -357,5 +357,13 @@ public class BomNewEbomParentEntity implements Serializable {
@ApiModelProperty(value = "修改时间")
private LocalDateTime modifyTime;
/**
* 待复核根节点
*/
@TableField(value = "root_is_for_wait_review")
@ApiModelProperty(value = "待复核根节点")
private Integer rootIsForWaitReview;
private static final long serialVersionUID = 265246823929418418L;
}

View File

@ -304,7 +304,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<BomNewEbomParentEntity> list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos)
.eq(!EBomStatusEnum.PUBLISHED.equalsValue(parent.getStatus()) ,BomNewEbomParentEntity::getLastVersionIs, 1)
.eq(EBomStatusEnum.PUBLISHED.equalsValue(parent.getStatus()), BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list();
if(EBomStatusEnum.CHECKED.equalsValue(parent.getStatus())){
list=list.stream().filter(u->EBomStatusEnum.CHECKED.equalsValue(u.getStatus())).collect(Collectors.toList());
}
Map<String, BomNewEbomParentEntity> bomListMap= list.parallelStream()
.collect(Collectors.toMap(
BomNewEbomParentEntity::getMaterialNo, // key: DrawingNo

View File

@ -302,7 +302,6 @@ public class EBomEdit {
checkHadBom(dto.getParent().getMaterialNo());
dto.getParent().setBomRowId(dto.getParent().getRowId());
parentEntity = createParentBomInfo(dto.getParent());
dto.getDatas().forEach(k -> {
k.setParentRowId(parentEntity.getRowId());
});

View File

@ -51,6 +51,8 @@
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
<result column="root_is_for_wait_review" property="rootIsForWaitReview" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List">
@ -82,7 +84,7 @@
<!--Ebom工作列表-->
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
<if test="job==0">
select * ,row_id as bomRowId from t_bom_new_ebom_parent where created_by=#{createdBy} and user_root_is=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)
<include refid="whr"/>
order by created_time desc
@ -218,6 +220,14 @@
where a.`status` &lt; 4 and b.row_id is null and a.last_version_is=1 ;
</update>
<!--更新-待复核根节点-->
<update id="updateRootForWaitReview">
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` =2
) b on a.material_no=b.material_no
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 ;
</update>
<delete id="delBatch">
@ -268,4 +278,8 @@
#{materialNo}
</foreach>
</select>
<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>
</mapper>