Browse Source

更新

master
周俊杰 1 year ago
parent
commit
a86c16bde8
  1. 4
      acs/nladmin-system/pom.xml
  2. 2
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/ZheDaAgvService.java
  3. 1
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java
  4. 15
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
  5. 10
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java
  6. 126
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/ZheDaAgvServiceImpl.java
  7. 2
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsZDController.java
  8. 3
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsZDToAcsController.java
  9. 72
      acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  10. 391
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  11. 9
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/DeviceStatusUpdate.java
  12. 3
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryZDAgvTaskStatus.java
  13. BIN
      acs/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls
  14. 7
      acs/nladmin-system/src/main/resources/log/AcsToWms.xml
  15. 33
      acs/nladmin-system/src/main/resources/log/AcsToZDWms.xml
  16. 33
      acs/nladmin-system/src/main/resources/log/ZDToAcsWms.xml
  17. 33
      acs/nladmin-system/src/main/resources/log/ZheDaAgv.xml
  18. 4
      acs/nladmin-system/src/main/resources/logback-spring.xml

4
acs/nladmin-system/pom.xml

@ -489,8 +489,10 @@
<includes> <includes>
<include>**/*.*</include> <include>**/*.*</include>
</includes> </includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource> </resource>
<resource> <resource>
<directory>${basedir}/src/main/resources</directory> <directory>${basedir}/src/main/resources</directory>
<includes> <includes>

2
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/ZheDaAgvService.java

