| | |
| | | import com.zy.acs.manager.core.integrate.dto.HttpResult; |
| | | import com.zy.acs.manager.core.service.ThreadPoolRegulator; |
| | | import com.zy.acs.manager.manager.entity.Task; |
| | | import com.zy.acs.manager.manager.enums.TaskStsType; |
| | | import com.zy.acs.manager.manager.enums.TaskUplinkStateType; |
| | | import com.zy.acs.manager.manager.service.TaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | public boolean reportFinished(Task task) { |
| | | if (Cools.isEmpty(task)) { |
| | | return false; |
| | | } |
| | | if (!uplinkProperties.getEnabled()) { |
| | | return false; |
| | | } |
| | | if (!task.getTaskSts().equals(TaskStsType.COMPLETE.val())) { |
| | | return false; |
| | | } |
| | | TaskUplinkStateType uplinkStateType = TaskUplinkStateType.of(task.getUplinkSts()); |
| | | if (!uplinkStateType.equals(TaskUplinkStateType.PENDING) && !uplinkStateType.equals(TaskUplinkStateType.FAILED)) { |
| | | return false; |
| | | } |
| | | |
| | | // block |
| | | // Future<R> future = threadPoolRegulator.getInstance().submit(() -> { |
| | | // mapDataDispatcher.modifyDynamicMatrix(null, null, param.getAgvNo(), true); |
| | |
| | | return false; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(""); |
| | | log.error("Uplink report failed, taskId={}", |
| | | JSON.toJSONString(task), |
| | | e); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private HttpResult<?> postForResult(String url |
| | | , Map<String, String> headers, Map<String, Object> params) throws Exception { |
| | | private HttpResult<?> postForResult(String url, Map<String, String> headers, Map<String, Object> params) throws Exception { |
| | | String json = JSON.toJSONString(params); |
| | | HttpGo.HttpResponse response = this.http.postJson(url, headers, json); |
| | | |