opt: 内包间优化

This commit is contained in:
yanps
2024-01-22 19:27:06 +08:00
parent 6cd78775ef
commit 37ac298f91
12 changed files with 181 additions and 64 deletions

View File

@@ -291,7 +291,11 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
if (ObjectUtil.isNotEmpty(inst1)) { if (ObjectUtil.isNotEmpty(inst1)) {
String task_code = inst1.getTask_code(); String task_code = inst1.getTask_code();
if (Long.parseLong(task_code) < 1) { 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; return;
} }
applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setAction("1");

View File

@@ -243,6 +243,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
// this.setNow_steps_type(0); // this.setNow_steps_type(0);
// logServer.deviceExecuteLog(this.device_code, "", "", "当前执行步骤复位后:" + this.getNow_steps_type()); // logServer.deviceExecuteLog(this.device_code, "", "", "当前执行步骤复位后:" + this.getNow_steps_type());
// } // }
requireSucess = false;
feedMessage = ""; feedMessage = "";
notCreateInstMessage = ""; notCreateInstMessage = "";
notCreateTaskMessage = ""; notCreateTaskMessage = "";
@@ -393,6 +394,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
itemMap.put(getToParam() + key, value); itemMap.put(getToParam() + key, value);
} }
}); });
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
if (ObjectUtil.isNotEmpty(itemMap)) { if (ObjectUtil.isNotEmpty(itemMap)) {
try { try {
this.checkcontrol(itemMap); this.checkcontrol(itemMap);
@@ -442,7 +444,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (mode == 3 && action == 2) { if (mode == 3 && action == 2) {
String task_code = inst1.getTask_code(); String task_code = inst1.getTask_code();
if(Long.parseLong(task_code) < 1){ if(Long.parseLong(task_code) < 1){
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 2);
this.writing(map);
message = "任务ACS创建,不反馈LMS尺寸"; message = "任务ACS创建,不反馈LMS尺寸";
feedbackSucess = true;
return; return;
} }
applyManipulatorActionRequest.setType("2"); applyManipulatorActionRequest.setType("2");
@@ -454,7 +460,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
message = "反馈尺寸LMS成功..."; message = "反馈尺寸LMS成功...";
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 2); map.put("to_command", "2");
this.writing(map); this.writing(map);
} else { } else {
feedbackSucess = false; feedbackSucess = false;
@@ -480,7 +486,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
map.put("to_size", applyManipulatorActionResponse.getSize()); map.put("to_size", applyManipulatorActionResponse.getSize());
map.put("to_command", 3); map.put("to_command", "3");
map.put("to_putpoint", Integer.parseInt(to_putpoint)); map.put("to_putpoint", Integer.parseInt(to_putpoint));
this.writing(map); this.writing(map);
feedbackSucess = true; feedbackSucess = true;
@@ -506,7 +512,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
Device device = deviceAppService.findDeviceByCode(get_device_code); Device device = deviceAppService.findDeviceByCode(get_device_code);
String to_new_getpoint = device.getExtraValue().get("address").toString(); String to_new_getpoint = device.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4); map.put("to_command", "4");
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint)); map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint));
this.writing(map); this.writing(map);
@@ -535,8 +541,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String to_two_putpoint = device.getExtraValue().get("address").toString(); String to_two_putpoint = device.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); 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)); map.put("to_two_putpoint", Integer.parseInt(to_two_putpoint));
this.writing(map); this.writing(map);
feedbackSucess = true; feedbackSucess = true;
@@ -552,6 +557,10 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (mode == 3 && action == 6) { if (mode == 3 && action == 6) {
String task_code = inst1.getTask_code(); String task_code = inst1.getTask_code();
if(Long.parseLong(task_code) < 1){ 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缓存库取货成功"; message = "任务ACS创建,不反馈LMS缓存库取货成功";
return; return;
} }
@@ -561,7 +570,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (applyManipulatorActionResponse1.getstatus() == 200) { if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 6); map.put("to_command", "6");
this.writing(map); this.writing(map);
message = "缓存库取货完成"; message = "缓存库取货完成";
feedbackSucess = true; feedbackSucess = true;
@@ -575,6 +584,10 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (mode == 3 && action == 7) { if (mode == 3 && action == 7) {
String task_code = inst1.getTask_code(); String task_code = inst1.getTask_code();
if(Long.parseLong(task_code) < 1){ 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缓存库放货完成"; message = "任务ACS创建,不反馈LMS缓存库放货完成";
return; return;
} }
@@ -584,7 +597,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (applyManipulatorActionResponse1.getstatus() == 200) { if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 7); map.put("to_command", "7");
this.writing(map); this.writing(map);
feedbackSucess = true; feedbackSucess = true;
message = "缓存库放货成功"; message = "缓存库放货成功";
@@ -604,7 +617,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
taskserver.cancel(byTaskCode.getTask_id()); taskserver.cancel(byTaskCode.getTask_id());
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成"); logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成");
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 9); map.put("to_command", "9");
this.writing(map); this.writing(map);
feedbackSucess = true; feedbackSucess = true;
message = "异常气胀轴任务取消成功"; message = "异常气胀轴任务取消成功";
@@ -622,7 +635,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
feedbackSucess = true; feedbackSucess = true;
finish_instruction(inst1); finish_instruction(inst1);
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 8); map.put("to_command", "8");
this.writing(map); this.writing(map);
message = "放货完成"; message = "放货完成";
} catch (Exception e) { } catch (Exception e) {
@@ -868,18 +881,26 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String is_bushing = taskDto.getIs_bushing(); String is_bushing = taskDto.getIs_bushing();
String version = taskDto.getVersion(); String version = taskDto.getVersion();
String bushing_num = taskDto.getBushing_num(); String bushing_num = taskDto.getBushing_num();
/*Map<String, Object> map = new LinkedHashMap<>();
Map<String, Object> map = new LinkedHashMap<>(); map.put("to_command", "1");
map.put("to_command", 1);
map.put("inflatableShaftVersion", version); map.put("inflatableShaftVersion", version);
map.put("tube_num", bushing_num); map.put("tube_num", StrUtil.isEmpty(bushing_num) ? "0" : bushing_num);
map.put("is_wrapped", is_bushing); map.put("is_wrapped",StrUtil.isEmpty(is_bushing) ? "0" : is_bushing );
map.put("to_task_type", taskDto.getTruss_type()); map.put("to_task_type", taskDto.getTruss_type());
map.put("to_onset", start_addr); map.put("to_onset", start_addr);
map.put("to_task", instruction.getInstruction_code()); 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 { try {
this.writing(map); this.writing(list);
} catch (Exception e) { } catch (Exception e) {
logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() logServer.deviceExecuteLog(device_code, "", "", "下发指令:" + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code() + ",指令执行失败:" + e.getMessage()); + ",指令终点:" + instruction.getNext_device_code() + ",指令执行失败:" + e.getMessage());
@@ -987,21 +1008,30 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String next_addr = nextDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString();
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code() + instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
+ ",指令终点:" + instdto.getNext_device_code()); + ",指令终点:" + instdto.getNext_device_code()+ "指令号:" + instdto.getInstruction_code()+
Map<String, Object> map = new LinkedHashMap<>(); "行架任务类型: "+ task.getTruss_type() + "起点:"+ start_addr + "终点"+ next_addr);
map.put("to_command", 1); /*Map<String, Object> map = new LinkedHashMap<>();
map.put("to_task_type", Integer.parseInt(task.getTruss_type())); map.put("to_command", "1");
map.put("to_onset", Integer.parseInt(start_addr)); map.put("to_task_type", task.getTruss_type());
map.put("to_task", Integer.parseInt(instdto.getInstruction_code())); map.put("to_onset", start_addr);
map.put("to_target", Integer.parseInt(next_addr)); map.put("to_task", instdto.getInstruction_code());
map.put("to_target", next_addr);
if (!StrUtil.isEmpty(task.getVersion())) { if (!StrUtil.isEmpty(task.getVersion())) {
map.put("inflatableShaftVersion", 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 { try {
this.writing(map); this.writing(list);
} catch (Exception e) { } 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()); + ",指令终点:" + instdto.getNext_device_code() + ",指令执行失败:" + e.getMessage());
} }
this.setRequireSucess(true); 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) { private Boolean checkAgv(TaskDto taskDto) {
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
RgvDeviceDriver rgv1; RgvDeviceDriver rgv1;

View File

@@ -107,7 +107,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
if (mode != last_mode) { if (mode != last_mode) {
this.requireSucess = false; 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) { if (move != last_move) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move); logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move);
@@ -185,24 +185,32 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
private void deliveryCompleted() { private void deliveryCompleted() {
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setAction("1");
applyManipulatorActionRequest.setTask_code1(String.valueOf(task1)); Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); String task_code1 = inst1.getTask_code();
if (applyManipulatorActionResponse.getstatus() == 200) { Map<String, Object> map = new LinkedHashMap<>();
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); if (Long.parseLong(task_code1) < 1) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 7); map.put("to_command", 7);
this.writing(map); this.writing(map);
requireSucess = true; 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 { } else {
requireSucess = false; requireSucess = false;
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
message = "缓存库放货失败"; message = "插拔机取货完成反馈失败";
} }
} }
private synchronized void pullingSucess() { private synchronized void pullingSucess() {
List list = new ArrayList();
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
ApplyManipulatorActionResponse applyManipulatorActionResponse; ApplyManipulatorActionResponse applyManipulatorActionResponse;
Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
@@ -264,45 +272,41 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
} }
private synchronized void applyBushing() { private synchronized void applyBushing() {
List list = new ArrayList();
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
ApplyManipulatorActionResponse applyManipulatorActionResponse; ApplyManipulatorActionResponse applyManipulatorActionResponse;
Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
// Instruction inst2 = instructionService.findByCode(String.valueOf(task2));
String task_code1 = inst1.getTask_code(); String task_code1 = inst1.getTask_code();
if (Long.parseLong(task_code1) < 1) { if (Long.parseLong(task_code1) < 1) {
message = "任务ACS创建,不向LMS申请套轴"; message = "任务ACS创建,不向LMS申请套轴";
return; return;
} }
// String task_code2 = inst2.getTask_code();
applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDevice_code(device_code);
applyManipulatorActionRequest.setTask_code1(task_code1); applyManipulatorActionRequest.setTask_code1(task_code1);
// applyManipulatorActionRequest.setTask_code2(task_code2);
applyManipulatorActionRequest.setType("6"); applyManipulatorActionRequest.setType("6");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); 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<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4); map.put("to_command", "4");
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
message = "套轴申请成功"; message = "套轴申请成功";
} else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "2".equals(applyManipulatorActionResponse.getIs_bushing())) { } else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && ("2".equals(applyManipulatorActionResponse.getIs_bushing()))) {
message = applyManipulatorActionResponse.getMessage(); message = applyManipulatorActionResponse.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse);
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 98); map.put("to_command", "98");
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
message = "等待套轴"; message = "等待套轴";
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse); } else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && ("0".equals(applyManipulatorActionResponse.getIs_bushing()))){
} else {
message = applyManipulatorActionResponse.getMessage(); message = applyManipulatorActionResponse.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse);
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99); map.put("to_command", "99");
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
message = "套轴申请失败"; message = "套轴申请失败";
logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse);
} }
} }

View File

@@ -63,6 +63,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
int last_error = 0; int last_error = 0;
int move1 = 0; int move1 = 0;
int last_move1 = 0; int last_move1 = 0;
int to_command = 0;
int last_to_command = 0;
Integer move2 = 0; Integer move2 = 0;
Integer last_move2 = 0; Integer last_move2 = 0;
Float qty1 = 0f; Float qty1 = 0f;
@@ -105,7 +107,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
qty1 = this.itemProtocol.getQty1(); qty1 = this.itemProtocol.getQty1();
qty2 = this.itemProtocol.getQty2(); qty2 = this.itemProtocol.getQty2();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getToCommand();
if (mode != last_mode) { if (mode != last_mode) {
this.requireSucess = false; this.requireSucess = false;
@@ -126,6 +128,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
if(task != last_task){ if(task != last_task){
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + 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) { } catch (Exception var17) {
@@ -179,6 +184,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
last_task = task; last_task = task;
last_qty1 = qty1; last_qty1 = qty1;
last_qty2 = qty2; last_qty2 = qty2;
last_to_command = to_command;
} }
private void manualFeedbackQty() { private void manualFeedbackQty() {
@@ -201,14 +207,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
message = "手动反馈LMS成功..."; message = "手动反馈LMS成功...";
logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 5); map.put("to_command", "5");
this.writing(map); this.writing(map);
} else { } else {
requireSucess = false; requireSucess = false;
message = "手动完成反馈LMS失败" + applyManipulatorActionResponse.getMessage(); message = "手动完成反馈LMS失败" + applyManipulatorActionResponse.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "手动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99); map.put("to_command", "99");
this.writing(map); this.writing(map);
} }
} }
@@ -232,14 +238,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
message = "自动反馈LMS成功..."; message = "自动反馈LMS成功...";
logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4); map.put("to_command", "4");
this.writing(map); this.writing(map);
} else { } else {
requireSucess = false; requireSucess = false;
message = "自动完成反馈LMS失败" + String.valueOf(applyManipulatorActionResponse); message = "自动完成反馈LMS失败" + String.valueOf(applyManipulatorActionResponse);
logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "自动反馈重量请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99); map.put("to_command", "99");
this.writing(map); this.writing(map);
} }
} }

View File

@@ -659,7 +659,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
public void writing(List list) { public void writing(List list) {
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);

View File

@@ -64,8 +64,10 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
try{ try{
if(i == 0){ if(i == 0){
control( itemValues); control( itemValues);
log.info("i等于0:{}",itemValues);
} else { } else {
controlByNewConn( itemValues); controlByNewConn( itemValues);
log.info("i不等于0:{}",itemValues);
} }
} catch (Exception e){ } catch (Exception e){
@@ -108,10 +110,11 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
String itemString = (String)var24.next(); String itemString = (String)var24.next();
if (!ObjectUtl.isEquals(String.valueOf(itemValues.get(itemString)), String.valueOf(read.get(itemString)))) { if (!ObjectUtl.isEquals(String.valueOf(itemValues.get(itemString)), String.valueOf(read.get(itemString)))) {
check = false; check = false;
log.info("写入失败,写入值为{},读取值为==={}" , itemValues.get(itemString), read.get(itemString));
} }
} }
} catch (Exception e){ } catch (Exception e){
e.printStackTrace(); log.info("写入信号出现异常:{}",e.getMessage());
check = false; check = false;
} }

View File

@@ -342,6 +342,14 @@ public class TaskDto implements Serializable {
private String paper_array; private String paper_array;
private JSONArray paperArray; private JSONArray paperArray;
/**
* 仓位
*/
private String device_code;
/**
* 数量
*/
private String qty;

View File

@@ -1,11 +1,15 @@
package org.nl.acs.task.service.impl; 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.date.DateUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.json.InternalJSONUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.StorageCellService;
import org.nl.acs.device.service.dto.DeviceAssignedDto; import org.nl.acs.device.service.dto.DeviceAssignedDto;
import org.nl.acs.device.service.impl.DeviceServiceImpl; 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.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
@@ -210,6 +215,28 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
Integer currentPageNumber = page.getPageNumber() + 1; Integer currentPageNumber = page.getPageNumber() + 1;
Integer pageMaxSize = page.getPageSize(); 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 = List<TaskDto> taskDtoList =
taskList.stream() taskList.stream()
.skip((currentPageNumber - 1) * pageMaxSize) .skip((currentPageNumber - 1) * pageMaxSize)

View File

@@ -13,11 +13,11 @@ spring:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_a1_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_a1_acs1}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root} username: ${DB_USER:root}
# password: ${DB_PWD:P@ssw0rd} # password: ${DB_PWD:P@ssw0rd}
# password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456}
password: ${DB_PWD:root} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数
initial-size: 5 initial-size: 5

