Merge remote-tracking branch 'origin/master'

This commit is contained in:
2024-02-20 17:17:32 +08:00
61 changed files with 889 additions and 196 deletions

View File

@@ -111,6 +111,7 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
walk_y = this.itemProtocol.getWalk_y();
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
iserror = this.itemProtocol.deviceStatus;
if (mode != last_mode) {
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
@@ -265,7 +266,9 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
} else if (this.getAction() == 4) {
action = "放货完成";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -64,9 +65,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if (item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -107,7 +107,7 @@ public class CargoLiftConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
error = this.itemProtocol.getItem_error();
task = this.itemProtocol.getItem_task();
action = this.itemProtocol.getItem_action();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.cargo_lift_conveyor;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -57,9 +58,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -150,7 +150,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
material2 = this.itemProtocol.getMaterial2();
qty = this.itemProtocol.getQty();
to_command = this.itemProtocol.getTo_command();
iserror = this.itemProtocol.isError;
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
@@ -479,12 +479,16 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getMove() == 1) {
move = "有托盘";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("task", task);
jo.put("mode", mode);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("move", move);
jo.put("inventory_qty", qty);
jo.put("isError", iserror);
jo.put("out_finish", out_finish);
jo.put("material1", material1);
jo.put("material2", material2);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.casing_station;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -85,11 +86,17 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
private CasingStationConveyorDeviceDriver driver;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -104,7 +104,7 @@ public class EmptyVehicleStackingPositionDeviceDriver extends AbstractOpcDeviceD
number = this.itemProtocol.getItem_number();
container_type = this.itemProtocol.getItem_container_type();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.getIsError();
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -61,9 +62,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -104,7 +104,7 @@ public class HailiangSmartplcTestDeviceDriver extends AbstractOpcDeviceDriver im
number = this.itemProtocol.getItem_number();
container_type = this.itemProtocol.getItem_container_type();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.hailiang_smart_plc_test;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -65,9 +66,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -167,6 +167,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
currentB = this.itemProtocol.getItem_currentB();
currentC = this.itemProtocol.getItem_currentC();
to_temperature = this.itemProtocol.getItem_to_temperature();
iserror = this.itemProtocol.isError;
if (door != last_door) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号door" + last_door + "->" + door);
}
@@ -335,6 +336,9 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("temperature", temperature);
jo.put("finish", finish);
@@ -350,6 +354,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("move", move);
jo.put("action", action);
jo.put("task", this.getTask());
jo.put("message", this.getMessage());
return jo;
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.hongxiang_device;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -123,9 +124,15 @@ public class ItemProtocol {
} ;
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -138,6 +138,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
int last_is_wrapped = 0;
Boolean isonline = true;
Boolean deviceStatus = false;
int hasGoods = 0;
String message = null;
Boolean iserror = false;
@@ -212,6 +213,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
tube_num = this.itemProtocol.getTube_num();
inflatableShaftVersion = this.itemProtocol.getInflatableShaftVersion();
is_wrapped = this.itemProtocol.getIs_wrapped();
deviceStatus = this.itemProtocol.deviceStatus;
if (to_onset != last_to_onset) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset" + last_to_onset + "->" + to_onset);
@@ -753,6 +755,13 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (this.requireSucess) {
requireSucess = "1";
}
if(deviceStatus && error == 0){
iserror = true;
message = "信号连接超时!";
}
if(error == 0 && !deviceStatus){
iserror = false;
}
jo.put("requireSucess", requireSucess);
if (this.getAction() == 2) {
action = "反馈气胀轴尺寸";

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.indoor_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -152,8 +153,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if(item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -40,6 +41,7 @@ public class ItemProtocol {
//下发任务号
public static String item_to_task = "to_task";
public Boolean device_status = false;
private OvenGantryManipulatorDeviceDriver driver;
@@ -104,6 +106,11 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
device_status = true;
}else if(item_heartbeat.equals(protocol)){
device_status = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -123,6 +123,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
//行架机械手申请任务成功标识
boolean requireSucess = false;
public boolean deviceStatus = false;
private int instruction_finished_time_out;
int branchProtocol = 0;
@@ -172,6 +174,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
to_onset = this.itemProtocol.getTo_onset();
x_position = this.itemProtocol.getX_position();
y_position = this.itemProtocol.getY_position();
deviceStatus = this.itemProtocol.getDevice_status();
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -386,105 +390,107 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code());
String start_device_code = instruction.getStart_device_code();
String next_device_code = instruction.getNext_device_code();
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver;
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver();
if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
if(ObjectUtil.isNotEmpty(instruction)){
String start_device_code = instruction.getStart_device_code();
String next_device_code = instruction.getNext_device_code();
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
PhotoelectricInspectionSiteDeviceDriver photoelectricInspectionSiteDeviceDriver;
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (startdevice.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver) {
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) startdevice.getDeviceDriver();
if (photoelectricInspectionSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + photoelectricInspectionSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevice_code() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
//判断关联的同一列烘箱设备是否都关门 都关门返回false有一个不关门就返回true
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
//未关门结束
if (isCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false;
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
}
//判断关联的同一列烘箱设备是否都关门 都关门返回false有一个不关门就返回true
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
//未关门结束
if (isCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false;
}
instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code());
this.writing("to_onset", start_addr);
this.writing("to_target", next_addr);
this.writing("to_task", instruction.getInstruction_code());
this.writing("to_command", "1");
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type);
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code());
this.writing("to_onset", start_addr);
this.writing("to_target", next_addr);
this.writing("to_task", instruction.getInstruction_code());
this.writing("to_command", "1");
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type);
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
}
}
this.setNow_steps_type(2);
this.setRequireSucess(true);
return true;
}
this.setNow_steps_type(2);
this.setRequireSucess(true);
return true;
} else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) {
@@ -560,8 +566,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
String route_plan_code = task.getRoute_plan_code();
String next_point_code = task.getNext_point_code();
String next_device_code = task.getNext_device_code();
String put_device_code = task.getPut_device_code();
String put_point_code = task.getPut_point_code();
Instruction instdto = new Instruction();
instdto.setPut_device_code(put_device_code);
instdto.setPut_point_code(put_point_code);
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code);
instdto.setRemark(task.getRemark());
@@ -843,7 +853,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (now_steps_type == 5) {
steps_type += "放货完成";
}
if(deviceStatus && error == 0){
iserror = true;
message = "信号连接超时!";
}
if(error == 0 && !deviceStatus){
iserror = false;
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
@@ -1128,7 +1144,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
/*if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
// hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
@@ -1147,7 +1163,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
}
}*/
this.writing("to_command", "5");
this.setNow_steps_type(6);
this.setNow_steps_type(0);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.paint_conveyor;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -60,9 +61,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -102,7 +102,7 @@ public class PaintConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
error = this.itemProtocol.getItem_error();
number = this.itemProtocol.getItem_number();
task = this.itemProtocol.getItem_task();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.paper_tube_device;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -75,9 +76,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -70,6 +70,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
int to_command =0;
int to_target =0;
String material = null;
String message = null;
Boolean isonline = true;
@@ -96,7 +97,6 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
@Override
public void execute() {
String message = null;
device_code = this.getDeviceCode();
heartbeat = this.itemProtocol.getHeartbeat();
@@ -107,7 +107,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
error = this.itemProtocol.getError();
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTotarget();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);
if (mode == 0) {
@@ -137,9 +137,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
if(error > 0){
this.setIserror(true);
} else {
if(error > 0){
this.setIserror(false);
}
this.setIserror(false);
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号out_finish" + last_out_finish + "->" + out_finish);
}
@@ -217,6 +215,9 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
} else if (this.getMode() == 4) {
mode = "出库中";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
@@ -224,6 +225,8 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("out_finish", out_finish);
jo.put("material", material);
jo.put("isOnline", this.getIsonline());
jo.put("isError", iserror);
jo.put("message", message);
return jo;
}

View File

@@ -294,9 +294,14 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
setIsonline(false);
} else {

View File

@@ -284,7 +284,7 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
item_to_position1 = this.itemProtocol.getTo_position1();
item_to_position2 = this.itemProtocol.getTo_position2();
item_to_position3 = this.itemProtocol.getTo_position3();
iserror = this.itemProtocol.isError;
//信号位置校验,记录日志
signal_verification();
@@ -754,10 +754,15 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("z_qty11", this.getItem_qty11());
map.put("material12", this.getItem_material12());
map.put("z_qty12", this.getItem_qty12());
map.put("isError", iserror);
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
this.message = "信号连接超时!";
}
map.put("message", message);
map.put("requireSucess", requireSucess);
map.put("driver_type", "conveyor");
JSONObject jo = new JSONObject(map);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.plugging_unplugging_machine;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -59,9 +60,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -104,6 +104,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
move = this.itemProtocol.getMove();
task1 = this.itemProtocol.getTask1();
to_command = this.itemProtocol.getToCommand();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.requireSucess = false;

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.basedriver.rgv;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -65,11 +66,11 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public float getOpcFloatValue(String protocol) {
Float value = this.driver.getDoubleValue(protocol);
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);
@@ -80,6 +81,11 @@ public class ItemProtocol {
}
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -57,6 +57,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
@Autowired
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
int heartbeat = 0;
int mode = 0;
int last_mode = 0;
int error = 0;
@@ -108,6 +109,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
qty2 = this.itemProtocol.getQty2();
task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getToCommand();
heartbeat = this.itemProtocol.getHeartbeat();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.requireSucess = false;
@@ -320,8 +323,21 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
move2 = "无货";
jo.put("hasGoods", false);
} else if (this.getMove1() == 1 || this.getMove2() == 1) {
if(this.getMove1() == 1){
move1 = "有货";
}else if(this.getMove1() == 0){
move1 = "无货";
}
if(this.getMove2() == 1){
move2 = "有货";
}else if(this.getMove2() == 0){
move2 = "无货";
}
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move1", move1);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -103,9 +104,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean deviceStatus = false;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
deviceStatus = true;
}else if (item_heartbeat.equals(protocol)){
deviceStatus = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -128,6 +128,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int hasGoods = 0;
String message = null;
Boolean iserror = false;
Boolean deviceStatus = false;
String hand_barcode = null;
@@ -186,6 +187,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
to_length = this.itemProtocol.getTo_length();
to_weight = this.itemProtocol.getTo_weight();
to_height = this.itemProtocol.getTo_height();
deviceStatus = this.itemProtocol.deviceStatus;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -611,7 +613,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(deviceStatus){
iserror = true;
}
if(error == 0 && !deviceStatus){
iserror = false;
}
if (this.carrier_direction == 1) {
carrier_direction = "正转";
} else if (this.carrier_direction == 2) {
@@ -621,6 +628,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -86,9 +87,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -166,6 +166,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
iserror = this.itemProtocol.isError;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -462,6 +463,9 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
@@ -470,8 +474,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("last_task", last_task);
jo.put("task_code", task_code);
jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
// jo.put("last_task", last_task);
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null
? null : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -81,9 +82,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -158,6 +158,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
weight = this.itemProtocol.getWeight();
heartbeat = this.itemProtocol.getHeartbeat();
iserror = this.itemProtocol.isError;
// if(heartbeat != last_heartbeat){
// logServer.deviceExecuteLog(this.device_code, "", "", "heartbeat" + last_heartbeat + "->" + heartbeat);
// }
@@ -455,7 +456,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
@@ -464,7 +467,8 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror());
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null ? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("barcode", this.getMove() == 0 ? null : instructionService.findByCodeFromCache(String.valueOf(task)) == null
? vehicle_code : instructionService.findByCodeFromCache(String.valueOf(task)).getVehicle_code());
jo.put("message", this.getMessage());
jo.put("is_click", true);
jo.put("requireSucess", requireSucess);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.siemens_onefloor_agv_conveyor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -87,9 +88,15 @@ public class ItemProtocol {
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -161,6 +161,7 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
to_command = this.itemProtocol.getTo_command();
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
iserror = this.itemProtocol.isError;
if (last_mode != mode) {
JSONObject param = new JSONObject();
param.put("device_code", this.device_code);
@@ -348,6 +349,9 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.slit_two_manipulator;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -163,9 +164,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -213,6 +213,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
to_target2 = this.itemProtocol.getTo_target2();
to_onset1 = this.itemProtocol.getTo_onset1();
to_onset2 = this.itemProtocol.getTo_onset2();
iserror = this.itemProtocol.isError;
if (to_command1 != last_to_command1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command1" + last_to_command1 + "->" + to_command1);
@@ -1216,8 +1217,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (this.requireSucess) {
requireSucess = "1";
}
if(error == 0 && iserror){
type = 4;
}
jo.put("requireSucess", requireSucess);
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
@@ -1278,6 +1281,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
map.put("8", "双任务后工位放货完成");
map.put("9", "双任务前工位允许放货");
map.put("10", "双任务前工位放货完成");
}else if(type == 4){
return "信号连接超时!";
} else {
return "未执行任务";
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -80,9 +81,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -151,6 +151,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
operation_type = this.itemProtocol.getOperation_type();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
}
if (move != last_move) {
@@ -463,6 +464,9 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
@@ -471,6 +475,7 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
jo.put("message", message);
return jo;
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -97,9 +98,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -162,6 +162,7 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
direction = this.itemProtocol.getDirection();
hasGoods = this.itemProtocol.getMove();
barcode = this.itemProtocol.getBarcode();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
this.setRequireSucess(false);
}
@@ -872,6 +873,9 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
if (this.applySucess) {
applySucess = "1";
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("requireSucess", requireSucess);
jo.put("applySucess", applySucess);
jo.put("driver_type", "standard_conveyor_control_with_scanner");
@@ -884,6 +888,7 @@ public class StandardCoveyorControlWithPlcScannerDeviceDriver extends AbstractOp
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
jo.put("message", message);
return jo;
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@@ -112,9 +113,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -225,6 +225,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
to_target = this.itemProtocol.getTo_target();
to_task = this.itemProtocol.getTo_task();
weight = this.itemProtocol.getWeight();
iserror = this.itemProtocol.isError;
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
@@ -1104,6 +1105,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("driver_type", "standard_conveyor_control_with_scanner");
jo.put("mode", mode);

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.standard_inspect_site;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
@@ -69,9 +70,15 @@ public class ItemProtocol {
}
Boolean isonline;
Boolean isError;
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
isError = true;
}else if (item_heartbeat.equals(protocol)){
isError = false;
}
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);

View File

@@ -57,6 +57,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
//有货标记
protected boolean has_goods_tag = false;
int heartbeat = 0;
int mode = 0;
int error = 0;
int move = 0;
@@ -133,11 +134,13 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
try {
device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
heartbeat = this.itemProtocol.getHeartbeat();
error = this.itemProtocol.getError();
move = this.itemProtocol.getMove();
action = this.itemProtocol.getAction();
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
iserror = this.itemProtocol.isError;
if (mode != last_mode) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode + "复位请求标记");
@@ -232,6 +235,9 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
move = "有托盘有货";
jo.put("hasGoods", true);
}
if(error == 0 && iserror){
message = "信号连接超时!";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
@@ -242,6 +248,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
jo.put("task", this.getTask());
jo.put("is_click", true);
jo.put("is_force", this.getIs_force());
jo.put("message", message);
return jo;
}

View File

@@ -54,12 +54,14 @@ public interface OpcDeviceDriver extends DeviceDriver {
@Override
Device getDevice();
default String getOpcPlc() {
return this.getDevice().getOpc_plc_code();
}
default Integer getIntegeregerValue(String protocol) {
if("heartbeat".equals(protocol) && this.getValue(protocol)==null){
return null;
}
Object value = this.getValue(protocol)==null?"0":this.getValue(protocol);
return Integer.parseInt(value.toString());
}

View File

@@ -413,6 +413,34 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
if (!StrUtil.equals(task.getAgv_system_type(), "0")
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
if(StrUtil.isBlank(dto.getAgv_inst_type())){
String agv_system_type = task.getAgv_system_type();
String task_type = task.getTask_type();
if (!StrUtil.equals(agv_system_type, "1")) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, "1")) {
dto.setAgv_inst_type("1");
} else if (StrUtil.equals(task_type, "3")) {
dto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
dto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
dto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + task.getTask_code() + ",task_type:" + task.getTask_type()) ;
}
} else {
dto.setAgv_inst_type("4");
}
dto.setAgv_system_type(task.getAgv_system_type());
}
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type()
+ ",AGV指令类型:" + dto.getInstruction_type() );

