问题修复

This commit is contained in:
luoliming 2023-12-23 21:35:59 +08:00
parent d94a6653d8
commit b98cfb6157
4 changed files with 17 additions and 0 deletions

View File

@ -61,4 +61,6 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
void updateRootState();
void delBatch(@Param("rowIds") List<Long> rowIds);
void updateStateBatchByRowIds(@Param("status") Integer status, @Param("list") List<Long> list );
}

View File

@ -463,6 +463,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult());
}
if (CollUtil.isNotEmpty(eBomToPBom.getPBomChildResult())) {
pBomChildService.saveOrUpdateBatch(eBomToPBom.getPBomChildResult());
@ -473,6 +474,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if(CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())){
upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
};
if(CollUtil.isNotEmpty(eBomToPBom.getHasConvertEBomRowIds())){
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(),eBomToPBom.getHasConvertEBomRowIds());
}
}

View File

@ -59,6 +59,9 @@ public class EBomToPBom {
@Getter
private List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
@Getter
private List<Long> hasConvertEBomRowIds=new ArrayList<>();
private Map<String, String> generateDrawingNoMap = new HashMap<>();
@ -124,6 +127,7 @@ public class EBomToPBom {
.eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, facCode).one();
this.hasConvertEBomRowIds.add(parentVo.getRowId());
if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) {
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
oldParent.setCurrentVersion(parentVo.getCurrentVersion());

View File

@ -207,6 +207,13 @@
</foreach>;
</delete>
<update id="updateStateBatchByRowIds">
update t_bom_new_ebom_parent set status=#{status} where row_id in
<foreach collection="list" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>