use of org.apache.inlong.manager.dao.entity.SourceFileDetailEntity in project incubator-inlong by apache.
the class SourceFileServiceImpl method updateDetail.
@Transactional(rollbackFor = Throwable.class)
@Override
public boolean updateDetail(SourceFileDetailInfo detailInfo, String operator) {
LOGGER.info("begin to update file data source detail={}", detailInfo);
Preconditions.checkNotNull(detailInfo, "file data source detail is empty");
Integer id = detailInfo.getId();
Preconditions.checkNotNull(id, Constant.ID_IS_EMPTY);
SourceFileDetailEntity entity = fileDetailMapper.selectByPrimaryKey(id);
if (entity == null) {
LOGGER.error("file data source detail not found by id=" + id);
throw new BusinessException(ErrorCodeEnum.SOURCE_DETAIL_NOT_FOUND);
}
// After the approval is passed, the status needs to be revised to be revised to be issued: 205
this.checkGroupIsTempStatus(detailInfo.getInlongGroupId());
detailInfo.setStatus(EntityStatus.AGENT_ADD.getCode());
SourceFileDetailEntity updateEntity = CommonBeanUtils.copyProperties(detailInfo, SourceFileDetailEntity::new);
updateEntity.setModifier(operator);
updateEntity.setModifyTime(new Date());
fileDetailMapper.updateByPrimaryKeySelective(updateEntity);
LOGGER.info("success to update file data source detail");
return true;
}
Aggregations