diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java index 32581ee..515120a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java @@ -43,7 +43,9 @@ import java.util.Map; @Slf4j @Service @RequiredArgsConstructor -public class ZheDaAgvServiceImpl implements ZheDaAgvService { +public class + +ZheDaAgvServiceImpl implements ZheDaAgvService { @Autowired AcsConfigService acsConfigService; @@ -154,7 +156,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { //释放AGV资源,继续后续动作 boolean is_feedback = false; String str = ""; - String backaddress = address; + String backaddress = address; TaskService taskService = SpringContextHolder.getBean("taskServiceImpl"); if (address.indexOf(".") > 0) { str = address.substring(address.indexOf(".") + 1, address.length()); address = address.substring(0, address.indexOf(".")); @@ -162,7 +164,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { address = address.substring(0, address.indexOf("-")); } InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); - TaskService taskService = SpringContextHolder.getBean("taskServiceImpl"); + // AcsToWmsService acsToWmsService=SpringContextHolder.getBean("acsToWmsServiceImpl"); AcsToWmsZDService acsToWmsZDService = SpringContextHolder.getBean("acsToWmsZDServiceImpl"); @@ -266,10 +268,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { int responseCode = response.getInteger("responseCode"); if (responseCode == 0) { log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode); + is_feedback = true; } lubeiConveyorDeviceDriver.writing(2); if (lubeiConveyorDeviceDriver.getTo_command() == 2) { - is_feedback = true; } else { lubeiConveyorDeviceDriver.writing(2); } @@ -286,10 +288,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { int responseCode = response.getInteger("responseCode"); if (responseCode == 0) { log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode); + is_feedback = true; } lubeiConveyorDeviceDriver.writing(2); if (lubeiConveyorDeviceDriver.getTo_command() == 2) { - is_feedback = true; } else { lubeiConveyorDeviceDriver.writing(2); } @@ -424,10 +426,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { int responseCode = response.getInteger("responseCode"); if (responseCode == 0) { log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode); + is_feedback = true; } lubeiConveyorDeviceDriver.writing(4); if (lubeiConveyorDeviceDriver.getTo_command() == 4) { - is_feedback = true; } else { lubeiConveyorDeviceDriver.writing(4); } @@ -444,10 +446,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService { int responseCode = response.getInteger("responseCode"); if (responseCode == 0) { log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode); + is_feedback = true; } lubeiConveyorDeviceDriver.writing(4); if (lubeiConveyorDeviceDriver.getTo_command() == 4) { - is_feedback = true; } else { lubeiConveyorDeviceDriver.writing(4); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 6ce1198..fe2647d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -942,7 +943,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } if (flag) { - + com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject(); + requestjo.put("task_code", entity.getInstruction_code()); + String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); + String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); + String taskcode=entity.getInstruction_code(); + agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + taskcode + "/withdrawal"; + HttpResponse result = HttpRequest.post(agvurl) + .body(String.valueOf(requestjo)) + .timeout(20000)//超时,毫秒 + .execute(); + log.info("请求地址agvurl{},请求结果{}",agvurl,result.body()); if (StrUtil.equals(entity.getInstruction_type(), "7")) { CancelTaskRequest cancelTaskRequest = new CancelTaskRequest(); cancelTaskRequest.setOrderId(entity.getInstruction_code());