View File

@@ -198,6 +198,9 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
if (true) {
this.logItemChanged(itemId, accessor_value, value, itemDto);
}
if(ObjectUtil.isEmpty(value)){
accessor_value.removeValue(itemId);
}
if(!ObjectUtil.isEmpty(value)){
accessor_value.setValue(itemId, value);
}

View File

@@ -9,6 +9,8 @@ public interface UnifiedDataAccessor {
void setValue(String key, Object value);
void removeValue(String key);
UnifiedData getUnifiedData(String key);
List<UnifiedData> getHistoryUnifiedData(String key);

View File

@@ -33,6 +33,10 @@ public class UnifiedDataAccessorImpl implements UnifiedDataAccessor {
this.unifiedDataAppService.setValue(this.unified_key, key, value);
}
public void removeValue(String key) {
this.unifiedDataAppService.removeValue(this.unified_key, key);
}
public void setValueWithPersistence(String key, Object value) {
this.unifiedDataAppService.setValueWithPersistence(this.unified_key, key, value);
}

View File

@@ -1,6 +1,7 @@
package org.nl.wms.basedata.st.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -12,7 +13,9 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@@ -98,10 +101,16 @@ public class StructivtController {
@PostMapping("/save")
@Log("保存")
public ResponseEntity<Object> save(@RequestBody JSONObject whereJson) {
structivtService.save(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/importExcel")
@SaIgnore
public ResponseEntity<Object> importExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
structivtService.importExcel(file, request);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.basedata.st.service.dto.StructivtDto;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@@ -81,4 +83,6 @@ public interface StructivtService {
void download(Map map, HttpServletResponse response, String[] product_area, String[] ivt_flag) throws IOException;
void save(JSONObject whereJson);
void importExcel(MultipartFile file, HttpServletRequest request);
}

View File

@@ -6,6 +6,9 @@ import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -23,9 +26,12 @@ import org.nl.wms.basedata.st.service.dto.StructivtDto;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
/**
@@ -329,4 +335,34 @@ public class StructivtServiceImpl implements StructivtService {
WQLObject.getWQLObject("st_ivt_structivt").update(jsonObject, "stockrecord_id = '" + whereJson.getString("stockrecord_id") + "'");
}
@Override
public void importExcel(MultipartFile file, HttpServletRequest request) {
// 1.获取上传文件输入流
InputStream inputStream = null;
try {
inputStream = file.getInputStream();
} catch (Exception e) {
e.printStackTrace();
}
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
List<List<Object>> read = excelReader.read(1, excelReader.getRowCount());
// 循环获取的数据
for (int i = 0; i < read.size(); i++) {
List list = read.get(i);
String container_name = list.get(0).toString();
String remark = list.get(1).toString();
if (StrUtil.isEmpty(container_name) || StrUtil.isEmpty(remark)) {
continue;
}
JSONObject ivt_jo = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(ivt_jo)) {
continue;
}
ivt_jo.put("remark", remark);
WQLObject.getWQLObject("st_ivt_structivt").update(ivt_jo);
}
}
}

View File

@@ -19,6 +19,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.BakingService;
import org.nl.wms.sch.tasks.CutConveyorTask;
@@ -29,6 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
@Service
@RequiredArgsConstructor
@Slf4j
@@ -383,10 +386,33 @@ public class BakingServiceImpl implements BakingService {
if (ObjectUtil.isEmpty(point_code2)) {
throw new BadRequestException("没有无货且没有任务的点位类型为出箱的烘箱对接位!");
}
// 2.找冷却区空货位
JSONObject map2 = new JSONObject();
map2.put("flag", "2");
map2.put("product_area", jsonHotIvt.getString("product_area"));
map2.put("point_location", jsonHotIvt.getString("point_location"));
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map2).process().uniqueResult(0);
// 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt)) {
if (StrUtil.equals(jsonHotIvt.getString("point_location"), "0")) {
map2.put("point_location", "1");
}
if (StrUtil.equals(jsonHotIvt.getString("point_location"), "1")) {
map2.put("point_location", "0");
}
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map2).process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonCooIvt)) {
throw new BadRequestException("冷却区空位不足");
}
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
param.put("point_code2", point_code2);
param.put("point_code3", jsonCooIvt.getString("full_point_code"));
param.put("material_code", jsonHotIvt.getString("container_name"));
param.put("product_area", jsonHotIvt.getString("product_area"));
OutHotTask outHotTask = new OutHotTask();
@@ -430,13 +456,13 @@ public class BakingServiceImpl implements BakingService {
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject inCoolIvt(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
WQLObject pointTab = WQLObject.getWQLObject("st_ivt_coolpointivt"); // 点位点
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
String point_code1 = whereJson.getString("point_code"); // 暂存位:起点
String point_code1 = whereJson.getString("point_code"); // 冷却区点位:起点
String container_name = whereJson.getString("container_name"); // 母卷号
//获取人员对应的区域
@@ -467,15 +493,16 @@ public class BakingServiceImpl implements BakingService {
throw new BadRequestException("该母卷在MES上未进行决策入半成品库不允许进行入冷却操作");
}
// 1.获取此暂存位的生产区域和上下位置
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
JSONObject jsonPoint = pointTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) {
throw new BadRequestException("请扫描点位类型为出箱的烘箱对接位");
throw new BadRequestException("请扫描冷却区满轴点位编码");
}
if (!in_area_id.contains(jsonPoint.getString("product_area"))) {
throw new BadRequestException("当前登录人员暂无【" + jsonPoint.getString("product_area") + "】操作权限");
}
/* // 1.获取此暂存位的生产区域和上下位置
// 2.找冷却区空货位
JSONObject map = new JSONObject();
map.put("flag", "2");
@@ -507,9 +534,9 @@ public class BakingServiceImpl implements BakingService {
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
String task_id = inCoolIvtTask.createTask(param);
*/
// 生成冷却区出入表
String currentUserId = SecurityUtils.getCurrentUserId();
/*String currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
@@ -540,7 +567,44 @@ public class BakingServiceImpl implements BakingService {
jsonCool.put("confirm_optid", currentUserId);
jsonCool.put("confirm_optname", currentUsername);
jsonCool.put("confirm_time", DateUtil.now());
coolTab.insert(jsonCool);
coolTab.insert(jsonCool);*/
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code1 + "'").uniqueResult(0);
// 更新冷却库存状态
jsonIvt.put("full_point_status", "02");
jsonIvt.put("cool_ivt_status", "04");
jsonIvt.put("instorage_time", DateUtil.now());
jsonIvt.put("container_name", raw_jo.getString("container_name"));
jsonIvt.put("workorder_id", raw_jo.getString("workorder_id"));
jsonIvt.put("ivt_qty", raw_jo.getString("qty"));
ivtTab.update(jsonIvt);
// 将入冷却信息发送给mes
JSONObject param = new JSONObject();
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
param.put("iContainerName", container_name);
param.put("iArrivalTime", DateUtil.now());
param.put("iWarehouse", 2);
param.put("UserName", userName);
param.put("PassWord", passWord);
//判断该接口是否需要回传
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(back_jo) && "1".equals(back_jo.getString("is_back"))) {
String product_area = back_jo.getString("product_area");
if (StrUtil.isNotEmpty(product_area) && product_area.contains(jsonPoint.getString("product_area"))) {
new LmsToMesServiceImpl().momRollSemiFGInboundComplete(param);
}
}
//将该母卷的入冷却标识改为0
HashMap<String, String> map = new HashMap<>();
map.put("is_instor", "0");
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + container_name + "'");
log.info("母卷:" + container_name + "对应的入冷却任务完成请求入半成品库标识改为0");
JSONObject result = new JSONObject();
result.put("message", "操作成功!");

View File

@@ -361,40 +361,90 @@ public class FeedingServiceImpl implements FeedingService {
if (StrUtil.isEmpty(point_code)) {
throw new BadRequestException("输入的点位不能为空!");
}
String type = form.getString("type");
//查询对应的分切点位是否存在
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("empty_point_code = '" + point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("请输入或者扫码分切区域的空轴点位!");
}
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
throw new BadRequestException("该点位库存状态不存在空轴!");
//空轴送回
if (type.equals("1")) {
//查询对应的分切点位是否存在
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("empty_point_code = '" + point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("请输入或者扫码分切区域的空轴点位!");
}
if (StrUtil.equals("01", cut_jo.getString("empty_point_status"))) {
throw new BadRequestException("该点位库存状态不存在空轴!");
}
// 2.找冷却区空货位
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("product_area", cut_jo.getString("product_area"));
map.put("point_location", "0");
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
// 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt)) {
map.put("point_location", "1");
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonCooIvt)) {
throw new BadRequestException("冷却区空位不足");
}
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code);
param.put("point_code2", jsonCooIvt.getString("empty_point_code"));
param.put("product_area", cut_jo.getString("product_area"));
param.put("task_type", "010303");
AbstractAcsTask task = new CoolCutTask();
task.createTask(param);
}
// 2.找冷却区空货位
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("product_area", cut_jo.getString("product_area"));
map.put("point_location", "0");
//满轴送回
if (type.equals("2")) {
//查询对应的分切点位是否存在
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(cut_jo)) {
throw new BadRequestException("请输入或者扫码分切区域的满轴点位!");
}
if (StrUtil.equals("01", cut_jo.getString("full_point_status"))) {
throw new BadRequestException("该点位库存状态不存在满轴!");
}
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
// 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt)) {
map.put("point_location", "1");
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonCooIvt)) {
throw new BadRequestException("冷却区空位不足");
String container_name = cut_jo.getString("container_name");
if (StrUtil.isEmpty(container_name)) {
throw new BadRequestException("该点位上不存在母卷或LMS系统上未维护母卷号");
}
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + container_name + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(raw_jo)) {
throw new BadRequestException("未查询到【" + container_name + "】对应的母卷号!");
}
JSONObject device_jo = WQLObject.getWQLObject("st_ivt_sbpointivt").query("ext_code = '" + raw_jo.getString("resource_name") + "'").uniqueResult(0);
String point_location = device_jo.getString("point_location");
// 2.找冷却区空货位
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("product_area", cut_jo.getString("product_area"));
map.put("point_location", point_location);
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
// 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt)) {
throw new BadRequestException("冷却区空位不足");
}
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code);
param.put("point_code2", jsonCooIvt.getString("full_point_code"));
param.put("product_area", cut_jo.getString("product_area"));
param.put("vehicle_code", container_name);
param.put("task_type", "010304");
AbstractAcsTask task = new CoolCutTask();
task.createTask(param);
}
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code);
param.put("point_code2", jsonCooIvt.getString("empty_point_code"));
param.put("product_area", cut_jo.getString("product_area"));
param.put("task_type", "010303");
AbstractAcsTask task = new CoolCutTask();
task.createTask(param);
JSONObject result = new JSONObject();
result.put("message", "操作成功!");

