Browse Source

更新

master
周俊杰 1 year ago
parent
commit
9864e5bb17
  1. 135
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java
  2. 2
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lubei_conveyor/LubeiConveyorDeviceDriver.java
  3. 16
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  4. 9
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java
  5. 33
      acs/nladmin-system/src/main/resources/log/LubeiConveyorDeviceDriver.xml
  6. 1
      acs/nladmin-system/src/main/resources/logback-spring.xml

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

@ -168,10 +168,9 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
Instruction inst = instructionService.findByCodeFromCache(jobno); Instruction inst = instructionService.findByCodeFromCache(jobno);
TaskDto task = taskService.findByCode(inst.getTask_code()); TaskDto task = taskService.findByCode(inst.getTask_code());
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device addressdevice = appService.findDeviceByCode(address); Device addressdevice = appService.findDeviceByCode(address);
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
LubeiConveyorDeviceDriver lubeiConveyorDeviceDriver; LubeiConveyorDeviceDriver lubeiConveyorDeviceDriver;
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
@ -182,10 +181,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver(); lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver();
if(lubeiConveyorDeviceDriver.getMove()==1 && lubeiConveyorDeviceDriver.getAction()==1){ if(lubeiConveyorDeviceDriver.getMove()==1 && lubeiConveyorDeviceDriver.getAction()==1){
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyTake"); jo.put("feedbackStatus", "applyTake");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -195,6 +195,23 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
is_feedback = true; is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode);
} }
}else{
if(StrUtil.equals(task.getTask_type(),"定点任务")){
JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyTake");
log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode);
}
}
}
} else { } else {
log.info("设备{} 请求取货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove()); log.info("设备{} 请求取货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove());
} }
@ -203,7 +220,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code()); jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle); jo.put("carId",processingVehicle);
jo.put("taskType ",type); jo.put("taskType ",task.getTask_type());
jo.put("feedbackStatus","applyTake"); jo.put("feedbackStatus","applyTake");
log.info("请求参数:{}",jo); log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
@ -215,10 +232,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyTake"); jo.put("feedbackStatus", "applyTake");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -229,16 +247,18 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode);
} }
} }
}
} }
if ("PauseOnStation".equals(type)) { if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver(); lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver();
if(lubeiConveyorDeviceDriver.getMove()==0){ if(lubeiConveyorDeviceDriver.getMove()==0){
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "takeFinish"); jo.put("feedbackStatus", "takeFinish");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -253,7 +273,28 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} else { } else {
lubeiConveyorDeviceDriver.writing(2); lubeiConveyorDeviceDriver.writing(2);
} }
}else{
if(StrUtil.equals(task.getTask_type(),"定点任务")){
JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "takeFinish");
log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode);
}
lubeiConveyorDeviceDriver.writing(2);
if (lubeiConveyorDeviceDriver.getTo_command() == 2) {
is_feedback = true;
} else {
lubeiConveyorDeviceDriver.writing(2);
}
}
}
} else { } else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove()); log.info("设备{} 请求离开,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove());
} }
@ -262,7 +303,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code()); jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle); jo.put("carId",processingVehicle);
jo.put("taskType ",type); jo.put("taskType ",task.getTask_type());
jo.put("feedbackStatus","takeFinish"); jo.put("feedbackStatus","takeFinish");
log.info("请求参数:{}",jo); log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
@ -274,10 +315,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "takeFinish"); jo.put("feedbackStatus", "takeFinish");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -285,7 +327,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
is_feedback = true; is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode); log.info("请求ZDwcs成功,取货完成 请求结果{}", responseCode);
}
} }
} }
} }
@ -297,10 +340,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver(); lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver();
if(lubeiConveyorDeviceDriver.getMove()==0 && lubeiConveyorDeviceDriver.getAction()==1){ if(lubeiConveyorDeviceDriver.getMove()==0 && lubeiConveyorDeviceDriver.getAction()==1){
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyPut"); jo.put("feedbackStatus", "applyPut");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -310,6 +354,23 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
is_feedback = true; is_feedback = true;
log.info("请求ZDwcs成功,开始放货 请求结果{}", responseCode); log.info("请求ZDwcs成功,开始放货 请求结果{}", responseCode);
} }
}else{
if(StrUtil.equals(task.getTask_type(),"定点任务")){
JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyPut");
log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
is_feedback = true;
log.info("请求ZDwcs成功,开始放货 请求结果{}", responseCode);
}
}
}
} else { } else {
log.info("设备{} 请求放货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove()); log.info("设备{} 请求放货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove());
} }
@ -318,7 +379,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code()); jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle); jo.put("carId",processingVehicle);
jo.put("taskType ",type); jo.put("taskType ",task.getTask_type());
jo.put("feedbackStatus","applyPut"); jo.put("feedbackStatus","applyPut");
log.info("请求参数:{}",jo); log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
@ -330,10 +391,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "applyPut"); jo.put("feedbackStatus", "applyPut");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -341,7 +403,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
is_feedback = true; is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode); log.info("请求ZDwcs成功,开始放货 请求结果{}", responseCode);
}
} }
} }
} }
@ -349,10 +412,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver(); lubeiConveyorDeviceDriver = (LubeiConveyorDeviceDriver) addressdevice.getDeviceDriver();
if(lubeiConveyorDeviceDriver.getMove()==1){ if(lubeiConveyorDeviceDriver.getMove()==1){
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "putFinish"); jo.put("feedbackStatus", "putFinish");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -361,11 +425,33 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (responseCode == 0) { if (responseCode == 0) {
log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode); log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode);
} }
lubeiConveyorDeviceDriver.writing(3); lubeiConveyorDeviceDriver.writing(4);
if(lubeiConveyorDeviceDriver.getTo_command() == 3){ if (lubeiConveyorDeviceDriver.getTo_command() == 4) {
is_feedback = true; is_feedback = true;
} else { } else {
lubeiConveyorDeviceDriver.writing(3); lubeiConveyorDeviceDriver.writing(4);
}
}else{
if(StrUtil.equals(task.getTask_type(),"定点任务")){
JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle);
jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "putFinish");
log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo);
JSONObject response = JSONObject.parseObject(result.body());
int responseCode = response.getInteger("responseCode");
if (responseCode == 0) {
log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode);
}
lubeiConveyorDeviceDriver.writing(4);
if (lubeiConveyorDeviceDriver.getTo_command() == 4) {
is_feedback = true;
} else {
lubeiConveyorDeviceDriver.writing(4);
}
}
} }
} else { } else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove()); log.info("设备{} 请求离开,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove());
@ -375,7 +461,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code()); jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle); jo.put("carId",processingVehicle);
jo.put("taskType ",type); jo.put("taskType ",task.getTask_type());
jo.put("feedbackStatus","putFinish"); jo.put("feedbackStatus","putFinish");
log.info("请求参数:{}",jo); log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
@ -387,10 +473,11 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
if (!StrUtil.startWith(task.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode", task.getTask_code()); jo.put("taskCode", task.getTask_code());
jo.put("carId", processingVehicle); jo.put("carId", processingVehicle);
jo.put("taskType ",type); jo.put("taskType ", task.getTask_type());
jo.put("feedbackStatus", "putFinish"); jo.put("feedbackStatus", "putFinish");
log.info("请求参数:{}", jo); log.info("请求参数:{}", jo);
HttpResponse result = acsToWmsZDService.taskFeedback(jo); HttpResponse result = acsToWmsZDService.taskFeedback(jo);
@ -398,7 +485,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
int responseCode = response.getInteger("responseCode"); int responseCode = response.getInteger("responseCode");
if (responseCode == 0) { if (responseCode == 0) {
is_feedback = true; is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode); log.info("请求ZDwcs成功,放货完成 请求结果{}", responseCode);
}
} }
} }
} }
@ -416,8 +504,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
System.out.println("back agv:" + requestjo); System.out.println("back agv:" + requestjo);
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + jobno + "/interact"; agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + jobno + "/interact";
@ -426,6 +514,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
.body(String.valueOf(requestjo)) .body(String.valueOf(requestjo))
.timeout(20000)//超时,毫秒 .timeout(20000)//超时,毫秒
.execute(); .execute();
log.info("请求地址agvurl{},请求结果{}",agvurl,result.body());
} }
return requestjo.toString(); return requestjo.toString();

