Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-04-25 19:38:51 +08:00
27 changed files with 154 additions and 179 deletions

View File

@@ -8,7 +8,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
#password: ${DB_PWD:123456}

View File

@@ -16,11 +16,11 @@ import java.util.Arrays;
public enum StatusEnum {
//指令状态
DEVICE_STATUS_CLOSE("01", "设备关机", ""),
DEVICE_STATUS_OPEN("02", "设备开机", ""),
DEVICE_STATUS_PRODUCING("03", "设备生产中", ""),
DEVICE_STATUS_WAIT_PRODUCE("04", "设备待生产", ""),
DEVICE_STATUS_ERROR("05", "设备异常", ""),
DEVICE_STATUS_CLOSE("1", "设备关机", ""),
DEVICE_STATUS_OPEN("2", "设备开机", ""),
DEVICE_STATUS_PRODUCING("3", "设备生产中", ""),
DEVICE_STATUS_WAIT_PRODUCE("4", "设备待生产", ""),
DEVICE_STATUS_ERROR("5", "设备异常", ""),
//AGV是否需要搬运
NO_NEED_MOVE("0", "不需要搬运", ""),
@@ -46,6 +46,8 @@ public enum StatusEnum {
KZ_EMPTY_REQ("4", "叫空框请求(刻字)", ""),
BZ_FULL_REQ("5", "叫满框请求(包装)", ""),
BZ_EMPTY_REQ("6", "送空框请求(包装)", ""),
QX_LACK_REQ("7", "清洗机缺料请求", ""),
QX_FULL_REQ("8", "清洗机满料请求", ""),
//指令状态
INST_READY("0", "就绪", ""),

View File

@@ -338,8 +338,8 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
message = "未联机";
//有报警
} else {
this.setIsonline(true);
this.setIserror(false);
// this.setIsonline(true);
// this.setIserror(false);
message = "";
/**
*
@@ -885,7 +885,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("task", task);
jo.put("prepare_barcode", prepare_barcode);
jo.put("docking_barcode", docking_barcode);
jo.put("isOnline", this.getIsonline());
jo.put("isOnline", this.itemProtocol.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("cache_line_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("message", this.getMessage());

View File

@@ -167,20 +167,17 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
//this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
//申请清洗上料
if (mode == 1 && in_ready == 1 && allowed_in == 1 && !requireSucess) {
applyForLoading();
message = "申请清洗上料成功";
boolean flag = applyForLoading();
this.noApplyTaskMessage = null;
if (flag) {
message = "申请清洗上料成功";
}
} else {
if (allowed_in == 1) {
String noApplyMessage = "未申请清洗上料原因:";
@@ -198,10 +195,12 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
}
//反馈mes清洗上料完成
if (mode == 1 && task_finish == 1 && requireSucess) {
feedMesTaskClear();
message = "反馈清洗上料完成成功";
if (mode == 1 && task_finish == 1 && !requireSucess) {
boolean flag = feedMesTaskClear();
this.noFeedMessage = null;
if (flag) {
this.message = "反馈清洗上料完成成功";
}
} else {
if (task_finish == 1) {
String notFeedMessage = "未反馈mes清洗上料完成原因:";
@@ -228,10 +227,11 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
/**
* 上料完成以后反馈mes 上料设备号
*/
private void feedMesTaskClear() {
private boolean feedMesTaskClear() {
Date date = new Date();
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.writing("to_confirm_finished", "1");
ProduceshiftorderDto dto = produceshiftorderService.findOrderByDeviceCode(this.getDevice_code());
@@ -251,31 +251,37 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
// TODO 反馈接口未确定
JSONObject reqParam = new JSONObject();
reqParam.put("device_code", this.getDevice_code());
reqParam.put("type", StatusEnum.QX_FULL_REQ.getCode());
reqParam.put("in_devices", dto.getIn_devices());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
}
/**
* 申请清洗上料
*/
private synchronized void applyForLoading() {
private synchronized boolean applyForLoading() {
Date date = new Date();
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
JSONObject reqParam = new JSONObject();
reqParam.put("device_code", this.getDevice_code());
reqParam.put("type", StatusEnum.FULL_REQ.getCode());
reqParam.put("type", StatusEnum.QX_LACK_REQ.getCode());
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
this.writing("to_in_confirm_req", "1");
requireSucess = true;
return true;
}
return false;
}
}

View File

@@ -155,11 +155,6 @@ public class HailiangCleaningMachineDeviceDriver extends AbstractOpcDeviceDriver
//this.setIserror(true);
message = "信号量同步异常";
//未联机
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);

View File

@@ -47,6 +47,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
int mode = 0;
//储料仓运行中
int running = 0;
//储料仓开关
@@ -60,6 +61,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
//储料仓物物料号
int silo_material_no = 0;
int last_mode = 0;
int last_running = 0;
int last_is_open = 0;
int last_error = 0;
@@ -148,11 +150,6 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
//this.setIserror(true);
message = "信号量同步异常";
//未联机
// } else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
// message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);

View File

@@ -12,6 +12,7 @@ import java.util.List;
public class ItemProtocol {
public static String item_heartbeat = "heartbeat";
public static String item_mode = "mode"; //工作模式
public static String item_running = "running"; //是否运行
public static String item_is_open = "is_open"; //储料仓开关
public static String item_error = "error"; //报警信号
@@ -58,7 +59,9 @@ public class ItemProtocol {
public int getItem_silo_material_no() {
return this.getOpcIntegerValue(item_silo_material_no);
}
public int getItem_mode() {
return this.getOpcIntegerValue(item_mode);
}
Boolean isonline;
@@ -71,14 +74,14 @@ public class ItemProtocol {
return value;
}
return 0;
}
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.0"));
list.add(new ItemDto(item_running, "储料仓运行中", "DB1.B2.0"));
list.add(new ItemDto(item_is_open, "储料仓开关", "DB1.W36"));
list.add(new ItemDto(item_is_open, "储料仓开关", "DB1.B36.0"));
list.add(new ItemDto(item_error, "储料仓故障", "DB1.W38"));
list.add(new ItemDto(item_silo_weight, "储料仓重量", "DB1.D84"));
list.add(new ItemDto(item_full_number, "储料仓总数量", "DB1.D164"));

View File

@@ -375,20 +375,17 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
//this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
//有货、联机、满料请求申请AGV搬运任务
if (move == 1 && mode == 1 && full_req == 1 && !requireSucess) {
apply_task();
boolean flag = apply_task();
this.noApplyTaskMessage = null;
this.message = "申请满料任务成功";
if (flag) {
this.message = "申请满料任务成功";
}
} else {
if (full_req == 1) {
String notApplyTaskMessage = "";
@@ -407,9 +404,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
//无货、联机、空箱请求申请AGV搬运任务
if (move == 0 && mode == 1 && empty_req == 1 && !requireSucess) {
apply_empty_task();
boolean flag = apply_empty_task();
this.noApplyTaskMessage = null;
this.message = "申请空箱任务成功";
if (flag) {
this.message = "申请空箱任务成功";
}
} else {
if (empty_req == 1) {
String notApplyTaskMessage = "";
@@ -564,10 +563,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}
/**
@@ -592,10 +592,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -118,7 +118,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
if (error == 1 || error == 51) {
if (error == 1 || error == 51 || error == 0) {
feedDeviceStatusFlag = false;
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
@@ -249,16 +249,10 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
//this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
// this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
}
last_mode = mode;

View File

@@ -144,11 +144,6 @@ public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDevic
// this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
// this.setIsonline(false);
// this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
@@ -227,7 +222,7 @@ public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDevic
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode == 1 ? "联机" : "单机");
jo.put("move", move == 1 ? "" : "");
jo.put("move", move == 1 ? "" : "");
jo.put("order", order);
jo.put("error", ErrorUtil.getDictDetail("empty_error_type", String.valueOf(this.getError())));
jo.put("task", task);

View File

@@ -165,11 +165,6 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
// this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
@@ -177,9 +172,11 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
//满料位满足联机有货有工单时向MES申请任务
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
apply_task();
boolean flag = apply_task();
this.noApplyTaskMessage = null;
this.message = "申请满料请求任务成功";
if (flag) {
this.message = "申请满料请求任务成功";
}
} else {
if (move == 1) {
String notApplyTaskMessage = "";
@@ -286,10 +283,11 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -130,8 +130,8 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
}
if (storage_stock_num != last_storage_stock_num) {
if (this.itemProtocol.getIsonline()) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice_code(), this.getStorage_stock_num());
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
}
if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num")))) {
requireSucess = false;
@@ -155,19 +155,16 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
// this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
// this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= this.storage_stock_num) {
applyOutCacheLineTask();
boolean flag = applyOutCacheLineTask();
this.noApplyTaskMessage = null;
this.message = "申请缓存线任务成功";
if (flag) {
this.message = "申请缓存线任务成功";
}
} else {
if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
String notApplyTaskMessage = "";
@@ -256,10 +253,11 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (httpResponse != null && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -198,9 +198,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
dto.setError_info(ErrorUtil.getDictDetail("packer_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
if (error == 1 || error == 51) {
feedDeviceStatusFlag = false;
}
feedDeviceStatusFlag = false;
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}
if (order_now != last_order_now) {
@@ -306,19 +304,16 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
// this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//.setIserror(true);
message = "有报警";
// //无报警
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
if (mode == 1 && lack_req == 1 && !requireSucess) {
apply_task();
boolean flag = apply_task();
this.noApplyTaskMessage = null;
this.message = "申请缺料请求任务成功";
if (flag) {
this.message = "申请缺料请求任务成功";
}
} else {
if (lack_req == 1) {
String notApplyTaskMessage = "";
@@ -333,9 +328,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
}
if (mode == 1 && req_task_empty == 1 && !requireSucess) {
apply_take_empty_task();
boolean flag = apply_take_empty_task();
this.noApplyTaskMessage = null;
this.message = "申请取空框任务成功";
if (flag) {
this.message = "申请取空框任务成功";
}
} else {
if (req_task_empty == 1) {
String notApplyTaskMessage = "";
@@ -470,10 +467,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}
/**
@@ -497,10 +495,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -117,7 +117,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
if (error == 1 || error == 51) {
if (error == 1 || error == 51 || error == 0) {
feedDeviceStatusFlag = false;
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
@@ -248,12 +248,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
// this.setIserror(true);
message = "未联机";
//有报警
} /*else if (error != 0) {
//this.setIsonline(false);
this.setIserror(true);
message = "有报警";
//无报警
} */else {
} else {
//this.setIsonline(true);
// this.setIserror(false);
message = "";

View File

@@ -145,12 +145,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
//this.setIserror(true);
message = "未联机";
//有报警
}/* else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
}*/ else {
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
@@ -228,7 +223,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode == 1 ? "联机" : "单机");
jo.put("move", move == 1 ? "" : "");
jo.put("move", move == 1 ? "" : "");
jo.put("order", order);
jo.put("error", ErrorUtil.getDictDetail("empty_error_type", String.valueOf(this.getError())));
jo.put("task", task);

View File

@@ -159,20 +159,15 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
}
if (!this.itemProtocol.getIsonline()) {
// this.setIsonline(false);
// this.setIserror(true);
// this.setIsonline(false);
// this.setIserror(true);
message = "信号量同步异常";
//未联机
/* } else if (mode == 0) {
// this.setIsonline(false);
// this.setIserror(true);
} else if (mode == 0) {
// this.setIsonline(false);
// this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";*/
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
@@ -180,9 +175,11 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//工作模式联机、满料位有货、工单号大于0 就申请agv任务
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
apply_task();
boolean flag = apply_task();
this.noApplyTaskMessage = null;
this.message = "申请满料请求任务成功";
if (flag) {
this.message = "申请满料请求任务成功";
}
} else {
if (move == 1) {
String notApplyTaskMessage = "";
@@ -232,7 +229,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//agv取货完成
if (agvphase == 0x05 || agvphase == 0x09) {
if (mode == 1 /*&& move == 0 */&& ObjectUtil.isNotEmpty(inst)) {
if (mode == 1 /*&& move == 0 */ && ObjectUtil.isNotEmpty(inst)) {
this.writing("to_agv_finish", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
instructionService.update(inst);
@@ -290,10 +287,11 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -132,8 +132,8 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}
if (storage_stock_num != last_storage_stock_num) {
if (this.itemProtocol.getIsonline()) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice_code(), this.getStorage_stock_num());
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
}
if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num")))) {
requireSucess = false;
@@ -156,11 +156,6 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
//this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
@@ -168,9 +163,11 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
//倒料位满足联机,剩余数量小于最小数量申请缓存线出库任务
if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
applyOutCacheLineTask();
boolean flag = applyOutCacheLineTask();
this.noApplyTaskMessage = null;
this.message = "申请缓存线任务成功";
if (flag) {
this.message = "申请缓存线任务成功";
}
} else {
if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
String notApplyTaskMessage = "";
@@ -260,10 +257,11 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
if (httpResponse != null && httpResponse.getStatus() == 200) {
requireSucess = true;
return true;
}
}
return false;
}
return true;
}

View File

@@ -320,11 +320,6 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
//this.setIserror(true);
message = "未联机";
//有报警
} else if (lane_error != 0 || line_error != 0) {
//this.setIsonline(false);
//this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);

View File

@@ -122,7 +122,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
*/
public String replace(String message) {
if (message.endsWith(",")) {
return message.replace(message.charAt(message.length() - 1) + "", "!");
return message.substring(0, message.length() - 1);
}
return message;
}

View File

@@ -140,8 +140,8 @@ public class DeviceOpcProtocolRunable implements Runnable {
}
if(ObjectUtil.isEmpty(itemStatus)) {
System.out.println( tag + " :itemStatus is null");
log.warn(" {} 读取异常 : {} itemStatus is null", tag);
//System.out.println( tag + " :itemStatus is null");
//log.warn(" {} 读取异常 : {} itemStatus is null", tag);
}
@@ -220,7 +220,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000));
} catch (InterruptedException e) {
e.printStackTrace();
log.warn("OPC 读取线程读取异常{} :", e);
//log.warn("OPC 读取线程读取异常{} :", e);
// Thread.currentThread().interrupt();不会真正停止线程
}
++this.error_num;

View File

@@ -49,9 +49,9 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn
try {
OpcServerServiceImpl.this.getServer(dto.getOpc_code());
OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
//OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
} catch (Exception var4) {
OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
//OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
}
}
}

