add 智能车间
This commit is contained in:
@@ -9,8 +9,11 @@ import org.nl.acs.acsEnum.WorkerOrderEnum;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.IssuedDeviceOrderInfo;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.MonitoringLargeScreenData;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
|
||||
@@ -19,8 +22,10 @@ import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.EalingOrderDto;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -37,9 +42,15 @@ import java.util.Map;
|
||||
public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, IssuedDeviceOrderInfo {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@Autowired
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
|
||||
|
||||
|
||||
int heartbeat = 0;
|
||||
@@ -47,12 +58,16 @@ public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDr
|
||||
int error = 0;
|
||||
int task = 0;
|
||||
int move = 0;
|
||||
int order = 0;
|
||||
int finish = 0;
|
||||
String barcode,last_barcode;
|
||||
|
||||
int last_heartbeat = 0;
|
||||
int last_mode = 0;
|
||||
int last_error = 0;
|
||||
int last_task = 0;
|
||||
int last_finish = 0;
|
||||
int last_order = 0;
|
||||
|
||||
|
||||
Boolean isonline = true;
|
||||
@@ -77,7 +92,8 @@ public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDr
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
error = this.itemProtocol.getError();
|
||||
|
||||
order = this.itemProtocol.getOrder();
|
||||
finish = this.itemProtocol.getOrder_finish();
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
@@ -92,7 +108,33 @@ public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDr
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error + "复位请求标记");
|
||||
}
|
||||
if (finish != last_finish) {
|
||||
if (mode == 2 && finish == 1) {
|
||||
MonitoringLargeScreenData.orderData.put(String.valueOf(order), -1);
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号finish:" + last_finish + "->" + finish);
|
||||
}
|
||||
|
||||
// 修改工单状态为生产中
|
||||
if (mode == 2 && order > 0) {
|
||||
ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (pdto != null) {
|
||||
if (pdto.getOrder_status().equals(WorkerOrderEnum.READY.getCode())) {
|
||||
pdto.setOrder_status(WorkerOrderEnum.PRODUCTING.getCode());
|
||||
produceshiftorderService.update(pdto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//修改工单状态为自动完成
|
||||
if (mode == 2 && finish != last_finish && finish == 1 && order > 0) {
|
||||
ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (pdto != null) {
|
||||
if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) {
|
||||
produceshiftorderService.finished(pdto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
@@ -117,6 +159,9 @@ public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDr
|
||||
last_mode = mode;
|
||||
last_error = error;
|
||||
last_task = task;
|
||||
last_finish = finish;
|
||||
last_order = order;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -141,24 +186,30 @@ public class HailiangOldLetteringPackageDeviceDriver extends AbstractOpcDeviceDr
|
||||
|
||||
@Override
|
||||
public void issuedOrderInfo(ProduceshiftorderDto dto) {
|
||||
EalingOrderDto ealingOrderDto = dto.getEalingOrderDto();
|
||||
if (ealingOrderDto != null) {
|
||||
String is_foreward = ealingOrderDto.getIs_foreward();
|
||||
if (dto != null) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("to_qty", dto.getQty());
|
||||
map.put("to_clear", "1");
|
||||
map.put("to_order_qty", String.valueOf(dto.getQty()));
|
||||
map.put("to_order", dto.getOrder_code());
|
||||
map.put("item_to_bz_qty", dto.getPackage_qty());
|
||||
map.put("item_to_box_qty", dto.getBox_num());
|
||||
map.put("to_bz_qty", dto.getPackage_qty());
|
||||
map.put("to_box_qty", dto.getBox_num());
|
||||
map.put("to_one_box_qty", dto.getOne_box_package_qty());
|
||||
map.put("to_one_bag_qty", dto.getOne_package_qty());
|
||||
map.put("to_one_box_qty", dto.getOne_box_package_qty());
|
||||
this.writing(map);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issuedOrderFinish(String autoFinish) {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||
map.put("to_finished", "1");
|
||||
} else {
|
||||
map.put("to_confirm_finished", "1");
|
||||
}
|
||||
//map.put("to_order", "0");
|
||||
//map.put("to_clear", "1");
|
||||
this.writing(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ public class ItemProtocol {
|
||||
public static String item_kz_qty = "kz_qty";
|
||||
public static String item_ds_qty = "ds_qty";
|
||||
public static String item_bz_qty = "bz_qty";
|
||||
public static String item_bz_box_qty = "bz_box_qty";
|
||||
public static String item_order_finish = "order_finish";
|
||||
public static String item_order_compulsion_finish = "order_compulsion_finish";
|
||||
public static String item_order = "order";
|
||||
@@ -91,6 +92,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_bz_qty);
|
||||
}
|
||||
|
||||
public int getBz_box_qty() {
|
||||
return this.getOpcIntegerValue(item_bz_box_qty);
|
||||
}
|
||||
|
||||
public int getError() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
@@ -111,6 +116,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_order);
|
||||
}
|
||||
|
||||
public int getOrder_finish() {
|
||||
return this.getOpcIntegerValue(item_order_finish);
|
||||
}
|
||||
|
||||
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
@@ -157,12 +166,13 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_kz_error, "刻字机报警信号", "DB600.W18"));
|
||||
list.add(new ItemDto(item_ds_error, "点数机报警信号", "DB600.W20"));
|
||||
list.add(new ItemDto(item_bz_error, "包装机报警信号", "DB600.W22"));
|
||||
list.add(new ItemDto(item_kz_qty, "刻字数量", "DB600.W24"));
|
||||
list.add(new ItemDto(item_ds_qty, "点数数量", "DB600.W26"));
|
||||
list.add(new ItemDto(item_bz_qty, "包装数量", "DB600.W28"));
|
||||
list.add(new ItemDto(item_order_finish, "工单完成", "DB600.W30"));
|
||||
list.add(new ItemDto(item_order_compulsion_finish, "工单强制完成", "DB600.W32"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB600.D34"));
|
||||
list.add(new ItemDto(item_kz_qty, "刻字数量", "DB600.D24"));
|
||||
list.add(new ItemDto(item_ds_qty, "点数数量", "DB600.D28"));
|
||||
list.add(new ItemDto(item_bz_qty, "包装数量", "DB600.W32"));
|
||||
list.add(new ItemDto(item_bz_box_qty, "包装箱数量", "DB600.W34"));
|
||||
list.add(new ItemDto(item_order_finish, "工单完成", "DB600.W36"));
|
||||
list.add(new ItemDto(item_order_compulsion_finish, "工单强制完成", "DB600.W38"));
|
||||
list.add(new ItemDto(item_order, "工单号", "DB600.D40"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_old.hailiang_old_package_ssx;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.acsEnum.WorkerOrderEnum;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
@@ -24,6 +27,7 @@ import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -45,6 +49,7 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
|
||||
int heartbeat = 0;
|
||||
int mode = 0;
|
||||
int action = 0;
|
||||
int error = 0;
|
||||
int task = 0;
|
||||
int move = 0;
|
||||
@@ -61,8 +66,8 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
Boolean isonline = true;
|
||||
String message = null;
|
||||
Boolean iserror = false;
|
||||
|
||||
private int instruction_require_time_out;
|
||||
private Date instruction_require_time = new Date();
|
||||
private int instruction_require_time_out = 3000;
|
||||
boolean requireSucess = false;
|
||||
|
||||
private int instruction_finished_time_out;
|
||||
@@ -80,6 +85,7 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
move = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
@@ -88,11 +94,12 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
if (move != last_move){
|
||||
if(to_command != 0){
|
||||
message = null;
|
||||
requireSucess =false;
|
||||
if(to_command != 0 && "true".equals(this.device.getExtraValue().get("open_scanner"))){
|
||||
this.writing("to_command", "0");
|
||||
this.writing("to_target", "0");
|
||||
}
|
||||
requireSucess =false;
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
@@ -113,53 +120,16 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17);
|
||||
}
|
||||
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
if (mode == 0) {
|
||||
message = "未联机";
|
||||
} else {
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
if(move == 1 && error == 0 && barcode.length() > 0 && requireSucess == false ){
|
||||
//2305281100001
|
||||
if(barcode.trim().length() == 16){
|
||||
if(isNumeric(barcode.trim())){
|
||||
/**
|
||||
* 工单为前9位
|
||||
* 第10位是否翻转
|
||||
* 第11位为前往巷道
|
||||
* 后5位为流水号
|
||||
*/
|
||||
String order = barcode.trim().substring(0,9);
|
||||
int isFlip = Integer.parseInt(barcode.trim().substring(9,10));
|
||||
int target = Integer.parseInt(barcode.trim().substring(10,11));
|
||||
if(isFlip>0 && target>0){
|
||||
this.writing("to_is_flip",String.valueOf(isFlip));
|
||||
this.writing("to_target", String.valueOf(target));
|
||||
this.writing("to_command","1");
|
||||
requireSucess = true;
|
||||
} else {
|
||||
message = "条码:"+ barcode + ",是否翻转:"+isFlip + "目标巷道:"+target;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
message = "条码不为数字,无法解析";
|
||||
}
|
||||
} else {
|
||||
message = "条码长度不等于16,无法下发目标位置";
|
||||
}
|
||||
if(action == 1 && move > 0 && error == 0 && barcode.length() > 0 && "true".equals(this.device.getExtraValue().get("open_scanner"))){
|
||||
applyTarget(barcode.trim());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
last_mode = mode;
|
||||
last_move = move;
|
||||
@@ -169,6 +139,43 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
}
|
||||
|
||||
|
||||
public synchronized void applyTarget(String barcode) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
//2305281100001
|
||||
if (barcode.trim().length() == 16) {
|
||||
if (isNumeric(barcode.trim())) {
|
||||
/**
|
||||
* 工单为前9位
|
||||
* 第10位是否翻转
|
||||
* 第11位为前往巷道
|
||||
* 后5位为流水号
|
||||
*/
|
||||
String order = barcode.trim().substring(0, 9);
|
||||
int isFlip = Integer.parseInt(barcode.trim().substring(9, 10));
|
||||
int target = Integer.parseInt(barcode.trim().substring(10, 11));
|
||||
if (target > 0) {
|
||||
this.writing("to_is_flip", String.valueOf(isFlip));
|
||||
this.writing("to_target", String.valueOf(target));
|
||||
this.writing("to_command", "1");
|
||||
requireSucess = true;
|
||||
} else {
|
||||
message = "条码:" + barcode + ",是否翻转:" + isFlip + "目标巷道:" + target;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
message = "条码不为数字,无法解析";
|
||||
}
|
||||
} else {
|
||||
message = "条码长度不等于16,无法下发目标位置";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -178,23 +185,23 @@ public class HailiangLetteringPackageSsxDeviceDriver extends AbstractOpcDeviceDr
|
||||
String move = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (this.getMode() == 1) {
|
||||
mode = "单机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (this.getMode() == 2) {
|
||||
mode = "联机";
|
||||
jo.put("isOnline", true);
|
||||
} else if (this.getMode() == 3) {
|
||||
mode = "运行中";
|
||||
jo.put("isOnline", true);
|
||||
}
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
jo.put("hasGoods", false);
|
||||
} else if (this.getMove() == 1) {
|
||||
} else if (this.getMove() > 0) {
|
||||
move = "有货";
|
||||
jo.put("hasGoods", true);
|
||||
} else if (this.getMove() == 2) {
|
||||
move = "有托盘有货";
|
||||
jo.put("move", move);
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
jo.put("move", move);
|
||||
jo.put("mode", mode);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_old.hailiang_old_palletizing_station;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -22,6 +24,8 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -56,7 +60,8 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean(ProduceshiftorderService.class);
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
|
||||
|
||||
@Autowired
|
||||
LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
Boolean isonline = true;
|
||||
int hasGoods = 0;
|
||||
String message = null;
|
||||
@@ -72,7 +77,8 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
private int instruction_require_time_out = 3000;
|
||||
//请求成功标记
|
||||
Boolean requireSucess = false;
|
||||
|
||||
JSONArray barcodeArr = new JSONArray();
|
||||
JSONArray last_barcodeArr = new JSONArray();
|
||||
String device_code;
|
||||
|
||||
//心跳
|
||||
@@ -112,25 +118,17 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
error = this.itemProtocol.getError();
|
||||
boxtype = this.itemProtocol.getBoxtype();
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
|
||||
}
|
||||
if (move != last_move) {
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move);
|
||||
|
||||
if(!ObjectUtil.equal(barcodeArr,last_barcodeArr)){
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code,"码垛工位当前最新条码:"+barcodeArr.toString()));
|
||||
}
|
||||
if (number != last_number) {
|
||||
logServer.deviceItemValue(this.device_code, "number", String.valueOf(number));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号number:" + last_number + "->" + number);
|
||||
}
|
||||
if (error != last_error) {
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (boxtype != last_boxtype) {
|
||||
logServer.deviceItemValue(this.device_code, "boxtype", String.valueOf(boxtype));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号boxtype:" + last_boxtype + "->" + boxtype);
|
||||
|
||||
if(number != last_number && number ==0 ){
|
||||
barcodeArr.clear();
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号出现异常:" + var17.getMessage());
|
||||
return;
|
||||
@@ -157,6 +155,9 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
this.setIserror(false);
|
||||
|
||||
}
|
||||
last_mode = mode;
|
||||
last_number = number;
|
||||
last_barcodeArr = barcodeArr;
|
||||
}
|
||||
|
||||
protected void executing(Instruction instruction) {
|
||||
@@ -180,6 +181,7 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -192,12 +194,16 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
String move = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (this.getMode() == 1) {
|
||||
mode = "单机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (this.getMode() == 2) {
|
||||
mode = "联机";
|
||||
jo.put("isOnline", true);
|
||||
} else if (this.getMode() == 3) {
|
||||
mode = "运行中";
|
||||
jo.put("isOnline", true);
|
||||
}
|
||||
if (this.getMove() == 0) {
|
||||
move = "无货";
|
||||
@@ -209,11 +215,16 @@ public class HailiangOldPalletizingStationDriver extends AbstractOpcDeviceDriver
|
||||
move = "有托盘有货";
|
||||
jo.put("hasGoods", true);
|
||||
}
|
||||
jo.put("move", move);
|
||||
jo.put("mode", mode);
|
||||
jo.put("number", this.itemProtocol.getNumber());
|
||||
jo.put("boxType", this.itemProtocol.getBoxtype());
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
|
||||
jo.put("isOnline", this.itemProtocol.getIsonline());
|
||||
jo.put("message", message);
|
||||
jo.put("barcodeArr",barcodeArr);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_old.hailiang_old_stacking_manipulator;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -99,8 +100,6 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
Boolean singlePlacementRequireSuccess = false;
|
||||
//请求码垛完成标志
|
||||
Boolean stackingRequireSuccess = false;
|
||||
|
||||
JSONArray barcodeArr = new JSONArray();
|
||||
//当前设备状态 01代表 关机, 02代表 开机, 03代表 生产中, 04代表 待机, 05代表 异常
|
||||
int status_type = 0;
|
||||
//上次设备状态
|
||||
@@ -162,25 +161,24 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (getStation != last_getStation) {
|
||||
logServer.deviceItemValue(this.device_code, "getStation", String.valueOf(getStation));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号getStation:" + last_getStation + "->" + getStation);
|
||||
}
|
||||
if (putStation != last_putStation) {
|
||||
logServer.deviceItemValue(this.device_code, "putStation", String.valueOf(putStation));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号putStation:" + last_putStation + "->" + putStation);
|
||||
}
|
||||
if (encoder_qty != last_encoder_qty) {
|
||||
logServer.deviceItemValue(this.device_code, "encoder_qty", String.valueOf(encoder_qty));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号encoder_qty:" + last_encoder_qty + "->" + encoder_qty);
|
||||
}
|
||||
if (boxtype != last_boxtype) {
|
||||
logServer.deviceItemValue(this.device_code, "boxtype", String.valueOf(boxtype));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号boxtype:" + last_boxtype + "->" + boxtype);
|
||||
}
|
||||
// if (getStation != last_getStation) {
|
||||
// logServer.deviceItemValue(this.device_code, "getStation", String.valueOf(getStation));
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "信号getStation:" + last_getStation + "->" + getStation);
|
||||
// }
|
||||
// if (putStation != last_putStation) {
|
||||
// logServer.deviceItemValue(this.device_code, "putStation", String.valueOf(putStation));
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "信号putStation:" + last_putStation + "->" + putStation);
|
||||
// }
|
||||
// if (encoder_qty != last_encoder_qty) {
|
||||
// logServer.deviceItemValue(this.device_code, "encoder_qty", String.valueOf(encoder_qty));
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "信号encoder_qty:" + last_encoder_qty + "->" + encoder_qty);
|
||||
// }
|
||||
// if (boxtype != last_boxtype) {
|
||||
// logServer.deviceItemValue(this.device_code, "boxtype", String.valueOf(boxtype));
|
||||
// logServer.deviceExecuteLog(this.device_code, "", "", "信号boxtype:" + last_boxtype + "->" + boxtype);
|
||||
// }
|
||||
} catch (Exception var17) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号出现异常:" + var17.getMessage());
|
||||
return;
|
||||
}
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
this.setIsonline(false);
|
||||
@@ -274,7 +272,7 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
}
|
||||
String order = barcode.trim().substring(0,9);
|
||||
ProduceshiftorderDto dto =produceshiftorderService.findByCodeFromCache(order);
|
||||
if(Objects.isNull(dto)){
|
||||
if(ObjectUtil.isEmpty(dto)){
|
||||
message = "获取托盘信息,工单号:" + order + "未找到对应工单";
|
||||
return false;
|
||||
}
|
||||
@@ -302,7 +300,10 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
HailiangOldPalletizingStationDriver hailiangOldPalletizingStationDriver;
|
||||
if(device.getDeviceDriver() instanceof HailiangOldPalletizingStationDriver){
|
||||
hailiangOldPalletizingStationDriver = (HailiangOldPalletizingStationDriver) device.getDeviceDriver();
|
||||
if(hailiangOldPalletizingStationDriver.getNumber() == 0 ){
|
||||
if(hailiangOldPalletizingStationDriver.getNumber() == 0 &&
|
||||
hailiangOldPalletizingStationDriver.getMode() == 2 &&
|
||||
hailiangOldPalletizingStationDriver.getMove()==1 &&
|
||||
hailiangOldPalletizingStationDriver.getBoxtype() ==0) {
|
||||
targetStation = putDeviceCodeList.get(i);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code,"单次码垛完成,取货位:"+getDeviceCode+",条码:"+barcode +",未找到相同箱型放货位,分配空放货位:"+ putDeviceCodeList.get(i)));
|
||||
putIndex = i;
|
||||
@@ -362,19 +363,29 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
|
||||
//暂时不反馈MES
|
||||
Device getDevice = deviceAppservice.findDeviceByCode(getDeviceCode);
|
||||
Device putDevice = deviceAppservice.findDeviceByCode(putDeviceCode);
|
||||
HailiangLetteringPackageSsxDeviceDriver hailiangLetteringPackageSsxDeviceDriver;
|
||||
HailiangOldPalletizingStationDriver hailiangOldPalletizingStationDriver;
|
||||
String barcode = null;
|
||||
if(getDevice.getDeviceDriver() instanceof HailiangLetteringPackageSsxDeviceDriver ){
|
||||
hailiangLetteringPackageSsxDeviceDriver = (HailiangLetteringPackageSsxDeviceDriver) getDevice.getDeviceDriver();
|
||||
String barcode = hailiangLetteringPackageSsxDeviceDriver.getLast_barcode();
|
||||
if(Objects.isNull(barcode)){
|
||||
barcode = hailiangLetteringPackageSsxDeviceDriver.getLast_barcode();
|
||||
if(ObjectUtil.isEmpty(barcode)){
|
||||
message = "单次码垛完成,取货位:"+getDeviceCode+"条码为空";
|
||||
return false;
|
||||
}
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code,"单次码垛完成,取货位:"+getDeviceCode+",条码:"+barcode));
|
||||
barcodeArr.add(barcode);
|
||||
}
|
||||
|
||||
if(putDevice.getDeviceDriver() instanceof HailiangOldPalletizingStationDriver ) {
|
||||
hailiangOldPalletizingStationDriver = (HailiangOldPalletizingStationDriver) putDevice.getDeviceDriver();
|
||||
JSONArray arr = hailiangOldPalletizingStationDriver.getBarcodeArr();
|
||||
arr.add(barcode.trim());
|
||||
hailiangOldPalletizingStationDriver.setBarcodeArr(arr);
|
||||
}
|
||||
|
||||
this.writing("to_feedback", "2");
|
||||
this.writing("to_boxType", "0");
|
||||
this.setSinglePlacementRequireSuccess(true);
|
||||
}
|
||||
return true;
|
||||
@@ -393,22 +404,34 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
List<String> putDeviceCodeList = this.getExtraDeviceCodes("link_put_device_code");
|
||||
//根据kep读取到的放货工位的值 - 1 得到对应设备的下标,再根据下标获得对应设备的编码
|
||||
String putDeviceCode = putDeviceCodeList.get(getPutStation() - 1).replace("\"", "");
|
||||
HailiangOldPalletizingStationDriver hailiangOldPalletizingStationDriver;
|
||||
Device putDevice = deviceAppservice.findDeviceByCode(putDeviceCode);
|
||||
JSONArray ja = null;
|
||||
if(putDevice.getDeviceDriver() instanceof HailiangOldPalletizingStationDriver ) {
|
||||
hailiangOldPalletizingStationDriver = (HailiangOldPalletizingStationDriver) putDevice.getDeviceDriver();
|
||||
ja = hailiangOldPalletizingStationDriver.getBarcodeArr();
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code,"码垛完成ja:"+ja.toString()));
|
||||
}
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("device_code", putDeviceCode);
|
||||
map.put("encoder_qty", String.valueOf(getEncoder_qty()));
|
||||
map.put("boxtype", String.valueOf(getBoxtype()));
|
||||
map.put("barcodeArr",barcodeArr);
|
||||
map.put("barcodeArr", String.valueOf(ja));
|
||||
map.put("id", IdUtil.simpleUUID());
|
||||
JSONObject resp = acsToWmsService.stackingCompleted(map);
|
||||
int code = Integer.parseInt(resp.getString("code"));
|
||||
String message = resp.getString("message");
|
||||
JSONObject data = resp.getJSONObject("data");
|
||||
if (code == 200) {
|
||||
this.writing("to_feedback", "3");
|
||||
this.setStackingRequireSuccess(true);
|
||||
} else {
|
||||
log.warn("码垛完成反馈失败!设备号:{},原因{}", device_code, message);
|
||||
}
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code,"码垛完成反馈:"+map));
|
||||
|
||||
// JSONObject resp = acsToWmsService.stackingCompleted(map);
|
||||
// int code = Integer.parseInt(resp.getString("code"));
|
||||
// String message = resp.getString("message");
|
||||
// JSONObject data = resp.getJSONObject("data");
|
||||
// if (code == 200) {
|
||||
// this.writing("to_feedback", "3");
|
||||
// this.setStackingRequireSuccess(true);
|
||||
// } else {
|
||||
// log.warn("码垛完成反馈失败!设备号:{},原因{}", device_code, message);
|
||||
// }
|
||||
this.writing("to_feedback", "3");
|
||||
this.setStackingRequireSuccess(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -435,16 +458,18 @@ public class HailiangOldStackingManipulatorDriver extends AbstractOpcDeviceDrive
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode == 1 ? "联机" : "未联机");
|
||||
jo.put("mode", mode == 2 ? "联机" : "未联机");
|
||||
jo.put("action", action);
|
||||
jo.put("error", ErrorUtil.getDictDetail("jxs_error_type", String.valueOf(error)));
|
||||
jo.put("barcodeArr", barcodeArr);
|
||||
jo.put("getStation", this.itemProtocol.getGetStation());
|
||||
jo.put("putStation", this.itemProtocol.getPutStation());
|
||||
jo.put("isOnline", this.itemProtocol.getIsonline());
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
|
||||
@@ -129,11 +129,12 @@ public class HailiangOldUnboxingMachineDeviceDriver extends AbstractOpcDeviceDri
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", this.getDevice().getDevice_code());
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode == 1 ? "联机" : "未联机");
|
||||
jo.put("error", ErrorUtil.getDictDetail("unbox_error_type", String.valueOf(error)));
|
||||
jo.put("qty", qty);
|
||||
jo.put("status", this.itemProtocol.getStatus()==1 ? "未知":"工作中");
|
||||
jo.put("status", this.itemProtocol.getStatus()== 0 ? "未知":"工作中");
|
||||
jo.put("one_qty", this.itemProtocol.getOne_qty());
|
||||
jo.put("two_qty", this.itemProtocol.getTwo_qty());
|
||||
jo.put("three_qty", this.itemProtocol.getThree_qty());
|
||||
|
||||
@@ -246,6 +246,7 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", this.getDevice().getDevice_code());
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("isOnline", this.itemProtocol.getIsonline());
|
||||
return jo;
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.nl.acs.opc.WcsConfig;
|
||||
import org.nl.acs.udw.UnifiedDataAccessor;
|
||||
import org.nl.acs.udw.UnifiedDataAccessorFactory;
|
||||
import org.nl.acs.udw.UnifiedDataAppService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.modules.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.modules.wql.exception.WDKException;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
@@ -144,6 +146,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
* @param value
|
||||
*/
|
||||
public void writing(String key, String value) {
|
||||
LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
String opcServerId = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcServerId);
|
||||
@@ -151,6 +154,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
itemMap.put(getToParam() + key, value);
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.disconnect();
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.getDeviceCode(),"下发单个电气信号:" + key + ",下发电气信号值:" + value));
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发单个电气信号:" + key + ",下发电气信号值:" + value);
|
||||
}
|
||||
|
||||
@@ -162,6 +166,8 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
*/
|
||||
public void writing(Map<String, Object> map) {
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
map.forEach((key, value) -> {
|
||||
if (ObjectUtil.isNotEmpty(value)) {
|
||||
@@ -170,6 +176,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
});
|
||||
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||
this.control(itemMap);
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.getDeviceCode(),"下发多个电气信号:" + itemMap));
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,11 +412,14 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
Object obj = accessor_value.getValue(relate);
|
||||
sb.append("key:" + relate + "value:" + obj + ";");
|
||||
}
|
||||
//lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".")+1), String.valueOf(his), String.valueOf(value)));
|
||||
if (!itemDto.getItem_code().endsWith("heartbeat")) {
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".")+1), String.valueOf(his), String.valueOf(value)));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".")+1), String.valueOf(his), String.valueOf(value)));
|
||||
if (!itemDto.getItem_code().endsWith("heartbeat")) {
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(itemDto.getOpc_server_code(), itemDto.getOpc_plc_code(), itemDto.getDevice_code(), itemDto.getItem_code().substring(itemDto.getItem_code().lastIndexOf(".")+1), String.valueOf(his), String.valueOf(value)));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
<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="检验有货">
|
||||
<el-switch v-model="form.inspect_in_stocck" />
|
||||
<el-form-item label="开启扫码">
|
||||
<el-switch v-model="form.open_scanner" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
@@ -1,601 +0,0 @@
|
||||
<template>
|
||||
<div class="monitor-wrap">
|
||||
<el-row style="margin-top: 20px;margin-left: 20px;margin-bottom: 20px">
|
||||
<el-col :span="6" />
|
||||
<el-col :span="18">
|
||||
<!-- 舞台:
|
||||
<el-select v-model="stage_code" placeholder="请选择" @change="changeStage">
|
||||
<el-option
|
||||
v-for="item in stageSelectList"
|
||||
:key="item.stage_code"
|
||||
:label="item.stage_name"
|
||||
:value="item.stage_code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="saveAll" :loading="saveLoading">保存</el-button>
|
||||
<el-button type="success" @click="cleanArr2">清空</el-button>-->
|
||||
<!-- <el-button type="info">操作</el-button>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="1" style="margin-left: 10px">
|
||||
<div>
|
||||
<!-- <draggable :list="arr1" animation="300"
|
||||
dragClass="dragClass"
|
||||
ghostClass="ghostClass"
|
||||
chosenClass="chosenClass"
|
||||
@start="onStart"
|
||||
@end="onEnd"
|
||||
:move="onMove"
|
||||
:group="{ name:'group', pull:'clone', put:false}"
|
||||
>
|
||||
|
||||
<!–vue中引入图片https://blog.csdn.net/qq_35393869/article/details/80333564–>
|
||||
<div v-for="(item,index) in arr1" :key="index"
|
||||
style="position: relative; width: 34px;height: 34px;display: inline-block;margin: 0 0 0 0 ;vertical-align:bottom;outline: 1px solid #f0f0f0;">
|
||||
<img :src="require('../../../../assets/acs/' +item.img1+'.png')" alt="" width="34px" height="34px;"
|
||||
style="margin: 0 0 0 0;vertical-align:bottom;transform: rotate(0deg);"/>
|
||||
|
||||
</div>
|
||||
|
||||
</draggable>-->
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="22" style="margin-left: 30px">
|
||||
<el-scrollbar style="width:1850px;height: 1050px;">
|
||||
<!--使用draggable组件-->
|
||||
<draggable
|
||||
:list="arr2"
|
||||
group="group"
|
||||
animation="300"
|
||||
filter=".forbid"
|
||||
:style="'width:'+ grid_width +'px;'"
|
||||
>
|
||||
|
||||
<div
|
||||
v-for="(item) in arr2"
|
||||
:key="item.index"
|
||||
class="forbid"
|
||||
style="position: relative; width: 34px;height: 34px;display: inline-block;margin: 0 0 0 0 ;vertical-align:bottom;"
|
||||
@click="clickDevice(item)"
|
||||
>
|
||||
|
||||
<el-popover
|
||||
v-if="currentItem == item.index"
|
||||
:ref="'pop_'+item.index"
|
||||
placement="bottom"
|
||||
effect="dark"
|
||||
trigger="manual"
|
||||
:value="currentItem == item.index"
|
||||
:disabled="item.device_code == ''"
|
||||
:popper-class="isErrorColor(item)"
|
||||
>
|
||||
<div v-if="item.device_code !== ''" style="height: 390px;overflow-y: auto">
|
||||
<div style="padding: 3px;">
|
||||
设备信息
|
||||
</div>
|
||||
<el-table
|
||||
:data="moveShow(item)"
|
||||
style="width: 100%"
|
||||
>
|
||||
<af-table-column
|
||||
prop="name"
|
||||
label="监控项"
|
||||
/>
|
||||
<af-table-column
|
||||
prop="value"
|
||||
label="当前值"
|
||||
/>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-popover>
|
||||
|
||||
<div v-popover="'pop_'+item.index" class="content" @mouseover="changeCurrentTime(item)">
|
||||
<img
|
||||
:src="require('../../../../assets/acs/' +item.img2+'.png')"
|
||||
alt=""
|
||||
width="34px"
|
||||
height="34px;"
|
||||
:style="{ transform:' rotate('+item.angle+'deg)' }"
|
||||
style="outline: 1px solid #f0f0f0;"
|
||||
>
|
||||
<img
|
||||
v-if="hasGoods(item) && item.img2!='1' "
|
||||
:src="require('../../../../assets/acs/' +'托盘'+'.png')"
|
||||
style="position: absolute; top: 5px;right: 5px;width: 24px;height: 24px;"
|
||||
>
|
||||
<img
|
||||
v-if="statusPic(item) && item.img2!='1'"
|
||||
:src="require('../../../../assets/acs/' +'status0'+'.png')"
|
||||
style="position: absolute; top: 0;left: 0;"
|
||||
>
|
||||
<img
|
||||
v-if="!statusPic(item) && item.img2!='1' && item.device_code"
|
||||
:src="require('../../../../assets/acs/' +'status1'+'.png')"
|
||||
style="position: absolute; top: 0;left: 0;"
|
||||
>
|
||||
<img
|
||||
v-if="isError(item)"
|
||||
:src="require('../../../../assets/acs/' +'icon_alert'+'.png')"
|
||||
style="position: absolute; top: 5px;right: 5px;width: 23px;height: 23px;"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</draggable>
|
||||
</el-scrollbar>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--弹窗设置设备与图标绑定与角度-->
|
||||
<el-dialog title="设备设置" :visible.sync="dialogFormVisible" width="35%">
|
||||
<el-form :model="form" size="small">
|
||||
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||
<el-input v-model="form.device_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备状态" label-width="80px">
|
||||
<el-radio-group v-model="form.option">
|
||||
<el-radio-button :label="0">禁止进出</el-radio-button>
|
||||
<el-radio-button :label="1">允许进入</el-radio-button>
|
||||
<el-radio-button :label="2">允许离开</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--弹窗设置设备与图标绑定与角度-->
|
||||
<el-dialog title="设备设置" :visible.sync="dialogFormVisible3" width="35%">
|
||||
<el-form :model="form" size="small">
|
||||
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||
<el-input v-model="form.device_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" label-width="80px">
|
||||
<el-radio-group v-model="form.hasGoodStatus">
|
||||
<el-radio-button :label="0">无货</el-radio-button>
|
||||
<el-radio-button :label="1">空料斗</el-radio-button>
|
||||
<el-radio-button :label="2">满料斗</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_type" label-width="80px">
|
||||
<el-input v-model="form.material_type" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible3 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--弹窗设置设备与图标绑定与角度-->
|
||||
<el-dialog title="设备设置" :visible.sync="dialogFormVisible4" width="35%">
|
||||
<el-form :model="form" size="small">
|
||||
<el-form-item label="设备编号" prop="device_code" label-width="120px">
|
||||
<el-input v-model="form.device_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺料请求成功" prop="requireSucess" label-width="120px">
|
||||
<el-radio-group v-model="form.requireSucess">
|
||||
<el-radio-button :label="0">否</el-radio-button>
|
||||
<el-radio-button :label="1">是</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="空想请求成功" prop="fullrequireSucess" label-width="120px">
|
||||
<el-radio-group v-model="form.fullrequireSucess">
|
||||
<el-radio-button :label="0">否</el-radio-button>
|
||||
<el-radio-button :label="1">是</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible4 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--弹窗设置设备与图标绑定与角度-->
|
||||
<el-dialog title="设备设置" :visible.sync="dialogFormVisible1" width="35%">
|
||||
<el-form :model="form" size="small">
|
||||
<el-form-item label="设备编号" prop="device_code" label-width="80px">
|
||||
<el-input v-model="form.device_code" :disabled="true" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="条码" label-width="80px">
|
||||
<el-input v-model="form.barcode" :disabled="false" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveBarcode">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<XJDeviceMonitor ref="child1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 导入draggable组件
|
||||
import deviceCrud from '@/api/acs/device/device'
|
||||
import draggable from 'vuedraggable'
|
||||
import crud from '@/mixins/crud'
|
||||
import actorCrud from '@/api/acs/stage/actor'
|
||||
import XJDeviceMonitor from '@/views/acs/monitor/device/XJDeviceMonitor'
|
||||
|
||||
export default {
|
||||
name: 'MonitorDevice',
|
||||
// 注册draggable组件
|
||||
components: {
|
||||
draggable, XJDeviceMonitor
|
||||
},
|
||||
mixins: [crud],
|
||||
data() {
|
||||
return {
|
||||
stage_code: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
dialogFormVisible3: false,
|
||||
dialogFormVisible4: false,
|
||||
arr2: [],
|
||||
currentItem: '',
|
||||
stageSelectList: [],
|
||||
deviceList: [],
|
||||
form: {
|
||||
index: 0,
|
||||
device_code: '',
|
||||
angle: 0,
|
||||
hasGoodStatus: null,
|
||||
barcode: '',
|
||||
suspended: null,
|
||||
material_type: '',
|
||||
requireSucess: '',
|
||||
fullrequireSucess: ''
|
||||
},
|
||||
grid_width: 1000
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initArr2()
|
||||
this.webSocket()
|
||||
},
|
||||
methods: {
|
||||
clickDevice(item) {
|
||||
// debugger
|
||||
const index = item.index
|
||||
const clickObj = this.arr2[index]
|
||||
console.log(clickObj.data)
|
||||
if (!clickObj.img2 || clickObj.img2 === '1' || !item.data) {
|
||||
return
|
||||
}
|
||||
if (clickObj.data.is_click !== true) {
|
||||
return
|
||||
}
|
||||
if (clickObj.data.device_type === 'scanner') {
|
||||
this.dialogFormVisible1 = true
|
||||
} else {
|
||||
if (clickObj.data.driver_type === 'hailiang_engraving_cache') {
|
||||
this.dialogFormVisible3 = true
|
||||
} else if (clickObj.data.driver_type === 'hailiang_packer_station') {
|
||||
this.dialogFormVisible4 = true
|
||||
} else if (clickObj.data.driver_type === 'hailiang_xj_plc_test') {
|
||||
this.$refs.child1.setForm(clickObj)
|
||||
} else {
|
||||
this.dialogFormVisible = true
|
||||
}
|
||||
}
|
||||
this.form.angle = clickObj.angle
|
||||
this.form.index = clickObj.index
|
||||
this.form.device_code = clickObj.device_code
|
||||
this.form.hasGoodStatus = clickObj.data.hasGoods
|
||||
this.form.material_type = clickObj.data.material_type
|
||||
this.form.requireSucess = clickObj.data.requireSucess
|
||||
this.form.fullrequireSucess = clickObj.data.fullrequireSucess
|
||||
},
|
||||
hasGoods(item) {
|
||||
if (item.data && item.data.hasGoods > 0) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
statusPic(item) {
|
||||
if (item.data && item.data.isOnline === true) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
isError(item) {
|
||||
if (item.data && item.data.isError === true) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
isErrorColor(item) {
|
||||
if (item.data && item.data.isError === true) {
|
||||
return 'error'
|
||||
}
|
||||
return 'normal'
|
||||
},
|
||||
changeCurrentTime(item) {
|
||||
this.currentItem = item.index
|
||||
},
|
||||
moveShow(item) {
|
||||
// debugger
|
||||
if (item.device_code && item.data) {
|
||||
const arr = [
|
||||
{ name: '设备编号', value: item.device_code },
|
||||
{ name: '设备名称', value: item.device_name }
|
||||
]
|
||||
const data = item.data
|
||||
for (const val in data) {
|
||||
if (val === 'isOnline' || val === 'isError' || val === 'hasGoods') {
|
||||
continue
|
||||
}
|
||||
if (val === 'message' && data.isError === true) {
|
||||
const obj = { name: '设备信息', value: data[val] }
|
||||
arr.push(obj)
|
||||
}
|
||||
|
||||
if (val === 'message' && data.isError === 'false') {
|
||||
const obj = { name: '异常信息', value: data[val] }
|
||||
arr.push(obj)
|
||||
}
|
||||
|
||||
if (val === 'move') {
|
||||
const obj = { name: '光电信号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'mode') {
|
||||
const obj = { name: '模式', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'error') {
|
||||
const obj = { name: '报警', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'ip') {
|
||||
const obj = { name: 'IP地址', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'number') {
|
||||
const obj = { name: '托盘数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'qty') {
|
||||
const obj = { name: '数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'weight') {
|
||||
const obj = { name: '重量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'instruction_message') {
|
||||
const obj = { name: '指令信息', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'last_instruction_message') {
|
||||
const obj = { name: '上次指令信息', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'container') {
|
||||
const obj = { name: '载具号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'last_container') {
|
||||
const obj = { name: '上次载具号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'instruction_code') {
|
||||
const obj = { name: '指令号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'last_instruction_code') {
|
||||
const obj = { name: '上次指令号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'action') {
|
||||
const obj = { name: '动作信号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'io_action') {
|
||||
const obj = { name: '允许进出信号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'material') {
|
||||
const obj = { name: '物料', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'batch') {
|
||||
const obj = { name: '批次', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'requestSucess') {
|
||||
const obj = { name: '缺料请求成功', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'applySucess') {
|
||||
const obj = { name: '是否申请指令', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'message') {
|
||||
const obj = { name: '说明', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'phase') {
|
||||
const obj = { name: 'AGV交互阶段', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'option') {
|
||||
const obj = { name: 'AGV动作', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'temperature') {
|
||||
const obj = { name: '当前温度', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'finish') {
|
||||
const obj = { name: '烘箱完成', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'countdown_house') {
|
||||
const obj = { name: '恒温倒计时(时)', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'countdown_min') {
|
||||
const obj = { name: '恒温倒计时(分)', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'countdown_sec') {
|
||||
const obj = { name: '恒温倒计时(秒)', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'task') {
|
||||
const obj = { name: '任务号', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'door') {
|
||||
const obj = { name: '门状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'address') {
|
||||
const obj = { name: 'agv位置', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'phaseName') {
|
||||
const obj = { name: 'phase', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'is_disable') {
|
||||
const obj = { name: '是否禁用', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'one_qty') {
|
||||
const obj = { name: '1号口数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'two_qty') {
|
||||
const obj = { name: '2号口数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'three_qty') {
|
||||
const obj = { name: '3号口数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'four_qty') {
|
||||
const obj = { name: '4号口数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'five_qty') {
|
||||
const obj = { name: '5号口数量', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'one_status') {
|
||||
const obj = { name: '1号口状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'two_status') {
|
||||
const obj = { name: '2号口状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'three_status') {
|
||||
const obj = { name: '3号口状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'four_status') {
|
||||
const obj = { name: '4号口状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
} else if (val === 'five_status') {
|
||||
const obj = { name: '5号口状态', value: data[val] }
|
||||
arr.push(obj)
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
},
|
||||
dialogSave() {
|
||||
deviceCrud.changeDeviceStatus(this.form).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible3 = false
|
||||
this.dialogFormVisible4 = false
|
||||
this.initArr2()
|
||||
}).catch(err => {
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible3 = false
|
||||
this.dialogFormVisible4 = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
statusSave() {
|
||||
deviceCrud.changeFenceStatus(this.form).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.dialogFormVisible2 = false
|
||||
this.initArr2()
|
||||
}).catch(err => {
|
||||
this.dialogFormVisible2 = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
saveBarcode() {
|
||||
deviceCrud.saveBarcode(this.form).then(res => {
|
||||
this.notify('操作成功', 'success')
|
||||
this.dialogFormVisible1 = false
|
||||
this.initArr2()
|
||||
}).catch(err => {
|
||||
this.dialogFormVisible1 = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
initArr2() {
|
||||
actorCrud.queryStageActor('SHDP').then(data => {
|
||||
if (data.detail.length > 0) {
|
||||
this.grid_width = data.form.grid_width
|
||||
this.arr2 = []
|
||||
for (let i = 0; i < data.form.grid_length; i++) {
|
||||
const a = { 'id': i, 'name': '', device_code: '', img: '', index: i, img2: '1', angle: '0' }
|
||||
this.arr2.push(a)
|
||||
}
|
||||
for (const i of data.detail) {
|
||||
const index = i.index
|
||||
this.arr2.splice(index, 1, i)
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
webSocket() {
|
||||
const that = this
|
||||
if (typeof (WebSocket) === 'undefined') {
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器!',
|
||||
type: 'warning',
|
||||
duration: 0
|
||||
})
|
||||
} else {
|
||||
const id = 'device_monitor'
|
||||
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
||||
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
||||
|
||||
// const wsUri = process.env.VUE_APP_WS_API + '/webSocket/' + id
|
||||
const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + id
|
||||
this.socket = new WebSocket(wsUri)
|
||||
// 监听socket打开
|
||||
this.socket.onopen = function() {
|
||||
console.log('浏览器WebSocket已打开')
|
||||
// that.socket.send('测试客户端发送消息')
|
||||
}
|
||||
|
||||
// 监听socket消息接收
|
||||
this.socket.onmessage = function(msg) {
|
||||
const list = JSON.parse(msg.data).msg.detail
|
||||
// console.log(list)
|
||||
|
||||
for (const item of list) {
|
||||
const index = item.index
|
||||
// that.arr2.splice(index, 1, item)
|
||||
|
||||
if (item.data) {
|
||||
Object.assign(that.arr2[index].data, item.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 监听socket错误
|
||||
this.socket.onerror = function() {
|
||||
that.$notify({
|
||||
title: '错误',
|
||||
message: '服务器错误,无法接收实时报警信息',
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
// 监听socket关闭
|
||||
this.socket.onclose = function() {
|
||||
console.log('WebSocket已关闭')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.normal {
|
||||
background: #4a659c !important;
|
||||
}
|
||||
|
||||
.error {
|
||||
background: #95341c !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style>
|
||||
|
||||
.monitor-wrap .el-popover {
|
||||
margin-left: 35px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -135,6 +135,27 @@
|
||||
<el-form-item label="开箱机编号" prop="unboxing_device_code">
|
||||
<el-input v-model="form.unboxing_device_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="箱型" prop="unboxing_device_code">
|
||||
<el-input v-model="form.box_type" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道" prop="unboxing_device_code">
|
||||
<el-input v-model="form.target_roadway" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="每箱包数" prop="unboxing_device_code">
|
||||
<el-input v-model="form.one_box_package_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="每包数量" prop="unboxing_device_code">
|
||||
<el-input v-model="form.one_package_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总箱数" prop="unboxing_device_code">
|
||||
<el-input v-model="form.box_num" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总袋数" prop="unboxing_device_code">
|
||||
<el-input v-model="form.package_qty" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否翻转" prop="unboxing_device_code">
|
||||
<el-input v-model="form.is_flip" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -173,7 +194,14 @@
|
||||
<el-table-column prop="tray_num" label="托盘总数" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_used_fxx" label="启用封箱线" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="ealing_device_code" label="装箱机编号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="unboxing_device_code" label="开箱机编号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="box_type" label="箱型" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="target_roadway" label="巷道" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="one_box_package_qty" label="每箱包数" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="one_package_qty" label="每包数量" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="box_num" label="箱数" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="tray_full_num" label="托盘满托数量" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="package_qty" label="总袋数" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="is_flip" label="是否翻转" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="create_by" label="创建者" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" show-overflow-tooltip />
|
||||
</el-table>
|
||||
@@ -214,7 +242,15 @@ const defaultForm = {
|
||||
in_devices: '',
|
||||
is_used_fxx: '0',
|
||||
ealing_device_code: '',
|
||||
unboxing_device_code: ''
|
||||
unboxing_device_code: '',
|
||||
one_box_package_qty: '',
|
||||
one_package_qty: '',
|
||||
box_num: '',
|
||||
box_type: '',
|
||||
target_roadway: '',
|
||||
tray_full_num: '',
|
||||
package_qty: '',
|
||||
is_flip: ''
|
||||
}
|
||||
export default {
|
||||
name: 'Produceshiftorder',
|
||||
|
||||
@@ -684,6 +684,48 @@ export default {
|
||||
} else if (val === 'agv_take_finish') {
|
||||
const obj = { name: '满箱已运出满箱位', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'one_qty') {
|
||||
const obj = { name: '1号口数量', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'two_qty') {
|
||||
const obj = { name: '2号口数量', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'three_qty') {
|
||||
const obj = { name: '3号口数量', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'four_qty') {
|
||||
const obj = { name: '4号口数量', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'five_qty') {
|
||||
const obj = { name: '5号口数量', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'one_status') {
|
||||
const obj = { name: '1号口状态', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'two_status') {
|
||||
const obj = { name: '2号口状态', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'three_status') {
|
||||
const obj = { name: '3号口状态', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'four_status') {
|
||||
const obj = { name: '4号口状态', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'five_status') {
|
||||
const obj = { name: '5号口状态', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'boxType') {
|
||||
const obj = { name: '箱型', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'getStation') {
|
||||
const obj = { name: '取货位', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'putStation') {
|
||||
const obj = { name: '放货位', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
} else if (val === 'barcodeArr') {
|
||||
const obj = { name: '码垛条码', value: data[val] }
|
||||
this.arr.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user