2
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/lubei_conveyor/LubeiConveyorDeviceDriver.java

@ -326,7 +326,7 @@ public class LubeiConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
Map<String, Object> itemMap = new HashMap<String, Object>(); Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, command); itemMap.put(to_command, command);
this.control(itemMap); this.control(itemMap);
log.info("下发的命令值是{}",command);
} }
public void writing(int type, int command) { public void writing(int type, int command) {

16
acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -867,23 +867,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS // 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
String Type1=entity.getTask_type(); String Type1=entity.getTask_type();
if(StrUtil.equals(Type1,"定点任务")){
JSONObject jo = new JSONObject();
jo.put("taskCode",entity.getTask_code());
jo.put("carId","");
jo.put("taskType ",entity.getTask_type());
jo.put("feedbackStatus","taking");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode");
if(responseCode == 0) {
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
}
}
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject feed_jo = new JSONObject(); JSONObject feed_jo = new JSONObject();
feed_jo.put("task_code", entity.getTask_code()); feed_jo.put("taskCode", entity.getTask_code());
// JSONArray ja = new JSONArray(); // JSONArray ja = new JSONArray();
// ja.add(feed_jo); // ja.add(feed_jo);
// acstowmsService.feedbackTaskStatusToWms(ja); // acstowmsService.feedbackTaskStatusToWms(ja);

9
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java

@ -52,12 +52,14 @@ public class QueryZDAgvTaskStatus {
} }
//反馈结果状态 //反馈结果状态
log.info("instcode:" + inst_code + "," + inst_jo.toString()); log.info("instcode:" + inst_code + "," + inst_jo.toString());
String state = inst_jo.getString("state"); String state = inst_jo.getString("status");
String vehicle = ""; String vehicle = "";
//正在执行指令agv车号 //正在执行指令agv车号
if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) { if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) {
vehicle = inst_jo.getString("vehicle"); vehicle = inst_jo.getString("vehicle");
inst.setCarno(vehicle); inst.setCarno(vehicle);
log.info("车号是{}",vehicle);
} }
// RAW:初始状态 // RAW:初始状态
// ACTIVE:业务订单已激活 // ACTIVE:业务订单已激活
@ -81,10 +83,9 @@ public class QueryZDAgvTaskStatus {
String Type1=entity.getTask_type(); String Type1=entity.getTask_type();
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("taskCode",entity.getTask_code()); jo.put("taskCode",entity.getTask_code());
jo.put("carId","111"); jo.put("carId",vehicle);
jo.put("taskType ",entity.getTask_type()); jo.put("taskType ",entity.getTask_type());
jo.put("feedbackStatus","taking"); jo.put("feedbackStatus","taking");
log.info("请求参数:{}",jo); log.info("请求参数:{}",jo);
@ -132,12 +133,14 @@ public class QueryZDAgvTaskStatus {
if (inst != null) { if (inst != null) {
inst.setInstruction_status("2"); inst.setInstruction_status("2");
instructionService.finish(inst); instructionService.finish(inst);
continue;
} }
} else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) { } else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) {
if (inst != null) { if (inst != null) {
inst.setInstruction_status("3"); inst.setInstruction_status("3");
instructionService.update(inst); instructionService.update(inst);
instructionService.removeByCodeFromCache(inst_jo.getString("task_code")); instructionService.removeByCodeFromCache(inst_jo.getString("task_code"));
continue;
} }
} }
JSONArray ja = inst_jo.getJSONArray("destinations"); JSONArray ja = inst_jo.getJSONArray("destinations");

