loujf
2 years ago
5 changed files with 52 additions and 5 deletions
@ -0,0 +1,41 @@ |
|||
package org.nl.modules.quartz.task; |
|||
|
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import net.sf.json.JSONObject; |
|||
import org.nl.acs.task.service.TaskFeedbackService; |
|||
import org.nl.acs.task.service.dto.TaskFeedbackDto; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 向wms反馈任务状态 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
public class TaskFeekback { |
|||
|
|||
@Autowired |
|||
TaskFeedbackService taskFeedbackService; |
|||
|
|||
public void run() throws Exception { |
|||
JSONObject json = new JSONObject(); |
|||
List<TaskFeedbackDto> taskFeedbackDtos = taskFeedbackService.queryAll(json); |
|||
List<TaskFeedbackDto> dtos = new ArrayList<>(); |
|||
|
|||
for (int i = 0; i < taskFeedbackDtos.size(); i++) { |
|||
TaskFeedbackDto dto = taskFeedbackDtos.get(i); |
|||
if (!dto.getError_code().equals("200") && dto.getIs_finished().equals("0")) { |
|||
dtos.add(dto); |
|||
} |
|||
} |
|||
|
|||
for (int i = 0; i < dtos.size(); i++) { |
|||
TaskFeedbackDto taskFeedbackDto = dtos.get(i); |
|||
taskFeedbackService.retry(taskFeedbackDto.getTaskback_id()); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue