优化
This commit is contained in:
@@ -392,7 +392,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
json.put("device_code",this.device_code);
|
json.put("device_code",this.device_code);
|
||||||
json.put("type","4");
|
json.put("type","4");
|
||||||
// json.put("vehicle_code",barcode);
|
// json.put("vehicle_code",barcode);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请空盘请求参数:" + json);
|
||||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请空盘返回参数:" + result);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||||
@@ -416,7 +418,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "排产单确认请求参数:" + json);
|
||||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "排产单确认返回参数:" + result);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
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("producetask_code",order_No);
|
||||||
json.put("unqualified_qty",unqualified_qty);
|
json.put("unqualified_qty",unqualified_qty);
|
||||||
json.put("is_full","1");
|
json.put("is_full","1");
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛完成请求参数:" + json);
|
||||||
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛完成返回参数:" + result);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
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("batch",batch);
|
||||||
json.put("producetask_code",order_No);
|
json.put("producetask_code",order_No);
|
||||||
json.put("is_full","0");
|
json.put("is_full","0");
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛强制完成请求参数:" + json);
|
||||||
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "码垛强制完成返回参数:" + result);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
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("qty",encoder_qty);
|
||||||
json.put("unqualified_qty",unqualified_qty);
|
json.put("unqualified_qty",unqualified_qty);
|
||||||
json.put("is_full","1");
|
json.put("is_full","1");
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请入库请求参数:" + json);
|
||||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), "申请入库返回参数:" + result);
|
||||||
if (ObjectUtil.isNotEmpty(result)) {
|
if (ObjectUtil.isNotEmpty(result)) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
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>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
itemMap.put(to_command, command);
|
itemMap.put(to_command, command);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_command + "下发" + command);
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
itemMap.put(to_target, command);
|
itemMap.put(to_target, command);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_target + "下发" + command);
|
||||||
} else if (type == 3) {
|
} else if (type == 3) {
|
||||||
itemMap.put(to_task, command);
|
itemMap.put(to_task, command);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_task + "下发" + command);
|
||||||
}
|
}
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
|
|
||||||
@@ -615,7 +627,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
itemMap.put(to_param, value);
|
itemMap.put(to_param, value);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_param + "下发" + value);
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,6 +638,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
|||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
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);
|
||||||
|
logServer.deviceExecuteLog(device_code, String.valueOf(barcode), inst.getInstruction_code(), to_command + "下发" + command);
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
// 如果是送料任务需要反向组盘
|
// 如果是送料任务需要反向组盘
|
||||||
String handle_class = taskobj.getString("handle_class");
|
String handle_class = taskobj.getString("handle_class");
|
||||||
if (SendMaterialTask.class.getName().equals(handle_class) || ToConveyorTask.class.getName().equals(handle_class)) {
|
if (SendMaterialTask.class.getName().equals(handle_class) || ToConveyorTask.class.getName().equals(handle_class)) {
|
||||||
|
groupTable.delete("vehicle_code = '" + vehicle_code + "' AND task_id <> '" + task_id + "'");
|
||||||
JSONObject groupObj = groupTable.query("task_id='" + task_id + "'").uniqueResult(0);
|
JSONObject groupObj = groupTable.query("task_id='" + task_id + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(groupObj)) {
|
if (ObjectUtil.isNotEmpty(groupObj)) {
|
||||||
groupObj.put("vehicle_code", vehicle_code);
|
groupObj.put("vehicle_code", vehicle_code);
|
||||||
|
|||||||
Reference in New Issue
Block a user