View File

@@ -45,9 +45,11 @@
IF 输入.flag = "1"
PAGEQUERY
SELECT
ivt.*
ivt.*,
dict.label
FROM
st_ivt_shaftivt ivt
LEFT JOIN sys_dict dict ON dict.value = ivt.point_type AND dict.`code` = 'PACKAGE_POINT_TYPE'
WHERE
ivt.product_area in 输入.in_area_id
OPTION 输入.point_code <> ""

View File

@@ -244,6 +244,31 @@ public class CoolCutTask extends AbstractAcsTask {
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
}
if ("010304".equals(jsonTask.getString("task_type"))) {
//更新分切区空轴库存
JSONObject cut_jo2 = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
String container_name = cut_jo2.getString("container_name");
cut_jo2.put("full_point_status", "01");
cut_jo2.put("full_vehicle_code", "");
cut_jo2.put("container_name", "");
cut_jo2.put("update_optid", currentUserId);
cut_jo2.put("update_optname", currentUsername);
cut_jo2.put("update_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo2);
//更新冷却区空轴库存
JSONObject jsonCoolIvt2 = WQLObject.getWQLObject("st_ivt_coolpointivt").query("full_point_code = '" + point_code2 + "'").uniqueResult(0);
jsonCoolIvt2.put("full_point_status", "02");
jsonCoolIvt2.put("container_name", container_name);
jsonCoolIvt2.put("cool_ivt_status", "02");
jsonCoolIvt2.put("instorage_time", "");
jsonCoolIvt2.put("update_optid", currentUserId);
jsonCoolIvt2.put("update_optname", currentUsername);
jsonCoolIvt2.put("update_time", DateUtil.now());
WQLObject.getWQLObject("st_ivt_coolpointivt").update(jsonCoolIvt2);
}
}
}