@ -29,7 +29,7 @@ public interface ZheDaAgvService {
HttpResponse queryZDAgvDeviceStatus(); HttpResponse queryZDAgvDeviceStatus();
String process(String jobno, String type, String address, String action, String processingVehicle,String feedbackStatus); String process(String jobno, String type, String address, String action, String processingVehicle);
public HttpResponse markComplete(String code); public HttpResponse markComplete(String code);

1
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/MagicAgvServiceImpl.java

@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceType;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays; import java.util.Arrays;

15
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java

@ -19,6 +19,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
@ -28,12 +29,14 @@ import java.util.Map;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class NDCAgvServiceImpl implements NDCAgvService { public class NDCAgvServiceImpl implements NDCAgvService {
@Autowired
private final DeviceAppService deviceAppService; private DeviceAppService deviceAppService;
private final ParamService paramService; @Autowired
private final AcsToWmsService acsToWmsService; private ParamService paramService;
@Autowired
private final DeviceExecuteLogService logServer; private AcsToWmsService acsToWmsService;
@Autowired
private DeviceExecuteLogService logServer;
Map<String, AgvDto> AGVDeviceStatus = new HashMap(); Map<String, AgvDto> AGVDeviceStatus = new HashMap();

10
acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java

@ -21,6 +21,7 @@ import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceType; import org.nl.acs.opc.DeviceType;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays; import java.util.Arrays;
@ -32,9 +33,12 @@ import java.util.Map;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class XianGongAgvServiceImpl implements XianGongAgvService { public class XianGongAgvServiceImpl implements XianGongAgvService {
private final DeviceAppService deviceAppService; @Autowired
private final ParamService paramService; private DeviceAppService deviceAppService;
private final AcsToWmsService acsToWmsService; @Autowired
private ParamService paramService;
@Autowired
private AcsToWmsService acsToWmsService;
Map<String, AgvDto> AGVDeviceStatus = new HashMap(); Map<String, AgvDto> AGVDeviceStatus = new HashMap();
@LokiLog(type = LokiLogType.AGV) @LokiLog(type = LokiLogType.AGV)

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

@ -1,5 +1,6 @@
package org.nl.acs.agv.server.impl; package org.nl.acs.agv.server.impl;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
@ -18,6 +19,7 @@ import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDev
import org.nl.acs.device_driver.basedriver.lubei_conveyor.LubeiConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.lubei_conveyor.LubeiConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.paint_conveyor.PaintConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.paint_conveyor.PaintConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.AcsToWmsZDService; import org.nl.acs.ext.wms.service.AcsToWmsZDService;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
@ -49,6 +51,7 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
private final ParamService paramService; private final ParamService paramService;
@LokiLog(type = LokiLogType.AGV) @LokiLog(type = LokiLogType.AGV)
@Override @Override
@SaIgnore
public HttpResponse sendAgvInstToAgv(Instruction inst) throws Exception { public HttpResponse sendAgvInstToAgv(Instruction inst) throws Exception {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
String start_point_code = inst.getStart_point_code(); String start_point_code = inst.getStart_point_code();
@ -68,15 +71,18 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
jo.put("task_code", inst.getInstruction_code()); jo.put("task_code", inst.getInstruction_code());
//根据任务,下发指令类型 //根据任务,下发指令类型
JSONArray destinations = new JSONArray(); JSONArray destinations = new JSONArray();
if (task_type.equals("3")) { // if (task_type.equals("3")) {
destinations.add(destination(start_point_code, "Wait", "5", "1")); // destinations.add(destination(start_point_code, "Wait", "5", "1"));
} else if (task_type.equals("4")) { // } else if (task_type.equals("4")) {
destinations.add(destination(start_point_code, "Load", "1", "1")); // destinations.add(destination(start_point_code, "Load", "1", "1"));
destinations.add(destination(next_point_code, "Wait", "5", "1")); // destinations.add(destination(next_point_code, "Wait", "5", "1"));
} else { // } else {
destinations.add(destination(start_point_code, "Load", "1", "1")); // destinations.add(destination(start_point_code, "Load", "1", "1"));
destinations.add(destination(next_point_code, "Unload", "1", "1")); // destinations.add(destination(next_point_code, "Unload", "1", "1"));
} // }
destinations.add(destination(start_point_code, "Load", "1", "1"));
destinations.add(destination(next_point_code, "Unload", "1", "1"));
jo.put("destinations", destinations); jo.put("destinations", destinations);
@ -86,13 +92,14 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue(); String agvport2 = paramService.findByCode(AcsConfig.AGVPORT2).getValue();
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + inst.getInstruction_code(); agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/" + inst.getInstruction_code();
log.info("下发agv任务请求:{}", agvurl); log.info("下发agv任务请求:{}", agvurl);
HttpResponse result = HttpRequest.post(agvurl) HttpResponse result = HttpRequest.post(agvurl)
.body(String.valueOf(jo))//表单内容 .body(String.valueOf(jo))//表单内容
.timeout(20000)//超时,毫秒 .timeout(20000)//超时,毫秒
.execute(); .execute();
log.info("下发agv任务请求内容:{}", jo);
log.info("下发agv任务请求反馈:{}", result); log.info("下发agv任务请求反馈:{}", result);
return result; return result;
} else { } else {
@ -107,11 +114,13 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/v1/vehicles"; agvurl = agvurl + ":" + agvport + "/rmds/v1/transportOrders/query";
HttpResponse result = HttpRequest.get(agvurl) HttpResponse result = HttpRequest.post(agvurl)
.body("{}")
.timeout(20000)//超时,毫秒 .timeout(20000)//超时,毫秒
.execute(); .execute();
System.out.println("查询agv指令数据:" + result.body());
log.info("查询agv指令数据:{}", result.body());
return result; return result;
} else { } else {
@ -138,10 +147,10 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
@LokiLog(type = LokiLogType.AGV) @LokiLog(type = LokiLogType.AGV)
@Override @Override
public synchronized String process(String jobno, String type, String address, String action, String processingVehicle,String feedbackStatus) public synchronized String process(String jobno, String type, String address, String action, String processingVehicle)
{ {
{ {
log.info("查询到AGV请求参数,jobno:{},address:{}", jobno + ",address:" + address + ",type:" + type + ",action:" + action+",feedbackStatus:"+feedbackStatus); log.info("查询到AGV请求参数,jobno:{},address:{}", jobno + ",address:" + address + ",type:" + type + ",action:" + action);
//释放AGV资源,继续后续动作 //释放AGV资源,继续后续动作
boolean is_feedback = false; boolean is_feedback = false;
String str = ""; String str = "";
@ -177,7 +186,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","applyTake");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -188,13 +198,14 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
} else { } else {
log.info("设备{} 请求取货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove()); log.info("设备{} 请求取货,光电信号:{}",addressdevice,lubeiConveyorDeviceDriver.getMove());
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","applyTake");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -203,6 +214,22 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode); log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle);
jo.put("taskType ",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);
}
}
} }
if ("PauseOnStation".equals(type)) { if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
@ -212,7 +239,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","takeFinish");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -229,7 +257,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","takeFinish");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -238,6 +267,21 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("请求ZDwcs成功,取货完成 请求结果{}",responseCode); log.info("请求ZDwcs成功,取货完成 请求结果{}",responseCode);
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle);
jo.put("taskType ",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) {
is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
}
}
} }
} }
@ -251,7 +295,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","applyPut");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -268,7 +313,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","applyPut");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -277,6 +323,21 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("请求ZDwcs成功,开始放货 请求结果{}",responseCode); log.info("请求ZDwcs成功,开始放货 请求结果{}",responseCode);
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle);
jo.put("taskType ",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);
}
}
} }
if ("PauseOnStation".equals(type)) { if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) { if (addressdevice.getDeviceDriver() instanceof LubeiConveyorDeviceDriver) {
@ -286,7 +347,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","putFinish");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -303,7 +365,8 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
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 ",type);
jo.put("feedbackStatus",feedbackStatus); jo.put("feedbackStatus","putFinish");
log.info("请求参数:{}",jo);
HttpResponse result= acsToWmsZDService.taskFeedback(jo); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
JSONObject response=JSONObject.parseObject(result.body()); JSONObject response=JSONObject.parseObject(result.body());
int responseCode= response.getInteger("responseCode"); int responseCode= response.getInteger("responseCode");
@ -312,6 +375,21 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
log.info("请求ZDwcs成功,放货完成 请求结果{}",responseCode); log.info("请求ZDwcs成功,放货完成 请求结果{}",responseCode);
} }
} }
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
JSONObject jo = new JSONObject();
jo.put("taskCode",task.getTask_code());
jo.put("carId",processingVehicle);
jo.put("taskType ",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) {
is_feedback = true;
log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
}
}
} }
} }
com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject requestjo = new com.alibaba.fastjson.JSONObject();

