rev 更新

This commit is contained in:
USER-20220102CG\noblelift
2023-12-17 11:37:40 +08:00
parent 24286d5e57
commit f04013cf3d
5 changed files with 24 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.JIUnsignedInteger; import org.jinterop.dcom.core.JIUnsignedInteger;
import org.nl.acs.agv.server.AgvService; import org.nl.acs.agv.server.AgvService;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
@@ -40,6 +41,7 @@ import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.AddFailedException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
@@ -463,7 +465,11 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
} }
}); });
if (ObjectUtil.isNotEmpty(itemMap)) { if (ObjectUtil.isNotEmpty(itemMap)) {
this.checkcontrol(itemMap); try {
this.checkcontrol(itemMap);
} catch (Exception e) {
throw new RuntimeException(e);
}
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap); logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
} }
} }
@@ -668,9 +674,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("to_material" + status, paper.getMaterial_code()); map.put("to_material" + status, paper.getMaterial_code());
map.put("to_out_qty" + status, paper.getQty()); map.put("to_out_qty" + status, paper.getQty());
map.put("to_seq" + status, status); map.put("to_seq" + status, status);
Device nextdevice = deviceAppservice.findDeviceByCode(paper.getDevice_code()); // Device nextdevice = deviceAppservice.findDeviceByCode(paper.getDevice_code());
String next_addr = nextdevice.getExtraValue().get("address").toString(); // String next_addr = nextdevice.getExtraValue().get("address").toString();
map.put("to_position" + status, next_addr); map.put("to_position" + status, paper.getDevice_code());
} }

View File

@@ -106,7 +106,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
while(var24.hasNext()) { while(var24.hasNext()) {
String itemString = (String)var24.next(); String itemString = (String)var24.next();
if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) { if (!ObjectUtl.isEquals(String.valueOf(itemValues.get(itemString)), String.valueOf(read.get(itemString)))) {
check = false; check = false;
} }
} }

View File

@@ -144,6 +144,6 @@ public class CreateTaskRequest extends BaseRequest {
*/ */
private String bushing_num; private String bushing_num;
private JSONArray paper_array; private String paper_array;
} }

View File

@@ -720,7 +720,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
for (int i = 0; i < datas.size(); i++) { for (int i = 0; i < datas.size(); i++) {
String data = datas.get(i).toString(); String data = datas.get(i).toString();
CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class); CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class);
JSONArray paper_array = request.getPaper_array(); String paper_array = request.getPaper_array();
String ext_task_id = request.getExt_task_id(); String ext_task_id = request.getExt_task_id();
String task_code = request.getTask_code(); String task_code = request.getTask_code();
String start_device_code = request.getStart_device_code(); String start_device_code = request.getStart_device_code();

View File

@@ -419,7 +419,17 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb}); log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb});
// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb});
} else { } else {
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); if(his instanceof int[]){
if(!Arrays.equals((long[]) his, (long[]) value)){
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
} else if(his instanceof String){
if(!StrUtil.equals((CharSequence) his, (CharSequence) value)){
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
} else {
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value});
} }
} }