This commit is contained in:
2022-12-01 09:15:20 +08:00
9 changed files with 206 additions and 108 deletions

View File

@@ -45,21 +45,21 @@
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi</artifactId>-->
<!-- <version>4.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>4.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml-schemas</artifactId>-->
<!-- <version>4.0.0</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>org.openscada.jinterop</groupId>
<artifactId>org.openscada.jinterop.core</artifactId>
@@ -341,16 +341,16 @@
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi</artifactId>-->
<!-- <version>3.17</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.poi</groupId>-->
<!-- <artifactId>poi-ooxml</artifactId>-->
<!-- <version>3.17</version>-->
<!-- </dependency>-->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>

View File

@@ -182,7 +182,7 @@ public class TwoNDC2SocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("未找到指令号{}对应的指令", ikey);
break;
}
instructionService.cancel(inst.getInstruction_id());
instructionService.cancelNOSendAgv(inst.getInstruction_id());
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
//上报异常信息

View File

@@ -184,7 +184,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("未找到指令号{}对应的指令", ikey);
break;
}
instructionService.cancel(inst.getInstruction_id());
instructionService.cancelNOSendAgv(inst.getInstruction_id());
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
//上报异常信息

View File

@@ -1590,16 +1590,23 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
Integer deviceCode = device_code + i;
for (int j = 0; j <= rss.size(); j++) {
Map<String,Object> map = new ListOrderedMap<>();
if (j == rss.size()){
map.put("设备编码","");
map.put("读取地址","");
map.put("读取意义","");
map.put("","");
map.put("写入地址","");
map.put("写入意义","");
list.add(map);
continue;
if (wss.size() > rss.size()){
if (j == rss.size()){
continue;
}
} else {
if (j == rss.size()){
map.put("设备编码","");
map.put("读取地址","");
map.put("读取意义","");
map.put("","");
map.put("写入地址","");
map.put("写入意义","");
list.add(map);
continue;
}
}
if (i == 0 && j ==0){
map.put("设备编码","");
}else {
@@ -1627,6 +1634,28 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
list.add(map);
System.out.println(map);
}
if (wss.size() > rss.size()){
int s = wss.size() - rss.size();
for (int l = 0; l <= s + 1; l++) {
Map<String,Object> map = new ListOrderedMap<>();
if (l == s + 1){
map.put("设备编码","");
map.put("读取地址","");
map.put("读取意义","");
map.put("","");
map.put("写入地址","");
map.put("写入意义","");
list.add(map);
continue;
}
map.put("设备编码",deviceCode);
map.put("读取地址","");
map.put("读取意义","");
Map<String, Object> value = getValue(wss, rss.size() + l, dbInterval,i);
map.putAll(value);
list.add(map);
}
}
}
}else if (type.equals("v")){
for (int i = 0; i < numberSize; i++) {

View File

@@ -27,6 +27,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@@ -54,7 +55,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
@Autowired
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
//工作模式
int mode = 0;
@@ -168,7 +169,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isNotEmpty(inst2)) {
String start_device_code = inst2.getStart_device_code();
Device device = appService.findDeviceByCode(start_device_code);
Device device = deviceAppService.findDeviceByCode(start_device_code);
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
@@ -186,7 +187,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (mode == 3 && action == 3 && move == 1 && task > 0) {
Instruction instructionDto = instructionService.findByCode(String.valueOf(task));
String next_device_code = instructionDto.getNext_device_code();
Device nextDevice = appService.findDeviceByCode(next_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
@@ -218,8 +219,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
acsToWmsService.feedbackTaskStatusToWms(array);
String next_device_code = taskDto.getNext_device_code();
String start_device_code = taskDto.getStart_device_code();
Device startDevice = appService.findDeviceByCode(start_device_code);
Device nextDevice = appService.findDeviceByCode(next_device_code);
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
@@ -314,12 +315,24 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
writing("to_onset", String.valueOf(start_addrIndex + 1));
writing("to_target", String.valueOf(next_addrIndex + 1));
writing("to_task", instruction.getInstruction_code());
writing("to_command", "1");
// int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
// int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
// writing("to_onset", String.valueOf(start_addrIndex + 1));
// writing("to_target", String.valueOf(next_addrIndex + 1));
Device startDevice = deviceAppService.findDeviceByCode(instruction.getStart_device_code());
Device nextDevice = deviceAppService.findDeviceByCode(instruction.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))){
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))){
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset", start_addr);
this.writing("to_target", next_addr);
this.writing("to_task", instruction.getInstruction_code());
this.writing("to_command", "1");
this.setRequireSucess(true);
return true;
} else {
@@ -371,12 +384,24 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
task.setUpdate_time(DateUtil.now());
taskserver.update(task);
//根据获取托盘信息返回的结果 得到对应抓取工位/放货工位设备编码所在的索引位置
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
writing("to_onset", String.valueOf(start_addrIndex + 1));
writing("to_target", String.valueOf(next_addrIndex + 1));
writing("to_task", instdto.getInstruction_code());
writing("to_command", "1");
// int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
// int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
// writing("to_onset", String.valueOf(start_addrIndex + 1));
// writing("to_target", String.valueOf(next_addrIndex + 1));
Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code());
Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))){
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))){
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset", start_addr);
this.writing("to_target", next_addr);
this.writing("to_task", instdto.getInstruction_code());
this.writing("to_command", "1");
this.setRequireSucess(true);
}
return true;

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -27,6 +28,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@@ -54,11 +56,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
//当前指令1
Instruction inst1 = null;
//当前指令2
Instruction inst2 = null;
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
//工作模式
@@ -138,6 +135,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
task2 = this.itemProtocol.getTask2();
if (mode != last_mode) {
if (mode == 2) {
this.setRequireHeadSucess(false);
this.setRequireBackSucess(false);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
@@ -245,11 +246,10 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
finish_instruction(inst2);
JSONArray array = new JSONArray();
TaskDto taskDto = taskserver.findByCode(inst1.getTask_code());
TaskDto taskDto = taskserver.findByCode(inst2.getTask_code());
JSONObject map = new JSONObject();
map.put("task_id", taskDto.getExt_task_id());
map.put("task_status", "2");
map.put("finished_type", "1");
array.add(map);
acsToWmsService.feedbackTaskStatusToWms(array);
writing("to_command2", "0");
@@ -260,9 +260,9 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
}
}
//双任务 - 工位取货时判断取货位光电信号
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
//双任务 - 工位取货时判断取货位光电信号
if (mode == 3 && action2 == 1 && move2 == 0 && task1 > 0 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
@@ -278,24 +278,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
}
}
//单任务 - 工位直接允许取货
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0 && task2 == 0) {
//单任务 - 工位直接允许取货
if (mode == 3 && action2 == 1 && move2 == 0 && task2 > 0 && task1 == 0) {
this.writing("to_command1", "2");
}
//后工位允许放货
if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) {
this.writing("to_command1", "3");
}
//前工位允许放货
if (mode == 3 && action1 == 1 && move1 == 0 && task1 > 0) {
this.writing("to_command2", "2");
}
//前工位放货时判断放货位光电信号
if (mode == 3 && action1 == 3 && move1 == 1 && task1 > 0) {
this.writing("to_command1", "3");
}
//后工位取货时判断取货位光电信号
if (mode == 3 && action2 == 2 && move2 == 0 && task2 > 0) {
this.writing("to_command2", "2");
}
//后工位放货时判断放货位光电信号
if (mode == 3 && action2 == 3 && move2 == 1 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
String next_device_code = inst1.getNext_device_code();
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
@@ -306,7 +306,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (move == 0 && mode == 2) {
this.writing("to_command2", "3");
} else {
log.warn("后工位放货位有货,放货位:{},mode:{},moce:{}", next_device_code, mode, move);
log.warn("后工位放货位有货,放货位:{},mode:{},move:{}", next_device_code, mode, move);
}
}
}
@@ -342,22 +342,26 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
return;
case 2:
//后工位申请任务 取空放空
if (move2 == 0 && action2 == 0 && task2 == 0 && !requireHeadSucess) {
//mode == 2 && move2 == 0 && action2 == 0 && !requireBackSucess
if (move2 == 0 && action2 == 0 && !requireBackSucess) {
instruction_require2();
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move1:" + move1 + ",action1:" + action1 + ",move2:" + move2 + ",task1:" + task1 + ",requireHeadSucess:" + requireHeadSucess);
}
//前工位申请任务 取满放满
if (move1 == 0 && action1 == 0 && task1 == 0 && move2 == 0 && task2 > 0 && !requireBackSucess) {
//mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess
if (move1 == 0 && action1 == 0 && !requireHeadSucess) {
instruction_require();
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
}
break;
case 3:
//前工位申请任务 取满放满
if (task2 > 0 && move2 == 1 && action2 == 1 && move1 == 0 && action1 == 0 && !requireBackSucess) {
instruction_require();
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
}
//mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess
// if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess) {
// instruction_require();
// logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
// }
break;
}
}
@@ -395,10 +399,18 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
Device startDevice = deviceAppservice.findDeviceByCode(instruction.getStart_device_code());
Device nextDevice = deviceAppservice.findDeviceByCode(instruction.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset1", start_addr);
this.writing("to_target1", next_addr);
this.writing("to_task1", instruction.getInstruction_code());
this.writing("to_command1", "1");
requireHeadSucess = true;
@@ -454,11 +466,19 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
task.setUpdate_time(DateUtil.now());
taskserver.update(task);
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
this.writing("to_onset1", String.valueOf(start_addrIndex + 1));
this.writing("to_target1", String.valueOf(next_addrIndex + 1));
//根据查询的任务起始点位 得出取放工位的电气值 写入后工位电气中
Device startDevice = deviceAppservice.findDeviceByCode(instdto.getStart_device_code());
Device nextDevice = deviceAppservice.findDeviceByCode(instdto.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset1", start_addr);
this.writing("to_target1", next_addr);
this.writing("to_task1", instdto.getInstruction_code());
this.writing("to_command1", "1");
requireHeadSucess = true;
@@ -491,10 +511,18 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);
int start_addrIndex = getDeviceCodeList.indexOf(instruction.getStart_device_code());
int next_addrIndex = putDeviceCodeList.indexOf(instruction.getNext_device_code());
this.writing("to_onset2", String.valueOf(start_addrIndex + 1));
this.writing("to_target2", String.valueOf(next_addrIndex + 1));
Device startDevice = deviceAppservice.findDeviceByCode(instruction.getStart_device_code());
Device nextDevice = deviceAppservice.findDeviceByCode(instruction.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset2", start_addr);
this.writing("to_target2", next_addr);
this.writing("to_task2", instruction.getInstruction_code());
this.writing("to_command2", "1");
requireBackSucess = true;
@@ -549,11 +577,19 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
task.setTask_status("1");
taskserver.update(task);
//根据查询的任务起始点位 得出取放工位的索引值 写入后工位电气中
int start_addrIndex = getDeviceCodeList.indexOf(start_device_code);
int next_addrIndex = putDeviceCodeList.indexOf(next_device_code);
this.writing("to_onset2", String.valueOf(start_addrIndex + 1));
this.writing("to_target2", String.valueOf(next_addrIndex + 1));
//根据查询的任务起始点位 得出取放工位的电气值 写入后工位电气中
Device startDevice = deviceAppservice.findDeviceByCode(instdto.getStart_device_code());
Device nextDevice = deviceAppservice.findDeviceByCode(instdto.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
this.writing("to_onset2", start_addr);
this.writing("to_target2", next_addr);
this.writing("to_task2", instdto.getInstruction_code());
this.writing("to_command2", "1");
requireBackSucess = true;

View File

@@ -366,8 +366,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
}
try {
String start_device_code = task.getStart_device_code();
String next_device_code = task.getNext_device_code();
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
String route_plan_code = task.getRoute_plan_code();
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
RouteLineDto route = null;
@@ -383,12 +383,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (ObjectUtil.isEmpty(route)) {
throw new BadRequestException("未查询到相关路由!");
}
String agvType = paramService.findByCode("agvType").getValue();
if (StrUtil.equals(agvType, "2")) {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto);
}
if (StrUtil.equals(shortPathsList.get(0).getType(), "1")){
String agvType = paramService.findByCode("agvType").getValue();
if (StrUtil.equals(agvType, "2")) {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(),dto);
}
}
} catch (Exception e) {
dto.setSend_status("2");
e.printStackTrace();

View File

@@ -182,6 +182,12 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
total_qty += Double.parseDouble(net_weight);
row.put("box_no", row.get("package_box_sn"));
//判断该木箱是否已经存在库内
JSONObject str_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '"+row.get("package_box_sn")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(str_jo)){
throw new BadRequestException("木箱:"+row.get("package_box_sn")+"已存在库内,请对数据进行核实!");
}
/*//如果是退货入库,查询对应的包装关系维护交货单号和交货单行号
if (whereJson.get("bill_type").equals("0002")) {
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '" + row.get("container_name") + "'").uniqueResult(0);