修复-待复核根节点问题
This commit is contained in:
parent
c915a629bb
commit
8537b3f15d
|
|
@ -260,6 +260,8 @@ public class EbomApi extends BaseApi {
|
||||||
dto.setRevertUserName(SessionUtil.getUserName());
|
dto.setRevertUserName(SessionUtil.getUserName());
|
||||||
dto.setUserCode(SessionUtil.getUserCode());
|
dto.setUserCode(SessionUtil.getUserCode());
|
||||||
bomNewEbomParentService.revertDesign(dto);
|
bomNewEbomParentService.revertDesign(dto);
|
||||||
|
//更新-待复核根节点
|
||||||
|
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||||
|
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
|
|
||||||
|
|
@ -364,7 +366,9 @@ public class EbomApi extends BaseApi {
|
||||||
|
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
||||||
return ResultVO.success(bomNewEbomParentService.temporary(dto));
|
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||||
|
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||||
|
return ResultVO.success(temporary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("temporaryAdd")
|
@PostMapping("temporaryAdd")
|
||||||
|
|
@ -373,7 +377,9 @@ public class EbomApi extends BaseApi {
|
||||||
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
||||||
return ResultVO.success(bomNewEbomParentService.temporary(dto));
|
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||||
|
bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||||
|
return ResultVO.success(temporary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("submitAdd")
|
@PostMapping("submitAdd")
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ public class OriginalBomApi extends BaseApi {
|
||||||
|
|
||||||
//跟新EBom 根节点
|
//跟新EBom 根节点
|
||||||
ebomParentService.getBaseMapper().updateRootState();
|
ebomParentService.getBaseMapper().updateRootState();
|
||||||
|
ebomParentService.getBaseMapper().updateRootForWaitReview();
|
||||||
|
|
||||||
return ResultVO.success(result);
|
return ResultVO.success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo);
|
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);
|
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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -357,5 +357,13 @@ public class BomNewEbomParentEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private LocalDateTime modifyTime;
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待复核根节点
|
||||||
|
*/
|
||||||
|
@TableField(value = "root_is_for_wait_review")
|
||||||
|
@ApiModelProperty(value = "待复核根节点")
|
||||||
|
private Integer rootIsForWaitReview;
|
||||||
|
|
||||||
private static final long serialVersionUID = 265246823929418418L;
|
private static final long serialVersionUID = 265246823929418418L;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
List<BomNewEbomParentEntity> list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos)
|
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::getLastVersionIs, 1)
|
||||||
.eq(EBomStatusEnum.PUBLISHED.equalsValue(parent.getStatus()), BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list();
|
.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()
|
Map<String, BomNewEbomParentEntity> bomListMap= list.parallelStream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
BomNewEbomParentEntity::getMaterialNo, // key: DrawingNo
|
BomNewEbomParentEntity::getMaterialNo, // key: DrawingNo
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,6 @@ public class EBomEdit {
|
||||||
checkHadBom(dto.getParent().getMaterialNo());
|
checkHadBom(dto.getParent().getMaterialNo());
|
||||||
dto.getParent().setBomRowId(dto.getParent().getRowId());
|
dto.getParent().setBomRowId(dto.getParent().getRowId());
|
||||||
parentEntity = createParentBomInfo(dto.getParent());
|
parentEntity = createParentBomInfo(dto.getParent());
|
||||||
|
|
||||||
dto.getDatas().forEach(k -> {
|
dto.getDatas().forEach(k -> {
|
||||||
k.setParentRowId(parentEntity.getRowId());
|
k.setParentRowId(parentEntity.getRowId());
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@
|
||||||
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
|
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
|
||||||
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
||||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||||
|
<result column="root_is_for_wait_review" property="rootIsForWaitReview" jdbcType="INTEGER" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
|
|
@ -82,7 +84,7 @@
|
||||||
<!--Ebom工作列表-->
|
<!--Ebom工作列表-->
|
||||||
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||||
<if test="job==0">
|
<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)
|
(status=1 or status=3)
|
||||||
<include refid="whr"/>
|
<include refid="whr"/>
|
||||||
order by created_time desc
|
order by created_time desc
|
||||||
|
|
@ -218,6 +220,14 @@
|
||||||
where a.`status` < 4 and b.row_id is null and a.last_version_is=1 ;
|
where a.`status` < 4 and b.row_id is null and a.last_version_is=1 ;
|
||||||
|
|
||||||
</update>
|
</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">
|
<delete id="delBatch">
|
||||||
|
|
@ -268,4 +278,8 @@
|
||||||
#{materialNo}
|
#{materialNo}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue