|
|
|
@ -8,10 +8,13 @@ import com.docus.server.dto.scheduling.management.schcollectrecord.EditSchCollec
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schterminator.EditSchTerminatorDTO;
|
|
|
|
|
import com.docus.server.dto.scheduling.management.schterminator.NettyTerminatorDTO;
|
|
|
|
|
import com.docus.server.enums.BusyStateEnum;
|
|
|
|
|
import com.docus.server.enums.RetryTaskEnum;
|
|
|
|
|
import com.docus.server.enums.StateEnum;
|
|
|
|
|
import com.docus.server.service.ISchCollectRecordRetryLogService;
|
|
|
|
|
import com.docus.server.service.ISchCollectRecordService;
|
|
|
|
|
import com.docus.server.service.ISchTerminatorService;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectrecord.SchCollectRecordVO;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schcollectrecordretrylog.SchCollectRecordRetryLogVO;
|
|
|
|
|
import com.docus.server.vo.scheduling.management.schterminator.SchTerminatorVO;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
@ -29,6 +32,8 @@ public class ChannelProcessor extends AbstractProcessor {
|
|
|
|
|
private ISchTerminatorService iSchTerminatorService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ISchCollectRecordService iSchCollectRecordService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ISchCollectRecordRetryLogService iSchCollectRecordRetryLogService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected Object doProcess(TrackContext context) {
|
|
|
|
@ -57,6 +62,8 @@ public class ChannelProcessor extends AbstractProcessor {
|
|
|
|
|
EditSchCollectRecordDTO collectRecordDTO = (EditSchCollectRecordDTO) context.getArgs()[0];
|
|
|
|
|
|
|
|
|
|
if (!error) {
|
|
|
|
|
|
|
|
|
|
if (RetryTaskEnum.NO_RETRY_TASK.equals(collectRecordDTO.getIsRetryTask())) {
|
|
|
|
|
SchCollectRecordVO schCollectRecordVO = iSchCollectRecordService.findById(String.valueOf(collectRecordDTO.getId()));
|
|
|
|
|
|
|
|
|
|
SchTerminatorVO schTerminatorVO = iSchTerminatorService.findById(String.valueOf(schCollectRecordVO.getTerminatorId()));
|
|
|
|
@ -72,6 +79,25 @@ public class ChannelProcessor extends AbstractProcessor {
|
|
|
|
|
if (stateEnums.contains(schCollectRecordVO.getTaskExecState())) {
|
|
|
|
|
nettyTerminatorDTO.setBusyState(BusyStateEnum.IDLE);
|
|
|
|
|
}
|
|
|
|
|
} else if (RetryTaskEnum.RETRY_TASK.equals(collectRecordDTO.getIsRetryTask())) {
|
|
|
|
|
|
|
|
|
|
SchCollectRecordRetryLogVO retryLogVO = iSchCollectRecordRetryLogService.findById(String.valueOf(collectRecordDTO.getId()));
|
|
|
|
|
|
|
|
|
|
SchTerminatorVO schTerminatorVO = iSchTerminatorService.findById(String.valueOf(retryLogVO.getTerminatorId()));
|
|
|
|
|
|
|
|
|
|
NettyTerminatorDTO nettyTerminatorDTO = channelRepository.getTerminatorByIp(String.valueOf(schTerminatorVO.getTerminatorIp()));
|
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(nettyTerminatorDTO)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<StateEnum> stateEnums = Arrays.asList(StateEnum.values());
|
|
|
|
|
|
|
|
|
|
if (stateEnums.contains(retryLogVO.getTaskExecState())) {
|
|
|
|
|
nettyTerminatorDTO.setBusyState(BusyStateEnum.IDLE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return error;
|
|
|
|
|
|
|
|
|
|