View File

@@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'http://127.0.0.1:8010' VUE_APP_BASE_API = 'http://10.1.3.94:8011'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://127.0.0.1:8010' VUE_APP_WS_API = 'ws://10.1.3.94:8011'

View File

@@ -1,9 +1,9 @@
window.g = { window.g = {
dev: { dev: {
VUE_APP_BASE_API: 'http://127.0.0.1:8010' VUE_APP_BASE_API: 'http://10.1.3.94:8011'
}, },
prod: { prod: {
VUE_APP_BASE_API: 'http://127.0.0.1:8010' VUE_APP_BASE_API: 'http://10.1.3.94:8011'
} }

View File

@@ -441,6 +441,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="start_height" label="取货高度" /> <el-table-column prop="start_height" label="取货高度" />
<el-table-column prop="next_height" label="放货高度" /> <el-table-column prop="next_height" label="放货高度" />
<el-table-column prop="device_code" label="纸管库出库仓位" />
<el-table-column prop="qty" label="纸管库出库数量" />
<el-table-column prop="truss_type" label="内包间行架任务类型" /> <el-table-column prop="truss_type" label="内包间行架任务类型" />
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column prop="create_by" label="创建者" /> <el-table-column prop="create_by" label="创建者" />
@@ -599,7 +601,9 @@ export default {
device_code: '', device_code: '',
material_code: '', material_code: '',
qty: '' qty: ''
}] }],
device_code: null,
qty: null
}, },
rules: { rules: {
start_height: [ start_height: [