This commit is contained in:
2022-12-09 18:30:30 +08:00
parent c486c04544
commit fa8a4dcad4
16 changed files with 32 additions and 14 deletions

View File

View File

@@ -0,0 +1 @@
2022-12-09 15:50:14.334 [http-nio-8010-exec-1] INFO org.nl.acs.agv.server.impl.AgvServiceImpl - 任务号10820,指令号00080,下发agv订单序列参数:{"id":"00080","complete":true,"blocks":[{"blockId":"d606f3dd0910426e9cabc33091846b68","location":"4204IN","operation":"script","id":"4204IN","script_name":"userpy/interact.py","script_args":{"addr":"http://127.0.0.1:8010","data":{"reach":{"task_code":"00080","address":"4204IN"}},"protocol":"HTTP"}},{"blockId":"7978bd275c024c038243f3864d9ed153","location":"4204","operation":"JackLoad"},{"blockId":"88413812f550427bac6abc68e0b1da8b","location":"4204OUT","operation":"script","id":"4204OUT","script_name":"userpy/interact.py","script_args":{"addr":"http://127.0.0.1:8010","data":{"reach":{"task_code":"00080","address":"4204OUT"}},"protocol":"HTTP"}},{"blockId":"1776881cf7144fc0b8e4bb35849d2c85","location":"1019IN","operation":"script","id":"1019IN","script_name":"userpy/interact.py","script_args":{"addr":"http://127.0.0.1:8010","data":{"reach":{"task_code":"00080","address":"1019IN"}},"protocol":"HTTP"}},{"blockId":"fe0f7bf9f6bb4ff3b2eb6cc3fe30170d","location":"1019","operation":"JackUnload"},{"blockId":"9c6f68517762442e84d833c28eeb0681","location":"1019OUT","operation":"script","id":"1019OUT","script_name":"userpy/interact.py","script_args":{"addr":"http://127.0.0.1:8010","data":{"reach":{"task_code":"00080","address":"1019OUT"}},"protocol":"HTTP"}}]}

View File

