Skip to content

Commit

Permalink
[INLONG-11163][Manager] Fix the problem of adding dataaddtask failed
Browse files Browse the repository at this point in the history
  • Loading branch information
fuweng11 committed Sep 20, 2024
1 parent 260a12d commit a32281c
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.inlong.manager.service.source.AbstractSourceOperator;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -114,7 +113,6 @@ public Integer addDataAddTask(DataAddTaskRequest request, String operator) {
StreamSourceEntity sourceEntity = sourceMapper.selectById(request.getSourceId());
try {
List<StreamSourceEntity> dataAddTaskList = sourceMapper.selectByTaskMapId(sourceEntity.getId());
int dataAddTaskSize = CollectionUtils.isNotEmpty(dataAddTaskList) ? dataAddTaskList.size() : 0;
FileSourceDTO dto = FileSourceDTO.getFromJson(sourceEntity.getExtParams());
dto.setStartTime(sourceRequest.getStartTime());
dto.setEndTime(sourceRequest.getEndTime());
Expand All @@ -125,7 +123,7 @@ public Integer addDataAddTask(DataAddTaskRequest request, String operator) {
CommonBeanUtils.copyProperties(sourceEntity, StreamSourceEntity::new);
dataAddTaskEntity.setId(null);
dataAddTaskEntity.setSourceName(
sourceEntity.getSourceName() + "-" + (dataAddTaskSize + 1) + "-" + sourceEntity.getId());
sourceEntity.getSourceName() + "-" + request.getAuditVersion() + "-" + sourceEntity.getId());
dataAddTaskEntity.setExtParams(objectMapper.writeValueAsString(dto));
dataAddTaskEntity.setTaskMapId(sourceEntity.getId());
Integer id = sourceMapper.insert(dataAddTaskEntity);
Expand Down

0 comments on commit a32281c

Please sign in to comment.