Browse Source

fix 任务反馈

master
周俊杰 5 months ago
parent
commit
fd639733f9
  1. 16
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java
  2. 13
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

16
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java

@ -43,7 +43,9 @@ import java.util.Map;
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class ZheDaAgvServiceImpl implements ZheDaAgvService { public class
ZheDaAgvServiceImpl implements ZheDaAgvService {
@Autowired @Autowired
AcsConfigService acsConfigService; AcsConfigService acsConfigService;
@ -154,7 +156,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
//释放AGV资源,继续后续动作 //释放AGV资源,继续后续动作
boolean is_feedback = false; boolean is_feedback = false;
String str = ""; String str = "";
String backaddress = address; String backaddress = address; TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
if (address.indexOf(".") > 0) { if (address.indexOf(".") > 0) {
str = address.substring(address.indexOf(".") + 1, address.length()); str = address.substring(address.indexOf(".") + 1, address.length());
address = address.substring(0, address.indexOf(".")); address = address.substring(0, address.indexOf("."));
@ -162,7 +164,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
address = address.substring(0, address.indexOf("-")); address = address.substring(0, address.indexOf("-"));
} }
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl");
// AcsToWmsService acsToWmsService=SpringContextHolder.getBean("acsToWmsServiceImpl"); // AcsToWmsService acsToWmsService=SpringContextHolder.getBean("acsToWmsServiceImpl");
AcsToWmsZDService acsToWmsZDService = SpringContextHolder.getBean("acsToWmsZDServiceImpl"); AcsToWmsZDService acsToWmsZDService = SpringContextHolder.getBean("acsToWmsZDServiceImpl");
@ -266,10 +268,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode); log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode);
is_feedback = true;
} }
lubeiConveyorDeviceDriver.writing(2); lubeiConveyorDeviceDriver.writing(2);
if (lubeiConveyorDeviceDriver.getTo_command() == 2) { if (lubeiConveyorDeviceDriver.getTo_command() == 2) {
is_feedback = true;
} else { } else {
lubeiConveyorDeviceDriver.writing(2); lubeiConveyorDeviceDriver.writing(2);
} }
@ -286,10 +288,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode); log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode);
is_feedback = true;
} }
lubeiConveyorDeviceDriver.writing(2); lubeiConveyorDeviceDriver.writing(2);
if (lubeiConveyorDeviceDriver.getTo_command() == 2) { if (lubeiConveyorDeviceDriver.getTo_command() == 2) {
is_feedback = true;
} else { } else {
lubeiConveyorDeviceDriver.writing(2); lubeiConveyorDeviceDriver.writing(2);
} }
@ -424,10 +426,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode); log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode);
is_feedback = true;
} }
lubeiConveyorDeviceDriver.writing(4); lubeiConveyorDeviceDriver.writing(4);
if (lubeiConveyorDeviceDriver.getTo_command() == 4) { if (lubeiConveyorDeviceDriver.getTo_command() == 4) {
is_feedback = true;
} else { } else {
lubeiConveyorDeviceDriver.writing(4); lubeiConveyorDeviceDriver.writing(4);
} }
@ -444,10 +446,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode); log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode);
is_feedback = true;
} }
lubeiConveyorDeviceDriver.writing(4); lubeiConveyorDeviceDriver.writing(4);
if (lubeiConveyorDeviceDriver.getTo_command() == 4) { if (lubeiConveyorDeviceDriver.getTo_command() == 4) {
is_feedback = true;
} else { } else {
lubeiConveyorDeviceDriver.writing(4); lubeiConveyorDeviceDriver.writing(4);
} }

13
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.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -942,7 +943,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
} }
if (flag) { 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")) { if (StrUtil.equals(entity.getInstruction_type(), "7")) {
CancelTaskRequest cancelTaskRequest = new CancelTaskRequest(); CancelTaskRequest cancelTaskRequest = new CancelTaskRequest();
cancelTaskRequest.setOrderId(entity.getInstruction_code()); cancelTaskRequest.setOrderId(entity.getInstruction_code());

Loading…
Cancel
Save