@@ -35,7 +35,7 @@ public class AgvWaitUtil {
//取货前等待
public Map<String, Object> waitInGet(String device_code, Map<String, Object> feedMap, JSONObject param) {
String inst_code = param.getString("task_code");
Instruction instructionDto = instructionService.findByCode(inst_code);
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
String task_code = String.valueOf(feedMap.get("taskCode"));
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver;
@@ -110,7 +110,7 @@ public class AgvWaitUtil {
//取货完成等待
public Map<String, Object> waitOutGet(String device_code, Map<String, Object> feedMap, JSONObject param) {
String inst_code = param.getString("task_code");
Instruction instructionDto = instructionService.findByCode(inst_code);
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
String task_code = String.valueOf(feedMap.get("taskCode"));
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver;
@@ -179,7 +179,7 @@ public class AgvWaitUtil {
//放货前等待
public Map<String, Object> waitInPut(String device_code, Map<String, Object> feedMap, JSONObject param) {
String inst_code = param.getString("task_code");
Instruction instructionDto = instructionService.findByCode(inst_code);
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
String task_code = String.valueOf(feedMap.get("taskCode"));
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver;
@@ -255,7 +255,7 @@ public class AgvWaitUtil {
//放货完成等待
public Map<String, Object> waitOutPut(String device_code, Map<String, Object> feedMap, JSONObject param) {
String inst_code = param.getString("task_code");
Instruction instructionDto = instructionService.findByCode(inst_code);
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
String task_code = String.valueOf(feedMap.get("taskCode"));
StandardConveyorLineDeviceDriver standardConveyorLineDeviceDriver;
StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver;

View File

@@ -6,6 +6,7 @@ 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.JSON;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
@@ -182,7 +183,7 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
String url = wcsurl + methods_url;
try {
result = HttpRequest.post(url)
.header("Authorization", token).body(String.valueOf(whereJson))
.header("Authorization", token).body(JSON.toJSONString(whereJson))
.execute();
logServer.log(taskCode, "taskFeedback", "success", whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, carId);
JSONObject jo = JSONObject.fromObject(result.body());
@@ -212,7 +213,8 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
String url = wcsurl + methods_url;
try {
result = HttpRequest.post(url)
.header("Authorization", token).body(String.valueOf(whereJson))
.header("Authorization", token)
.body(JSON.toJSONString(whereJson))
.execute();
logServer.log(taskCode, "taskDeprecate", "success", whereJson.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
JSONObject jo = JSONObject.fromObject(result.body());
@@ -247,7 +249,7 @@ public class AcsToWmsZDServiceImpl implements AcsToWmsZDService {
}
try {
result = HttpRequest.post(url)
.header("Authorization", token).body(String.valueOf(whereJson))
.header("Authorization", token).body(JSON.toJSONString(whereJson))
.execute();
JSONObject jo = JSONObject.fromObject(result.body());
log.info("checkDeviceStatus-----输出参数{}", jo.toString());

View File

@@ -31,7 +31,7 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
public Map<String, Object> waitpointRequest(JSONObject param) {
String inst_code = param.getString("task_code");
String address = param.getString("address");
Instruction instructionDto = instructionService.findByCode(inst_code);
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
Map<String, Object> map = new HashMap<>();
if (ObjectUtil.isEmpty(instructionDto)) {
map.put("status", 400);
@@ -43,7 +43,7 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
Map<String, Object> feedMap = new HashMap();
feedMap.put("taskCode", task_code);
feedMap.put("taskType", instructionDto.getInstruction_type());
feedMap.put("carId", instructionDto.getAgv_jobno());
feedMap.put("carId", instructionDto.getCarno());
String start_device_code = instructionDto.getStart_device_code();
String next_device_code = instructionDto.getNext_device_code();
if (address.contains("IN")) {

View File

@@ -638,7 +638,10 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
Map<String, Object> feedMap = new HashMap();
feedMap.put("taskCode", entity.getTask_code());
feedMap.put("taskType", entity.getTask_type());
feedMap.put("carId", instruction.getAgv_jobno());
String carno = instruction.getCarno();
if (StrUtil.isEmpty(carno)){
carno = "null";
}
feedMap.put("feedbackStatus", "errorFinish");
Map<String, Object> map = acsToWmsZDService.taskFeedback(feedMap);
removeByCodeFromCache(entity.getTask_code());
@@ -665,7 +668,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
Map<String, Object> feedMap = new HashMap();
feedMap.put("taskCode", entity.getTask_code());
feedMap.put("taskType", entity.getTask_type());
feedMap.put("carId", instruction.getAgv_jobno());
String carno = instruction.getCarno();
if (StrUtil.isEmpty(carno)){
carno = "null";
}
feedMap.put("carId", carno);
feedMap.put("feedbackStatus", "exception");
acsToWmsZDService.taskFeedback(feedMap);
removeByCodeFromCache(entity.getTask_code());
@@ -692,7 +699,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
Map<String, Object> feedMap = new HashMap();
feedMap.put("taskCode", entity.getTask_code());
feedMap.put("taskType", entity.getTask_type());
feedMap.put("carId", instruction.getAgv_jobno());
String carno = instruction.getCarno();
if (StrUtil.isEmpty(carno)){
carno = "null";
}
feedMap.put("carId", carno);
feedMap.put("feedbackStatus", "deprecate");
acsToWmsZDService.taskFeedback(feedMap);
removeByCodeFromCache(entity.getTask_code());
@@ -719,7 +730,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
Map<String, Object> feedMap = new HashMap();
feedMap.put("taskCode", entity.getTask_code());
feedMap.put("taskType", entity.getTask_type());
feedMap.put("carId", instruction.getAgv_jobno());
String carno = instruction.getCarno();
if (StrUtil.isEmpty(carno)){
carno = "null";
}
feedMap.put("carId", carno);
feedMap.put("feedbackStatus", "NoTargetPutFinish");
acsToWmsZDService.taskFeedback(feedMap);
removeByCodeFromCache(entity.getTask_code());

View File

@@ -135,4 +135,4 @@ file:
avatarMaxSize: 5
agvToAcs:
addr: http://172.22.50.184:8010
addr: http://172.22.50.188:8010