2
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsZDController.java

@ -1,5 +1,6 @@
package org.nl.acs.ext.wms.rest; package org.nl.acs.ext.wms.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -23,6 +24,7 @@ import java.util.Map;
@RequestMapping("/restful/api/v3/system_car") @RequestMapping("/restful/api/v3/system_car")
@Slf4j @Slf4j
@Lazy @Lazy
@SaIgnore
public class AcsToWmsZDController { public class AcsToWmsZDController {
private final AcsToWmsZDService acsToWmsZDService; private final AcsToWmsZDService acsToWmsZDService;

3
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsZDToAcsController.java

@ -20,10 +20,11 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "wms接口") @Api(tags = "wms接口")
@RequestMapping("/restful/api/v3") @RequestMapping("/restful/API/V3")
@Slf4j @Slf4j
@Service @Service
@Lazy @Lazy
@SaIgnore
public class WmsZDToAcsController { public class WmsZDToAcsController {
private final WmsZDToAcsService wmsZDToAcsService; private final WmsZDToAcsService wmsZDToAcsService;
@PostMapping("/createTask") @PostMapping("/createTask")

72
acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -375,56 +375,50 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (ObjectUtil.isEmpty(route)) { if (ObjectUtil.isEmpty(route)) {
throw new BadRequestException("未查询到相关路由!"); throw new BadRequestException("未查询到相关路由!");
} }
<<<<<<< HEAD
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
String agvType = paramService.findByCode(AcsConfig.AGVTYPE).getValue();
if(agvType.equals("2")) { try {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue().toString(),String.valueOf(AgvSystemEnum.Maigic.getIndex()))) {
} HttpResponse result = magicAgvService.sendAgvInstToMagic(dto);
if(agvType.equals("4")){
ZheDaAgvService zheDaAgvService=SpringContextHolder.getBean(ZheDaAgvService.class);
zheDaAgvService.sendAgvInstToAgv(dto);
}
=======
try {
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) {
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).toString(), AgvSystemEnum.Maigic.getCode())) {
HttpResponse result = magicAgvService.sendAgvInstToMagic(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).toString(), AgvSystemEnum.NDC.getCode())) {
ndcAgvService.sendAgvInstToNDC("1",dto);
dto.setSend_status("1");
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).toString(), AgvSystemEnum.XianGong.getCode())) {
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
//追加订单
HttpResponse result = xianGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) { if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2"); dto.setSend_status("2");
} else { } else {
dto.setSend_status("1"); dto.setSend_status("1");
} }
} else { } else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue().toString(), String.valueOf(AgvSystemEnum.NDC.getIndex()))) {
//创建订单序列 ndcAgvService.sendAgvInstToNDC("1", dto);
HttpResponse result = xianGongAgvService.sendOrderSequencesToXZ(dto); dto.setSend_status("1");
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2"); } else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).toString(), String.valueOf(AgvSystemEnum.XianGong.getIndex()))) {
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
//追加订单
HttpResponse result = xianGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
} else { } else {
dto.setSend_status("1"); //创建订单序列
HttpResponse result = xianGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
} }
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue().toString(), String.valueOf(AgvSystemEnum.ZheDa.getIndex()))) {
ZheDaAgvService zheDaAgvService = SpringContextHolder.getBean(ZheDaAgvService.class);
zheDaAgvService.sendAgvInstToAgv(dto);
} }
} }
} catch (Exception e) {
dto.setSend_status("2");
e.printStackTrace();
} }
} catch (Exception e) {
dto.setSend_status("2");
e.printStackTrace();
>>>>>>> 7f049d32a8a28d031795c078f9dfda73974dbac8
} }
} catch (Exception e) { } catch (Exception e) {
dto.setSend_status("2"); dto.setSend_status("2");

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

@ -702,92 +702,120 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
} }
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS // 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { String Type1=entity.getTask_type();
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); if(StrUtil.equals(Type1,"定点任务")){
JSONObject feed_jo = new JSONObject(); JSONObject jo = new JSONObject();
feed_jo.put("task_id", entity.getExt_task_id()); jo.put("taskCode",entity.getTask_code());
feed_jo.put("task_code", dto.getTask_code()); jo.put("carId","");
feed_jo.put("task_status", dto.getTask_status()); jo.put("taskType ",entity.getTask_type());
JSONArray ja = new JSONArray(); jo.put("feedbackStatus","taking");
ja.add(feed_jo); log.info("请求参数:{}",jo);
String message = null; HttpResponse result= acsToWmsZDService.taskFeedback(jo);
HttpResponse body = null; JSONObject response=JSONObject.parseObject(result.body());
boolean flag = false; int responseCode= response.getInteger("responseCode");
try { if(responseCode == 0) {
body = acstowmsService.feedbackTaskStatusToWms(ja); log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
} catch (Exception e) {
flag = true;
message = e.getMessage();
e.printStackTrace();
} finally {
} }
if (flag) { }
if (ObjectUtil.isEmpty(feefbackdto)) { if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
feefbackdto = new TaskFeedbackDto(); JSONObject jo = new JSONObject();
feefbackdto.setTask_id(entity.getTask_id()); jo.put("taskCode",entity.getTask_code());
feefbackdto.setTask_code(entity.getTask_code()); jo.put("carId","");
feefbackdto.setTask_status(entity.getTask_status()); jo.put("taskType ",entity.getTask_type());
feefbackdto.setVehicle_type(entity.getVehicle_type()); jo.put("feedbackStatus","taking");
feefbackdto.setVehicle_code(entity.getVehicle_code()); log.info("请求参数:{}",jo);
feefbackdto.setStart_device_code(entity.getStart_device_code()); HttpResponse result= acsToWmsZDService.taskFeedback(jo);
feefbackdto.setStart_point_code(entity.getStart_point_code()); JSONObject response=JSONObject.parseObject(result.body());
feefbackdto.setNext_device_code(entity.getNext_device_code()); int responseCode= response.getInteger("responseCode");
feefbackdto.setNext_point_code(entity.getNext_point_code()); if(responseCode == 0) {
feefbackdto.setError_code("400"); log.info("请求ZDwcs成功,申请取货 请求结果{}",responseCode);
feefbackdto.setIs_finished("0");
feefbackdto.setRemark(message);
taskFeedbackService.create(feefbackdto);
} else {
feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getStart_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code());
feefbackdto.setError_code("400");
feefbackdto.setRemark(message);
taskFeedbackService.update(feefbackdto);
}
} else {
int status = body.getStatus();
JSONObject jo = JSONObject.parseObject(body.body());
if (ObjectUtil.isEmpty(feefbackdto)) {
feefbackdto = new TaskFeedbackDto();
feefbackdto.setTask_id(entity.getTask_id());
feefbackdto.setTask_code(entity.getTask_code());
feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setVehicle_type(entity.getVehicle_type());
feefbackdto.setVehicle_code(entity.getVehicle_code());
feefbackdto.setError_code(String.valueOf(body.getStatus()));
feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getNext_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code());
if (status == 200) {
if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1");
} else {
feefbackdto.setIs_finished("0");
}
} else {
feefbackdto.setIs_finished("0");
feefbackdto.setRemark(jo.getString("message"));
}
taskFeedbackService.create(feefbackdto);
} else {
feefbackdto.setTask_status(entity.getTask_status());
if (status == 200) {
} else {
if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1");
} else {
feefbackdto.setIs_finished("0");
}
}
taskFeedbackService.update(feefbackdto);
}
} }
} }
// TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
// JSONObject feed_jo = new JSONObject();
// feed_jo.put("task_id", entity.getExt_task_id());
// feed_jo.put("task_code", dto.getTask_code());
// feed_jo.put("task_status", dto.getTask_status());
// JSONArray ja = new JSONArray();
// ja.add(feed_jo);
// String message = null;
// HttpResponse body = null;
// boolean flag = false;
// try {
// body = acstowmsService.feedbackTaskStatusToWms(ja);
// } catch (Exception e) {
// flag = true;
// message = e.getMessage();
// e.printStackTrace();
// } finally {
//
// }
// if (flag) {
// if (ObjectUtil.isEmpty(feefbackdto)) {
// feefbackdto = new TaskFeedbackDto();
// feefbackdto.setTask_id(entity.getTask_id());
// feefbackdto.setTask_code(entity.getTask_code());
// feefbackdto.setTask_status(entity.getTask_status());
// feefbackdto.setVehicle_type(entity.getVehicle_type());
// feefbackdto.setVehicle_code(entity.getVehicle_code());
// feefbackdto.setStart_device_code(entity.getStart_device_code());
// feefbackdto.setStart_point_code(entity.getStart_point_code());
// feefbackdto.setNext_device_code(entity.getNext_device_code());
// feefbackdto.setNext_point_code(entity.getNext_point_code());
// feefbackdto.setError_code("400");
// feefbackdto.setIs_finished("0");
// feefbackdto.setRemark(message);
// taskFeedbackService.create(feefbackdto);
// } else {
// feefbackdto.setTask_status(entity.getTask_status());
// feefbackdto.setStart_device_code(entity.getStart_device_code());
// feefbackdto.setStart_point_code(entity.getStart_point_code());
// feefbackdto.setNext_device_code(entity.getNext_device_code());
// feefbackdto.setNext_point_code(entity.getNext_point_code());
// feefbackdto.setError_code("400");
// feefbackdto.setRemark(message);
// taskFeedbackService.update(feefbackdto);
// }
// } else {
// int status = body.getStatus();
// JSONObject jo = JSONObject.parseObject(body.body());
// if (ObjectUtil.isEmpty(feefbackdto)) {
// feefbackdto = new TaskFeedbackDto();
// feefbackdto.setTask_id(entity.getTask_id());
// feefbackdto.setTask_code(entity.getTask_code());
// feefbackdto.setTask_status(entity.getTask_status());
// feefbackdto.setVehicle_type(entity.getVehicle_type());
// feefbackdto.setVehicle_code(entity.getVehicle_code());
// feefbackdto.setError_code(String.valueOf(body.getStatus()));
// feefbackdto.setStart_device_code(entity.getStart_device_code());
// feefbackdto.setStart_point_code(entity.getNext_point_code());
// feefbackdto.setNext_device_code(entity.getNext_device_code());
// feefbackdto.setNext_point_code(entity.getNext_point_code());
// if (status == 200) {
// if (StrUtil.equals(entity.getTask_status(), "2")) {
// feefbackdto.setIs_finished("1");
// } else {
// feefbackdto.setIs_finished("0");
// }
// } else {
// feefbackdto.setIs_finished("0");
// feefbackdto.setRemark(jo.getString("message"));
// }
// taskFeedbackService.create(feefbackdto);
// } else {
// feefbackdto.setTask_status(entity.getTask_status());
// if (status == 200) {
// } else {
// if (StrUtil.equals(entity.getTask_status(), "2")) {
// feefbackdto.setIs_finished("1");
// } else {
// feefbackdto.setIs_finished("0");
// }
// }
// taskFeedbackService.update(feefbackdto);
// }
// }
// }
} }
@ -818,97 +846,97 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
removeByCodeFromCache(entity.getTask_code()); removeByCodeFromCache(entity.getTask_code());
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS // 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { // if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); // TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
System.out.println(feefbackdto == null); // System.out.println(feefbackdto == null);
JSONObject feed_jo = new JSONObject(); // JSONObject feed_jo = new JSONObject();
feed_jo.put("task_id", entity.getTask_id()); // feed_jo.put("task_id", entity.getTask_id());
feed_jo.put("task_code", entity.getTask_code()); // feed_jo.put("task_code", entity.getTask_code());
feed_jo.put("task_status", entity.getTask_status()); // feed_jo.put("task_status", entity.getTask_status());
JSONArray ja = new JSONArray(); // JSONArray ja = new JSONArray();
ja.add(feed_jo); // ja.add(feed_jo);
String message = null; // String message = null;
HttpResponse body = null; // HttpResponse body = null;
boolean flag = false; // boolean flag = false;
try { // try {
body = acstowmsService.feedbackTaskStatusToWms(ja); // body = acstowmsService.feedbackTaskStatusToWms(ja);
log.info("任务号:{},反馈wms任务状态完成成功,响应信息:{}!", entity.getTask_code(), body.body()); // log.info("任务号:{},反馈wms任务状态完成成功,响应信息:{}!", entity.getTask_code(), body.body());
} catch (Exception e) { // } catch (Exception e) {
log.error("任务号:{},反馈wms任务状态失败,原因:{}!", entity.getTask_code(), e.getMessage()); // log.error("任务号:{},反馈wms任务状态失败,原因:{}!", entity.getTask_code(), e.getMessage());
flag = true; // flag = true;
message = e.getMessage(); // message = e.getMessage();
e.printStackTrace(); // e.printStackTrace();
} finally { // } finally {
//
} // }
if (flag) { // if (flag) {
if (ObjectUtil.isEmpty(feefbackdto)) { // if (ObjectUtil.isEmpty(feefbackdto)) {
feefbackdto = new TaskFeedbackDto(); // feefbackdto = new TaskFeedbackDto();
feefbackdto.setTask_id(entity.getTask_id()); // feefbackdto.setTask_id(entity.getTask_id());
feefbackdto.setTask_code(entity.getTask_code()); // feefbackdto.setTask_code(entity.getTask_code());
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setVehicle_type(entity.getVehicle_type()); // feefbackdto.setVehicle_type(entity.getVehicle_type());
feefbackdto.setVehicle_code(entity.getVehicle_code()); // feefbackdto.setVehicle_code(entity.getVehicle_code());
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getStart_point_code()); // feefbackdto.setStart_point_code(entity.getStart_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
feefbackdto.setError_code("400"); // feefbackdto.setError_code("400");
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
feefbackdto.setRemark(message); // feefbackdto.setRemark(message);
taskFeedbackService.create(feefbackdto); // taskFeedbackService.create(feefbackdto);
} else { // } else {
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getStart_point_code()); // feefbackdto.setStart_point_code(entity.getStart_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
feefbackdto.setError_code("400"); // feefbackdto.setError_code("400");
feefbackdto.setRemark(message); // feefbackdto.setRemark(message);
taskFeedbackService.update(feefbackdto); // taskFeedbackService.update(feefbackdto);
} // }
} else { // } else {
int status = body.getStatus(); // int status = body.getStatus();
JSONObject jo = JSONObject.parseObject(body.body()); // JSONObject jo = JSONObject.parseObject(body.body());
if (ObjectUtil.isEmpty(feefbackdto)) { // if (ObjectUtil.isEmpty(feefbackdto)) {
feefbackdto = new TaskFeedbackDto(); // feefbackdto = new TaskFeedbackDto();
feefbackdto.setTask_id(entity.getTask_id()); // feefbackdto.setTask_id(entity.getTask_id());
feefbackdto.setTask_code(entity.getTask_code()); // feefbackdto.setTask_code(entity.getTask_code());
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
feefbackdto.setVehicle_type(entity.getVehicle_type()); // feefbackdto.setVehicle_type(entity.getVehicle_type());
feefbackdto.setVehicle_code(entity.getVehicle_code()); // feefbackdto.setVehicle_code(entity.getVehicle_code());
feefbackdto.setError_code(String.valueOf(body.getStatus())); // feefbackdto.setError_code(String.valueOf(body.getStatus()));
feefbackdto.setStart_device_code(entity.getStart_device_code()); // feefbackdto.setStart_device_code(entity.getStart_device_code());
feefbackdto.setStart_point_code(entity.getNext_point_code()); // feefbackdto.setStart_point_code(entity.getNext_point_code());
feefbackdto.setNext_device_code(entity.getNext_device_code()); // feefbackdto.setNext_device_code(entity.getNext_device_code());
feefbackdto.setNext_point_code(entity.getNext_point_code()); // feefbackdto.setNext_point_code(entity.getNext_point_code());
if (status == 200) { // if (status == 200) {
if (StrUtil.equals(entity.getTask_status(), "2")) { // if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1"); // feefbackdto.setIs_finished("1");
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
} // }
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
feefbackdto.setRemark(jo.getString("message")); // feefbackdto.setRemark(jo.getString("message"));
} // }
taskFeedbackService.create(feefbackdto); // taskFeedbackService.create(feefbackdto);
} else { // } else {
feefbackdto.setTask_status(entity.getTask_status()); // feefbackdto.setTask_status(entity.getTask_status());
if (status == 200) { // if (status == 200) {
if (StrUtil.equals(entity.getTask_status(), "2")) { // if (StrUtil.equals(entity.getTask_status(), "2")) {
feefbackdto.setIs_finished("1"); // feefbackdto.setIs_finished("1");
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
} // }
} else { // } else {
feefbackdto.setIs_finished("0"); // feefbackdto.setIs_finished("0");
feefbackdto.setRemark(jo.getString("message")); // feefbackdto.setRemark(jo.getString("message"));
} // }
taskFeedbackService.update(feefbackdto); // taskFeedbackService.update(feefbackdto);
} // }
} // }
} // }
// 如果属于先知AGV,关闭运单序列 // 如果属于先知AGV,关闭运单序列
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) {
try { try {
@ -954,6 +982,21 @@ 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();
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("task_code", entity.getTask_code());

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

@ -29,16 +29,15 @@ public class DeviceStatusUpdate {
public void run() throws Exception { public void run() throws Exception {
JSONObject row = new JSONObject(); JSONObject row = new JSONObject();
HttpResponse response = zheDaAgvService.queryAgvInstStatus(); HttpResponse response = zheDaAgvService.queryZDAgvDeviceStatus();
JSONArray inst_rows = JSONArray.parseArray(response.body()); JSONArray inst_rows = JSONArray.parseArray(response.body());
for (int i = 0; i < inst_rows.size(); i++) { for (int i = 0; i < inst_rows.size(); i++) {
JSONObject inst_jo = inst_rows.getJSONObject(i); JSONObject inst_jo = inst_rows.getJSONObject(i);
String deviceCode = inst_jo.getString("deviceCode"); String deviceCode = inst_jo.getString("vehicle");
Integer status = inst_jo.getInteger("status"); String statusDescription = inst_jo.getString("status");
String statusDescription = inst_jo.getString("statusDescription");
row.put("deviceCode",deviceCode); row.put("deviceCode",deviceCode);
row.put("status",status); row.put("status","1");
row.put("statusDescription",statusDescription); row.put("statusDescription",statusDescription);
JSONObject jo=JSONObject.parseObject(String.valueOf(row)); JSONObject jo=JSONObject.parseObject(String.valueOf(row));
HttpResponse result=acsToWmsZDService.deviceStatusUpdate(jo); HttpResponse result=acsToWmsZDService.deviceStatusUpdate(jo);

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

@ -31,7 +31,6 @@ public class QueryZDAgvTaskStatus {
for (int i = 0; i < inst_rows.size(); i++) { for (int i = 0; i < inst_rows.size(); i++) {
JSONObject inst_jo = inst_rows.getJSONObject(i); JSONObject inst_jo = inst_rows.getJSONObject(i);
String inst_code = inst_jo.getString("taskCode"); String inst_code = inst_jo.getString("taskCode");
String feedbackStatus=inst_jo.getString("feedbackStatus");
Instruction inst = instructionService.findByCodeFromCache(inst_code); Instruction inst = instructionService.findByCodeFromCache(inst_code);
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {
continue; continue;
@ -84,7 +83,7 @@ public class QueryZDAgvTaskStatus {
if ("true".equals(item.get("value"))) { if ("true".equals(item.get("value"))) {
String param = item.get("key").toString(); String param = item.get("key").toString();
//EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待 //EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待
agvService.process(inst_code, param, device, operation, vehicle,feedbackStatus); agvService.process(inst_code, param, device, operation, vehicle);
} }
} }
} }

BIN
acs/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls

Binary file not shown.

7
acs/nladmin-system/src/main/resources/log/AcsToWms.xml

@ -3,21 +3,20 @@
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/> <springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/> <property name="LOG_HOME" value="${logPath}"/>
<!-- 按照每天生成日志文件 --> <!-- 按照每天生成日志文件 -->
<appender name="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILEAcsToWmsServiceImpl" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名--> <!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern> <FileNamePattern>${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数--> <!--日志文件保留天数-->
<maxHistory>15</maxHistory> <maxHistory>15</maxHistory>
<!--单个日志最大容量 至少10MB才能看得出来--> <!--单个日志最大容量 至少10MB才能看得出来-->
<maxFileSize>200MB</maxFileSize> <maxFileSize>50MB</maxFileSize>
<!--所有日志最多占多大容量--> <!--所有日志最多占多大容量-->
<totalSizeCap>2GB</totalSizeCap> <totalSizeCap>2GB</totalSizeCap>
</rollingPolicy> </rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>${log.charset}</charset>
</encoder> </encoder>
</appender> </appender>
@ -28,6 +27,6 @@
<!-- 打印sql --> <!-- 打印sql -->
<logger name="org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl" level="info" additivity="false"> <logger name="org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl" level="info" additivity="false">
<appender-ref ref="FILE12"/> <appender-ref ref="FILEAcsToWmsServiceImpl"/>
</logger> </logger>
</included> </included>

33
acs/nladmin-system/src/main/resources/log/AcsToZDWms.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="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ACS反馈ZD/%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.ext.wms.service.impl.AcsToWmsZDServiceImpl" level="info" additivity="false">
<appender-ref ref="FILE12"/>
</logger>
</included>

33
acs/nladmin-system/src/main/resources/log/ZDToAcsWms.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="FILE13" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ZD反馈ACS/%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.ext.wms.service.impl.WmsZDToAcsServiceImpl" level="info" additivity="false">
<appender-ref ref="FILE13"/>
</logger>
</included>

33
acs/nladmin-system/src/main/resources/log/ZheDaAgv.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="FILE13" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/下发AGV日志/%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.agv.server.impl.ZheDaAgvServiceImpl" level="info" additivity="false">
<appender-ref ref="FILE13"/>
</logger>
</included>

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

@ -27,6 +27,10 @@ https://juejin.cn/post/6844903775631572999
<include resource="log/OneNDCSocketConnectionAutoRun.xml"/> <include resource="log/OneNDCSocketConnectionAutoRun.xml"/>
<include resource="log/Lucene.xml"/> <include resource="log/Lucene.xml"/>
<include resource="log/OpcUtil.xml"/> <include resource="log/OpcUtil.xml"/>
<include resource="log/ZheDaAgv.xml"/>
<include resource="log/AcsToZDWms.xml"/>
<include resource="log/ZDToAcsWms.xml"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>

Loading…
Cancel
Save