33
acs/nladmin-system/src/main/resources/log/LubeiConveyorDeviceDriver.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<included>
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/>
<!-- 按照每天生成日志文件 -->
<appender name="LubeiConveyorDeviceDriver" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/驱动日志/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>200MB</maxFileSize>
<!--所有日志最多占多大容量-->
<totalSizeCap>2GB</totalSizeCap>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>${log.charset}</charset>
</encoder>
</appender>
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
<appender-ref ref="FILE3"/>
</logger>-->
<!-- 打印sql -->
<logger name="org.nl.acs.device_driver.basedriver.lubei_conveyor.LubeiConveyorDeviceDriver" level="info" additivity="false">
<appender-ref ref="LubeiConveyorDeviceDriver"/>
</logger>
</included>

1
acs/nladmin-system/src/main/resources/logback-spring.xml

@ -31,6 +31,7 @@ https://juejin.cn/post/6844903775631572999
<include resource="log/AcsToZDWms.xml"/> <include resource="log/AcsToZDWms.xml"/>
<include resource="log/ZDToAcsWms.xml"/> <include resource="log/ZDToAcsWms.xml"/>
<include resource="log/QueryZDAgvTaskStatus.xml"/> <include resource="log/QueryZDAgvTaskStatus.xml"/>
<include resource="log/LubeiConveyorDeviceDriver.xml"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>

Loading…
Cancel
Save