This commit is contained in:
zhangjiangwei
2023-03-16 18:17:12 +08:00
parent d58e8f6b41
commit f98efc0ca2
2 changed files with 16 additions and 2 deletions

View File

@@ -392,7 +392,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
json.put("device_code",this.device_code);
json.put("type","4");
// json.put("vehicle_code",barcode);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请空盘请求参数:" + json);
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请空盘返回参数:" + result);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
@@ -416,7 +418,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
return false;
} else {
this.instruction_require_time = date;
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "排产单确认请求参数:" + json);
HttpResponse result = acsToWmsService.enterOrder(json);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "排产单确认返回参数:" + result);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
@@ -459,7 +463,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
json.put("producetask_code",order_No);
json.put("unqualified_qty",unqualified_qty);
json.put("is_full","1");
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛完成请求参数:" + json);
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛完成返回参数:" + result);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
@@ -495,7 +501,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
json.put("batch",batch);
json.put("producetask_code",order_No);
json.put("is_full","0");
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛强制完成请求参数:" + json);
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛强制完成返回参数:" + result);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
@@ -527,7 +535,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
json.put("qty",encoder_qty);
json.put("unqualified_qty",unqualified_qty);
json.put("is_full","1");
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请入库请求参数:" + json);
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请入库返回参数:" + result);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
@@ -597,11 +607,13 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
Map<String, Object> itemMap = new HashMap<String, Object>();
if (type == 1) {
itemMap.put(to_command, command);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_command + "下发" + command);
} else if (type == 2) {
itemMap.put(to_target, command);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_target + "下发" + command);
} else if (type == 3) {
itemMap.put(to_task, command);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_task + "下发" + command);
}
ReadUtil.write(itemMap, server);
@@ -615,7 +627,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, value);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_param + "下发" + value);
ReadUtil.write(itemMap, server);
}
@@ -626,6 +638,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, command);
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_command + "下发" + command);
ReadUtil.write(itemMap, server);
}