Merge remote-tracking branch 'origin/master'

This commit is contained in:
2023-12-06 16:07:11 +08:00
140 changed files with 1871 additions and 887 deletions

View File

@@ -443,6 +443,26 @@
<version>${commons-csv.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -13,9 +13,9 @@ import org.nl.acs.agv.AgvUtil;
import org.nl.acs.agv.server.MagicAgvService;
import org.nl.acs.agv.server.dto.AgvDto;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
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.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;

View File

@@ -12,7 +12,7 @@ import org.nl.acs.agv.AgvUtil;
import org.nl.acs.agv.server.ZheDaAgvService;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;

View File

@@ -6,7 +6,7 @@ import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver;
import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
@@ -71,6 +71,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
return "NDC在线连接";
}
@Override
public void autoRun() throws IOException {
System.out.println("NDCAgv链接开始");
ISysParamService ISysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);

View File

@@ -3,7 +3,7 @@ package org.nl.acs.common;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver;
import org.springframework.stereotype.Service;
/**

View File

@@ -3,7 +3,7 @@ package org.nl.acs.common;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.springframework.stereotype.Service;
/**

View File

@@ -2,7 +2,7 @@ package org.nl.acs.common;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.springframework.stereotype.Service;
/**

View File

@@ -2,7 +2,7 @@ package org.nl.acs.common;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.springframework.stereotype.Service;
/**

View File

@@ -1,6 +1,5 @@
package org.nl.acs.device.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -41,15 +40,15 @@ import org.nl.acs.device.service.DeviceDriverDefinationAppService;
import org.nl.acs.device.service.DeviceExtraService;
import org.nl.acs.device_driver.DeviceDriverDefination;
import org.nl.acs.device_driver.ScannerDeviceDriver;
import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver;
import org.nl.acs.device_driver.basedriver.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_scanner.StandardScannerDeviceDriver;
import org.nl.acs.device_driver.conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver;
import org.nl.acs.device_driver.conveyor.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.scanner.standard_scanner.StandardScannerDeviceDriver;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.nl.acs.device.service.dto.DeviceRunpointDto;
import org.nl.acs.opc.DeviceAppService;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.magic_agv;
package org.nl.acs.device_driver.agv.magic_agv;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.magic_agv;
package org.nl.acs.device_driver.agv.magic_agv;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.ndcone;
package org.nl.acs.device_driver.agv.ndcone;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;

View File

@@ -1,6 +1,5 @@
package org.nl.acs.device_driver.basedriver.agv.ndcone;
package org.nl.acs.device_driver.agv.ndcone;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
@@ -13,28 +12,21 @@ import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.FeedLmsRealFailed;
import org.nl.acs.device_driver.basedriver.agv.utils.OneAgvPhase;
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_storage.StandardStorageDeviceDriver;
import org.nl.acs.device_driver.agv.utils.OneAgvPhase;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.ext.wms.data.one.BaseRequest;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.impl.InstructionServiceImpl;
import org.nl.acs.log.LokiLog;
import org.nl.acs.log.LokiLogType;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.system.service.param.ISysParamService;
import org.nl.config.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import java.util.ArrayList;
import java.util.HashMap;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.ndctwo;
package org.nl.acs.device_driver.agv.ndctwo;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.ndctwo;
package org.nl.acs.device_driver.agv.ndctwo;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -9,8 +9,8 @@ import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
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.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.utils;
package org.nl.acs.device_driver.agv.utils;
public interface IAgv {
String getPhaseName(Integer phase);

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.utils;
package org.nl.acs.device_driver.agv.utils;
import org.springframework.stereotype.Service;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.utils;
package org.nl.acs.device_driver.agv.utils;
import org.springframework.stereotype.Service;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.xg_agv;
package org.nl.acs.device_driver.agv.xg_agv;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.xg_agv;
package org.nl.acs.device_driver.agv.xg_agv;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.agv.xg_agv;
package org.nl.acs.device_driver.agv.xg_agv;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -13,11 +13,10 @@ import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.enums.InstructionStatusEnum;
import org.nl.acs.utils.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_autodoor;
package org.nl.acs.device_driver.autodoor.standard_autodoor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_autodoor;
package org.nl.acs.device_driver.autodoor.standard_autodoor;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_autodoor;
package org.nl.acs.device_driver.autodoor.standard_autodoor;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;

View File

@@ -1,227 +0,0 @@
package org.nl.acs.device_driver.basedriver.led_screen;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.config.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
* LED点阵屏
*/
@Slf4j
@Data
@RequiredArgsConstructor
public class LedScreenDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@Autowired
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
@Autowired
DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl");
@Autowired
RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl");
@Autowired
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
@Autowired
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
@Autowired
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
@Autowired
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
Integer hasGoods = 0;
int error = 0;
Boolean iserror = false;
Boolean islock = false;
int branchProtocol = 0;
int last_branchProtocol = 0;
//是否需要输入物料
String input_material = "0";
//备注
String remark = "";
//数量
String qty = "";
//批次
String batch = "";
//物料
String material = "";
//目标点位
String purpose = "";
//当前指令
Instruction inst = null;
//上次指令
Instruction last_inst = null;
boolean requireSucess = false;
//触摸屏手动触发任务
private Boolean is_has_task = false;
//申请搬运任务
private Boolean apply_handling = false;
//申请物料
private Boolean apply_material = false;
// 1取货完成 2放货完成 3进入区域 4离开区域
private int flag;
//人工确认信号 默认0 agv到达后请求置1 等人工确认后变为2 反馈agv后继续为0
private int manua_confirm = 0;
String device_code = null;
String container;
String container_type_desc;
String last_container_type_desc;
String last_container;
private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date();
private int instruction_require_time_out;
String message;
// 1 上位系统允许进入 2 上位系统允许离开
int status = 0;
int agvphase = 0;
int index = 0;
int mode = 2;
int move;
@Override
public void execute() {
hasGoods = this.getDevice().getHas_goods();
batch = this.getDevice().getBatch();
device_code = this.getDeviceCode();
if (agvphase == 0x03) {
if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("1");
instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
agvphase = 0;
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
}
}
if (agvphase == 0x05) {
if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("2");
instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0;
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
}
}
if (agvphase == 0x07) {
if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("5");
instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0;
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
}
}
if (agvphase == 0x09) {
if (ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status("6");
instructionService.update(inst);
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
// OneNDCSocketConnectionAutoRun.write(data);
agvphase = 0;
index = 0;
inst = null;
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功");
} else {
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈");
}
}
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String action = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
}
if (this.getMove() == 0) {
move = "无货";
jo.put("hasGoods", false);
} else if (this.getMove() == 1) {
move = "有货";
jo.put("hasGoods", true);
} else if (this.getMove() == 2) {
move = "有托盘有货";
jo.put("hasGoods", true);
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", true);
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.belt_conveyor;
package org.nl.acs.device_driver.conveyor.belt_conveyor;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.belt_conveyor;
package org.nl.acs.device_driver.conveyor.belt_conveyor;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -6,7 +6,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
@@ -26,7 +25,6 @@ import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.task.domain.Task;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.config.SpringContextHolder;
@@ -300,7 +298,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
public void writing(int command) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command;
+ "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command;
Map<String, Object> itemMap = new HashMap<String, Object>();
this.control(itemMap);
@@ -389,6 +387,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
//查找有没有对应的指令
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
if (ObjectUtil.isNotNull(inst) && "1".equals(inst.getInstruction_type())) {
List<RouteLineDto> routeLineDtos = routeLineService.selectDeviceCodeList(this.device_code);
if (routeLineDtos.size() < 1) {
return false;
}
int i = 0;
for (RouteLineDto routeLineDto : routeLineDtos) {
if (routeLineDto.getNext_device_code().equals(inst.getNext_device_code())) {
i++;
}
}
if (i == 0) {
return false;
}
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
String next_addr = nextdevice.getExtraValue().get("address").toString();
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
@@ -485,7 +496,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
instructionService.create(instdto);
} catch (Exception e) {
e.printStackTrace();
log.error("指令创建失败!", e.getMessage());
log.error("指令创建失败!,{}", e.getMessage());
return false;
}
taskdto.setTask_status("1");

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.belt_conveyor;
package org.nl.acs.device_driver.conveyor.belt_conveyor;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.belt_conveyor;
package org.nl.acs.device_driver.conveyor.belt_conveyor;
import lombok.AllArgsConstructor;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator;
package org.nl.acs.device_driver.conveyor.box_palletizing_manipulator;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator;
package org.nl.acs.device_driver.conveyor.box_palletizing_manipulator;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.box_palletizing_manipulator;
package org.nl.acs.device_driver.conveyor.box_palletizing_manipulator;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.double_station_stacker;
package org.nl.acs.device_driver.conveyor.double_station_stacker;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.double_station_stacker;
package org.nl.acs.device_driver.conveyor.double_station_stacker;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
@@ -20,10 +20,10 @@ import org.nl.acs.device.service.DeviceExtraService;
import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.double_station_stacker.enums.CommandEnum;
import org.nl.acs.device_driver.basedriver.double_station_stacker.enums.SortEnum;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.double_station_stacker.enums.CommandEnum;
import org.nl.acs.device_driver.conveyor.double_station_stacker.enums.SortEnum;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.instruction.domain.Instruction;
@@ -578,7 +578,7 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im
//根据排序进行加减
String nextPointCodeDown = splitFront[0] + "-" + (Integer.parseInt(splitFront[1]) - 1) + "-" + splitFront[2];
String nextPointCodeUp = splitFront[0] + "-" + (Integer.parseInt(splitFront[1]) + 1) + "-" + splitFront[2];
if (CollectionUtil.isNotEmpty(sort)&&SortEnum.BACK.getCode().equals(sort.get(0).getExtra_value())){
if (CollectionUtil.isNotEmpty(sort)&& SortEnum.BACK.getCode().equals(sort.get(0).getExtra_value())){
nextPointCodeDown = splitFront[0] + "-" + (Integer.parseInt(splitFront[1]) + 1) + "-" + splitFront[2];
nextPointCodeUp = splitFront[0] + "-" + (Integer.parseInt(splitFront[1]) - 1) + "-" + splitFront[2];
}

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.double_station_stacker;
package org.nl.acs.device_driver.conveyor.double_station_stacker;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -2,11 +2,10 @@
* @author ls
* @date 2023/12/4 13:42
*/
package org.nl.acs.device_driver.basedriver.double_station_stacker.enums;
package org.nl.acs.device_driver.conveyor.double_station_stacker.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.nl.acs.task.enums.TaskStatusEnum;
@Getter
@AllArgsConstructor

View File

@@ -2,7 +2,7 @@
* @author ls
* @date 2023/12/4 17:43
*/
package org.nl.acs.device_driver.basedriver.double_station_stacker.enums;
package org.nl.acs.device_driver.conveyor.double_station_stacker.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_conveyor;
package org.nl.acs.device_driver.conveyor.hongxiang_conveyor;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_conveyor;
package org.nl.acs.device_driver.conveyor.hongxiang_conveyor;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_conveyor;
package org.nl.acs.device_driver.conveyor.hongxiang_conveyor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_device;
package org.nl.acs.device_driver.conveyor.hongxiang_device;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_device;
package org.nl.acs.device_driver.conveyor.hongxiang_device;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.hongxiang_device;
package org.nl.acs.device_driver.conveyor.hongxiang_device;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.lnsh_station;
package org.nl.acs.device_driver.conveyor.lnsh_station;
import cn.hutool.core.util.StrUtil;
import lombok.Getter;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.lnsh_station;
package org.nl.acs.device_driver.conveyor.lnsh_station;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,14 +1,12 @@
package org.nl.acs.device_driver.basedriver.lnsh_station;
package org.nl.acs.device_driver.conveyor.lnsh_station;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.jinterop.dcom.common.JIException;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
@@ -18,9 +16,6 @@ import org.nl.acs.device_driver.StandardRequestMethod;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusResponse;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
@@ -31,9 +26,6 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.config.SpringContextHolder;
import org.nl.system.service.lucene.LuceneExecuteLogService;
import org.nl.system.service.lucene.dto.LuceneLogDto;
import org.openscada.opc.lib.da.AddFailedException;
import org.openscada.opc.lib.da.Server;
import java.lang.reflect.Method;
import java.util.*;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
package org.nl.acs.device_driver.conveyor.oven_manipulator;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
package org.nl.acs.device_driver.conveyor.oven_manipulator;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
package org.nl.acs.device_driver.conveyor.oven_manipulator;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -8,12 +8,11 @@ import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Lang;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.oven_manipulator;
package org.nl.acs.device_driver.conveyor.oven_manipulator;
import java.text.DecimalFormat;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
package org.nl.acs.device_driver.conveyor.plug_pull_device_site;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
package org.nl.acs.device_driver.conveyor.plug_pull_device_site;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.plug_pull_device_site;
package org.nl.acs.device_driver.conveyor.plug_pull_device_site;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor;
package org.nl.acs.device_driver.conveyor.siemens_conveyor;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor;
package org.nl.acs.device_driver.conveyor.siemens_conveyor;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;
@@ -44,7 +44,7 @@ public class SiemensConveyorDefination implements OpcDeviceDriverDefination {
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList();
types.add(DeviceType.station);
types.add(DeviceType.conveyor);
return types;
}

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor;
package org.nl.acs.device_driver.conveyor.siemens_conveyor;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -406,33 +406,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
//String opcservcerid = this.getDevice().getOpc_server_id();
//Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, Integer.parseInt(value));
// itemMap.put(to_param, Integer.parseInt(value));
this.control(itemMap);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
}
public void executing(Server server, Map<String, Object> itemMap) {
this.control(itemMap);
}
public void writing(int command) {
//String opcservcerid = this.getDevice().getOpc_server_id();
//Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
this.control(itemMap);
}
@Override
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
@@ -513,8 +490,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
public void writing(List list) {
// String opcservcerid = this.getDevice().getOpc_server_id();
// Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
for (int i = 0; i < list.size(); i++) {
Object ob = list.get(i);
@@ -526,7 +501,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
this.control(itemMap);
try {
this.checkcontrol(itemMap);
} catch (Exception e) {
e.printStackTrace();
try{
this.checkcontrol(itemMap);
} catch (Exception e1){
e1.printStackTrace();
}
}
}
@@ -575,11 +559,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
map3.put("value", "1");
list.add(map3);
this.writing(list);
// if (task != Integer.parseInt(inst.getInstruction_code())) {
// this.writing(list);
// message = "重新下发电气信号";
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
// }
message = "下发电气任务号成功";
requireSucess = true;
return true;
@@ -682,11 +661,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
map3.put("value", "1");
list.add(map3);
this.writing(list);
// if (task != Integer.parseInt(inst.getInstruction_code())) {
// this.writing(list);
// message = "重新下发电气信号";
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
// }
} else {
//如果不存在则直接找对应指令
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
@@ -714,10 +688,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
map3.put("value", "1");
list.add(map3);
this.writing(list);
if (task != Integer.parseInt(inst.getInstruction_code())) {
this.writing(list);
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
}
}
return true;
}
@@ -853,8 +823,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
map5.put("value", "4");
list.add(map5);
this.writing(list);
// this.writing(list);
message = "申请捆扎成功";
requireSucess = true;
} else {

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_ckk;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_ckk;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_ckk;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_labeling;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_labeling;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling;
package org.nl.acs.device_driver.conveyor.siemens_conveyor_labeling;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.slit_two_manipulator;
package org.nl.acs.device_driver.conveyor.slit_two_manipulator;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.slit_two_manipulator;
package org.nl.acs.device_driver.conveyor.slit_two_manipulator;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.slit_two_manipulator;
package org.nl.acs.device_driver.conveyor.slit_two_manipulator;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -13,7 +13,7 @@ import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -352,11 +352,11 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
public void writing(int command, int target, int task) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command;
+ "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_command;
String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target;
+ "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_target;
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task;
+ "." + org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.ItemProtocol.item_to_task;
//String opcservcerid = this.getDevice().getOpc_server_id();
//Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_plcscanner;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_plcscanner;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_plcscanner;
public class StandardConveyorWithPlcScannerConfig {
public static String relation_scanner = "link_scanner";

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_plcscanner;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner;
import cn.hutool.core.util.StrUtil;
import lombok.Data;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner;
public class StandardConveyorWithScannerConfig {
public static String relation_scanner = "link_scanner";

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner;
package org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_inspect_site;
package org.nl.acs.device_driver.conveyor.standard_inspect_site;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_inspect_site;
package org.nl.acs.device_driver.conveyor.standard_inspect_site;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_inspect_site;
package org.nl.acs.device_driver.conveyor.standard_inspect_site;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -10,11 +10,9 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RequestMethodEnum;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.one.feedBackTaskStatus.FeedBackTaskStatusRequest;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_ordinary_site;
package org.nl.acs.device_driver.conveyor.standard_ordinary_site;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.DeviceDriver;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_ordinary_site;
package org.nl.acs.device_driver.conveyor.standard_ordinary_site;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.led_screen;
package org.nl.acs.device_driver.led.led_screen;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.DeviceType;

View File

@@ -0,0 +1,35 @@
package org.nl.acs.device_driver.led.led_screen;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.monitor.DeviceStageMonitor;
/**
* LED点阵屏
* @author 涂强
*/
@Slf4j
@Data
@RequiredArgsConstructor
public class LedScreenDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
@Override
public void execute() {
}
@Override
public JSONObject getDeviceStatusName() throws Exception {
return null;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
}

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_scanner;
package org.nl.acs.device_driver.scanner.standard_scanner;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.DeviceDriver;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_scanner;
package org.nl.acs.device_driver.scanner.standard_scanner;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_stacker;
package org.nl.acs.device_driver.stacker.standard_stacker;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_stacker;
package org.nl.acs.device_driver.stacker.standard_stacker;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,22 +1,20 @@
package org.nl.acs.device_driver.basedriver.standard_stacker;
package org.nl.acs.device_driver.stacker.standard_stacker;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.domain.DeviceExtra;
import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.device.service.DeviceExtraService;
import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.instruction.domain.Instruction;
@@ -622,13 +620,13 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
map.put("to_task", inst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x"))) {
map.put("to_x", startDevice.getExtraValue().get("x"));
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z")) ) {
map.put("to_x", startDevice.getExtraValue().get("z"));
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
map.put("to_z", startDevice.getExtraValue().get("z"));
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x")) ) {
map.put("to_z", startDevice.getExtraValue().get("x"));
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y"))) {
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y")) ) {
map.put("to_y", startDevice.getExtraValue().get("y"));
}
}

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_storage;
package org.nl.acs.device_driver.storage.standard_storage;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.DeviceDriver;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.standard_storage;
package org.nl.acs.device_driver.storage.standard_storage;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.lamp_three_color;
package org.nl.acs.device_driver.three_color.lamp_three_color;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.lamp_three_color;
package org.nl.acs.device_driver.three_color.lamp_three_color;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;

View File

@@ -1,4 +1,4 @@
package org.nl.acs.device_driver.basedriver.lamp_three_color;
package org.nl.acs.device_driver.three_color.lamp_three_color;
import lombok.Data;
import lombok.RequiredArgsConstructor;

View File

@@ -7,9 +7,8 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.address.service.AddressService;
import org.nl.acs.address.service.AddressService;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.ext.wms.RespUtil;
import org.nl.acs.ext.wms.liKuData.*;
import org.nl.acs.ext.wms.service.AcsToLiKuService;

View File

@@ -154,4 +154,12 @@ public class InstructionController {
instructionService.init(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/downloadInstLogging")
@Log("导出指令记录")
@ApiOperation("导出指令记录")
//@PreAuthorize("@el.check('task:list')")
public void downloadInstLogging(HttpServletResponse response,@RequestParam Map whereJson) throws IOException {
instructionService.downloadInstLogging(instructionService.getInstList(whereJson), response);
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.instruction.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.instruction.domain.InstructionMybatis;
import org.nl.acs.instruction.service.dto.InstructionDto;
import org.nl.acs.instruction.service.dto.InstructionQueryParam;
@@ -327,5 +328,21 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
* @param instruction1
* @return
*/
List<Instruction> findByDeviceCodes(Instruction instruction1, Boolean flay);
/**
* 根据条件查询指令
* @param whereJson
* @return
*/
List<JSONObject> getInstList(Map whereJson);
/**
* 导出指令记录
* @param instList
* @param response
*/
void downloadInstLogging(List<JSONObject> instList, HttpServletResponse response) throws IOException;
}

View File

@@ -26,15 +26,14 @@ import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.impl.DeviceServiceImpl;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.DeviceDriverDefination;
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.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.ext.wms.liKuData.*;
import org.nl.acs.ext.wms.service.AcsToLiKuService;
import org.nl.acs.instruction.domain.InstructionMybatis;
import org.nl.acs.instruction.enums.InstructionStatusEnum;
import org.nl.acs.instruction.service.SortUtlEx;
import org.nl.acs.instruction.service.dto.InstructionDto;
import org.nl.acs.instruction.service.dto.InstructionQueryParam;
import org.nl.acs.opc.DeviceAppService;
@@ -1607,4 +1606,80 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
List<Instruction> instructions = ConvertUtil.convertList(instructionMybatis, Instruction.class);*/
return instructionList;
}
@Override
public List<JSONObject> getInstList(Map whereJson) {
String task_code = (String) whereJson.get("code");
String vehicle_code = (String) whereJson.get("vehicle_code");
String material_type = (String) whereJson.get("material_type");
String status = (String) whereJson.get("status");
String point_code = (String) whereJson.get("point_code");
String create_time = (String) whereJson.get("createTime");
String end_time = (String) whereJson.get("end_time");
LambdaQueryWrapper<InstructionMybatis> wrapper = new LambdaQueryWrapper<>();
if (!StrUtil.isEmpty(task_code)) {
wrapper.and(instructionMybatis -> instructionMybatis.like(InstructionMybatis::getInstruction_code, task_code).or().like(InstructionMybatis::getTask_code, task_code));
}
if (!StrUtil.isEmpty(vehicle_code)) {
wrapper.like(InstructionMybatis::getVehicle_code, vehicle_code);
}
if (!StrUtil.isEmpty(material_type)) {
wrapper.eq(InstructionMybatis::getMaterial, material_type);
}
if (!StrUtil.isEmpty(status)) {
wrapper.eq(InstructionMybatis::getInstruction_status, status);
}
if (!StrUtil.isEmpty(point_code)) {
wrapper.and(task -> task.like(InstructionMybatis::getStart_point_code, point_code).or().like(InstructionMybatis::getNext_point_code, point_code));
}
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
wrapper.between(InstructionMybatis::getCreate_time, create_time, end_time);
}
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(wrapper);
List<JSONObject> array = new ArrayList<>();
if(instructionMybatis.size() > 0){
for (InstructionMybatis inst : instructionMybatis) {
JSONObject ins = new JSONObject();
ins.put("instruction_code", inst.getInstruction_code());
ins.put("task_code", inst.getTask_code());
ins.put("vehicle_code", inst.getVehicle_code());
ins.put("task_status", inst.getInstruction_status());
ins.put("start_point_code", inst.getStart_point_code());
ins.put("next_point_code", inst.getNext_point_code());
ins.put("matarial", inst.getMaterial());
ins.put("quantity", inst.getQuantity());
ins.put("remark", inst.getRemark());
ins.put("create_by", inst.getCreate_by());
ins.put("create_time", inst.getCreate_time());
ins.put("update_by", inst.getUpdate_by());
ins.put("update_time", inst.getUpdate_time());
array.add(ins);
}
}
return array;
}
@Override
public void downloadInstLogging(List<JSONObject> instList, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (JSONObject jsonObject : instList) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("指令编码", jsonObject.getString("instruction_code"));
map.put("任务号", jsonObject.getString("task_code"));
map.put("载具号", jsonObject.getString("vehicle_code"));
map.put("指令状态", jsonObject.getString("task_status"));
map.put("起点", jsonObject.getString("start_point_code"));
map.put("终点", jsonObject.getString("next_point_code"));
map.put("物料", jsonObject.getString("matarial"));
map.put("数量", jsonObject.getString("quantity"));
map.put("备注", jsonObject.getString("remark"));
map.put("创建者", jsonObject.getString("create_by"));
map.put("创建时间", jsonObject.getString("create_time"));
map.put("修改者", jsonObject.getString("update_by"));
map.put("修改时间", jsonObject.getString("update_time"));
list.add(map);
}
FileUtil.downloadExcel(list, response);
}
}

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alicp.jetcache.anno.method.SpringCacheContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.bag.SynchronizedSortedBag;
import org.nl.acs.opc.service.dto.OpcServerManageDto;
import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAccessorFactory;
@@ -424,7 +425,17 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb});
// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb});
} else {
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
if(his instanceof int[]){
if(!Arrays.equals((long[]) his, (long[]) value)){
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
} else if(his instanceof String){
if(!StrUtil.equals((CharSequence) his, (CharSequence) value)){
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
} else {
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value});
}
// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value});
}
}

View File

@@ -8,8 +8,9 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum AgvSystemTypeEnum {
NDC_System_Type("1", "NDC_System_Type", "NDC系统"),
XG_System_Type("2", "XG_System_Type", "仙工系统");
One_NDC_System_Type("1", "1", "一期1楼叉车NDC系统"),
Two_NDC_System_Type("2", "2", "一期2楼NDC系统"),
XG_System_Type("3", "3", "仙工AGV系统");
//索引
private String index;

Some files were not shown because too many files have changed in this diff Show More