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 091031f1d..7d2895ea1 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 @@ -221,31 +221,30 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC random *= 1000; if (this.all_null < 3) { if (log.isWarnEnabled()) { - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,5000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } - ThreadUtl.sleep((long) ((new Random()).nextInt(3) +1) * 1000); + ThreadUtl.sleep( 3000); break start; } else if (this.all_null < 6) { if (log.isWarnEnabled()) { log.warn(tag + "重新创建server"); - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,30000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } -// ThreadUtl.sleep((long) (30000 + random)); - ThreadUtl.sleep((long) ((new Random()).nextInt(3) +1) * 1000); + ThreadUtl.sleep(3000); break start; } else if (this.all_null < 12) { if (log.isWarnEnabled()) { - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, '\uea60' + random); + log.warn(tag + "重新创建server"); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,3); } - - ThreadUtl.sleep((long) ('\uea60' + random)); + ThreadUtl.sleep(3000); + break start; } else { if (log.isWarnEnabled()) { - log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 120000 + random); + log.warn("{} 所有内容都为空, all_null:{} ,暂定{}ms", tag, all_null, 5000); } - - ThreadUtl.sleep((long) (120000 + random)); + ThreadUtl.sleep((long) (5000)); } ++this.all_null; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index 7e34d45b5..e49d55c38 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -9,148 +9,6 @@ import com.alibaba.fastjson.JSONObject; * https://blog.csdn.net/moneyshi/article/details/82978073 */ public enum DriverTypeEnum { - // - ORDINARY_SITE(1, "standard_ordinary_site", "普通站点", "conveyor"), - - INSPECT_SITE(2, "standard_inspect_site", "检测站点", "conveyor"), - - STORAGE(3, "standard_storage", "标准版-货架", "storage"), - - SCANNER(4, "standard_scanner", "标准版-扫码器", "scanner"), - - INSPECT_CONVEYOR_CONTROL(5, "standard_conveyor_control", "标准版-输送机-控制点", "conveyor"), - - INSPECT_CONVEYOR_MONITOR(6, "standard_conveyor_monitor", "标准版-输送机-监控点", "conveyor"), - - AGV_NDC_ONE(7, "agv_ndc_one", "NDCAGV", "agv"), - - AGV_NDC_TWO(8, "agv_ndc_two", "NDC2楼AGV", "agv"), - - XGAGV(9, "xg_agv", "xg_agv", "agv"), - - AUTODOOR(10, "standard_autodoor", "标准版-自动门", "autodoor"), - - STANDARD_STACKER(11, "standard_stacker", "标准版-单工位堆垛机", "stacker"), - - SIEMENS_CONVEYOR_LABELING(12, "siemens_conveyor_labeling", "西门子-输送机驱动-贴标", "conveyor"), - - SIEMENS_CONVEYOR(14, "siemens_conveyor", "西门子-输送机驱动", "conveyor"), - - BELT_CONVEYOR(13, "belt_conveyor", "输送线", "conveyor"), - - LED_SCREEN(15, "led_screen", "LED点阵屏", "screen"), - - DOUBLE_STATION_STACKER(16, "double_station_stacker", "标准版-双工位堆垛机", "double_station_stacker"), - - DOUBLE_BELT_CONVEYOR(17, "double_belt_conveyor", "双工位输送线", "conveyor"), - - WITH_STATION_DEVICE_DRIVER(18, "with_station_device_driver", "输送线关联站点", "conveyor"), - - STANDARD_MANIPULATOR(19, "standard_manipulator", "标准版-行架机械手", "station"), - - BOX_MANIPULATOR(20, "box_manipulator", "装箱行架机械手", "station"), - BOX_MANIPULATOR_SITE(21, "box_manipulator_site", "木箱机械手对接位", "station"); - /** - * 驱动索引 - */ - private int index; - /** - * 驱动编码 - */ - private String code; - /** - * 驱动名字 - */ - private String name; - /** - * 驱动描述 - */ - private String desc; - /** - * 设备驱动类型 - */ - private String type; - - DriverTypeEnum(int index, String code, String name, String type) { - this.index = index; - this.code = code; - this.name = name; - this.type = type; - } - - - public static JSONArray getList() { - JSONArray arr = new JSONArray(); - for (DriverTypeEnum em : DriverTypeEnum.values()) { - JSONObject json = new JSONObject(); - json.put("code", em.getCode()); - json.put("name", em.getName()); - arr.add(json); - } - return arr; - } - - public static JSONArray getListByType(String type) { - JSONArray arr = new JSONArray(); - for (DriverTypeEnum em : DriverTypeEnum.values()) { - if (em.getType().equals(type)) { - JSONObject json = new JSONObject(); - json.put("code", em.getCode()); - json.put("name", em.getName()); - arr.add(json); - } - } - return arr; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public static String getName(String code) { - for (DriverTypeEnum c : DriverTypeEnum.values()) { - if (c.code == code) { - return c.name; - } - } - return null; - } - - public int getIndex() { - return index; - } - - public void setIndex(int index) { - this.index = index; - } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java index 411819849..d3cbec8b0 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/rest/DeviceController.java @@ -251,12 +251,14 @@ public class DeviceController { deviceService.downloadProtocolConfig(whereJson, response); } - @GetMapping("/getAllDriverCodeList") - @Log("协议配置下拉选设备驱动") - public ResponseEntity getAllDriverCodeList() { - return new ResponseEntity<>(DriverTypeEnum.getList(), HttpStatus.OK); - } + +// @GetMapping("/getAllDriverCodeList") +// @Log("协议配置下拉选设备驱动") +// @ApiOperation("协议配置下拉选设备驱动") +// public ResponseEntity getAllDriverCodeList() { +// return new ResponseEntity<>(DriverTypeEnum.getList(), HttpStatus.OK); +// } @Log("导出Smart设备协议CSV") diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml index 387ab2798..4aaae10db 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -13,6 +13,24 @@ spring: redis: repositories: enabled: false + redis: + #数据库索引 + host: ${REDIS_HOST:127.0.0.1} + port: ${REDIS_PORT:6379} + password: ${REDIS_PWD:} + #连接超时时间 + timeout: 5000 + redisson: + config: | + threads: 4 + nettyThreads: 4 + singleServerConfig: + database: 1 + connectionMinimumIdleSize: 8 + connectionPoolSize: 8 + address: redis://127.0.0.1:6379 + idleConnectionTimeout: 10000 + timeout: 3000 #配置 Jpa jpa: @@ -124,6 +142,7 @@ mybatis-plus: global-config: db-config: id-type: INPUT + banner: false lucene: index: