diff --git a/acs/nladmin-system/pom.xml b/acs/nladmin-system/pom.xml
index 9d3187d..4ce11ae 100644
--- a/acs/nladmin-system/pom.xml
+++ b/acs/nladmin-system/pom.xml
@@ -35,11 +35,11 @@
-
- org.bouncycastle
- bcprov-jdk15on
- 1.50
-
+
+
+
+
+
org.apache.commons
@@ -70,21 +70,45 @@
org.openscada.jinterop
org.openscada.jinterop.core
2.1.8
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+
+
org.openscada.jinterop
org.openscada.jinterop.deps
1.5.0
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+
+
org.openscada.utgard
org.openscada.opc.dcom
1.5.0
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+
+
org.openscada.utgard
org.openscada.opc.lib
1.5.0
+
+
+ org.bouncycastle
+ bcprov-jdk15on
+
+
com.squareup.okhttp3
@@ -447,45 +471,27 @@
${lucene.version}
-
-
-
-
-
- nexus
-
- nexus
- http://121.40.234.130:8081/repository/maven-releases/
-
-
-
-
-
+ ${project.artifactId}
org.springframework.boot
spring-boot-maven-plugin
-
+ 2.2.10.RELEASE
org.nl.AppRun
+ true
+
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
-
+
+
+
+ repackage
+
+
+
-
@@ -504,7 +510,5 @@
-
-
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java b/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java
index 77cbff7..4719225 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/AcsConfig.java
@@ -30,6 +30,10 @@ public interface AcsConfig {
String AGVTYPE = "agvType";
//WMS系统接口地址
String WMSURL = "wmsurl";
+ //MES系统接口地址
+ String MESURL = "mesurl";
+ //MES系统接口地址
+// String MESURL = "mesurl";
//WCS系统接口地址
String WCSURL = "wcsurl";
@@ -38,6 +42,8 @@ public interface AcsConfig {
String ERPURL = "erpurl";
//是否存在wms系统
String HASWMS = "hasWms";
+ //是否存在mes系统
+ String HASMES = "hasMes";
//路由选择
String ROUTE = "route";
//忽略取放货校验
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/NDCAgvService.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/NDCAgvService.java
index abc3185..b94840b 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/NDCAgvService.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/NDCAgvService.java
@@ -31,6 +31,8 @@ public interface NDCAgvService {
public byte[] sendAgvOneModeInst(int phase, int index,int result);
+ public byte[] sendAgvOneModeInst(int phase, int index,int result,Instruction inst);
+
public byte[] sendAgvTwoModeInst(int phase, int index,int result);
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
index 28be8fc..bfef3a3 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java
@@ -1,5 +1,6 @@
package org.nl.acs.agv.server.impl;
+import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -14,6 +15,7 @@ import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.LokiLog;
import org.nl.acs.log.LokiLogType;
import org.nl.acs.log.service.DeviceExecuteLogService;
+import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.modules.system.service.ParamService;
@@ -30,13 +32,13 @@ import java.util.Map;
@RequiredArgsConstructor
public class NDCAgvServiceImpl implements NDCAgvService {
@Autowired
- private DeviceAppService deviceAppService;
+ private DeviceAppService deviceAppService;
@Autowired
- private ParamService paramService;
+ private ParamService paramService;
@Autowired
- private AcsToWmsService acsToWmsService;
+ private AcsToWmsService acsToWmsService;
@Autowired
- private DeviceExecuteLogService logServer;
+ private DeviceExecuteLogService logServer;
Map AGVDeviceStatus = new HashMap();
@@ -76,6 +78,9 @@ public class NDCAgvServiceImpl implements NDCAgvService {
@LokiLog(type = LokiLogType.AGV)
@Override
public void sendAgvInstToNDC(String agv_system_type, Instruction inst) {
+ log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
+ ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
+ ",nextAddress:" + inst.getNext_point_code());
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
String instcode = inst.getInstruction_code();
int type = Integer.parseInt(inst.getAgv_inst_type());
@@ -83,7 +88,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
int startAddress = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
- int nextAddress = deviceService.queryAddressBydeviceCode(inst.getNext_point_code());
+ int nextAddress = deviceService.queryAddressBynextdeviceCode(inst.getNext_point_code());
byte ikeyhigh = (byte) IntToHexHigh(Integer.parseInt(instcode));
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
byte typehigh = (byte) IntToHexHigh(type);
@@ -93,37 +98,71 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte fhdhigh = (byte) IntToHexHigh(nextAddress);
byte fhdlow = (byte) IntToHexLow(nextAddress);
byte prioritylow = (byte) IntToHexLow(priority);
+
+
String str = "十进制下发:";
String str1 = "十六进制下发:";
- str += "ikey:" + (Integer.parseInt(instcode));
- str1 += "ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
- str += "/type:" + (type);
- str1 += "/type:" + hexToString(typehigh & 0xFF) + hexToString(typelow & 0xFF);
- str += "/qhd:" + (startAddress);
- str1 += "/qhd:" + hexToString(qhdhigh & 0xFF) + hexToString(qhdlow & 0xFF);
- str += "/fhd:" + (nextAddress);
- str1 += "/fhd:" + hexToString(fhdhigh & 0xFF) + hexToString(fhdlow & 0xFF);
- str += "/priority:" + (priority);
- str1 += "/priority:" + hexToString(prioritylow & 0xFF);
- System.out.println(str);
- System.out.println(str1);
- byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
- (byte) 0X00, (byte) 0X08,
- (byte) 0X00, (byte) 0X12,
- (byte) 0X00, (byte) 0X01,
- (byte) 0X00, (byte) 0X71,
- (byte) 0X00, (byte) 0X0E,
- (byte) 0X01, prioritylow,
- (byte) 0X00, (byte) 0X01,
- (byte) ikeyhigh, (byte) ikeylow,
- (byte) ikeyhigh, (byte) ikeylow,
- (byte) typehigh, (byte) typelow,
- (byte) qhdhigh, (byte) qhdlow,
- (byte) fhdhigh, (byte) fhdlow
- };
- log.info("下发AGV作业指令--{}", str1);
+ if (ObjectUtil.isNotEmpty(inst.getCarno())) {
+ int carNo = Integer.parseInt(inst.getCarno());
+ byte agvnohigh = (byte) IntToHexHigh(carNo);
+ byte agvnolow = (byte) IntToHexLow(carNo);
+ str += "agv车号 /carNo:" + (carNo);
+ str1 += "agv车号 /carNo:" + hexToString(agvnolow & 0xFF);
+ }
+ str += "任务号 ikey:" + (Integer.parseInt(instcode));
+ str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
+
+ str += "指令类型 /type:" + (type);
+ str1 += "指令类型 /type:" + hexToString(typehigh & 0xFF) + hexToString(typelow & 0xFF);
+
+ str += "取货点 /qhd:" + (startAddress);
+ str1 += "取货点 /qhd:" + hexToString(qhdhigh & 0xFF) + hexToString(qhdlow & 0xFF);
+ str += "放货点 /fhd:" + (nextAddress);
+ str1 += "放货点 /fhd:" + hexToString(fhdhigh & 0xFF) + hexToString(fhdlow & 0xFF);
+
+ str += "优先级 /priority:" + (priority);
+ str1 += "优先级 /priority:" + hexToString(prioritylow & 0xFF);
+
+ byte[] b = new byte[]{};
+ if (ObjectUtil.isNotEmpty(inst.getCarno())){
+ int carNo = Integer.parseInt(inst.getCarno());
+ byte agvnohigh = (byte) IntToHexHigh(carNo);
+ byte agvnolow = (byte) IntToHexLow(carNo);
+ b = new byte[]{(byte) 0X87, (byte) 0XCD,
+ (byte) 0X00, (byte) 0X08,
+ (byte) 0X00, (byte) 0X14,
+ (byte) 0X00, (byte) 0X01,
+ (byte) 0X00, (byte) 0X71,
+ (byte) 0X00, (byte) 0X10,
+ (byte) 0X01, prioritylow,
+ (byte) 0X00, (byte) 0X01,
+ (byte) ikeyhigh, (byte) ikeylow,
+ (byte) ikeyhigh, (byte) ikeylow,
+ (byte) typehigh, (byte) typelow,
+ (byte) qhdhigh, (byte) qhdlow,
+ (byte) fhdhigh, (byte) fhdlow,
+ (byte) agvnohigh, (byte) agvnolow
+ };
+ }else {
+ b = new byte[]{(byte) 0X87, (byte) 0XCD,
+ (byte) 0X00, (byte) 0X08,
+ (byte) 0X00, (byte) 0X12,
+ (byte) 0X00, (byte) 0X01,
+ (byte) 0X00, (byte) 0X71,
+ (byte) 0X00, (byte) 0X0E,
+ (byte) 0X01, prioritylow,
+ (byte) 0X00, (byte) 0X01,
+ (byte) ikeyhigh, (byte) ikeylow,
+ (byte) ikeyhigh, (byte) ikeylow,
+ (byte) typehigh, (byte) typelow,
+ (byte) qhdhigh, (byte) qhdlow,
+ (byte) fhdhigh, (byte) fhdlow
+ };
+ }
+ log.info("下发AGV作业指令 --{}", str1);
+ log.info("下发AGV作业指令--{}", str);
+ log.info("下发agv指令数据--{}", Bytes2HexString(b));
OneNDCSocketConnectionAutoRun.write(b);
- System.out.println("下发agv指令数据:" + Bytes2HexString(b));
}
}
@@ -155,6 +194,111 @@ public class NDCAgvServiceImpl implements NDCAgvService {
}
+ @Override
+ public byte[] sendAgvOneModeInst(int phase, int index, int result,Instruction inst) {
+ if (inst.getAgv_inst_type().equals("1")){
+ return sendAgvOneModeInst(phase, index, result);
+ }
+ DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
+ DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
+ Device startDevice = appService.findDeviceByCode(inst.getStart_point_code());
+ Device nextDevice = appService.findDeviceByCode(inst.getNext_point_code());
+ String startLinkDeviceCode = "";
+ String nextLinkDeviceCode = "";
+ int start2Address = 0;
+ int next2Address = 0;
+ int startLinkAddress = 0;
+ int nextLinkAddress = 0;
+ if (inst.getAgv_inst_type().equals("3")) {
+ startLinkDeviceCode = String.valueOf(startDevice.getExtraValue().get("link_device_code"));
+ nextLinkDeviceCode = String.valueOf(nextDevice.getExtraValue().get("link_device_code"));
+ startLinkAddress = deviceService.queryAddressBydeviceCode(startLinkDeviceCode);
+ nextLinkAddress = deviceService.queryAddressBynextdeviceCode(nextLinkDeviceCode);
+ }
+ int startAddress = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
+ int nextAddress = deviceService.queryAddressBynextdeviceCode(inst.getNext_point_code());
+ if (!inst.getAgv_inst_type().equals("1")){
+ start2Address = deviceService.queryAddressBydeviceCode(inst.getStart_point_code2());
+ next2Address = deviceService.queryAddressBynextdeviceCode(inst.getNext_point_code2());
+ }
+
+ byte qhdhigh = 0;
+ byte qhdlow = 0;
+ byte fhdhigh = 0;
+ byte fhdlow = 0;
+ byte addrHigh = 0;
+ byte addrLow = 0;
+ if (phase < 0 || index < 0)
+ return null;
+ byte indexhigh = (byte) IntToHexHigh(index);
+ byte indexlow = (byte) IntToHexLow(index);
+ byte phasehigh = (byte) IntToHexHigh(phase);
+ byte phaselow = (byte) IntToHexLow(phase);
+ if (inst.getAgv_inst_type().equals("2")){
+ if (phase == 0x09) {
+ qhdhigh = (byte) IntToHexHigh(start2Address);
+ qhdlow = (byte) IntToHexLow(start2Address);
+ addrHigh = qhdhigh;
+ addrLow = qhdlow;
+ }else if (phase == 0x0D) {
+ fhdhigh = (byte) IntToHexHigh(next2Address);
+ fhdlow = (byte) IntToHexLow(next2Address);
+ addrHigh = fhdhigh;
+ addrLow = fhdlow;
+ }
+ }else if (inst.getAgv_inst_type().equals("3")) {
+ if (phase == 0x09) {
+ qhdhigh = (byte) IntToHexHigh(nextAddress);
+ qhdlow = (byte) IntToHexLow(nextAddress);
+ addrHigh = qhdhigh;
+ addrLow = qhdlow;
+ }else if (phase == 0x11) {
+ qhdhigh = (byte) IntToHexHigh(startLinkAddress);
+ qhdlow = (byte) IntToHexLow(startLinkAddress);
+ addrHigh = qhdhigh;
+ addrLow = qhdlow;
+ }else if (phase == 0x19){
+ qhdhigh = (byte) IntToHexHigh(nextLinkAddress);
+ qhdlow = (byte) IntToHexLow(nextLinkAddress);
+ addrHigh = qhdhigh;
+ addrLow = qhdlow;
+ }else if (phase == 0x0D){
+ fhdhigh = (byte) IntToHexHigh(nextLinkAddress);
+ fhdlow = (byte) IntToHexLow(nextLinkAddress);
+ addrHigh = fhdhigh;
+ addrLow = fhdlow;
+ }else if (phase == 0x15){
+ fhdhigh = (byte) IntToHexHigh(start2Address);
+ fhdlow = (byte) IntToHexLow(start2Address);
+ addrHigh = fhdhigh;
+ addrLow = fhdlow;
+ }else if (phase == 0x1D){
+ fhdhigh = (byte) IntToHexHigh(next2Address);
+ fhdlow = (byte) IntToHexLow(next2Address);
+ addrHigh = fhdhigh;
+ addrLow = fhdlow;
+ }
+ }
+ byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
+ (byte) 0X00, (byte) 0X08,
+ (byte) 0X00, (byte) 0X0C,
+ (byte) 0X00, (byte) 0X01,
+ (byte) 0X00, (byte) 0X6D,
+ (byte) 0X00, (byte) 0X08,
+ (byte) indexhigh, (byte) indexlow,
+ (byte) 0X01, (byte) 0X12,
+ (byte) phasehigh, (byte) phaselow,
+ (byte) addrHigh, (byte) addrLow,
+ };
+
+
+ log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:" + hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF));
+
+ System.out.println("反馈agv动作数据:" + Bytes2HexString(b));
+ return b;
+
+ }
+
@Override
public byte[] sendAgvTwoModeInst(int phase, int index, int result) {
@@ -217,9 +361,9 @@ public class NDCAgvServiceImpl implements NDCAgvService {
};
log.info("下发AGV充电任务--{}", str1);
- try{
+ try {
OneNDCSocketConnectionAutoRun.write(b);
- } catch (Exception e){
+ } catch (Exception e) {
e.getMessage();
return false;
}
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
index e8672f2..ed8a01b 100644
--- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java
@@ -159,7 +159,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
//任务完毕
//(无车id及状态)
- else if (phase == 0x0A) {
+ else if (phase == 0x22) {
if (!ObjectUtil.isEmpty(inst)) {
if (!ObjectUtil.isEmpty(inst)) {
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls
index 1c3db51..1664120 100644
Binary files a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls and b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls differ
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/address/wql/sys_config.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device/address/wql/sys_config.xls
index b0b5f2a..bac9ea7 100644
Binary files a/acs/nladmin-system/src/main/java/org/nl/acs/device/address/wql/sys_config.xls and b/acs/nladmin-system/src/main/java/org/nl/acs/device/address/wql/sys_config.xls differ
diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/TaskConfigController.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/TaskConfigController.java
new file mode 100644
index 0000000..98458fc
--- /dev/null
+++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/rest/TaskConfigController.java
@@ -0,0 +1,61 @@
+package org.nl.acs.device.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.nl.acs.device.service.TaskConfigService;
+import org.nl.acs.device.service.dto.TaskConfigDto;
+import org.nl.modules.logging.annotation.Log;
+import org.springframework.data.domain.Pageable;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "任务配置管理")
+@RequestMapping("/api/TaskConfig")
+@Slf4j
+public class TaskConfigController {
+ private final TaskConfigService taskConfigService;
+
+
+ @GetMapping
+ @Log("查询任务配置")
+ @ApiOperation("查询任务配置")
+ //@PreAuthorize("@el.check('Address:list')")
+ public ResponseEntity