更新
This commit is contained in:
@@ -310,9 +310,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
JSONObject param = new JSONObject() {{
|
JSONObject param = new JSONObject() {{
|
||||||
put("device_code", device_code);
|
put("device_code", device_code);
|
||||||
}};
|
}};
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:"+param);
|
||||||
HttpResponse response = acsToWmsService.shipDeviceUpdate(param);
|
HttpResponse response = acsToWmsService.shipDeviceUpdate(param);
|
||||||
if (response == null || response.getStatus() == 200) {
|
if (response == null || response.getStatus() == 200) {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:"+response.body());
|
||||||
this.requiresShipDeviceUpdate = true;
|
this.requiresShipDeviceUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,7 +370,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
public synchronized boolean finish_instruction() throws Exception {
|
public synchronized boolean finish_instruction() throws Exception {
|
||||||
instructionService.finish(inst);
|
instructionService.finish(inst);
|
||||||
// requireSucess = false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,12 +383,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." + param;
|
+ "." + param;
|
||||||
//String opcservcerid = this.getDevice().getOpc_server_id();
|
|
||||||
//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, Integer.parseInt(value));
|
itemMap.put(to_param, Integer.parseInt(value));
|
||||||
// itemMap.put(to_param, Integer.parseInt(value));
|
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||||
}
|
}
|
||||||
@@ -398,12 +395,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writing(int command) {
|
public void writing(int command) {
|
||||||
|
|
||||||
//String opcservcerid = this.getDevice().getOpc_server_id();
|
|
||||||
//Server server = ReadUtil.getServer(opcservcerid);
|
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -459,9 +452,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("last_task", last_task);
|
jo.put("last_task", last_task);
|
||||||
jo.put("task_code", task_code);
|
jo.put("task_code", task_code);
|
||||||
|
|
||||||
// jo.put("barcode", barcode);
|
|
||||||
// jo.put("last_task", last_task);
|
|
||||||
jo.put("inst_message", this.inst_message);
|
jo.put("inst_message", this.inst_message);
|
||||||
jo.put("last_inst_message", this.last_inst_message);
|
jo.put("last_inst_message", this.last_inst_message);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
@@ -486,8 +476,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
public void writing(List list) {
|
public void writing(List list) {
|
||||||
|
|
||||||
// String opcservcerid = this.getDevice().getOpc_server_id();
|
|
||||||
// Server server = ReadUtil.getServer(opcservcerid);
|
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Object ob = list.get(i);
|
Object ob = list.get(i);
|
||||||
@@ -728,6 +716,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||||
applyLabelingAndBindingRequest.setType("1");
|
applyLabelingAndBindingRequest.setType("1");
|
||||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,请求参数:"+JSON.toJSONString(applyLabelingAndBindingRequest));
|
||||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||||
|
|
||||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||||
@@ -741,8 +730,11 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
this.writing(list);
|
this.writing(list);
|
||||||
message = "申请贴标下发电气信号成功";
|
message = "申请贴标下发电气信号成功";
|
||||||
requireApplyLabelingSuccess = true;
|
requireApplyLabelingSuccess = true;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage();
|
message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage();
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -787,6 +779,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||||
applyLabelingAndBindingRequest.setType("2");
|
applyLabelingAndBindingRequest.setType("2");
|
||||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,请求参数:"+JSON.toJSONString(applyLabelingAndBindingRequest));
|
||||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||||
if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
|
if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
|
||||||
@@ -819,15 +812,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
list.add(map5);
|
list.add(map5);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
// this.writing(list);
|
// this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse));
|
||||||
message = "申请捆扎成功";
|
message = "申请捆扎成功";
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
message = "未返回尺寸信息";
|
message = "未返回尺寸信息";
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
message = applyLabelingAndBindingResponse.getMessage();
|
message = applyLabelingAndBindingResponse.getMessage();
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请捆扎,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -853,6 +848,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
apply.put("type", "2");
|
apply.put("type", "2");
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:"+JSON.toJSONString(apply));
|
||||||
|
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
message = "申请空盘入库接口不通";
|
message = "申请空盘入库接口不通";
|
||||||
@@ -891,7 +888,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
apply.put("type", "4");
|
apply.put("type", "4");
|
||||||
apply.put("vehicle_code", instruction.getVehicle_code());
|
apply.put("vehicle_code", instruction.getVehicle_code());
|
||||||
|
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:"+apply);
|
||||||
|
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
message = "申请AGV搬运任务接口不通";
|
message = "申请AGV搬运任务接口不通";
|
||||||
@@ -899,6 +899,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
message = "申请AGV搬运任务成功";
|
message = "申请AGV搬运任务成功";
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:"+jo);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user