View File

@@ -49,13 +49,18 @@ public class OutHotTask extends AbstractAcsTask {
.task_code(json.getString("task_code"))
.task_type(json.getString("acs_task_type"))
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code"))
.agv_system_type(agv_system_type)
.priority(json.getString("priority"))
.product_area(product_area)
.remark(json.getString("remark"))
.build();
if (StrUtil.isNotEmpty(json.getString("point_code3"))) {
dto.setNext_device_code(json.getString("point_code3"));
dto.setPut_device_code(json.getString("point_code2"));
} else {
dto.setNext_device_code(json.getString("point_code2"));
}
resultList.add(dto);
}
return resultList;
@@ -105,11 +110,11 @@ public class OutHotTask extends AbstractAcsTask {
// 更新主表: 什么时候更新主表
JSONObject jsonHotMst = hotMstTab.query("task_id = '" + task_id + "'").uniqueResult(0);
// 更新暂存区点位状态
/*// 更新暂存区点位状态
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
jsonPoint2.put("point_status", "2");
jsonPoint2.put("material_code", jsonHotIvt.getString("container_name"));
pointTab.update(jsonPoint2);
pointTab.update(jsonPoint2);*/
// 更新烘箱区库存状态
jsonHotIvt.put("point_status", "01");
@@ -121,6 +126,24 @@ public class OutHotTask extends AbstractAcsTask {
jsonHotIvt.put("update_optname", currentUsername);
jsonHotIvt.put("update_time", DateUtil.now());
// 更新冷却库存状态
// 校验终点是否存在
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) {
throw new BadRequestException("终点未找到可用点位:" + jsonTask.getString("point_code3"));
}
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0);
jsonIvt.put("full_point_status", "02");
jsonIvt.put("cool_ivt_status", "03");
jsonIvt.put("instorage_time", DateUtil.now());
jsonIvt.put("container_name", raw_jo.getString("container_name"));
jsonIvt.put("workorder_id", raw_jo.getString("workorder_id"));
jsonIvt.put("ivt_qty", raw_jo.getString("qty"));
ivtTab.update(jsonIvt);
log.info("出烘箱wql执行update语句");
hotIvtTab.update(jsonHotIvt);
JSONObject update_ivt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
@@ -191,6 +214,7 @@ public class OutHotTask extends AbstractAcsTask {
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));
json.put("product_area", form.getString("product_area"));
json.put("material_code", form.getString("material_code"));
json.put("sort_seq", "1");
@@ -205,7 +229,7 @@ public class OutHotTask extends AbstractAcsTask {
} else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type", "6");
json.put("acs_task_type", "8");
tab.insert(json);
immediateNotifyAcs(json.getString("task_id"));
return json.getString("task_id");

