diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java index 98c4452..f8a8cdd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control/StandardConveyorControlDefination.java @@ -52,23 +52,9 @@ public class StandardConveyorControlDefination implements OpcDeviceDriverDefinat @Override public List getReadableItemDtos() { - return getReadableItemDtos2(); + return ItemProtocol.getReadableItemDtos(); } - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true))); - list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB600.B3")); - list.add(new ItemDto(ItemProtocol.item_ioaction, "进出类型", "DB600.B4")); - list.add(new ItemDto(ItemProtocol.item_height, "高度类型", "DB600.B5")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6")); - list.add(new ItemDto(ItemProtocol.item_direction, "电机方向", "DB600.B7")); - list.add(new ItemDto(ItemProtocol.item_operation_type, "作业类型", "DB600.B8")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D22")); - return list; - } @Override public List getWriteableItemDtos() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java index 3080e0e..faf9dda 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_plcscanner/StandardConveyorControlWithPlcScannerDefination.java @@ -51,24 +51,9 @@ public class StandardConveyorControlWithPlcScannerDefination implements OpcDevic @Override public List getReadableItemDtos() { - return getReadableItemDtos2(); + return ItemProtocol.getReadableItemDtos(); } - public static List getReadableItemDtos2() { - List list = new ArrayList(); - list.add(new ItemDto(ItemProtocol.item_heartbeat, "心跳", "DB600.B0")); - list.add(new ItemDto(ItemProtocol.item_mode, "工作状态", "DB600.B1", Boolean.valueOf(true))); - list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB600.B2")); - list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB600.B3")); - list.add(new ItemDto(ItemProtocol.item_ioaction, "进出类型", "DB600.B4")); - list.add(new ItemDto(ItemProtocol.item_height, "高度类型", "DB600.B5")); - list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB600.B6")); - list.add(new ItemDto(ItemProtocol.item_direction, "电机方向", "DB600.B7")); - list.add(new ItemDto(ItemProtocol.item_operation_type, "作业类型", "DB600.B8")); - list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB600.D22")); - list.add(new ItemDto(ItemProtocol.item_barcode, "托盘号", "DB600.S26")); - return list; - } @Override public List getWriteableItemDtos() { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index 06555f4..c2af26a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -21,6 +21,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; 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.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.WcsConfig; @@ -42,7 +43,7 @@ import java.util.*; @Slf4j @Data @RequiredArgsConstructor -public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver { +public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); @@ -546,5 +547,69 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe } } + @Override + public JSONObject getDeviceStatusName() { + JSONObject jo = new JSONObject(); + String mode = ""; + String action = ""; + String io_action = ""; + String move = ""; + String status = ""; + if (this.getMode() == 0) { + mode = "未联机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "联机"; + } else if (this.getMode() == 4) { + mode = "人工排产确认"; + } else if (this.getMode() == 5) { + mode = "申请空盘"; + } else if (this.getMode() == 6) { + mode = "申请入库"; + } else if (this.getMode() == 7) { + mode = "码垛完成"; + } else if (this.getMode() == 8) { + mode = "码垛强制完成"; + } else if (this.getMode() == 9) { + mode = "工单完成"; + } + if (this.getAction() == 0) { + action = "禁止取放"; + } else if (this.getAction() == 1) { + action = "允许取货"; + } else if (this.getAction() == 2) { + action = "允许放货"; + } else if (this.getAction() == 3) { + action = "允许取放"; + } + + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } else if (this.getMove() == 2) { + move = "有托盘有货"; + } + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("status", status); + jo.put("io_action", io_action); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", this.getMessage()); + jo.put("task", this.getTask()); + jo.put("barcode", this.getBarcode()); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + + } } 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 7e9974e..5e6b6a9 100644 --- a/acs/nladmin-system/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/src/main/resources/config/application-dev.yml @@ -1,5 +1,5 @@ server: - port: 8011 + port: 8010 #配置数据源 spring: datasource: @@ -7,9 +7,10 @@ spring: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true +# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:yongyu_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} password: ${DB_PWD:P@ssw0rd} - # password: ${DB_PWD:12356} +# password: ${DB_PWD:Root.123456} # 初始连接数 initial-size: 5 # 最小连接数 @@ -51,12 +52,12 @@ spring: wall: config: multi-statement-allow: true -redis: - #数据库索引 - database: ${REDIS_DB:15} - host: ${REDIS_HOST:127.0.0.1} - port: ${REDIS_PORT:6379} - password: ${REDIS_PWD:} + redis: + #数据库索引 + database: ${REDIS_DB:15} + host: ${REDIS_HOST:127.0.0.1} + port: ${REDIS_PORT:6379} + password: ${REDIS_PWD:} # 登录相关配置 login: @@ -133,7 +134,7 @@ logging: # Sa-Token配置 sa-token: # token 名称 (同时也是cookie名称) - token-name: satoken + token-name: Authorization # token 有效期,单位s 默认30天, -1代表永不过期 timeout: 2592000 # token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 @@ -148,7 +149,7 @@ sa-token: is-log: false jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq # token 前缀 -# token-prefix: Bearer + token-prefix: Bearer loki: url: http://localhost:3100/loki/api/v1 diff --git a/acs/nladmin-ui/src/api/system/param.js b/acs/nladmin-ui/src/api/system/param.js index 52896bc..c2ded22 100644 --- a/acs/nladmin-ui/src/api/system/param.js +++ b/acs/nladmin-ui/src/api/system/param.js @@ -24,7 +24,7 @@ export function edit(data) { }) } -export function getStageCodeByCode(code) { +export function getValueByCode(code) { return request({ url: 'api/param/getValueByCode', method: 'post', @@ -32,4 +32,4 @@ export function getStageCodeByCode(code) { }) } -export default { add, edit, del, getStageCodeByCode } +export default { add, edit, del, getValueByCode } diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 405059f..bdd40b6 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -1,7 +1,7 @@