更新
This commit is contained in:
@@ -97,7 +97,6 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
if (address.indexOf("-") > 0) {
|
if (address.indexOf("-") > 0) {
|
||||||
String str = address.substring(address.indexOf("-"), address.length());
|
String str = address.substring(address.indexOf("-"), address.length());
|
||||||
address = address.substring(0, address.indexOf("-"));
|
address = address.substring(0, address.indexOf("-"));
|
||||||
System.out.println(address);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.nl.acs.agv.server.NDCAgvService;
|
|||||||
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
|
import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
||||||
@@ -107,6 +108,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||||
//货架
|
//货架
|
||||||
StandardStorageDeviceDriver standardStorageDeviceDriver;
|
StandardStorageDeviceDriver standardStorageDeviceDriver;
|
||||||
|
//
|
||||||
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
|
|
||||||
//分配 车id
|
//分配 车id
|
||||||
//(不需要WCS反馈)
|
//(不需要WCS反馈)
|
||||||
@@ -163,6 +166,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
|
if(siemensConveyorDeviceDriver.getMove() == 1 && siemensConveyorDeviceDriver.getMode() == 2 ){
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
@@ -215,6 +225,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
siemensConveyorDeviceDriver.writing(2);
|
||||||
|
}
|
||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
@@ -261,9 +277,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
// standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
// standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
@@ -311,16 +328,18 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
}
|
}
|
||||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
|
||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
|
||||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
|
||||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
|
||||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
|
||||||
}
|
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||||
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||||
|
// standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||||
|
// standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||||
|
|||||||
@@ -133,9 +133,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
String message = null;
|
String message = null;
|
||||||
|
|
||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
if (device_code.equals("A1_HK_05_1")){
|
|
||||||
System.out.println("1");
|
|
||||||
}
|
|
||||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||||
mode = this.itemProtocol.getItem_mode();
|
mode = this.itemProtocol.getItem_mode();
|
||||||
move = this.itemProtocol.getItem_move();
|
move = this.itemProtocol.getItem_move();
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.nl.acs.AcsConfig;
|
import org.nl.acs.AcsConfig;
|
||||||
|
import org.nl.acs.agv.server.NDCAgvService;
|
||||||
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
|
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
|
||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
@@ -19,6 +20,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
||||||
|
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
@@ -65,6 +67,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
|
@Autowired
|
||||||
|
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||||
//当前指令
|
//当前指令
|
||||||
Instruction inst = null;
|
Instruction inst = null;
|
||||||
|
|
||||||
@@ -83,8 +87,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
//任务号
|
//任务号
|
||||||
int task = 0;
|
int task = 0;
|
||||||
int last_task = 0;
|
int last_task = 0;
|
||||||
|
int agvphase = 0;
|
||||||
|
|
||||||
|
int phase = 0;
|
||||||
|
int index = 0;
|
||||||
Boolean isonline = true;
|
Boolean isonline = true;
|
||||||
int hasGoods = 0;
|
int hasGoods = 0;
|
||||||
String message = null;
|
String message = null;
|
||||||
@@ -137,16 +143,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess);
|
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess);
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
|
requireApplyLabelingSuccess = false;
|
||||||
|
requireApplyLaStrangulationSuccess =false;
|
||||||
|
requireEmptyInSuccess =false;
|
||||||
|
requireEmptyOutSuccess =false;
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess);
|
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireSucess:" + requireSucess);
|
||||||
}
|
}
|
||||||
if (mode == 4) {
|
if (mode == 4) {
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
||||||
requireApplyLabelingSuccess = false;
|
requireApplyLaStrangulationSuccess = false;
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLabelingSuccess:" + requireApplyLabelingSuccess);
|
||||||
}
|
}
|
||||||
if (mode == 5) {
|
if (mode == 5) {
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
||||||
requireApplyLaStrangulationSuccess = false;
|
requireApplyLabelingSuccess = false;
|
||||||
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
logServer.deviceExecuteLog(device_code, "", "", "请求标记复位成功`此时请求标记值为requireApplyLaStrangulationSuccess:" + requireApplyLaStrangulationSuccess);
|
||||||
}
|
}
|
||||||
if (mode == 6) {
|
if (mode == 6) {
|
||||||
@@ -198,22 +208,86 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
if(mode ==2 ){
|
||||||
int nextTask = siemensConveyorDeviceDriver.getTask();
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
if (nextTask == task) {
|
int nextTask = siemensConveyorDeviceDriver.getTask();
|
||||||
inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code();
|
if (nextTask == task) {
|
||||||
if (StrUtil.equals(instruction.getInstruction_status(), "1")) {
|
inst_message = "指令号:" + instruction.getInstruction_code() + " " + instruction.getStart_point_code() + "->" + instruction.getNext_point_code() + " 载具号:" + instruction.getVehicle_code();
|
||||||
inst = instruction;
|
if (StrUtil.equals(instruction.getInstruction_status(), "1")) {
|
||||||
finish_instruction();
|
inst = instruction;
|
||||||
this.clearWrite();
|
finish_instruction();
|
||||||
|
this.clearWrite();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x03) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("1");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x05) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("2");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x07) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("5");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (agvphase == 0x09) {
|
||||||
|
if (ObjectUtil.isNotEmpty(inst)) {
|
||||||
|
inst.setExecute_status("6");
|
||||||
|
instructionService.update(inst);
|
||||||
|
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
|
||||||
|
// OneNDCSocketConnectionAutoRun.write(data);
|
||||||
|
agvphase = 0;
|
||||||
|
index = 0;
|
||||||
|
inst = null;
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
inst_message = var17.getMessage();
|
inst_message = var17.getMessage();
|
||||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||||
@@ -270,15 +344,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
//申请贴标
|
//申请捆扎
|
||||||
if (move > 0 && !requireApplyLabelingSuccess) {
|
if (move > 0 && !requireApplyLaStrangulationSuccess) {
|
||||||
applyLabeling();
|
applyLaStrangulation();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
//申请困扎
|
//申请贴标
|
||||||
if (move > 0 && !requireApplyLaStrangulationSuccess) {
|
if (move > 0 && !requireApplyLabelingSuccess) {
|
||||||
applyLaStrangulation();
|
applyLabeling();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
@@ -286,6 +361,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (move > 0 && !requireEmptyInSuccess) {
|
if (move > 0 && !requireEmptyInSuccess) {
|
||||||
emptyIn();
|
emptyIn();
|
||||||
}
|
}
|
||||||
|
if (move > 0 && !requireSucess) {
|
||||||
|
instruction_require();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
//空托盘满垛出库申请
|
//空托盘满垛出库申请
|
||||||
@@ -573,6 +651,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//申请贴标
|
||||||
public synchronized void applyLabeling() {
|
public synchronized void applyLabeling() {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_apply_labeling_time.getTime() < (long) this.instruction_require_time_out) {
|
if (date.getTime() - this.require_apply_labeling_time.getTime() < (long) this.instruction_require_time_out) {
|
||||||
@@ -580,6 +659,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.require_apply_labeling_time = date;
|
this.require_apply_labeling_time = date;
|
||||||
|
String vehicle_code = "";
|
||||||
|
if(task >0 ){
|
||||||
|
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
vehicle_code = instruction.getVehicle_code();
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
|
||||||
|
message = "申请贴标电气设备任务号:"+task+"异常";
|
||||||
|
throw new RuntimeException("任务号为空!");
|
||||||
|
}
|
||||||
|
if(StrUtil.isEmpty(vehicle_code)){
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"未找到载具号");
|
||||||
|
message = "申请贴标电气设备任务号:"+task+"未找到载具号";
|
||||||
|
throw new RuntimeException("载具号为空!");
|
||||||
|
}
|
||||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||||
new ApplyLabelingAndBindingRequest();
|
new ApplyLabelingAndBindingRequest();
|
||||||
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
||||||
@@ -589,11 +682,28 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||||
applyLabelingAndBindingRequest.setType("1");
|
applyLabelingAndBindingRequest.setType("1");
|
||||||
acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||||
|
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||||
|
if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){
|
||||||
|
Map datas = applyLabelingAndBindingResponse.getData();
|
||||||
|
String length = datas.get("box_length").toString();
|
||||||
|
String width = datas.get("box_width").toString();
|
||||||
|
String box_high = datas.get("box_high").toString();
|
||||||
|
String bundle_times = datas.get("bundle_times").toString();
|
||||||
|
|
||||||
|
List list = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code","to_command");
|
||||||
|
map.put("value","5");
|
||||||
|
list.add(map);
|
||||||
|
this.writing(list);
|
||||||
|
|
||||||
|
}
|
||||||
requireApplyLabelingSuccess = true;
|
requireApplyLabelingSuccess = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//申请捆扎
|
||||||
public synchronized void applyLaStrangulation() {
|
public synchronized void applyLaStrangulation() {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) {
|
if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) {
|
||||||
@@ -601,6 +711,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.require_apply_strangulation_time = date;
|
this.require_apply_strangulation_time = date;
|
||||||
|
String vehicle_code = "";
|
||||||
|
if(task >0 ){
|
||||||
|
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
|
vehicle_code = instruction.getVehicle_code();
|
||||||
|
} else {
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"异常");
|
||||||
|
message = "申请捆扎电气设备任务号:"+task+"异常";
|
||||||
|
throw new RuntimeException("任务号为空!");
|
||||||
|
}
|
||||||
|
if(StrUtil.isEmpty(vehicle_code)){
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"未找到载具号");
|
||||||
|
message = "申请捆扎电气设备任务号:"+task+"未找到载具号";
|
||||||
|
throw new RuntimeException("载具号为空!");
|
||||||
|
}
|
||||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||||
new ApplyLabelingAndBindingRequest();
|
new ApplyLabelingAndBindingRequest();
|
||||||
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
||||||
@@ -610,7 +734,40 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
|
||||||
applyLabelingAndBindingRequest.setType("2");
|
applyLabelingAndBindingRequest.setType("2");
|
||||||
acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||||
|
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||||
|
if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){
|
||||||
|
Map datas = applyLabelingAndBindingResponse.getData();
|
||||||
|
String length = datas.get("box_length").toString();
|
||||||
|
String width = datas.get("box_width").toString();
|
||||||
|
String box_high = datas.get("box_high").toString();
|
||||||
|
String bundle_times = datas.get("bundle_times").toString();
|
||||||
|
|
||||||
|
List list = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code","to_length");
|
||||||
|
map.put("value",length);
|
||||||
|
list.add(map);
|
||||||
|
Map map2 = new HashMap();
|
||||||
|
map2.put("code","to_weight");
|
||||||
|
map2.put("value",width);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_height");
|
||||||
|
map3.put("value",box_high);
|
||||||
|
list.add(map3);
|
||||||
|
Map map4 = new HashMap();
|
||||||
|
map4.put("code","to_strap_times");
|
||||||
|
map4.put("value",bundle_times);
|
||||||
|
list.add(map4);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code","to_command");
|
||||||
|
map5.put("value","4");
|
||||||
|
list.add(map5);
|
||||||
|
this.writing(list);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
requireApplyLaStrangulationSuccess = true;
|
requireApplyLaStrangulationSuccess = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -622,6 +779,26 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.require_empty_in_time = date;
|
this.require_empty_in_time = date;
|
||||||
|
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
message = "申请任务中...";
|
||||||
|
JSONObject apply = new JSONObject();
|
||||||
|
apply.put("device_code", device_code);
|
||||||
|
apply.put("type","2");
|
||||||
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
|
JSONObject jo = JSON.parseObject(str);
|
||||||
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
|
message = "接口不通";
|
||||||
|
} else {
|
||||||
|
if (jo.getInteger("status") == 200) {
|
||||||
|
requireEmptyInSuccess = true;
|
||||||
|
} else {
|
||||||
|
requireEmptyInSuccess = false;
|
||||||
|
message = jo.get("message").toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,6 +809,25 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.require_empty_out_time = date;
|
this.require_empty_out_time = date;
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
message = "申请任务中...";
|
||||||
|
JSONObject apply = new JSONObject();
|
||||||
|
apply.put("device_code", device_code);
|
||||||
|
apply.put("type","2");
|
||||||
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
|
JSONObject jo = JSON.parseObject(str);
|
||||||
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
|
message = "接口不通";
|
||||||
|
} else {
|
||||||
|
if (jo.getInteger("status") == 200) {
|
||||||
|
requireEmptyOutSuccess = true;
|
||||||
|
} else {
|
||||||
|
requireEmptyOutSuccess = false;
|
||||||
|
message = jo.get("message").toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package org.nl.acs.ext.wms.data;
|
package org.nl.acs.ext.wms.data;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ApplyLabelingAndBindingResponse extends BaseResponse {
|
public class ApplyLabelingAndBindingResponse extends BaseResponse {
|
||||||
|
|
||||||
|
private Map<String, String> data = new HashMap();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package org.nl.acs.ext.wms.liKuData;
|
package org.nl.acs.ext.wms.liKuData;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class DeviceStatusData {
|
public class DeviceStatusData {
|
||||||
|
|
||||||
String deviceId;
|
String deviceId;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package org.nl.acs.ext.wms.liKuData;
|
package org.nl.acs.ext.wms.liKuData;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class DeviceStatusRequest {
|
public class DeviceStatusRequest {
|
||||||
|
|
||||||
String deviceId;
|
String deviceId;
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.nl.acs.ext.wms.liKuData;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class putEmptyPalletRequest {
|
||||||
|
|
||||||
|
String deviceId;
|
||||||
|
|
||||||
|
String orderId;
|
||||||
|
|
||||||
|
String type;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -55,5 +55,13 @@ public class LiKuToACSController {
|
|||||||
return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SaIgnore
|
||||||
|
@PostMapping("/putEmptyPallet")
|
||||||
|
@Log("请求放空盘")
|
||||||
|
@ApiOperation("请求放空盘")
|
||||||
|
public ResponseEntity<Object> putEmptyPallet(@RequestBody putEmptyPalletRequest requestParam) throws Exception {
|
||||||
|
return new ResponseEntity<>(liKuToAcsService.putEmptyPallet(requestParam), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public interface AcsToWmsService {
|
|||||||
HttpResponse applyOutCacheLineTask(JSONObject param);
|
HttpResponse applyOutCacheLineTask(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ACS系统申请出库任务
|
* 申请捆扎、贴标
|
||||||
*
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -29,4 +29,12 @@ public interface LiKuToAcsService {
|
|||||||
*/
|
*/
|
||||||
public Resp<MoveStoreReportResponse> moveStoreReport(MoveStoreReportRequest requestParam) throws Exception;
|
public Resp<MoveStoreReportResponse> moveStoreReport(MoveStoreReportRequest requestParam) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移库任务上报
|
||||||
|
* @param requestParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Resp<DeviceStatusResponse> putEmptyPallet(putEmptyPalletRequest requestParam) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService {
|
|||||||
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam) {
|
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam) {
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
log.info("queryTsjDeviceStatus-----输入参数{}", requestParam);
|
log.info("querySsxDeviceStatus-----输入参数{}", requestParam);
|
||||||
String api = addressService.findByCode("querySsxDeviceStatus").getMethods_url();
|
String api = addressService.findByCode("querySsxDeviceStatus").getMethods_url();
|
||||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||||
log.info("queryTsjDeviceStatus-----输出参数{}", result);
|
log.info("querySsxDeviceStatus-----输出参数{}", result);
|
||||||
return RespUtil.getResp(result, new DeviceStatusRequest());
|
return RespUtil.getResp(result, new DeviceStatusRequest());
|
||||||
} finally {
|
} finally {
|
||||||
MDC.remove(log_file_type);
|
MDC.remove(log_file_type);
|
||||||
|
|||||||
@@ -411,6 +411,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String url = wmsUrl + methods_url;
|
String url = wmsUrl + methods_url;
|
||||||
log.info("ApplyLabelingAndBindingRequest----请求参数{}", param);
|
log.info("ApplyLabelingAndBindingRequest----请求参数{}", param);
|
||||||
try {
|
try {
|
||||||
|
// String result = "";
|
||||||
String result = HttpRequest.post(url)
|
String result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device.address.service.AddressService;
|
import org.nl.acs.device.address.service.AddressService;
|
||||||
|
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.AcsUtil;
|
import org.nl.acs.ext.wms.AcsUtil;
|
||||||
import org.nl.acs.ext.wms.RespUtil;
|
import org.nl.acs.ext.wms.RespUtil;
|
||||||
import org.nl.acs.ext.wms.data.UpdateLKTaskRequest;
|
import org.nl.acs.ext.wms.data.UpdateLKTaskRequest;
|
||||||
@@ -15,8 +18,12 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
|
|||||||
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
|
import org.nl.acs.opc.Device;
|
||||||
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -260,4 +267,42 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//请求放空盘
|
||||||
|
@Override
|
||||||
|
public Resp<DeviceStatusResponse> putEmptyPallet(putEmptyPalletRequest requestParam) throws Exception {
|
||||||
|
try {
|
||||||
|
MDC.put(log_file_type, log_type);
|
||||||
|
log.info("请求放空盘-----输入参数{}", requestParam.toString());
|
||||||
|
String device_code = requestParam.getDeviceId();
|
||||||
|
String type = requestParam.getType();
|
||||||
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
Device device = appService.findDeviceByCode(device_code);
|
||||||
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("code", "0");
|
||||||
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
|
if(StrUtil.equals(type,"1")){
|
||||||
|
if(siemensConveyorDeviceDriver.getMode() ==2 && siemensConveyorDeviceDriver.getMove() ==0){
|
||||||
|
result.put("result", "true");
|
||||||
|
result.put("comment", "");
|
||||||
|
} else {
|
||||||
|
result.put("result", "false");
|
||||||
|
result.put("comment", "当前设备光电信号:"+siemensConveyorDeviceDriver.getMove()+",工作模式:"+siemensConveyorDeviceDriver.getMode());
|
||||||
|
}
|
||||||
|
} else if(StrUtil.equals(type,"2")){
|
||||||
|
siemensConveyorDeviceDriver.writing("to_command","3");
|
||||||
|
result.put("result", "true");
|
||||||
|
result.put("comment", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
log.info("请求放空盘-----输出参数{}", result);
|
||||||
|
return RespUtil.getResp(result.toString(), new DeviceStatusResponse());
|
||||||
|
} finally {
|
||||||
|
MDC.remove(log_file_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
response.setMessage("success");
|
response.setMessage("success");
|
||||||
response.setErrArr(errArr);
|
response.setErrArr(errArr);
|
||||||
log.info("createFromWms--------------:输出参数:" + response);
|
log.info("cancelFromWms--------------:输出参数:" + response);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_error) {
|
if (is_error) {
|
||||||
log.info("设备OPC数据同步配置异常");
|
log.info("设备OPC数据同步配置异常," + err_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OpcStartTag.is_run) {
|
if (!OpcStartTag.is_run) {
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ public class TaskFeedbackServiceImpl implements TaskFeedbackService {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
int status = body.getStatus();
|
int status = body.getStatus();
|
||||||
JSONObject jo = (JSONObject) JSONObject.toJSON(body.body());
|
|
||||||
|
|
||||||
dto.setTask_status(entity.getTask_status());
|
dto.setTask_status(entity.getTask_status());
|
||||||
if (status == 200) {
|
if (status == 200) {
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package org.nl.modules.quartz.task;
|
||||||
|
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.acs.agv.server.AgvService;
|
||||||
|
import org.nl.acs.agv.server.ZheDaAgvService;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.DeviceStatusRequest;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.DeviceStatusResponse;
|
||||||
|
import org.nl.acs.ext.wms.liKuData.Resp;
|
||||||
|
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||||
|
import org.nl.acs.instruction.service.InstructionService;
|
||||||
|
import org.nl.acs.instruction.service.dto.Instruction;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询立库设备状态
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class QueryLKDeviceStatus {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AcsToLiKuService acsToLiKuService;
|
||||||
|
|
||||||
|
|
||||||
|
public void run() throws Exception {
|
||||||
|
DeviceStatusRequest deviceStatusRequest = new DeviceStatusRequest();
|
||||||
|
deviceStatusRequest.setDeviceId("0");
|
||||||
|
Resp<DeviceStatusResponse> carResp = acsToLiKuService.queryCarDeviceStatus(deviceStatusRequest);
|
||||||
|
Resp<DeviceStatusResponse> ssxResp = acsToLiKuService.querySsxDeviceStatus(deviceStatusRequest);
|
||||||
|
Resp<DeviceStatusResponse> tsjResp = acsToLiKuService.queryTsjDeviceStatus(deviceStatusRequest);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
package org.nl.modules.quartz.task;
|
|
||||||
|
|
||||||
import cn.hutool.core.map.MapUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.http.HttpResponse;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nl.acs.agv.server.AgvService;
|
|
||||||
import org.nl.acs.agv.server.ZheDaAgvService;
|
|
||||||
import org.nl.acs.instruction.service.InstructionService;
|
|
||||||
import org.nl.acs.instruction.service.dto.Instruction;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询AGV任务状态
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class QueryZDAgvTaskStatus {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
InstructionService instructionService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
ZheDaAgvService agvService;
|
|
||||||
|
|
||||||
|
|
||||||
public void run() throws Exception {
|
|
||||||
HttpResponse response = agvService.queryAgvInstStatus("1");
|
|
||||||
//查询AGV指令列表
|
|
||||||
JSONArray inst_rows = JSONArray.parseArray(response.body());
|
|
||||||
for (int i = 0; i < inst_rows.size(); i++) {
|
|
||||||
JSONObject inst_jo = inst_rows.getJSONObject(i);
|
|
||||||
String inst_code = inst_jo.getString("task_code");
|
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
|
||||||
if (ObjectUtil.isEmpty(inst)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//反馈结果状态
|
|
||||||
log.info("instcode:" + inst_code + "," + inst_jo.toString());
|
|
||||||
|
|
||||||
String state = inst_jo.getString("state");
|
|
||||||
String vehicle = "";
|
|
||||||
//正在执行指令agv车号
|
|
||||||
if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) {
|
|
||||||
vehicle = inst_jo.getString("vehicle");
|
|
||||||
inst.setCarno(vehicle);
|
|
||||||
}
|
|
||||||
// RAW:初始状态
|
|
||||||
// ACTIVE:业务订单已激活
|
|
||||||
// DISPATCHABLE:业务订单已通过系统验证,等待被调度执行
|
|
||||||
// BEING_PROCESSED:业务订单正在被执行
|
|
||||||
// WITHDRAWN:业务订单已被撤销
|
|
||||||
// FINISHED:业务订单已完成
|
|
||||||
// FAILED:业务订单已失败
|
|
||||||
// UNROUTABLE:无法规划该业务订单的执行路线
|
|
||||||
|
|
||||||
//执行中
|
|
||||||
if ("BEING_PROCESSED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("1");
|
|
||||||
instructionService.update(inst);
|
|
||||||
}
|
|
||||||
} else if ("FINISHED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("2");
|
|
||||||
instructionService.finish(inst);
|
|
||||||
}
|
|
||||||
} else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("3");
|
|
||||||
instructionService.update(inst);
|
|
||||||
instructionService.removeByCodeFromCache(inst_jo.getString("task_code"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
JSONArray ja = inst_jo.getJSONArray("destinations");
|
|
||||||
for (int j = 0; j < ja.size(); j++) {
|
|
||||||
JSONObject jo = ja.getJSONObject(j);
|
|
||||||
JSONArray pro_rows = jo.getJSONArray("properties");
|
|
||||||
//Load 取货动作 Unload放货动作 Wait等待
|
|
||||||
String operation = jo.getString("operation");
|
|
||||||
String device = jo.getString("locationName");
|
|
||||||
for (int k = 0; k < pro_rows.size(); k++) {
|
|
||||||
JSONObject item = pro_rows.getJSONObject(k);
|
|
||||||
if ("True".equals(item.get("value"))) {
|
|
||||||
String param = item.get("key").toString();
|
|
||||||
//EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待
|
|
||||||
agvService.process(inst_code, param, device, operation, vehicle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HttpResponse response2 = agvService.queryAgvInstStatus("2");
|
|
||||||
//查询AGV指令列表
|
|
||||||
JSONArray inst_rows2 = JSONArray.parseArray(response2.body());
|
|
||||||
for (int i = 0; i < inst_rows2.size(); i++) {
|
|
||||||
JSONObject inst_jo = inst_rows2.getJSONObject(i);
|
|
||||||
String inst_code = inst_jo.getString("task_code");
|
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
|
||||||
if (ObjectUtil.isEmpty(inst)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//反馈结果状态
|
|
||||||
log.info("instcode:" + inst_code + "," + inst_jo.toString());
|
|
||||||
|
|
||||||
String state = inst_jo.getString("state");
|
|
||||||
String vehicle = "";
|
|
||||||
//正在执行指令agv车号
|
|
||||||
if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) {
|
|
||||||
vehicle = inst_jo.getString("vehicle");
|
|
||||||
inst.setCarno(vehicle);
|
|
||||||
}
|
|
||||||
// RAW:初始状态
|
|
||||||
// ACTIVE:业务订单已激活
|
|
||||||
// DISPATCHABLE:业务订单已通过系统验证,等待被调度执行
|
|
||||||
// BEING_PROCESSED:业务订单正在被执行
|
|
||||||
// WITHDRAWN:业务订单已被撤销
|
|
||||||
// FINISHED:业务订单已完成
|
|
||||||
// FAILED:业务订单已失败
|
|
||||||
// UNROUTABLE:无法规划该业务订单的执行路线
|
|
||||||
|
|
||||||
//执行中
|
|
||||||
if ("BEING_PROCESSED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("1");
|
|
||||||
instructionService.update(inst);
|
|
||||||
}
|
|
||||||
} else if ("FINISHED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("2");
|
|
||||||
instructionService.finish(inst);
|
|
||||||
}
|
|
||||||
} else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) {
|
|
||||||
if (inst != null) {
|
|
||||||
inst.setInstruction_status("3");
|
|
||||||
instructionService.update(inst);
|
|
||||||
instructionService.removeByCodeFromCache(inst_jo.getString("task_code"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
JSONArray ja = inst_jo.getJSONArray("destinations");
|
|
||||||
for (int j = 0; j < ja.size(); j++) {
|
|
||||||
JSONObject jo = ja.getJSONObject(j);
|
|
||||||
JSONArray pro_rows = jo.getJSONArray("properties");
|
|
||||||
//Load 取货动作 Unload放货动作 Wait等待
|
|
||||||
String operation = jo.getString("operation");
|
|
||||||
String device = jo.getString("locationName");
|
|
||||||
for (int k = 0; k < pro_rows.size(); k++) {
|
|
||||||
JSONObject item = pro_rows.getJSONObject(k);
|
|
||||||
if ("True".equals(item.get("value"))) {
|
|
||||||
String param = item.get("key").toString();
|
|
||||||
//EntryRequired是否进入前等待 PauseOnStation是否离开等待 Wait在该点进行等待
|
|
||||||
agvService.process(inst_code, param, device, operation, vehicle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,11 +6,14 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_one_wcs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
# password: ${DB_PWD:P@ssw0rd}
|
# password: ${DB_PWD:P@ssw0rd}
|
||||||
password: ${DB_PWD:Root.123456}
|
# password: ${DB_PWD:Root.123456}
|
||||||
|
password: ${DB_PWD:123456}
|
||||||
|
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
# 最小连接数
|
# 最小连接数
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
# 初始连接数
|
# 初始连接数
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
repositories:
|
repositories:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
#配置 Jpa
|
#配置 Jpa
|
||||||
jpa:
|
jpa:
|
||||||
hibernate:
|
hibernate:
|
||||||
@@ -17,7 +18,7 @@ spring:
|
|||||||
properties:
|
properties:
|
||||||
hibernate:
|
hibernate:
|
||||||
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||||
|
enable_lazy_load_no_trans: true
|
||||||
task:
|
task:
|
||||||
pool:
|
pool:
|
||||||
# 核心线程池大小
|
# 核心线程池大小
|
||||||
@@ -43,13 +44,37 @@ rsa:
|
|||||||
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||||
logging:
|
logging:
|
||||||
file:
|
file:
|
||||||
path: C:\logs\nlacs\
|
path: C:\log\wms
|
||||||
demo:
|
config: classpath:logback-spring.xml
|
||||||
monitor:
|
# sa-token白名单配置
|
||||||
server-url: https://www.demo-monitor.com
|
security:
|
||||||
username: MessiLoveRidingBike
|
# 排除路径
|
||||||
password: 123456
|
excludes:
|
||||||
|
# 认证
|
||||||
acsTowms:
|
- /auth/login
|
||||||
token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2ZjI2OGMxZjAyOTE0MTNiOWU3YThmMTM2ZTc2MWJkYSIsImF1dGgiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.lKxY3Wc_efzmBXXAS_dDC_Sfh32kZInxYmaxBzg83e5gviSJPPKolNt4IlCCaGM8HOc_yKByiIu8YFlgQif01Q
|
- /auth/code
|
||||||
|
- /auth/logout
|
||||||
|
# swagger
|
||||||
|
- /swagger-ui.html
|
||||||
|
- /swagger-resources/**
|
||||||
|
- /webjars/**
|
||||||
|
- /file/**
|
||||||
|
- /webSocket/**
|
||||||
|
# 静态资源
|
||||||
|
- /*.html
|
||||||
|
- /**/*.html
|
||||||
|
- /**/*.css
|
||||||
|
- /**/*.js
|
||||||
|
# swagger 文档配置
|
||||||
|
- /favicon.ico
|
||||||
|
- /*/api-docs
|
||||||
|
- /*/api-docs/**
|
||||||
|
# druid 监控配置
|
||||||
|
- /druid/**
|
||||||
|
# actuator 监控配置
|
||||||
|
- /actuator
|
||||||
|
- /actuator/**
|
||||||
|
# 上传
|
||||||
|
- /api/localStorage/pictures
|
||||||
|
# 参数
|
||||||
|
- /api/param/getValueByCode
|
||||||
|
|||||||
32
acs/nladmin-system/src/main/resources/log/AcsToWms.xml
Normal file
32
acs/nladmin-system/src/main/resources/log/AcsToWms.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||||
|
<property name="LOG_HOME" value="${logPath}"/>
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE8" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>15</maxHistory>
|
||||||
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
<maxFileSize>200MB</maxFileSize>
|
||||||
|
<!--所有日志最多占多大容量-->
|
||||||
|
<totalSizeCap>2GB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
<!-- 打印sql -->
|
||||||
|
<logger name="org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE8"/>
|
||||||
|
</logger>
|
||||||
|
</included>
|
||||||
31
acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml
Normal file
31
acs/nladmin-system/src/main/resources/log/AutoCreateInst.xml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||||
|
<property name="LOG_HOME" value="${logPath}"/>
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE3" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/自动创建指令/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>15</maxHistory>
|
||||||
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
<maxFileSize>200MB</maxFileSize>
|
||||||
|
<!--所有日志最多占多大容量-->
|
||||||
|
<totalSizeCap>2GB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
<!-- 打印sql -->
|
||||||
|
<logger name="org.nl.modules.quartz.task.AutoCreateInst" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>
|
||||||
|
</included>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||||
|
<property name="LOG_HOME" value="${logPath}"/>
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE10" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/一楼NDC系统/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>15</maxHistory>
|
||||||
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
<maxFileSize>200MB</maxFileSize>
|
||||||
|
<!--所有日志最多占多大容量-->
|
||||||
|
<totalSizeCap>2GB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
<!-- 打印sql -->
|
||||||
|
<logger name="org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE10"/>
|
||||||
|
</logger>
|
||||||
|
</included>
|
||||||
32
acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml
Normal file
32
acs/nladmin-system/src/main/resources/log/ScannerBarcode.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||||
|
<property name="LOG_HOME" value="${logPath}"/>
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE11" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/扫码记录/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>15</maxHistory>
|
||||||
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
<maxFileSize>200MB</maxFileSize>
|
||||||
|
<!--所有日志最多占多大容量-->
|
||||||
|
<totalSizeCap>2GB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
<!-- 打印sql -->
|
||||||
|
<logger name="org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE11"/>
|
||||||
|
</logger>
|
||||||
|
</included>
|
||||||
32
acs/nladmin-system/src/main/resources/log/WmsToAcs.xml
Normal file
32
acs/nladmin-system/src/main/resources/log/WmsToAcs.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<included>
|
||||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||||
|
<property name="LOG_HOME" value="${logPath}"/>
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE9" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名-->
|
||||||
|
<FileNamePattern>${LOG_HOME}/WMS下发ACS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数-->
|
||||||
|
<maxHistory>15</maxHistory>
|
||||||
|
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||||
|
<maxFileSize>200MB</maxFileSize>
|
||||||
|
<!--所有日志最多占多大容量-->
|
||||||
|
<totalSizeCap>2GB</totalSizeCap>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE3"/>
|
||||||
|
</logger>-->
|
||||||
|
|
||||||
|
<!-- 打印sql -->
|
||||||
|
<logger name="org.nl.acs.ext.wms.service.impl.WmsToAcsServiceImpl" level="info" additivity="false">
|
||||||
|
<appender-ref ref="FILE9"/>
|
||||||
|
</logger>
|
||||||
|
</included>
|
||||||
@@ -29,8 +29,9 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<include resource="log/AcsToWms.xml"/>
|
<include resource="log/AcsToWms.xml"/>
|
||||||
<include resource="log/WmsToAcs.xml"/>
|
<include resource="log/WmsToAcs.xml"/>
|
||||||
<include resource="log/QueryXZAgvTaskStatus.xml"/>
|
<include resource="log/QueryXZAgvTaskStatus.xml"/>
|
||||||
<include resource="log/NDCSocketConnectionAutoRun.xml"/>-->
|
-->
|
||||||
<!-- <include resource="log/QueryMagicAgvDeviceStatus.xml"/>-->
|
<!-- <include resource="log/QueryMagicAgvDeviceStatus.xml"/>-->
|
||||||
|
<include resource="log/OneNDCSocketConnectionAutoRun.xml"/>
|
||||||
|
|
||||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
@@ -87,6 +88,7 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
<appender-ref ref="lokiAppender" />
|
||||||
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
</root>
|
</root>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default {
|
|||||||
this.timmer = setTimeout(() => {
|
this.timmer = setTimeout(() => {
|
||||||
sessionStorage.clear()
|
sessionStorage.clear()
|
||||||
this.logout()
|
this.logout()
|
||||||
}, 1000 * 60 * 15) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
|
}, 1000 * 60 * 60) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user