add:新增任务看板功能和LED驱动
This commit is contained in:
@@ -35,8 +35,11 @@ public enum DriverTypeEnum {
|
|||||||
|
|
||||||
SIEMENS_CONVEYOR(14,"siemens_conveyor","西门子-输送机驱动","conveyor"),
|
SIEMENS_CONVEYOR(14,"siemens_conveyor","西门子-输送机驱动","conveyor"),
|
||||||
|
|
||||||
BELT_CONVEYOR(13,"belt_conveyor","输送线","conveyor")
|
BELT_CONVEYOR(13,"belt_conveyor","输送线","conveyor"),
|
||||||
;
|
|
||||||
|
SCREEN(15, "led_screen", "LED点阵屏", "screen");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//驱动索引
|
//驱动索引
|
||||||
private int index;
|
private int index;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public enum DeviceType {
|
|||||||
agv("自动导引搬运车辆-AGV", 4),
|
agv("自动导引搬运车辆-AGV", 4),
|
||||||
rgv("有轨制导搬运车辆-RGV", 5),
|
rgv("有轨制导搬运车辆-RGV", 5),
|
||||||
scanner("条码阅读器-BCR", 6),
|
scanner("条码阅读器-BCR", 6),
|
||||||
led("LED点阵屏", 7),
|
screen("LED点阵屏", 7),
|
||||||
storage("货架", 8),
|
storage("货架", 8),
|
||||||
robot("机械手", 9),
|
robot("机械手", 9),
|
||||||
autodoor("自动门", 10),
|
autodoor("自动门", 10),
|
||||||
@@ -19,6 +19,7 @@ public enum DeviceType {
|
|||||||
shadow("影子设备", 15),
|
shadow("影子设备", 15),
|
||||||
other("其他设备", 16);
|
other("其他设备", 16);
|
||||||
|
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private int i;
|
private int i;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.nl.acs.monitor.DeviceStageMonitor;
|
|||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||||
|
import org.nl.acs.task.domain.Task;
|
||||||
import org.nl.acs.task.service.TaskService;
|
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.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
@@ -32,6 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static redis.clients.jedis.HostAndPort.localhost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 输送线
|
* 输送线
|
||||||
*/
|
*/
|
||||||
@@ -137,6 +140,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
String vehicle_code;
|
String vehicle_code;
|
||||||
String inst_message;
|
String inst_message;
|
||||||
|
|
||||||
|
//led点阵屏信息
|
||||||
|
JSONObject led_message = null;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
return this.device;
|
return this.device;
|
||||||
@@ -494,6 +501,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
map.put("to_container_type", "1");
|
map.put("to_container_type", "1");
|
||||||
map.put("to_container_no", "1");
|
map.put("to_container_no", "1");
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
|
led_message = getLedMessage(instdto);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -558,6 +566,24 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务信息
|
||||||
|
*/
|
||||||
|
public JSONObject getLedMessage(Instruction instdto){
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("task_code", instdto.getTask_code());
|
||||||
|
json.put("inst_code", instdto.getInstruction_code());
|
||||||
|
json.put("start_device_code", instdto.getStart_device_code());
|
||||||
|
json.put("next_device_code", instdto.getNext_device_code());
|
||||||
|
json.put("material_type", instdto.getMaterial());
|
||||||
|
json.put("quantity", instdto.getQuantity());
|
||||||
|
json.put("vehicle_code", instdto.getVehicle_code());
|
||||||
|
json.put("instruction_status",instdto.getInstruction_status());
|
||||||
|
json.put("entry_time", instdto.getCreate_time());
|
||||||
|
json.put("ip", localhost);
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package org.nl.acs.device_driver.basedriver.led_screen;
|
||||||
|
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.enums.DeviceType;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriverDefination;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LED点阵屏定义
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LedScreenDefination implements DeviceDriverDefination {
|
||||||
|
@Override
|
||||||
|
public String getDriverCode() {
|
||||||
|
return "led_screen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverName() {
|
||||||
|
return "LED点阵屏";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDriverDescription() {
|
||||||
|
return "LED点阵屏";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceDriver getDriverInstance(Device device) {
|
||||||
|
return (new LedScreenDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends DeviceDriver> getDeviceDriverType(){
|
||||||
|
return LedScreenDeviceDriver.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceType> getFitDeviceTypes() {
|
||||||
|
List<DeviceType> types = new LinkedList();
|
||||||
|
types.add(DeviceType.screen);
|
||||||
|
return types;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
package org.nl.acs.device_driver.basedriver.led_screen;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.agv.server.NDCAgvService;
|
||||||
|
import org.nl.acs.device.service.DeviceService;
|
||||||
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||||
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
|
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||||
|
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
|
import org.nl.acs.task.service.TaskService;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LED点阵屏
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Data
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class LedScreenDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||||
|
@Autowired
|
||||||
|
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
||||||
|
@Autowired
|
||||||
|
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
||||||
|
@Autowired
|
||||||
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||||
|
@Autowired
|
||||||
|
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
|
|
||||||
|
Integer hasGoods = 0;
|
||||||
|
int error = 0;
|
||||||
|
Boolean iserror = false;
|
||||||
|
Boolean islock = false;
|
||||||
|
|
||||||
|
int branchProtocol = 0;
|
||||||
|
int last_branchProtocol = 0;
|
||||||
|
//是否需要输入物料
|
||||||
|
String input_material = "0";
|
||||||
|
//备注
|
||||||
|
String remark = "";
|
||||||
|
//数量
|
||||||
|
String qty = "";
|
||||||
|
//批次
|
||||||
|
String batch = "";
|
||||||
|
//物料
|
||||||
|
String material = "";
|
||||||
|
//目标点位
|
||||||
|
String purpose = "";
|
||||||
|
//当前指令
|
||||||
|
Instruction inst = null;
|
||||||
|
//上次指令
|
||||||
|
Instruction last_inst = null;
|
||||||
|
|
||||||
|
boolean requireSucess = false;
|
||||||
|
|
||||||
|
//触摸屏手动触发任务
|
||||||
|
private Boolean is_has_task = false;
|
||||||
|
|
||||||
|
//申请搬运任务
|
||||||
|
private Boolean apply_handling = false;
|
||||||
|
//申请物料
|
||||||
|
private Boolean apply_material = false;
|
||||||
|
|
||||||
|
// 1取货完成 2放货完成 3进入区域 4离开区域
|
||||||
|
private int flag;
|
||||||
|
|
||||||
|
//人工确认信号 默认0 agv到达后请求置1 等人工确认后变为2 反馈agv后继续为0
|
||||||
|
private int manua_confirm = 0;
|
||||||
|
|
||||||
|
String device_code = null;
|
||||||
|
String container;
|
||||||
|
String container_type_desc;
|
||||||
|
String last_container_type_desc;
|
||||||
|
String last_container;
|
||||||
|
private Date instruction_require_time = new Date();
|
||||||
|
private Date instruction_finished_time = new Date();
|
||||||
|
|
||||||
|
private int instruction_require_time_out;
|
||||||
|
|
||||||
|
String message;
|
||||||
|
|
||||||
|
// 1 上位系统允许进入 2 上位系统允许离开
|
||||||
|
int status = 0;
|
||||||
|
|
||||||
|
int agvphase = 0;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
int mode = 2;
|
||||||
|
|
||||||
|
int move;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
hasGoods = this.getDevice().getHas_goods();
|
||||||
|
batch = this.getDevice().getBatch();
|
||||||
|
device_code = this.getDeviceCode();
|
||||||
|
|
||||||
|
if (agvphase == 0x03) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("1");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x05) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("2");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x07) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("5");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x09) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("6");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getDeviceStatusName() {
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
String mode = "";
|
||||||
|
String action = "";
|
||||||
|
String move = "";
|
||||||
|
if (this.getMode() == 0) {
|
||||||
|
mode = "未联机";
|
||||||
|
} else if (this.getMode() == 1) {
|
||||||
|
mode = "单机";
|
||||||
|
} else if (this.getMode() == 2) {
|
||||||
|
mode = "联机";
|
||||||
|
} else if (this.getMode() == 3) {
|
||||||
|
mode = "运行中";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.getMove() == 0) {
|
||||||
|
move = "无货";
|
||||||
|
jo.put("hasGoods", false);
|
||||||
|
} else if (this.getMove() == 1) {
|
||||||
|
move = "有货";
|
||||||
|
jo.put("hasGoods", true);
|
||||||
|
} else if (this.getMove() == 2) {
|
||||||
|
move = "有托盘有货";
|
||||||
|
jo.put("hasGoods", true);
|
||||||
|
}
|
||||||
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
|
jo.put("mode", mode);
|
||||||
|
jo.put("move", move);
|
||||||
|
jo.put("action", action);
|
||||||
|
jo.put("isOnline", true);
|
||||||
|
jo.put("error", this.getError());
|
||||||
|
jo.put("isError", this.getIserror());
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDeviceStatus(JSONObject data) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.nl.acs.taskscreen.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import org.nl.acs.common.base.CommonMapper;
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.domain.DeviceAssigned;
|
||||||
|
import org.nl.common.base.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface TaskScreenMapper extends CommonMapper<Device> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.nl.acs.taskscreen.rest;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.nl.acs.taskscreen.service.TaskScreenService;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Tu Qiang
|
||||||
|
* @date 2023-11-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "任务看板")
|
||||||
|
@RequestMapping("/api/screen")
|
||||||
|
public class TaskScreenController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TaskScreenService taskScreenService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("下拉选设备")
|
||||||
|
@ApiOperation("下拉选设备")
|
||||||
|
public ResponseEntity<Object> selectLedList() {
|
||||||
|
return new ResponseEntity<>(taskScreenService.selectLedList(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getLedMessage/{device}")
|
||||||
|
@Log("根据关联设备获取任务信息")
|
||||||
|
@ApiOperation("根据关联设备获取任务信息")
|
||||||
|
public ResponseEntity<Object> getLedMessage(@PathVariable String device) {
|
||||||
|
return new ResponseEntity<>(taskScreenService.getLedMessage(device), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.nl.acs.taskscreen.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
|
||||||
|
public interface TaskScreenService extends IService<Device> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前端设备下拉选列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JSONArray selectLedList();
|
||||||
|
|
||||||
|
JSONObject getLedMessage(String device);
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package org.nl.acs.taskscreen.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||||
|
import org.nl.acs.common.base.PageInfo;
|
||||||
|
import org.nl.acs.common.base.impl.CommonServiceImpl;
|
||||||
|
import org.nl.acs.device.domain.Device;
|
||||||
|
import org.nl.acs.device.service.DeviceService;
|
||||||
|
import org.nl.acs.device.service.dto.DeviceDto;
|
||||||
|
import org.nl.acs.device.service.dto.DeviceQueryParam;
|
||||||
|
import org.nl.acs.device.service.mapper.DeviceMapper;
|
||||||
|
import org.nl.acs.device_driver.basedriver.belt_conveyor.BeltConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.instruction.domain.Instruction;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
|
import org.nl.acs.storage_cell.service.dto.StorageCellDto;
|
||||||
|
import org.nl.acs.taskscreen.mapper.TaskScreenMapper;
|
||||||
|
import org.nl.acs.taskscreen.service.TaskScreenService;
|
||||||
|
import org.nl.config.SpringContextHolder;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||||
|
public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper,Device> implements TaskScreenService, ApplicationAutoInitial {
|
||||||
|
|
||||||
|
|
||||||
|
private final DeviceMapper deviceMapper;
|
||||||
|
private final DeviceAppService deviceAppservice;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void autoInitial() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray selectLedList() {
|
||||||
|
List<Device> list = new LambdaQueryChainWrapper<Device>(deviceMapper)
|
||||||
|
.like(Device::getDevice_code, "LED")
|
||||||
|
.list();
|
||||||
|
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(list));
|
||||||
|
JSONArray result = new JSONArray();
|
||||||
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
|
JSONObject obj = arr.getJSONObject(i);
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("device_code",obj.getString("device_code"));
|
||||||
|
result.add(json);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject getLedMessage(String device_code) {
|
||||||
|
if (!ObjectUtil.isNotEmpty(device_code)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//根据设备号找到当前设备
|
||||||
|
LambdaQueryChainWrapper<Device> wrapper = new LambdaQueryChainWrapper<Device>(deviceMapper)
|
||||||
|
.eq(Device::getDevice_code, device_code);
|
||||||
|
Device device1 = deviceMapper.selectOne(wrapper);
|
||||||
|
//获取关联设备驱动信息
|
||||||
|
String link_device_code = String.valueOf(device1.getExtraValue().get("link_device_code"));
|
||||||
|
Device link_device = deviceAppservice.findDeviceByCode(link_device_code);
|
||||||
|
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
if (link_device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||||
|
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) link_device.getDeviceDriver();
|
||||||
|
if(ObjectUtil.isNotEmpty(beltConveyorDeviceDriver.getLed_message())){
|
||||||
|
Instruction inst = beltConveyorDeviceDriver.getInst();
|
||||||
|
json = beltConveyorDeviceDriver.getLedMessage(inst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
acs/nladmin-ui/src/api/monitor/screen.js
Normal file
17
acs/nladmin-ui/src/api/monitor/screen.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function selectLedList() {
|
||||||
|
return request({
|
||||||
|
url: 'api/screen',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLedMessage(device) {
|
||||||
|
return request({
|
||||||
|
url: 'api/screen/getLedMessage/' + device,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { selectLedList, getLedMessage }
|
||||||
BIN
acs/nladmin-ui/src/assets/images/bigScreen.png
Normal file
BIN
acs/nladmin-ui/src/assets/images/bigScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 MiB |
BIN
acs/nladmin-ui/src/assets/images/bigScreenTwo.png
Normal file
BIN
acs/nladmin-ui/src/assets/images/bigScreenTwo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 459 KiB |
BIN
acs/nladmin-ui/src/assets/screen_images/1.jpg
Normal file
BIN
acs/nladmin-ui/src/assets/screen_images/1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 435 KiB |
@@ -50,6 +50,12 @@ export const constantRouterMap = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/bigScreen/screen',
|
||||||
|
component: (resolve) => require(['@/views/screen/bigScreen'], resolve),
|
||||||
|
hidden: true,
|
||||||
|
meta: { title: '任务看板' }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ import belt_conveyor from '@/views/acs/device/driver/belt_conveyor'
|
|||||||
import agv_ndc_one from '@/views/acs/device/driver/agv/agv_ndc_one'
|
import agv_ndc_one from '@/views/acs/device/driver/agv/agv_ndc_one'
|
||||||
import agv_ndc_two from '@/views/acs/device/driver/agv/agv_ndc_two'
|
import agv_ndc_two from '@/views/acs/device/driver/agv/agv_ndc_two'
|
||||||
import xg_agv from '@/views/acs/device/driver/agv/xg_agv'
|
import xg_agv from '@/views/acs/device/driver/agv/xg_agv'
|
||||||
|
import led_screen from './driver/led_screen'
|
||||||
// import standard_station from '@/views/acs/device/driver/standard_station'
|
// import standard_station from '@/views/acs/device/driver/standard_station'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -109,11 +110,12 @@ export default {
|
|||||||
// empty_vehicle_stacking_position,
|
// empty_vehicle_stacking_position,
|
||||||
agv_ndc_two,
|
agv_ndc_two,
|
||||||
agv_ndc_one,
|
agv_ndc_one,
|
||||||
|
xg_agv,
|
||||||
|
led_screen,
|
||||||
standard_stacker,
|
standard_stacker,
|
||||||
siemens_conveyor_labeling,
|
siemens_conveyor_labeling,
|
||||||
siemens_conveyor,
|
siemens_conveyor,
|
||||||
belt_conveyor,
|
belt_conveyor,
|
||||||
xg_agv
|
|
||||||
// standard_station
|
// standard_station
|
||||||
},
|
},
|
||||||
dicts: ['device_type'],
|
dicts: ['device_type'],
|
||||||
|
|||||||
353
acs/nladmin-ui/src/views/acs/device/driver/led_screen.vue
Normal file
353
acs/nladmin-ui/src/views/acs/device/driver/led_screen.vue
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
<template>
|
||||||
|
<!--LED点阵屏-->
|
||||||
|
<div>
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span class="role-span">设备协议:</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
OpcServer:
|
||||||
|
<el-select
|
||||||
|
v-model="opc_id"
|
||||||
|
placeholder="无"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="changeOpc"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dataOpcservers"
|
||||||
|
:key="item.opc_id"
|
||||||
|
:label="item.opc_name"
|
||||||
|
:value="item.opc_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
PLC:
|
||||||
|
<el-select
|
||||||
|
v-model="plc_id"
|
||||||
|
placeholder="无"
|
||||||
|
clearable
|
||||||
|
@change="changePlc"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dataOpcPlcs"
|
||||||
|
:key="item.plc_id"
|
||||||
|
:label="item.plc_name"
|
||||||
|
:value="item.plc_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span class="role-span">输送系统:</span>
|
||||||
|
</div>
|
||||||
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="电气调度号" label-width="150px">
|
||||||
|
<el-input v-model="form.OPCServer" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span class="role-span">指令相关:</span>
|
||||||
|
</div>
|
||||||
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="关联设备" prop="device_code">
|
||||||
|
<el-select
|
||||||
|
v-model="form.link_device_code"
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
clearable
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in deviceList"
|
||||||
|
:key="item.device_code"
|
||||||
|
:label="item.device_name"
|
||||||
|
:value="item.device_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span class="role-span" />
|
||||||
|
<el-button
|
||||||
|
:loading="false"
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
style="float: right; padding: 6px 9px"
|
||||||
|
type="primary"
|
||||||
|
@click="doSubmit"
|
||||||
|
>保存
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
queryDriverConfig,
|
||||||
|
updateConfig,
|
||||||
|
testRead,
|
||||||
|
testwrite
|
||||||
|
} from '@/api/acs/device/driverConfig'
|
||||||
|
import { selectOpcList } from '@/api/acs/device/opc'
|
||||||
|
import { selectPlcList } from '@/api/acs/device/opcPlc'
|
||||||
|
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
|
||||||
|
|
||||||
|
import crud from '@/mixins/crud'
|
||||||
|
import deviceCrud from '@/api/acs/device/device'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LedScreen',
|
||||||
|
mixins: [crud],
|
||||||
|
props: {
|
||||||
|
parentForm: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
device_code: '',
|
||||||
|
device_id: '',
|
||||||
|
plc_id: '',
|
||||||
|
plc_code: '',
|
||||||
|
opc_id: '',
|
||||||
|
opc_code: '',
|
||||||
|
load_device_code: '',
|
||||||
|
configLoading: false,
|
||||||
|
dataOpcservers: [],
|
||||||
|
dataOpcPlcs: [],
|
||||||
|
deviceList: [],
|
||||||
|
data1: [],
|
||||||
|
data2: [],
|
||||||
|
form: {
|
||||||
|
inspect_in_stocck: true,
|
||||||
|
ignore_pickup_check: true,
|
||||||
|
ignore_release_check: true,
|
||||||
|
apply_task: true,
|
||||||
|
link_three_lamp: '',
|
||||||
|
manual_create_task: true,
|
||||||
|
is_pickup: true,
|
||||||
|
is_release: true,
|
||||||
|
link_device_code: [],
|
||||||
|
get_device_code: [],
|
||||||
|
put_device_code: []
|
||||||
|
},
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 从父表单获取设备编码
|
||||||
|
this.device_id = this.$props.parentForm.device_id
|
||||||
|
this.device_code = this.$props.parentForm.device_code
|
||||||
|
queryDriverConfig(this.device_id, this.$props.parentForm.driver_code).then(data => {
|
||||||
|
// 给表单赋值,并且属性不能为空
|
||||||
|
if (data.form) {
|
||||||
|
const arr = Object.keys(data.form)
|
||||||
|
// 不为空
|
||||||
|
if (arr.length > 0) {
|
||||||
|
this.form = data.form
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 给表单赋值,并且属性不能为空
|
||||||
|
if (data.parentForm) {
|
||||||
|
const arr = Object.keys(data.parentForm)
|
||||||
|
// 不为空
|
||||||
|
if (arr.length > 0) {
|
||||||
|
this.opc_code = data.parentForm.opc_code
|
||||||
|
this.plc_code = data.parentForm.plc_code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.data1 = data.rs
|
||||||
|
this.data2 = data.ws
|
||||||
|
this.sliceItem()
|
||||||
|
})
|
||||||
|
selectPlcList().then(data => {
|
||||||
|
this.dataOpcPlcs = data
|
||||||
|
this.plc_id = this.$props.parentForm.opc_plc_id
|
||||||
|
})
|
||||||
|
selectOpcList().then(data => {
|
||||||
|
this.dataOpcservers = data
|
||||||
|
this.opc_id = this.$props.parentForm.opc_server_id
|
||||||
|
})
|
||||||
|
deviceCrud.selectDeviceList().then(data => {
|
||||||
|
this.deviceList = data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
finishReadEdit(data) {
|
||||||
|
// 编辑的是code列,并且值包含mode
|
||||||
|
if (data.code.indexOf('mode') !== -1) {
|
||||||
|
debugger
|
||||||
|
const dbValue = data.db
|
||||||
|
// .之前的字符串
|
||||||
|
const beforeStr = dbValue.match(/(\S*)\./)[1]
|
||||||
|
// .之后的字符串
|
||||||
|
const afterStr = dbValue.match(/\.(\S*)/)[1]
|
||||||
|
// 取最后数字
|
||||||
|
const endNumber = afterStr.substring(1)
|
||||||
|
// 最后为非数字
|
||||||
|
if (isNaN(parseInt(endNumber))) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// for (const val in this.data1) {
|
||||||
|
// if (this.data1[val].code.indexOf('move') !== -1) {
|
||||||
|
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 1)
|
||||||
|
// }
|
||||||
|
// if (this.data1[val].code.indexOf('error') !== -1) {
|
||||||
|
// this.data1[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 5)
|
||||||
|
// }
|
||||||
|
// if (this.data1[val].code.indexOf('task') !== -1) {
|
||||||
|
// this.data1[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 7)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
finishWriteEdit(data) {
|
||||||
|
// 编辑的是code列,并且值包含mode
|
||||||
|
if (data.code.indexOf('to_command') !== -1) {
|
||||||
|
const dbValue = data.db
|
||||||
|
// .之前的字符串
|
||||||
|
const beforeStr = dbValue.match(/(\S*)\./)[1]
|
||||||
|
// .之后的字符串
|
||||||
|
const afterStr = dbValue.match(/\.(\S*)/)[1]
|
||||||
|
// 取最后数字
|
||||||
|
const endNumber = afterStr.substring(1)
|
||||||
|
// 最后为非数字
|
||||||
|
if (isNaN(parseInt(endNumber))) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// for (const val in this.data2) {
|
||||||
|
// if (this.data2[val].code.indexOf('to_target') !== -1) {
|
||||||
|
// this.data2[val].db = beforeStr + '.' + afterStr.substring(0, 1) + (parseInt(endNumber) + 2)
|
||||||
|
// }
|
||||||
|
// if (this.data2[val].code.indexOf('to_task') !== -1) {
|
||||||
|
// this.data2[val].db = beforeStr + '.' + 'D' + (parseInt(endNumber) + 6)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeOpc(val) {
|
||||||
|
this.dataOpcservers.forEach(item => {
|
||||||
|
if (item.opc_id === val) {
|
||||||
|
this.opc_code = item.opc_code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
selectListByOpcID(val).then(data => {
|
||||||
|
this.dataOpcPlcs = data
|
||||||
|
this.plc_id = ''
|
||||||
|
this.plc_code = ''
|
||||||
|
if (this.dataOpcPlcs && this.dataOpcPlcs.length > 0) {
|
||||||
|
this.plc_id = this.dataOpcPlcs[0].plc_id
|
||||||
|
this.plc_code = this.dataOpcPlcs[0].plc_code
|
||||||
|
}
|
||||||
|
this.sliceItem()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changePlc(val) {
|
||||||
|
this.dataOpcPlcs.forEach(item => {
|
||||||
|
if (item.plc_id === val) {
|
||||||
|
this.plc_code = item.plc_code
|
||||||
|
this.sliceItem()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
test_read1() {
|
||||||
|
testRead(this.data1, this.opc_id).then(data => {
|
||||||
|
this.data1 = data
|
||||||
|
this.notify('操作成功!', 'success')
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
test_read2() {
|
||||||
|
testRead(this.data2, this.opc_id).then(data => {
|
||||||
|
this.data2 = data
|
||||||
|
console.log(this.data2)
|
||||||
|
this.notify('操作成功!', 'success')
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
test_write1() {
|
||||||
|
testwrite(this.data2, this.opc_id).then(data => {
|
||||||
|
this.notify('操作成功!', 'success')
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doSubmit() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.configLoading = true
|
||||||
|
// 根据驱动类型判断是否为路由设备
|
||||||
|
const parentForm = this.parentForm
|
||||||
|
parentForm.is_route = true
|
||||||
|
parentForm.plc_id = this.plc_id
|
||||||
|
parentForm.opc_id = this.opc_id
|
||||||
|
updateConfig(parentForm, this.form, this.data1, this.data2).then(res => {
|
||||||
|
this.notify('保存成功', 'success')
|
||||||
|
this.configLoading = false
|
||||||
|
}).catch(err => {
|
||||||
|
this.configLoading = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sliceItem() { // 拼接DB的Item值
|
||||||
|
this.data1.forEach(item => {
|
||||||
|
const str = item.code
|
||||||
|
// 是否包含.
|
||||||
|
if (str.search('.') !== -1) {
|
||||||
|
// 截取最后一位
|
||||||
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||||
|
} else {
|
||||||
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.data2.forEach(item => {
|
||||||
|
const str = item.code
|
||||||
|
// 是否包含.
|
||||||
|
if (str.search('.') !== -1) {
|
||||||
|
// 截取最后一位
|
||||||
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + str.slice(str.lastIndexOf('.') + 1)
|
||||||
|
} else {
|
||||||
|
item.code = this.opc_code + '.' + this.plc_code + '.' + this.device_code + '.' + item.code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
231
acs/nladmin-ui/src/views/screen/bigScreen.vue
Normal file
231
acs/nladmin-ui/src/views/screen/bigScreen.vue
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
<template>
|
||||||
|
<div class="login" :style="'background-image:url('+ Background +');'">
|
||||||
|
<div style="font-size: 42px; color: #f4f4f5; text-align: center; background-color: transparent;padding-top: 20px;">兰州海亮设备管理任务看板</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<di><h2 style="font-size: 50px; color: #f4f4f5;margin-left: 30px;padding-top: 10px;">任务看板</h2></di>
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
label-position="right"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item class="item" label="当前设备">
|
||||||
|
<el-select id="sltFont" v-model="device" placeholder="请选择"
|
||||||
|
@change="changeDevice">
|
||||||
|
<el-option style="font-size: 22px;"
|
||||||
|
v-for="item in ledList"
|
||||||
|
:key="item.device_code"
|
||||||
|
:label="item.device_name"
|
||||||
|
:value="item.device_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="grid-content bg-purple-light">
|
||||||
|
<h2 style="font-size: 50px; color: #f4f4f5;text-align:right;margin-right: 140px;">{{ getTime }}</h2>
|
||||||
|
</div>
|
||||||
|
<div class="grid-content bg-purple-light">
|
||||||
|
<p style="font-size: 50px; color: #f4f4f5;text-align:right;margin-right: 110px;"><b>{{ getDate }}</b></p>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form v-if="device!=''" ref="form" style="border: 2px solid #f4f4f5;margin-top: 10px;padding-top: 50px;"
|
||||||
|
:inline="true"
|
||||||
|
:model="form" :rules="rules" size="medium" label-width="85px" label-suffix=":">
|
||||||
|
<el-row type="flex" justify="center" style="height: 100px;">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="任务号" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.task_code"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="指令号" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.inst_code"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center" style="height: 100px;">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="起点" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.start_device_code"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="终点" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.next_device_code"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center" style="height: 100px;">
|
||||||
|
<el-col :span="12" >
|
||||||
|
<el-form-item class="item" label="物料类型" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.material_type"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="物料数量" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.quantity"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center" style="height: 100px;">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="载具号" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.vehicle_code"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="条码" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.instruction_status"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row type="flex" justify="center" style="height: 100px;">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="入库日期" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.entry_time"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="item" label="IP" label-width="400px">
|
||||||
|
<el-input class="cpp" v-model="form.ip"/>
|
||||||
|
<span style="color: #f4f4f5;margin-left: 10px;"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div v-if="device!=''" style="font-size: 30px; color: #f4f4f5; text-align: center; background-color: transparent;padding-top: 50px;">
|
||||||
|
<i class="el-icon-lock"></i>
|
||||||
|
http://127.0.0.1:8014/bigScreen/screen</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import crud from '@/mixins/crud'
|
||||||
|
import deviceCrud from '@/api/monitor/screen'
|
||||||
|
import Background from '@/assets/images/bigScreen.png'
|
||||||
|
import BackgroundTwo from '@/assets/images/bigScreenTwo.png'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [crud],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
Background: Background,
|
||||||
|
BackgroundTwo: BackgroundTwo,
|
||||||
|
device_code: '',
|
||||||
|
device_id: '',
|
||||||
|
device: '',
|
||||||
|
vehicle_code: '',
|
||||||
|
bar_code: '',
|
||||||
|
entry_time: '',
|
||||||
|
ip: '',
|
||||||
|
form: {
|
||||||
|
task_code: '',
|
||||||
|
inst_code: '',
|
||||||
|
start_device_code: '',
|
||||||
|
next_device_code: '',
|
||||||
|
material_type: '',
|
||||||
|
quantity: 0,
|
||||||
|
vehicle_code: '',
|
||||||
|
instruction_status: '',
|
||||||
|
entry_time: '',
|
||||||
|
ip: ''
|
||||||
|
},
|
||||||
|
ledList: [],
|
||||||
|
getTime: '',
|
||||||
|
getDate: '',
|
||||||
|
src: '../images/bigScreen.png'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
// 定时器
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
this.settime()// 你所加载数据的方法
|
||||||
|
}, 1000)
|
||||||
|
// 销毁定时器
|
||||||
|
this.$once('hook:beforeDestroy', () => {
|
||||||
|
clearInterval(timer)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// js提供的clearInterval方法用来清除定时器
|
||||||
|
console.log('定时器销毁')
|
||||||
|
clearInterval(this.timer)
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
deviceCrud.selectLedList().then(data => {
|
||||||
|
this.ledList = data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeDevice(val) {
|
||||||
|
this.device = val
|
||||||
|
deviceCrud.getLedMessage(this.device).then(data => {
|
||||||
|
this.form = data
|
||||||
|
})
|
||||||
|
// todo: 定时器
|
||||||
|
this.timer = setInterval(() => { // 定时刷新设备的状态信息
|
||||||
|
console.log('定时器启动')
|
||||||
|
this.initStatus()
|
||||||
|
}, 10000)
|
||||||
|
},
|
||||||
|
settime() {
|
||||||
|
const _this = this
|
||||||
|
const yy = new Date().getFullYear()
|
||||||
|
const mm = new Date().getMonth() + 1
|
||||||
|
const dd = new Date().getDate()
|
||||||
|
const hh = new Date().getHours()
|
||||||
|
const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
|
||||||
|
const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
|
||||||
|
_this.getDate = yy + '年' + mm + '月' + dd + '日 ' + '星期' + '日一二三四五六'.charAt(new Date().getDay())
|
||||||
|
_this.getTime = hh + ':' + mf + ':' + ss
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.login {
|
||||||
|
height: 100%;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.item .el-form-item__label{
|
||||||
|
color: white;
|
||||||
|
font-size: 34px;
|
||||||
|
}
|
||||||
|
.cpp {
|
||||||
|
height: 300%;
|
||||||
|
width: 350px;
|
||||||
|
font-size: 30px;;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.ppd{
|
||||||
|
height: 300%;
|
||||||
|
width: 350px;
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 30px;;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#sltFont {
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
Reference in New Issue
Block a user