diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 3b2c9030b..d50af98ea 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -1,30 +1,22 @@ package org.nl.acs.agv.server.impl; -import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.dto.AgvDto; import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun; -import org.nl.acs.auto.run.TwoNDC2SocketConnectionAutoRun; import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.LokiLog; import org.nl.acs.log.LokiLogType; import org.nl.acs.log.service.DeviceExecuteLogService; -import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; -import org.nl.acs.opc.DeviceType; -import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.system.service.ParamService; import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.util.SpringContextHolder; @@ -32,7 +24,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.util.HashMap; -import java.util.List; import java.util.Map; @Slf4j @@ -80,10 +71,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { OneNDCSocketConnectionAutoRun.write(b); } else if (StrUtil.equals(inst.getAgv_system_type(), "2")) { TwoNDCSocketConnectionAutoRun.write(b); - } else if (StrUtil.equals(inst.getAgv_system_type(), "3")) { - TwoNDC2SocketConnectionAutoRun.write(b); } - System.out.println("下发删除agv指令数据:" + Bytes2HexString(b)); } @@ -198,8 +186,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { if (StrUtil.equals(agv_system_type, "2")) { TwoNDCSocketConnectionAutoRun.write(b); - } else if (StrUtil.equals(agv_system_type, "3")) { - TwoNDC2SocketConnectionAutoRun.write(b); } } else { @@ -394,8 +380,6 @@ public class NDCAgvServiceImpl implements NDCAgvService { OneNDCSocketConnectionAutoRun.write(b); } else if (StrUtil.equals(agv_system, "2")) { TwoNDCSocketConnectionAutoRun.write(b); - } else if (StrUtil.equals(agv_system, "3")) { - TwoNDC2SocketConnectionAutoRun.write(b); } } catch (Exception e) { e.getMessage(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/HeartbeatOfflineCheckerAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/HeartbeatOfflineCheckerAutoRun.java new file mode 100644 index 000000000..1002f9862 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/HeartbeatOfflineCheckerAutoRun.java @@ -0,0 +1,55 @@ +package org.nl.acs.auto.run; + +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.heartbeat.service.HeartbeatUnifiedService; +import org.nl.acs.heartbeat.service.impl.HeartbeatUnifiedServiceimpl; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.instruction.service.impl.InstructionServiceImpl; +import org.nl.acs.opc.ThreadUtl; +import org.nl.modules.wql.util.SpringContextHolder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; + +@Slf4j +@Component +public class HeartbeatOfflineCheckerAutoRun extends AbstractAutoRunnable { + @Autowired + AutoRunService autoRunService; + + private int recordTimeOut = 10000; + private Date recordTime; + int offline_loop_time_millions = 1000; + boolean heartbeat_no_use =false; + public HeartbeatOfflineCheckerAutoRun() { + this.recordTime = new Date((new Date()).getTime() - (long)this.recordTimeOut); + } + + public String getCode() { + return HeartbeatOfflineCheckerAutoRun.class.getSimpleName(); + } + + public String getName() { + return "在线监听器"; + } + + public void autoRun() { + InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); + HeartbeatUnifiedService heartbeatUnifiedService = SpringContextHolder.getBean(HeartbeatUnifiedServiceimpl.class); + + for(; !heartbeat_no_use; ThreadUtl.sleep((long)offline_loop_time_millions)) { + try { + heartbeatUnifiedService.offlineChecker(); + } catch (Exception var3) { + Date date = new Date(); + if (date.getTime() - this.recordTime.getTime() < (long)this.recordTimeOut) { + return; + } + + this.recordTime = date; + } + } + + } +} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDC2SocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDC2SocketConnectionAutoRun.java deleted file mode 100644 index 762948e80..000000000 --- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDC2SocketConnectionAutoRun.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.nl.acs.auto.run; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import lombok.extern.slf4j.Slf4j; -import org.nl.acs.AcsConfig; -import org.nl.acs.agv.server.NDCAgvService; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver; -import org.nl.acs.ext.wms.service.AcsToWmsService; -import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; -import org.nl.acs.instruction.service.InstructionService; -import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.instruction.service.impl.InstructionServiceImpl; -import org.nl.acs.opc.Device; -import org.nl.acs.opc.DeviceAppService; -import org.nl.modules.system.service.ParamService; -import org.nl.modules.system.service.impl.ParamServiceImpl; -import org.nl.modules.wql.util.SpringContextHolder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.net.Socket; -import java.util.Date; - -import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString; - - -@Slf4j -@Component -public class TwoNDC2SocketConnectionAutoRun extends AbstractAutoRunnable { - - Socket s; - String ip = "192.168.46.225"; - int port = 1234; - static DataOutputStream dos; - static DataInputStream dis; - private int recordTimeOut = 10000; - private Date recordTime; - String[] ERROR = new String[]{ - "货叉尖部传感器触发", "S300传感器触发", "载货状态改变", "急停按钮触发", "触边开关出发", "需要复位", - "停在充电位", "取货失败", "放货失败", "轮子打滑", "没有动作码不能进入站点", "取货时有货", "丢失定位", - "抬叉停止"}; - boolean bConnected = true; - - boolean isReConnect = false; - - @Autowired - ParamService paramService; - @Autowired - AutoRunService autoRunService; - - - public TwoNDC2SocketConnectionAutoRun() { - this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut); - } - - public String getCode() { - return TwoNDC2SocketConnectionAutoRun.class.getSimpleName(); - } - - public String getName() { - return "2楼2区域AGV系统"; - } - - public void autoRun() { - - try { - System.out.println("2楼2区域AGV系统链接开始"); - ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class); - InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class); - AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); - NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); - DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); - DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); - ip = paramService.findByCode(AcsConfig.AGVURL22).getValue(); - port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT22).getValue()); - byte[] b = new byte[1028]; - s = new Socket(ip, port); - System.out.println("2楼2区域AGV链接成功"); - dos = new DataOutputStream(s.getOutputStream()); - dis = new DataInputStream(s.getInputStream()); - - while (bConnected) { - int count = dis.read(b); - - if (count == -1) { - break; - } - - int[] arr = new int[count]; - StringBuffer bs = new StringBuffer(); - - for (int i = 0; i < count; i++) { - int temp = b[i]; - if (temp < 0) - temp += 256; - arr[i] = temp; - StringBuffer bs1 = new StringBuffer("0"); - bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp)); - } - - System.out.println("收到请求参数:" + bs); - boolean flag = false; - if (arr[8] * 256 + arr[9] == 0x73) { - byte[] data = null; - System.out.println("接收agv上报信息:" + bs); - //执行阶段 - int phase = arr[16] * 256 + arr[17]; - // agv任务号 - int index = arr[12] * 256 + arr[13]; - //任务号 - int ikey = arr[26] * 256 + arr[27]; - //站点号 - int agvaddr = arr[18] * 256 + arr[19]; - //车号 - int carno = arr[20]; - Instruction inst = null; - if (ikey != 0) { - inst = instructionService.findByCodeFromCache(String.valueOf(ikey)); - } - log.info("接收agv上报信息:" + bs); - log.info("接收agv上报信息:" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno); - Device device = null; - String device_code = null; - String old_device_code = null; - String emptyNum = null; - if (agvaddr != 0) { - old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); - if (StrUtil.contains(old_device_code, "-")) { - String[] point = old_device_code.split("-"); - device_code = point[0]; - } else if (StrUtil.contains(old_device_code, ".")) { - String[] point = old_device_code.split("\\."); - device_code = point[0]; - emptyNum = point[1]; - } else { - device_code = old_device_code; - } - device = deviceAppService.findDeviceByCode(device_code); - } - - AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver; - //开始任务 - if (phase == 0x01) { - if (!ObjectUtil.isEmpty(inst)) { - inst.setInstruction_status("1"); - inst.setAgv_jobno(String.valueOf(index)); - inst.setSend_status("1"); - instructionService.update(inst); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } - flag = true; - } - //任务完毕 - //(无车id及状态) - else if (phase == 0x14) { - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到指令号{}对应的指令", ikey); - break; - } - String agvcar = inst.getCarno(); - Device agvDevice = deviceAppService.findDeviceByCode(agvcar); - if (agvDevice != null) { - if (agvDevice.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { - agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) agvDevice.getDeviceDriver(); - agvNdcTwoDeviceDriver.setInstruction(null); - } - } - inst.setInstruction_status("2"); - instructionService.finish(inst); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } - //请求删除任务 - //(需要WCS反馈) - else if (phase == 0x30) { - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到指令号{}对应的指令", ikey); - break; - } - data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0); - } - //任务删除确认 - //(需要WCS反馈) - else if (phase == 0xFF) { - if (ObjectUtil.isEmpty(inst)) { - log.info("未找到指令号{}对应的指令", ikey); - break; - } - instructionService.cancelNOSendAgv(inst.getInstruction_id()); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - //上报异常信息 - //(不需要WCS反馈) - if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) { - device = deviceAppService.findDeviceByCode(Integer.toString(arr[18] * 256 + arr[19])); - } else { - device = deviceAppService.findDeviceByCode(Integer.toString(arr[20])); - } - if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { - agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver(); - agvNdcTwoDeviceDriver.processSocket(arr); - } - } - if (!ObjectUtil.isEmpty(data)) { - write(data); - } - - } else { - System.out.println("agv上报不是0073类型动作,不处理"); - } - } - - } catch (Exception e) { - - - } finally { - - - } - - } - - - @Override - public void stop() { - super.after(); - try { - s.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - public static void write(byte[] b) { - try { - log.info("下发agv数据:" + Bytes2HexString(b)); - System.out.println("下发agv数据:" + Bytes2HexString(b)); - dos.write(b); - dos.flush(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } -} diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 804100ff7..d0cdafe04 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -206,20 +206,23 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { log.info(agvaddr + "对应设备号为空!"); return; } - if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - - try { - standardAutodoorDeviceDriver.writing("to_open", "1"); - standardAutodoorDeviceDriver.writing("to_close", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); - } - if (standardAutodoorDeviceDriver.getOpen() == 1) { - log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + if(ObjectUtil.isNotEmpty(device)) { + if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); + try { + standardAutodoorDeviceDriver.writing("to_open", "1"); + standardAutodoorDeviceDriver.writing("to_close", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); + } + if (standardAutodoorDeviceDriver.getOpen() == 1) { + log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } } + } else { + log.info(agvaddr + "对应设备号为空!"); } } else if (phase == 0x51) { @@ -227,17 +230,20 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { log.info(agvaddr + "对应设备号为空!"); return; } - if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { - standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - try { - standardAutodoorDeviceDriver.writing("to_close", "1"); - standardAutodoorDeviceDriver.writing("to_open", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); + if(ObjectUtil.isNotEmpty(device)){ + if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); + try { + standardAutodoorDeviceDriver.writing("to_close", "1"); + standardAutodoorDeviceDriver.writing("to_open", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); + } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - + } else { + log.info(device_code + "对应设备号为空!"); } } else { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls index 1c3db516e..dedf580ea 100644 Binary files a/acs/nladmin-system/src/main/java/org/nl/acs/device.xls and b/acs/nladmin-system/src/main/java/org/nl/acs/device.xls differ diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 2a65667b1..6a6118704 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -7,12 +7,10 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.server.NDCAgvService; -import org.nl.acs.auto.run.TwoNDC2SocketConnectionAutoRun; import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; -import org.nl.acs.device_driver.basedriver.agv.utils.OneAgvPhase; import org.nl.acs.device_driver.basedriver.agv.utils.TwoAgvPhase; import org.nl.acs.device_driver.basedriver.photoelectric_inspection_site.PhotoelectricInspectionSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_autodoor.StandardAutodoorDeviceDriver; @@ -719,8 +717,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data)); if (StrUtil.equals(inst.getAgv_system_type(), "2")) { TwoNDCSocketConnectionAutoRun.write(data); - } else if (StrUtil.equals(inst.getAgv_system_type(), "3")) { - TwoNDC2SocketConnectionAutoRun.write(data); } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/dto/HeartbeatManageDto.java b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/dto/HeartbeatManageDto.java index bd6e46a72..3953c6cfa 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/dto/HeartbeatManageDto.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/dto/HeartbeatManageDto.java @@ -5,7 +5,7 @@ import org.nl.acs.heartbeat.enums.HeartbeatType; import java.util.Date; -public class HeartbeatManageDto extends Dto { +public class HeartbeatManageDto { private static final long serialVersionUID = 1L; private String resource_code; private String resource_name; @@ -14,6 +14,7 @@ public class HeartbeatManageDto extends Dto { private Date online_datetime; private Date offline_datetime; private Date lastreceivetime; + private String id; public HeartbeatManageDto() { } @@ -25,6 +26,10 @@ public class HeartbeatManageDto extends Dto { } + public String getId() { + return this.id; + } + public String getResource_code() { return this.resource_code; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/HeartbeatUnifiedService.java b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/HeartbeatUnifiedService.java index d2f2f9244..1880620b4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/HeartbeatUnifiedService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/HeartbeatUnifiedService.java @@ -3,6 +3,7 @@ package org.nl.acs.heartbeat.service; import org.nl.acs.heartbeat.HeartbeatEvent; import org.nl.acs.heartbeat.dto.HeartbeatManageDto; +import org.springframework.stereotype.Service; import java.util.List; import java.util.UUID; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatManageServiceimpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatManageServiceimpl.java similarity index 72% rename from acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatManageServiceimpl.java rename to acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatManageServiceimpl.java index 7557f971c..75f71933c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatManageServiceimpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatManageServiceimpl.java @@ -1,16 +1,19 @@ -package org.nl.acs.heartbeat.service_impl; +package org.nl.acs.heartbeat.service.impl; +import com.alibaba.fastjson.JSONArray; import org.nl.acs.heartbeat.domain.HeartbeatDomain; import org.nl.acs.heartbeat.dto.HeartbeatManageDto; import org.nl.acs.heartbeat.service.HeartbeatManageService; +import org.nl.acs.instruction.service.dto.Instruction; +import org.nl.modules.wql.core.bean.WQLObject; +import org.springframework.stereotype.Service; import java.util.List; import java.util.UUID; +@Service public class HeartbeatManageServiceimpl implements HeartbeatManageService { - public HeartbeatManageServiceimpl() { - } // public PageResult queryAllHeartbeat(PageQuery pageQuery) { // return this.heartbeatRespository.queryPagedByColumn(pageQuery, HeartbeatManageDto.class); @@ -40,7 +43,10 @@ public class HeartbeatManageServiceimpl implements HeartbeatManageService { } public List queryAllActive() { - return null; + WQLObject wo = WQLObject.getWQLObject("acs_heartbeat"); + JSONArray arr = wo.query().getResultJSONArray(0); + List list = arr.toJavaList(HeartbeatManageDto.class); + return list; } public HeartbeatManageDto queryById(UUID id) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatUnifiedServiceimpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatUnifiedServiceimpl.java similarity index 96% rename from acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatUnifiedServiceimpl.java rename to acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatUnifiedServiceimpl.java index 42ec13dd8..1d683cdcb 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service_impl/HeartbeatUnifiedServiceimpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/heartbeat/service/impl/HeartbeatUnifiedServiceimpl.java @@ -1,4 +1,4 @@ -package org.nl.acs.heartbeat.service_impl; +package org.nl.acs.heartbeat.service.impl; import cn.hutool.core.util.ObjectUtil; @@ -12,23 +12,22 @@ import org.nl.acs.heartbeat.service.HeartbeatManageService; import org.nl.acs.heartbeat.service.HeartbeatUnifiedService; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import java.util.*; +@Service public class HeartbeatUnifiedServiceimpl implements HeartbeatUnifiedService, ApplicationAutoInitial { private List heartbeats = new ArrayList(); + @Autowired private HeartbeatManageService heartbeatManageService; - public HeartbeatUnifiedServiceimpl() { - } @Override public void autoInitial() throws Exception { - heartbeatManageService = SpringContextHolder.getBean("heartbeatManageServiceImpl"); - this.reload(); Iterator iterator = this.heartbeats.iterator(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index b1ad40336..08625ef06 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -192,9 +192,9 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC if (true) { this.logItemChanged(itemId, accessor_value, value, itemDto); } - if(!ObjectUtil.isEmpty(value)){ +// if(!ObjectUtil.isEmpty(value)){ accessor_value.setValue(itemId, value); - } +// } } } diff --git a/acs/nladmin-system/src/main/resources/config/application-dev.yml b/acs/nladmin-system/src/main/resources/config/application-dev.yml index f57637425..7a0351aed 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -13,11 +13,11 @@ spring: 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: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_one_wcs}?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_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} # password: ${DB_PWD:P@ssw0rd} # password: ${DB_PWD:Root.123456} - password: ${DB_PWD:password} + password: ${DB_PWD:123456} # 初始连接数 initial-size: 5