View File

@@ -0,0 +1,116 @@
<template>
<el-dialog
title="导入Excel文件"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="400px"
:show-close="true"
@close="close"
@open="open"
>
<el-upload
ref="upload"
class="upload-demo"
action=""
drag
:on-exceed="is_one"
:limit="1"
:auto-upload="false"
:multiple="false"
:show-file-list="true"
:on-change="uploadByJsqd"
:file-list="fileList"
accept=".xlsx,.xls"
>
<i class="el-icon-upload" />
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div slot="tip" class="el-upload__tip">只能上传Excel文件且不超过10MB</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import crudStructivt from '@/views/wms/basedata/st/ivt/structivt'
import CRUD, { crud } from '@crud/crud'
export default {
name: 'UploadDialog',
mixins: [crud()],
components: {},
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
fileList: [],
file1: ''
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
open() {
},
close() {
this.$emit('update:dialogShow', false)
},
is_one() {
this.crud.notify('只能上传一个excel文件', CRUD.NOTIFICATION_TYPE.WARNING)
},
// 文件校验方法
beforeAvatarUpload(file) {
// 不能导入大小超过2Mb的文件
if (file.size > 10 * 1024 * 1024) {
return false
}
return true
},
// 文件发生改变就会触发的事件
uploadByJsqd(file) {
this.file1 = file
},
submit() {
if (this.beforeAvatarUpload(this.file1)) {
this.fileList.name = this.file1.name
this.fileList.url = ''
var formdata = new FormData()
formdata.append('file', this.file1.raw)
// excelImport请求接口 formdata传递参数
crudStructivt.excelImport(formdata).then((res) => {
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.$emit('tableChanged', '')
this.$emit('update:dialogShow', false)
})
} else {
this.crud.notify('文件过大请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
}
}
}
}
</script>

