更新
This commit is contained in:
@@ -521,4 +521,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String str = "10001";
|
||||||
|
System.out.println(StrUtil.startWith(str, "-") );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public class AcsToXRlkServiceImpl implements AcsToXrlkService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
AddressService addressService;
|
AddressService addressService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
private final LogServer logServer;
|
private final LogServer logServer;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -61,14 +62,14 @@ public class AcsToXRlkServiceImpl implements AcsToXrlkService {
|
|||||||
AddressDto addressDto = addressService.findByCode("isPutPermission");
|
AddressDto addressDto = addressService.findByCode("isPutPermission");
|
||||||
String url = wcsurl + addressDto.getMethods_url() + device_code;
|
String url = wcsurl + addressDto.getMethods_url() + device_code;
|
||||||
HttpResponse result = null;
|
HttpResponse result = null;
|
||||||
log.info("isPutPermission-----请求url{}",url);
|
log.info("isPutPermission-----请求url"+url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"}
|
//{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"}
|
||||||
|
|
||||||
result = HttpRequest.get(url)
|
result = HttpRequest.get(url)
|
||||||
.execute();
|
.execute();
|
||||||
log.info("isPutPermission-----反馈{}", result);
|
log.info("isPutPermission-----反馈"+ result);
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
@@ -109,19 +110,21 @@ public class AcsToXRlkServiceImpl implements AcsToXrlkService {
|
|||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("station",device_code);
|
jo.put("station",device_code);
|
||||||
jo.put("type",type);
|
jo.put("type",type);
|
||||||
log.info("AGVWorkStatus-----请求参数{}", jo.toString());
|
log.info("AGVWorkStatus-----请求参数"+ jo.toString());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"}
|
//{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"}
|
||||||
result = HttpRequest.post(url).body(String.valueOf(jo))
|
result = HttpRequest.post(url).body(String.valueOf(jo))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
log.info("AGVWorkStatus-----反馈{}", result);
|
log.info("AGVWorkStatus-----反馈"+ result);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
//网络不通
|
//网络不通
|
||||||
System.out.println(msg);
|
System.out.println(msg);
|
||||||
|
log.info("AGVWorkStatus-----反馈"+ msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,11 +127,11 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
|
bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("收到请求参数:" + bs);
|
// System.out.println("收到请求参数:" + bs);
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
if (arr[8] * 256 + arr[9] == 0x73) {
|
if (arr[8] * 256 + arr[9] == 0x73) {
|
||||||
byte[] data = null;
|
byte[] data = null;
|
||||||
System.out.println("接收agv上报信息:" + bs);
|
// System.out.println("接收agv上报信息:" + bs);
|
||||||
//执行阶段
|
//执行阶段
|
||||||
int phase = arr[16] * 256 + arr[17];
|
int phase = arr[16] * 256 + arr[17];
|
||||||
// agv任务号
|
// agv任务号
|
||||||
@@ -830,7 +830,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
case 1:
|
case 1:
|
||||||
TaskDto taskDto = taskService.findByCode(inst.getTask_code());
|
TaskDto taskDto = taskService.findByCode(inst.getTask_code());
|
||||||
boolean tag = false;
|
boolean tag = false;
|
||||||
if (!StrUtil.startWith(inst.getTask_code(), "-") || StrUtil.equals(taskDto.getTask_type(),"3")) {
|
if (StrUtil.startWith(inst.getTask_code(), "-") || StrUtil.equals(taskDto.getTask_type(),"3")) {
|
||||||
tag = true;
|
tag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -889,13 +889,16 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
HttpResponse response = acsToXrlkService.isTakePermission(device.getDevice_code());
|
HttpResponse response = acsToXrlkService.isTakePermission(device.getDevice_code());
|
||||||
if (response.getStatus() == 200) {
|
if (response.getStatus() == 200) {
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
log.info("AGV请求取货设备:" + jo.toString());
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求取货设备{},立库WMS不允许取货", device_code);
|
log.info("AGV请求取货设备{},立库WMS不允许取货", device_code);
|
||||||
|
log.info("AGV请求取货设备立库WMS不允许取货");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求取货设备{},接口请求立库WMS失败", device_code);
|
log.info("AGV请求取货设备{},接口请求立库WMS失败", device_code);
|
||||||
|
log.info("AGV请求取货设备立库WMS失败");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
@@ -964,10 +967,12 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "2");
|
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "2");
|
||||||
if (response.getStatus() == 200) {
|
if (response.getStatus() == 200) {
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
log.info("AGV取货完成请求请求立库" + jo.toString());
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
log.info("AGV取货完成请求请求立库:{}", jo.toString());
|
log.info("AGV取货完成请求请求立库成功");
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
|
log.info("AGV取货完成请求请求立库失败");
|
||||||
log.info("AGV取货完成反馈设备{},{}", device_code, jo.getString("message"));
|
log.info("AGV取货完成反馈设备{},{}", device_code, jo.getString("message"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -975,6 +980,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
log.info("AGV取货完成不需要反馈立库");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
@@ -3770,7 +3776,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("agv上报不是0073类型动作,不处理");
|
// System.out.println("agv上报不是0073类型动作,不处理");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3799,7 +3805,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
public static void write(byte[] b) {
|
public static void write(byte[] b) {
|
||||||
try {
|
try {
|
||||||
log.info("下发agv数据:" + Bytes2HexString(b));
|
log.info("下发agv数据:" + Bytes2HexString(b));
|
||||||
System.out.println("下发agv数据:" + Bytes2HexString(b));
|
// System.out.println("下发agv数据:" + Bytes2HexString(b));
|
||||||
dos.write(b);
|
dos.write(b);
|
||||||
dos.flush();
|
dos.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
<?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="FILE7" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<!--日志文件输出的文件名-->
|
|
||||||
<FileNamePattern>${LOG_HOME}/ACS请求ERP/%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>
|
|
||||||
</encoder>
|
|
||||||
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
|
||||||
<appender-ref ref="FILE3"/>
|
|
||||||
</logger>-->
|
|
||||||
|
|
||||||
<!-- 打印sql -->
|
|
||||||
<logger name=" org.nl.acs.ext.erp.service.impl.AcsToErpServiceImpl" level="info" additivity="false">
|
|
||||||
<appender-ref ref="FILE7"/>
|
|
||||||
</logger>
|
|
||||||
</included>
|
|
||||||
Reference in New Issue
Block a user