fix: 原始bom转换ebom后重新设置是否有bom
This commit is contained in:
parent
3a82521c3a
commit
3c8d341bdb
|
|
@ -176,6 +176,8 @@ public class OriginalBomApi extends BaseApi {
|
|||
ebomParentService.getBaseMapper().updateRootState();
|
||||
ebomParentService.getBaseMapper().updateRootForWaitReview();
|
||||
|
||||
ebomParentService.resetAllBomExist();
|
||||
|
||||
return ResultVO.success(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomUpgradeChangeVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.MaterialHistoryProjectTypeVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ReverseReportVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -74,4 +76,6 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
void resetBomExist(Long rowId);
|
||||
|
||||
Set<String> getMaterialParent(@Param("materialNos") Collection<String> materialNos ,@Param("createdBy") String createdBy);
|
||||
|
||||
void resetAllBomExist();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2045,7 +2045,20 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
LogRecordContext.putVariable("bom", ent);
|
||||
}
|
||||
|
||||
private void resetBomExist(Long rowId) {
|
||||
/**
|
||||
* 重置BOM存在状态
|
||||
* @param rowId 父级节点rowId
|
||||
*/
|
||||
public void resetBomExist(Long rowId) {
|
||||
log.debug("resetBomExist:{}", rowId);
|
||||
this.getBaseMapper().resetBomExist(rowId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置所有BOM存在状态
|
||||
*/
|
||||
public void resetAllBomExist() {
|
||||
log.debug("resetAllBomExist");
|
||||
this.getBaseMapper().resetAllBomExist();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,6 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
|||
|
||||
// this.eBomChildResult.add(childEntity);
|
||||
return childEntity;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -327,7 +326,7 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
|||
eBomParent.setSourceRowId(parentEnt.getBomRowId());
|
||||
eBomParent.setLastVersionIs(1);
|
||||
eBomParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
eBomParent.setModifyTime(LocalDateTime.now());
|
||||
//eBomParent.setModifyTime(LocalDateTime.now());
|
||||
eBomParent.setBomExist(parentEnt.getBomRowId() > 0 ? 1 : 0);
|
||||
eBomParent.setDeviseName(SessionUtil.getRealName());
|
||||
eBomParent.setDeptName(SessionUtil.getDepartName());
|
||||
|
|
|
|||
|
|
@ -353,4 +353,10 @@
|
|||
SET p.bom_exist = (IF(EXISTS (SELECT 1 FROM t_bom_new_ebom_child WHERE parent_row_id = p.row_id), 1, 0))
|
||||
WHERE p.row_id = #{rowId};
|
||||
</select>
|
||||
|
||||
<select id="resetAllBomExist">
|
||||
UPDATE t_bom_new_ebom_parent p
|
||||
SET p.bom_exist = (IF(EXISTS (SELECT 1 FROM t_bom_new_ebom_child WHERE parent_row_id = p.row_id), 1, 0))
|
||||
WHERE p.status < 4;
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue