opt: 内包间优化
This commit is contained in:
@@ -291,7 +291,11 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (ObjectUtil.isNotEmpty(inst1)) {
|
||||
String task_code = inst1.getTask_code();
|
||||
if (Long.parseLong(task_code) < 1) {
|
||||
message = "任务ACS创建,不反馈LMS取货完成";
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 6);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "任务ACS创建,不反馈LMS套管工位取货完成";
|
||||
return;
|
||||
}
|
||||
applyManipulatorActionRequest.setAction("1");
|
||||
|
||||
@@ -243,6 +243,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
// this.setNow_steps_type(0);
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "当前执行步骤复位后:" + this.getNow_steps_type());
|
||||
// }
|
||||
requireSucess = false;
|
||||
feedMessage = "";
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
@@ -393,6 +394,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
itemMap.put(getToParam() + key, value);
|
||||
}
|
||||
});
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
@@ -442,7 +444,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (mode == 3 && action == 2) {
|
||||
String task_code = inst1.getTask_code();
|
||||
if(Long.parseLong(task_code) < 1){
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 2);
|
||||
this.writing(map);
|
||||
message = "任务ACS创建,不反馈LMS尺寸";
|
||||
feedbackSucess = true;
|
||||
return;
|
||||
}
|
||||
applyManipulatorActionRequest.setType("2");
|
||||
@@ -454,7 +460,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
message = "反馈尺寸LMS成功...";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 2);
|
||||
map.put("to_command", "2");
|
||||
this.writing(map);
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
@@ -480,7 +486,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
|
||||
map.put("to_size", applyManipulatorActionResponse.getSize());
|
||||
map.put("to_command", 3);
|
||||
map.put("to_command", "3");
|
||||
map.put("to_putpoint", Integer.parseInt(to_putpoint));
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
@@ -506,7 +512,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
Device device = deviceAppService.findDeviceByCode(get_device_code);
|
||||
String to_new_getpoint = device.getExtraValue().get("address").toString();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 4);
|
||||
map.put("to_command", "4");
|
||||
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
|
||||
map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint));
|
||||
this.writing(map);
|
||||
@@ -535,8 +541,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
String to_two_putpoint = device.getExtraValue().get("address").toString();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
|
||||
// map.put("to_size", applyManipulatorActionResponse.getSize());
|
||||
map.put("to_command", 5);
|
||||
map.put("to_command", "5");
|
||||
map.put("to_two_putpoint", Integer.parseInt(to_two_putpoint));
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
@@ -552,6 +557,10 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (mode == 3 && action == 6) {
|
||||
String task_code = inst1.getTask_code();
|
||||
if(Long.parseLong(task_code) < 1){
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "6");
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
message = "任务ACS创建,不反馈LMS缓存库取货成功";
|
||||
return;
|
||||
}
|
||||
@@ -561,7 +570,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (applyManipulatorActionResponse1.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 6);
|
||||
map.put("to_command", "6");
|
||||
this.writing(map);
|
||||
message = "缓存库取货完成";
|
||||
feedbackSucess = true;
|
||||
@@ -575,6 +584,10 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (mode == 3 && action == 7) {
|
||||
String task_code = inst1.getTask_code();
|
||||
if(Long.parseLong(task_code) < 1){
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "7");
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
message = "任务ACS创建,不反馈LMS缓存库放货完成";
|
||||
return;
|
||||
}
|
||||
@@ -584,7 +597,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
if (applyManipulatorActionResponse1.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 7);
|
||||
map.put("to_command", "7");
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
message = "缓存库放货成功";
|
||||
@@ -604,7 +617,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
taskserver.cancel(byTaskCode.getTask_id());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 9);
|
||||
map.put("to_command", "9");
|
||||
this.writing(map);
|
||||
feedbackSucess = true;
|
||||
message = "异常气胀轴任务取消成功";
|
||||
@@ -622,7 +635,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
feedbackSucess = true;
|
||||
finish_instruction(inst1);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 8);
|
||||
map.put("to_command", "8");
|
||||
this.writing(map);
|
||||
message = "放货完成";
|
||||
} catch (Exception e) {
|
||||
@@ -868,18 +881,26 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
String is_bushing = taskDto.getIs_bushing();
|
||||
String version = taskDto.getVersion();
|
||||
String bushing_num = taskDto.getBushing_num();
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 1);
|
||||
/*Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "1");
|
||||
map.put("inflatableShaftVersion", version);
|
||||
map.put("tube_num", bushing_num);
|
||||
map.put("is_wrapped", is_bushing);
|
||||
map.put("tube_num", StrUtil.isEmpty(bushing_num) ? "0" : bushing_num);
|
||||
map.put("is_wrapped",StrUtil.isEmpty(is_bushing) ? "0" : is_bushing );
|
||||
map.put("to_task_type", taskDto.getTruss_type());
|
||||
map.put("to_onset", start_addr);
|
||||
map.put("to_task", instruction.getInstruction_code());
|
||||
map.put("to_target", next_addr);
|
||||
map.put("to_target", next_addr);*/
|
||||
List list = new ArrayList();
|
||||
writing(list,"to_command","1");
|
||||
writing(list,"inflatableShaftVersion",version);
|
||||
writing(list,"tube_num",StrUtil.isEmpty(bushing_num) ? "0" : bushing_num);
|
||||
writing(list,"is_wrapped",StrUtil.isEmpty(is_bushing) ? "0" : is_bushing);
|
||||
writing(list,"to_task_type",taskDto.getTruss_type());
|
||||
writing(list,"to_onset",start_addr);
|
||||
writing(list,"to_task",instruction.getInstruction_code());
|
||||
writing(list,"to_target",next_addr);
|
||||
try {
|
||||
this.writing(map);
|
||||
this.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
|
||||
+ ",指令终点:" + instruction.getNext_device_code() + ",指令执行失败:" + e.getMessage());
|
||||
@@ -987,21 +1008,30 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code());
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 1);
|
||||
map.put("to_task_type", Integer.parseInt(task.getTruss_type()));
|
||||
map.put("to_onset", Integer.parseInt(start_addr));
|
||||
map.put("to_task", Integer.parseInt(instdto.getInstruction_code()));
|
||||
map.put("to_target", Integer.parseInt(next_addr));
|
||||
+ ",指令终点:" + instdto.getNext_device_code()+ "指令号:" + instdto.getInstruction_code()+
|
||||
"行架任务类型: "+ task.getTruss_type() + "起点:"+ start_addr + "终点"+ next_addr);
|
||||
/*Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "1");
|
||||
map.put("to_task_type", task.getTruss_type());
|
||||
map.put("to_onset", start_addr);
|
||||
map.put("to_task", instdto.getInstruction_code());
|
||||
map.put("to_target", next_addr);
|
||||
if (!StrUtil.isEmpty(task.getVersion())) {
|
||||
map.put("inflatableShaftVersion", task.getVersion());
|
||||
}
|
||||
this.writing(map);
|
||||
}*/
|
||||
|
||||
List list = new ArrayList();
|
||||
writing(list,"to_command","1");
|
||||
writing(list,"to_task_type",task.getTruss_type());
|
||||
writing(list,"to_onset",start_addr);
|
||||
writing(list,"to_task",instdto.getInstruction_code());
|
||||
writing(list,"to_target",next_addr);
|
||||
writing(list,"inflatableShaftVersion",StrUtil.isEmpty(task.getVersion()) ? "0" : task.getVersion());
|
||||
try {
|
||||
this.writing(map);
|
||||
this.writing(list);
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instdto.getInstruction_code()
|
||||
+ ",指令起点:" + instdto.getStart_device_code()
|
||||
+ ",指令终点:" + instdto.getNext_device_code() + ",指令执行失败:" + e.getMessage());
|
||||
}
|
||||
this.setRequireSucess(true);
|
||||
@@ -1015,6 +1045,38 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
}
|
||||
}
|
||||
|
||||
public void writing(List list,String writingName,String writeValue) {
|
||||
Map map = new HashMap();
|
||||
map.put("code", writingName);
|
||||
map.put("value", writeValue);
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
public void writing(List list) {
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object ob = list.get(i);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
|
||||
if (!StrUtil.isEmpty(json.getString("value"))) {
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + json.getString("code");
|
||||
itemMap.put(to_param, json.getString("value"));
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Boolean checkAgv(TaskDto taskDto) {
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
RgvDeviceDriver rgv1;
|
||||
|
||||
@@ -107,7 +107,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.requireSucess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记" + requireSucess);
|
||||
}
|
||||
if (move != last_move) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
@@ -185,24 +185,32 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
private void deliveryCompleted() {
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
applyManipulatorActionRequest.setAction("1");
|
||||
applyManipulatorActionRequest.setTask_code1(String.valueOf(task1));
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
|
||||
String task_code1 = inst1.getTask_code();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
if (Long.parseLong(task_code1) < 1) {
|
||||
map.put("to_command", 7);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "缓存库放货成功";
|
||||
message = "任务ACS创建,不向LMS反馈插拔机取货完成";
|
||||
return;
|
||||
}
|
||||
applyManipulatorActionRequest.setTask_code1(task_code1);
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
map.put("to_command", 7);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "插拔机取货完成反馈成功";
|
||||
} else {
|
||||
requireSucess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
message = "缓存库放货失败";
|
||||
message = "插拔机取货完成反馈失败";
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void pullingSucess() {
|
||||
List list = new ArrayList();
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse;
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
|
||||
@@ -264,45 +272,41 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
|
||||
private synchronized void applyBushing() {
|
||||
List list = new ArrayList();
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse;
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
|
||||
// Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
|
||||
String task_code1 = inst1.getTask_code();
|
||||
if (Long.parseLong(task_code1) < 1) {
|
||||
message = "任务ACS创建,不向LMS申请套轴";
|
||||
return;
|
||||
}
|
||||
// String task_code2 = inst2.getTask_code();
|
||||
applyManipulatorActionRequest.setDevice_code(device_code);
|
||||
applyManipulatorActionRequest.setTask_code1(task_code1);
|
||||
// applyManipulatorActionRequest.setTask_code2(task_code2);
|
||||
applyManipulatorActionRequest.setType("6");
|
||||
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
|
||||
if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "1".equals(applyManipulatorActionResponse.getIs_bushing())) {
|
||||
if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && ("1".equals(applyManipulatorActionResponse.getIs_bushing()))) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 4);
|
||||
map.put("to_command", "4");
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "套轴申请成功";
|
||||
} else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "2".equals(applyManipulatorActionResponse.getIs_bushing())) {
|
||||
} else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && ("2".equals(applyManipulatorActionResponse.getIs_bushing()))) {
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 98);
|
||||
map.put("to_command", "98");
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "等待套轴";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse);
|
||||
} else {
|
||||
} else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && ("0".equals(applyManipulatorActionResponse.getIs_bushing()))){
|
||||
message = applyManipulatorActionResponse.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
map.put("to_command", "99");
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "套轴申请失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
int last_error = 0;
|
||||
int move1 = 0;
|
||||
int last_move1 = 0;
|
||||
int to_command = 0;
|
||||
int last_to_command = 0;
|
||||
Integer move2 = 0;
|
||||
Integer last_move2 = 0;
|
||||
Float qty1 = 0f;
|
||||
@@ -105,7 +107,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
qty1 = this.itemProtocol.getQty1();
|
||||
qty2 = this.itemProtocol.getQty2();
|
||||
task = this.itemProtocol.getTask();
|
||||
|
||||
to_command = this.itemProtocol.getToCommand();
|
||||
|
||||
if (mode != last_mode) {
|
||||
this.requireSucess = false;
|
||||
@@ -126,6 +128,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
if(task != last_task){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
if(to_command != last_to_command){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command);
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception var17) {
|
||||
@@ -179,6 +184,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
last_task = task;
|
||||
last_qty1 = qty1;
|
||||
last_qty2 = qty2;
|
||||
last_to_command = to_command;
|
||||
}
|
||||
|
||||
private void manualFeedbackQty() {
|
||||
@@ -201,14 +207,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
message = "手动反馈LMS成功...";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 5);
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = "手动完成反馈LMS失败," + applyManipulatorActionResponse.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
map.put("to_command", "99");
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
@@ -232,14 +238,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
message = "自动反馈LMS成功...";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 4);
|
||||
map.put("to_command", "4");
|
||||
this.writing(map);
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = "自动完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
map.put("to_command", "99");
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,7 +659,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
public void writing(List list) {
|
||||
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object ob = list.get(i);
|
||||
|
||||
@@ -64,8 +64,10 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
try{
|
||||
if(i == 0){
|
||||
control( itemValues);
|
||||
log.info("i等于0:{}",itemValues);
|
||||
} else {
|
||||
controlByNewConn( itemValues);
|
||||
log.info("i不等于0:{}",itemValues);
|
||||
}
|
||||
|
||||
} catch (Exception e){
|
||||
@@ -108,10 +110,11 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
String itemString = (String)var24.next();
|
||||
if (!ObjectUtl.isEquals(String.valueOf(itemValues.get(itemString)), String.valueOf(read.get(itemString)))) {
|
||||
check = false;
|
||||
log.info("写入失败,写入值为{},读取值为==={}" , itemValues.get(itemString), read.get(itemString));
|
||||
}
|
||||
}
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.info("写入信号出现异常:{}",e.getMessage());
|
||||
check = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,14 @@ public class TaskDto implements Serializable {
|
||||
private String paper_array;
|
||||
|
||||
private JSONArray paperArray;
|
||||
/**
|
||||
* 仓位
|
||||
*/
|
||||
private String device_code;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String qty;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package org.nl.acs.task.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.InternalJSONUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -20,6 +24,7 @@ import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.StorageCellService;
|
||||
import org.nl.acs.device.service.dto.DeviceAssignedDto;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
import org.nl.acs.device_driver.basedriver.paper_tube_device2.Paper;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
@@ -210,6 +215,28 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
Integer currentPageNumber = page.getPageNumber() + 1;
|
||||
Integer pageMaxSize = page.getPageSize();
|
||||
for (TaskDto taskDto : taskList) {
|
||||
if("10".equals(taskDto.getTask_type())){
|
||||
cn.hutool.json.JSONArray jsonArray = JSONUtil.parseArray(taskDto.getPaper_array());
|
||||
List<Paper> papers = JSONUtil.toList(jsonArray, Paper.class);
|
||||
StringBuilder task_paper = new StringBuilder();
|
||||
StringBuilder task_qty = new StringBuilder();
|
||||
for (Paper paper : papers) {
|
||||
task_qty.append(paper.getQty()).append(",");
|
||||
task_paper.append(paper.getDevice_code()).append(",");
|
||||
}
|
||||
String qty = task_qty.toString();
|
||||
if (qty.endsWith(",")) {
|
||||
qty = qty.substring(0, qty.length() - 1);
|
||||
}
|
||||
String device_code = task_paper.toString();
|
||||
if (device_code.endsWith(",")) {
|
||||
device_code = device_code.substring(0, device_code.length() - 1);
|
||||
}
|
||||
taskDto.setDevice_code(device_code);
|
||||
taskDto.setQty(qty);
|
||||
}
|
||||
}
|
||||
List<TaskDto> taskDtoList =
|
||||
taskList.stream()
|
||||
.skip((currentPageNumber - 1) * pageMaxSize)
|
||||
|
||||
Reference in New Issue
Block a user