View File

@@ -155,7 +155,7 @@
/>
</el-select>
</el-form-item>
<rrOperation :crud="crud" />
<rrOperation :crud="crud"/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -170,39 +170,63 @@
>
导出Excel
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-arrow-down"
size="mini"
@click="Import"
>
超期信息导入
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="struct_code" label="仓位编码" :min-width="flexWidth('struct_code',crud.data,'仓位编码')" />
<el-table-column prop="struct_name" label="仓位名称" :min-width="flexWidth('struct_name',crud.data,'仓位名称')" />
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
<el-table-column prop="sect_name" label="库区" :min-width="flexWidth('sect_name',crud.data,'库区')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<!-- <el-table-column prop="region_name" label="下料区域" min-width="120" show-overflow-tooltip />-->
<!-- <el-table-column prop="quality_scode" label="品质类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.ST_QUALITY_SCODE[scope.row.quality_scode] }}
</template>
</el-table-column>-->
<el-table-column prop="package_box_sn" label="木箱码" :min-width="flexWidth('package_box_sn',crud.data,'木箱码')" />
<el-table-column prop="quanlity_in_box" label="子卷数" :min-width="flexWidth('quanlity_in_box',crud.data,'子卷数')" />
<el-table-column prop="pcsn" label="子卷号" :min-width="flexWidth('pcsn',crud.data,'子卷号')" />
<el-table-column prop="sap_pcsn" label="sap批次" :min-width="flexWidth('sap_pcsn',crud.data,'sap批次')" />
<el-table-column prop="box_weight" label="毛重" :formatter="rounding2" />
<el-table-column prop="canuse_qty" label="可用数" :formatter="rounding" />
<el-table-column prop="frozen_qty" label="冻结数" :formatter="rounding" />
<el-table-column prop="ivt_qty" label="库存数" :formatter="rounding" />
<el-table-column prop="warehousing_qty" label="待入数" :formatter="rounding" />
<el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="instorage_time" label="入库时间" min-width="150" />
<el-table-column prop="paper_type" label="管件类型" min-width="150" />
<el-table-column prop="paper_code" label="管件编码" min-width="150" />
<el-table-column prop="paper_name" label="管件描述" min-width="250" />
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column prop="struct_code" label="仓位编码"
:min-width="flexWidth('struct_code',crud.data,'仓位编码')"
/>
<el-table-column prop="struct_name" label="仓位名称"
:min-width="flexWidth('struct_name',crud.data,'仓位名称')"
/>
<el-table-column prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')"/>
<el-table-column prop="sect_name" label="库区" :min-width="flexWidth('sect_name',crud.data,'库区')"/>
<el-table-column prop="material_code" label="物料编码"
:min-width="flexWidth('material_code',crud.data,'物料编码')"
/>
<el-table-column prop="material_name" label="物料名称"
:min-width="flexWidth('material_name',crud.data,'物料名称')"
/>
<!-- <el-table-column prop="region_name" label="下料区域" min-width="120" show-overflow-tooltip />-->
<!-- <el-table-column prop="quality_scode" label="品质类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.ST_QUALITY_SCODE[scope.row.quality_scode] }}
</template>
</el-table-column>-->
<el-table-column prop="package_box_sn" label="木箱码"
:min-width="flexWidth('package_box_sn',crud.data,'木箱码')"
/>
<el-table-column prop="quanlity_in_box" label="子卷数"
:min-width="flexWidth('quanlity_in_box',crud.data,'子卷数')"
/>
<el-table-column prop="pcsn" label="子卷号" :min-width="flexWidth('pcsn',crud.data,'子卷号')"/>
<el-table-column prop="sap_pcsn" label="sap批次" :min-width="flexWidth('sap_pcsn',crud.data,'sap批次')"/>
<el-table-column prop="box_weight" label="毛重" :formatter="rounding2"/>
<el-table-column prop="canuse_qty" label="可用数" :formatter="rounding"/>
<el-table-column prop="frozen_qty" label="冻结数" :formatter="rounding"/>
<el-table-column prop="ivt_qty" label="库存数" :formatter="rounding"/>
<el-table-column prop="warehousing_qty" label="待入数" :formatter="rounding"/>
<el-table-column prop="unit_name" label="计量单位"/>
<el-table-column prop="instorage_time" label="入库时间" min-width="150"/>
<el-table-column prop="paper_type" label="管件类型" min-width="150"/>
<el-table-column prop="paper_code" label="管件编码" min-width="150"/>
<el-table-column prop="paper_name" label="管件描述" min-width="250"/>
<el-table-column prop="remark" label="超期原因" min-width="250">
<template scope="scope">
<!-- <el-input v-model="scope.row.remark" style="width: 200px" />-->
<!-- <el-input v-model="scope.row.remark" style="width: 200px" />-->
<el-select
v-model="scope.row.remark"
clearable
@@ -222,13 +246,16 @@
</el-table-column>
<el-table-column align="center" label="操作" width="120" fixed="right">
<template scope="scope">
<el-button type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click.native.prevent="save(scope.row)" />
<el-button type="primary" class="filter-item" size="mini" icon="el-icon-edit"
@click.native.prevent="save(scope.row)"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
<pagination/>
</div>
<UploadDialog :dialog-show.sync="viewShow" @tableChanged="querytable"/>
</div>
</template>
@@ -240,17 +267,37 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
import UploadDialog from '@/views/wms/basedata/st/ivt/UploadDialog'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
const defaultForm = { stockrecord_id: null, cascader: null, struct_id: null, struct_code: null, struct_name: null, workprocedure_id: null, material_id: null, material_code: null, quality_scode: null, pcsn: null, canuse_qty: null, frozen_qty: null, ivt_qty: null, warehousing_qty: null, qty_unit_id: null, instorage_time: null, sale_id: null }
const defaultForm = {
stockrecord_id: null,
cascader: null,
struct_id: null,
struct_code: null,
struct_name: null,
workprocedure_id: null,
material_id: null,
material_code: null,
quality_scode: null,
pcsn: null,
canuse_qty: null,
frozen_qty: null,
ivt_qty: null,
warehousing_qty: null,
qty_unit_id: null,
instorage_time: null,
sale_id: null
}
export default {
name: 'Structivt',
dicts: ['ST_QUALITY_SCODE', 'product_area', 'IS_OR_NOT'],
components: { pagination, crudOperation, rrOperation, udOperation },
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({ title: '库存管理', url: 'api/structivt', idField: 'stockrecord_id', sort: 'stockrecord_id,desc',
return CRUD({
title: '库存管理', url: 'api/structivt', idField: 'stockrecord_id', sort: 'stockrecord_id,desc',
optShow: {
add: false,
edit: false,
@@ -258,11 +305,13 @@ export default {
download: false,
reset: true
},
crudMethod: { ...crudStructivt }})
crudMethod: { ...crudStructivt }
})
},
data() {
return {
sects: [],
viewShow: false,
ivtStatusList: [
{ 'value': 'canuse_qty', 'label': '可用数' },
{ 'value': 'warehousing_qty', 'label': '待入数' },
@@ -278,10 +327,8 @@ export default {
{ 'value': '2', 'label': '生产质量原因' },
{ 'value': '3', 'label': '市场原因' }
],
permission: {
},
rules: {
}
permission: {},
rules: {}
}
},
created() {
@@ -324,6 +371,9 @@ export default {
}
this.crud.toQuery()
},
querytable() {
this.crud.toQuery()
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
@@ -335,6 +385,9 @@ export default {
})
}
},
Import() {
this.viewShow = true
},
save(row) {
crudStructivt.save(row).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)

View File

@@ -54,4 +54,12 @@ export function save(data) {
})
}
export default { add, edit, del, getStruct, getStructById, getUnits, save }
export function excelImport(data) {
return request({
url: 'api/structivt/importExcel',
method: 'post',
data
})
}
export default { add, edit, del, getStruct, getStructById, getUnits, save, excelImport }

View File

@@ -158,6 +158,7 @@
>
<el-table-column type="selection" width="55" />
<el-table-column prop="point_code" label="点位编码" width="100px" />
<el-table-column prop="label" label="点位类型" width="100px" />
<el-table-column prop="product_area" label="生产区域">
<template slot-scope="scope">
{{ dict.label.product_area[scope.row.product_area] }}