View File

@@ -24,7 +24,7 @@ export default {
this.timmer = setTimeout(() => {
sessionStorage.clear()
this.logout()
}, 1000 * 60 * 60) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
}, 10000 * 60 * 60) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
},
logout() {
this.$store.dispatch('LogOut').then(() => {

View File

@@ -250,7 +250,7 @@ export default {
form: {
link_device_code: '',
min_num: '',
max_num: ''
max_num: '0'
},
rules: {}
}

View File

@@ -250,7 +250,7 @@ export default {
form: {
link_device_code: '',
min_num: '',
max_num: ''
max_num: '0'
},
rules: {}
}

View File

@@ -118,7 +118,7 @@
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="device_id" label="设备标识" />
<el-table-column sortable prop="device_code" label="设备编码" />
<el-table-column sortable label="设备名字">
<el-table-column sortable label="设备名字" width="200">
<template slot-scope="scope">
<div>{{ scope.row.device_name }}</div>
</template>

View File

@@ -14,9 +14,9 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation/>
<rrOperation />
</div>
<crudOperation :permission="permission"/>
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
@@ -27,32 +27,32 @@
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="OPC编码" prop="opc_code">
<el-input v-model="form.opc_code" style="width: 370px;"/>
<el-input v-model="form.opc_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="OPC名称" prop="opc_name">
<el-input v-model="form.opc_name" style="width: 370px;"/>
<el-input v-model="form.opc_name" style="width: 370px;" />
</el-form-item>
<el-form-item label="OPC地址">
<el-input v-model="form.opc_host" style="width: 370px;"/>
<el-input v-model="form.opc_host" style="width: 370px;" />
</el-form-item>
<el-form-item label="用户名">
<el-input v-model="form.user" style="width: 370px;"/>
<el-input v-model="form.user" style="width: 370px;" />
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" style="width: 370px;" type="password"/>
<el-input v-model="form.password" style="width: 370px;" type="password" />
<el-button :loading="crud.cu === 2" type="primary" @click="getDetail()">详情</el-button>
</el-form-item>
<el-form-item label="程序ID">
<el-input v-model="form.prog_id" style="width: 370px;"/>
<el-input v-model="form.prog_id" style="width: 370px;" />
</el-form-item>
<el-form-item label="注册表ID">
<el-input v-model="form.cls_id" style="width: 370px;"/>
<el-input v-model="form.cls_id" style="width: 370px;" />
</el-form-item>
<el-form-item label="domain">
<el-input v-model="form.domain" style="width: 370px;"/>
<el-input v-model="form.domain" style="width: 370px;" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea"/>
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -63,18 +63,18 @@
<el-dialog title="PLC管理" :visible.sync="dialogPlcFormVisible" width="550px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-input v-model="form.opc_server_id" type="hidden" prop="opc_server_id"/>
<el-input v-model="form.opc_server_id" type="hidden" prop="opc_server_id" />
<el-form-item label="PLC编码" prop="plc_code">
<el-input v-model="form.plc_code" style="width: 370px;"/>
<el-input v-model="form.plc_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="OPC名称" prop="plc_opc_name">
<el-input v-model="form.plc_opc_name" style="width: 370px;" disabled/>
<el-input v-model="form.plc_opc_name" style="width: 370px;" disabled />
</el-form-item>
<el-form-item label="PLC名称" prop="plc_name">
<el-input v-model="form.plc_name" style="width: 370px;"/>
<el-input v-model="form.plc_name" style="width: 370px;" />
</el-form-item>
<el-form-item label="PLC地址" prop="plc_host">
<el-input v-model="form.plc_host" style="width: 370px;"/>
<el-input v-model="form.plc_host" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -97,18 +97,18 @@
@select-all="crud.selectAllChange"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="opc_code" label="OPC编码" width="100"/>
<el-table-column prop="opc_name" label="OPC名称"/>
<el-table-column prop="opc_host" label="OPC地址" min-width="130"/>
<el-table-column prop="type" label="类型"/>
<el-table-column prop="user" label="用户名" min-width="100"/>
<el-table-column prop="password" label="密码"/>
<el-table-column prop="prog_id" label="程序ID" min-width="150"/>
<el-table-column prop="cls_id" label="注册表ID" min-width="150"/>
<el-table-column prop="domain" label="domain"/>
<el-table-column prop="remark" label="备注" min-width="100"/>
<el-table-column prop="createtime" label="创建时间"/>
<el-table-column type="selection" width="55" />
<el-table-column prop="opc_code" label="OPC编码" show-overflow-tooltip width="135" />
<el-table-column prop="opc_name" label="OPC名称" show-overflow-tooltip width="135" />
<el-table-column prop="opc_host" label="OPC地址" show-overflow-tooltip min-width="130" />
<el-table-column prop="type" label="类型" show-overflow-tooltip />
<el-table-column prop="user" label="用户名" show-overflow-tooltip min-width="100" />
<el-table-column prop="password" label="密码" show-overflow-tooltip />
<el-table-column prop="prog_id" label="程序ID" show-overflow-tooltip min-width="150" />
<el-table-column prop="cls_id" label="注册表ID" show-overflow-tooltip min-width="150" />
<el-table-column prop="domain" label="domain" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" show-overflow-tooltip min-width="100" />
<el-table-column prop="createtime" label="创建时间" show-overflow-tooltip />
<el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="handleClick(scope.row,'1')">修改</el-button>
@@ -120,7 +120,7 @@
</el-table-column>
</el-table>
<!--分页组件-->
<pagination/>
<pagination />
</div>
</div>
</template>

View File

@@ -39,45 +39,50 @@
"af-table-column": "^1.0.3",
"ansi_up": "^5.1.0",
"axios": "0.18.1",
"clipboard": "2.0.4",
"clipboard": "^2.0.4",
"codemirror": "^5.49.2",
"connect": "3.6.6",
"echarts": "^4.2.1",
"echarts-gl": "^1.1.1",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.13.2",
"file-saver": "^1.3.8",
"element-ui": "^2.15.8",
"file-saver": "1.3.8",
"font-awesome": "^4.7.0",
"fuse.js": "3.4.4",
"jquery": "^3.6.0",
"js-beautify": "^1.10.2",
"js-cookie": "2.2.0",
"jsbarcode": "^3.11.5",
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
"mavon-editor": "^2.9.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"qrcodejs2": "0.0.2",
"qs": "^6.9.1",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"throttle-debounce": "^5.0.0",
"vue": "2.6.10",
"vue-color": "^2.8.1",
"vue-count-to": "1.0.13",
"vue-cropper": "0.4.9",
"vue-easy-print": "0.0.8",
"vue-echarts": "^5.0.0-beta.0",
"vue-highlightjs": "^1.3.3",
"vue-image-crop-upload": "^2.5.0",
"vue-print-nb": "^1.7.5",
"vue-router": "3.0.2",
"vue-seamless-scroll": "^1.1.23",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuedraggable": "^2.24.3",
"vuex": "3.1.0",
"vxe-table": "^3.3.10",
"wangeditor": "^3.1.1",
"xe-ajax": "^4.0.5",
"xe-utils": "^3.3.1",
"xlsx": "^0.14.5"
"xlsx": "^0.14.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
@@ -105,8 +110,9 @@
"husky": "1.3.1",
"lint-staged": "8.1.5",
"plop": "2.3.0",
"print-template": "^1.2.5",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass": "~1.26.5",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",