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