add: 诺宝agv、诺宝叉车调试开发

This commit is contained in:
2024-06-15 15:09:22 +08:00
parent 0a98b9ac44
commit 01a0ebfb4e
14 changed files with 362 additions and 489 deletions

View File

@@ -9,7 +9,9 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.BoxStorageManipulatorDeviceDriver; import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.BoxStorageManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
@@ -41,15 +43,19 @@ public class AgvWaitUtil {
public JSONObject waitInGet(String startDeviceCode, Instruction inst) { public JSONObject waitInGet(String startDeviceCode, Instruction inst) {
log.info("仙工AGV请求取货设备号 - {}", startDeviceCode); log.info("仙工AGV请求取货设备号 - {}", startDeviceCode);
Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode); Device startDevice = deviceAppService.findDeviceByCode(startDeviceCode);
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
if(startDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver;
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startDevice.getDeviceDriver(); if(startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){
if(standardInspectSiteDeviceDriver.getError() != 0){ manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver();
JSONObject map = new JSONObject(); manipulatorAgvStationDeviceDriver.writing(2);
map.put("status", 500); if(manipulatorAgvStationDeviceDriver.getAction() != 1){
map.put("message", "不允许取货"); throw new BadRequestException("上位系统不允许取货");
log.info("不允许仙工AGV取货,烘箱对接位有报警,设备号 - {}", startDeviceCode); }
return map; }
if(startDevice.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver){
boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) startDevice.getDeviceDriver();
if(boxSubvolumesConveyorDeviceDriver.getMode() != 2){
throw new BadRequestException("上位系统不允许取货");
} }
} }
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
@@ -75,15 +81,13 @@ public class AgvWaitUtil {
public JSONObject waitInPut(String endDeviceCode, Instruction inst) { public JSONObject waitInPut(String endDeviceCode, Instruction inst) {
log.info("仙工AGV请求放货设备号 - {}", endDeviceCode); log.info("仙工AGV请求放货设备号 - {}", endDeviceCode);
Device endDevice = deviceAppService.findDeviceByCode(endDeviceCode); Device endDevice = deviceAppService.findDeviceByCode(endDeviceCode);
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
if(endDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ if(endDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver){
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) endDevice.getDeviceDriver(); manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) endDevice.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getError() != 0){ manipulatorAgvStationDeviceDriver.writing(2);
JSONObject map = new JSONObject(); if(manipulatorAgvStationDeviceDriver.getAction() != 1){
map.put("status", 500); log.info("不允许仙工AGV取货,烘箱对接位有报警,设备号 - {}", endDevice);
map.put("message", "不允许放货!"); throw new BadRequestException("上位系统不允许取货");
log.info("不允许仙工AGV放货,烘箱对接位有报警,设备号 - {}", endDeviceCode);
return map;
} }
} }
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();

View File

@@ -13,11 +13,13 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig; import org.nl.acs.AcsConfig;
import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.task.enums.AgvSystemTypeEnum;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 定时查询AGV状态 * 定时查询AGV状态
@@ -30,15 +32,15 @@ public class QueryAGVStatus {
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
List<Instruction> allInstFromCache = instructionService.findAllInstFromCache(); List<Instruction> allInstFromCache = instructionService.findAllInstFromCache();
if(CollUtil.isEmpty(allInstFromCache) || allInstFromCache.size() < 1){ List<Instruction> agvInstruction = allInstFromCache.stream().filter(item -> AgvSystemTypeEnum.One_NDC_System_Type.getIndex().equals(item.getAgv_system_type()) || AgvSystemTypeEnum.XG_System_Type.getIndex().equals(item.getAgv_system_type())).collect(Collectors.toList());
if (CollUtil.isEmpty(agvInstruction) || agvInstruction.size() < 1) {
return; return;
} }
for (Instruction instruction : allInstFromCache) { for (Instruction instruction : agvInstruction) {
if ("4".equals(instruction.getInstruction_type())) { String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvurl =paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
agvurl = agvurl + ":" + agvport + "/" + instruction.getInstruction_code(); agvurl = agvurl + ":" + agvport + "/orderDetails/" + instruction.getInstruction_code();
log.info("根据运单号查询运单状态的请求:{}", agvurl); log.info("根据运单号查询运单状态的请求:{}", agvurl);
HttpResponse result = HttpRequest.get(agvurl) HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒 .timeout(20000)//超时,毫秒
@@ -46,7 +48,7 @@ public class QueryAGVStatus {
log.info("根据运单号查询运单状态的请求反馈:{}", result); log.info("根据运单号查询运单状态的请求反馈:{}", result);
String body = result.body(); String body = result.body();
JSONObject json = JSONObject.parseObject(body); JSONObject json = JSONObject.parseObject(body);
if(result.getStatus() == 200 && json.getString("id").equals(instruction.getInstruction_code())){ if (result.getStatus() == 200 && json.getString("id").equals(instruction.getInstruction_code())) {
// 已创建=CREATED // 已创建=CREATED
// 待分配=TOBEDISPATCHED // 待分配=TOBEDISPATCHED
// 正在执行=RUNNING // 正在执行=RUNNING
@@ -75,5 +77,4 @@ public class QueryAGVStatus {
} }
} }
} }
}
} }

View File

@@ -1,5 +1,6 @@
package org.nl.acs.agv.rest; package org.nl.acs.agv.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import groovy.lang.Lazy; import groovy.lang.Lazy;
import org.nl.acs.agv.server.XianGongAgvService; import org.nl.acs.agv.server.XianGongAgvService;
@@ -24,6 +25,7 @@ public class XianGongAgvController {
@PostMapping("/api/agv/xg/waitPointRequest") @PostMapping("/api/agv/xg/waitPointRequest")
@Log("仙工AGV请求取放货") @Log("仙工AGV请求取放货")
@SaIgnore
public ResponseEntity<JSONObject> xgAGVWaitPointRequest(@RequestBody JSONObject requestParam) { public ResponseEntity<JSONObject> xgAGVWaitPointRequest(@RequestBody JSONObject requestParam) {
return new ResponseEntity<>(xianGongAgentService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK); return new ResponseEntity<>(xianGongAgentService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK);
} }

View File

@@ -259,7 +259,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("priority", inst.getPriority()); jo.put("priority", inst.getPriority());
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("下发诺宝运单") .device_code("下发诺宝运单")
.content("任务号:"+inst.getTask_code()+",指令号:"+inst.getInstruction_code()+",下发agv订单序列参数:"+jo) .content("任务号:" + inst.getTask_code() + ",指令号:" + inst.getInstruction_code() + ",下发agv订单序列参数:" + jo)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -280,7 +280,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
.execute(); .execute();
LuceneLogDto logDto1 = LuceneLogDto.builder() LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("诺宝运单响应") .device_code("诺宝运单响应")
.content("任务号:"+inst.getTask_code()+",指令号:"+inst.getInstruction_code()+",下发诺宝订单序列反馈参数:"+jo) .content("任务号:" + inst.getTask_code() + ",指令号:" + inst.getInstruction_code() + ",下发诺宝订单序列反馈参数:" + jo)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1); luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -326,6 +326,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
/** /**
* 下发取货信号 * 下发取货信号
*
* @param ja * @param ja
* @param pointCode 起始点位 * @param pointCode 起始点位
* @param device_code 起始设备 * @param device_code 起始设备
@@ -333,8 +334,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
*/ */
public void sendStartDeviceOrder(JSONArray ja, String pointCode, String device_code, String instCode) { public void sendStartDeviceOrder(JSONArray ja, String pointCode, String device_code, String instCode) {
Device startDevice = deviceAppService.findDeviceByCode(device_code); Device startDevice = deviceAppService.findDeviceByCode(device_code);
//忽略取货校验
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) {
//取货前等待 //取货前等待
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
//动作块id //动作块id
@@ -358,51 +357,19 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
script_args.put("protocol", "HTTP"); script_args.put("protocol", "HTTP");
jo.put("script_args", script_args); jo.put("script_args", script_args);
ja.add(jo); ja.add(jo);
}
JSONObject jo3 = new JSONObject();
//动作块id
jo3.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo3.put("location", pointCode + "INGET");
jo3.put("id", pointCode + "INGET");
//执行脚本
jo3.put("operation", "expand");
//通信脚本,动作前后与现场设备交互的场景
jo3.put("script_name", "Fork-expand.py");
JSONObject script_args = new JSONObject();
script_args.put("expandWidth", 0.2);
script_args.put("operation", "expand");
jo3.put("script_args", script_args);
ja.add(jo3);
JSONObject jo4 = new JSONObject();
//动作块id
jo4.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo4.put("location", pointCode + "INGET");
jo4.put("id", pointCode + "INGET");
//执行脚本
jo4.put("operation", "stretch");
//通信脚本,动作前后与现场设备交互的场景
jo4.put("script_name", "Fork-expand.py");
JSONObject script_args1 = new JSONObject();
script_args1.put("expandWidth", 0.2);
script_args1.put("operation", "stretch");
jo4.put("script_args", script_args1);
ja.add(jo4);
//将货物顶起来,机器识别提升高度 //将货物顶起来,机器识别提升高度
JSONObject jo1 = new JSONObject(); JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", pointCode); jo1.put("location", pointCode);
jo1.put("operation", "JackLoad"); jo1.put("operation", "JackLoad");
jo1.put("operationArgs", new JSONObject() {{ // jo1.put("operationArgs", new JSONObject() {{
put("recognize", true); // put("recognize", true);
}}); // }});
ja.add(jo1); ja.add(jo1);
//取货完成等待
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) {
JSONObject jo2 = new JSONObject(); JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", pointCode + "OUTGET"); jo2.put("location", pointCode + "OUTGET");
@@ -421,10 +388,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo2.put("script_args", script_args2); jo2.put("script_args", script_args2);
ja.add(jo2); ja.add(jo2);
} }
}
/** /**
* 下发放货信号 * 下发放货信号
*
* @param ja * @param ja
* @param device_code 起始设备 * @param device_code 起始设备
* @param instCode 指令号 * @param instCode 指令号
@@ -433,8 +400,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
*/ */
public void sendEndDeviceOrder(JSONArray ja, String device_code, String instCode, String pointCode, String nextDeviceCode) { public void sendEndDeviceOrder(JSONArray ja, String device_code, String instCode, String pointCode, String nextDeviceCode) {
Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode); Device nextDevice = deviceAppService.findDeviceByCode(nextDeviceCode);
//忽略放货校验
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) {
//放货前等待 //放货前等待
JSONObject jo3 = new JSONObject(); JSONObject jo3 = new JSONObject();
jo3.put("blockId", IdUtil.simpleUUID()); jo3.put("blockId", IdUtil.simpleUUID());
@@ -453,7 +419,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
script_args3.put("protocol", "HTTP"); script_args3.put("protocol", "HTTP");
jo3.put("script_args", script_args3); jo3.put("script_args", script_args3);
ja.add(jo3); ja.add(jo3);
}
//放货前下发旋转角度 //放货前下发旋转角度
/*JSONObject json1 = new JSONObject(); /*JSONObject json1 = new JSONObject();
@@ -478,8 +444,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
ja.add(jo4); ja.add(jo4);
//忽略放货校验
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) {
//放货完成等待 //放货完成等待
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject();
jo5.put("blockId", IdUtil.simpleUUID()); jo5.put("blockId", IdUtil.simpleUUID());
@@ -498,7 +462,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
script_args5.put("protocol", "HTTP"); script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5); jo5.put("script_args", script_args5);
ja.add(jo5); ja.add(jo5);
}
} }
@@ -803,7 +767,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("priority", inst.getPriority()); jo.put("priority", inst.getPriority());
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("下发叉车运单") .device_code("下发叉车运单")
.content("任务号:"+inst.getTask_code()+",指令号:"+inst.getInstruction_code()+",下发叉车订单序列参数:"+jo) .content("任务号:" + inst.getTask_code() + ",指令号:" + inst.getInstruction_code() + ",下发叉车订单序列参数:" + jo)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -824,7 +788,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
.execute(); .execute();
LuceneLogDto logDto1 = LuceneLogDto.builder() LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("叉车运单响应") .device_code("叉车运单响应")
.content("任务号:"+inst.getTask_code()+",指令号:"+inst.getInstruction_code()+",下发叉车订单序列反馈参数:"+jo) .content("任务号:" + inst.getTask_code() + ",指令号:" + inst.getInstruction_code() + ",下发叉车订单序列反馈参数:" + jo)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1); luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -838,6 +802,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
/** /**
* 叉车运单动作块 * 叉车运单动作块
*
* @param inst * @param inst
* @return * @return
*/ */
@@ -845,17 +810,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
//起点 //起点
Device startDevice = deviceAppService.findDeviceByCode(inst.getStart_device_code()); Device startDevice = deviceAppService.findDeviceByCode(inst.getStart_device_code());
//忽略取货校验 String pointCode = inst.getStart_point_code();
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) {
//取货前等待 //取货前等待
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
//动作块id //动作块id
jo.put("blockId", IdUtil.simpleUUID()); jo.put("blockId", IdUtil.simpleUUID());
//目的地名称 //目的地名称
jo.put("location", inst.getStart_point_code() + "INGET"); jo.put("location", pointCode + "INGET");
//执行脚本 //执行脚本
jo.put("operation", "script"); jo.put("operation", "script");
jo.put("id", inst.getStart_point_code() + "INGET"); jo.put("id", pointCode + "INGET");
//通信脚本,动作前后与现场设备交互的场景 //通信脚本,动作前后与现场设备交互的场景
jo.put("script_name", "userpy/interact.py"); jo.put("script_name", "userpy/interact.py");
JSONObject script_args = new JSONObject(); JSONObject script_args = new JSONObject();
@@ -864,108 +828,71 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
JSONObject reach = new JSONObject(); JSONObject reach = new JSONObject();
reach.put("task_code", inst.getInstruction_code()); reach.put("task_code", inst.getInstruction_code());
reach.put("address", inst.getStart_point_code() + "INGET"); reach.put("address", pointCode + "INGET");
data.put("reach", reach); data.put("reach", reach);
script_args.put("data", data); script_args.put("data", data);
script_args.put("protocol", "HTTP"); script_args.put("protocol", "HTTP");
jo.put("script_args", script_args); jo.put("script_args", script_args);
ja.add(jo); ja.add(jo);
}
//货叉加载货物,会将叉车状态变成载货中
JSONObject jo1 = new JSONObject(); JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID()); jo1.put("blockId", IdUtil.simpleUUID());
jo1.put("location", inst.getStart_point_code()); jo1.put("location", inst.getStart_point_code()+ "INGET");
jo1.put("operation", "ForkLoad"); jo1.put("binTask", "InForkHeight");
//行走高度
jo1.put("start_height", "0.1");
//取货高度
jo1.put("end_height", inst.getStart_height());
//升起信号
jo1.put("operationArgs", new JSONObject() {{
put("recognize", true);
}});
ja.add(jo1); ja.add(jo1);
//取货完成等待 JSONObject jo6 = new JSONObject();
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) { jo6.put("blockId", IdUtil.simpleUUID());
jo6.put("location", inst.getStart_point_code());
jo6.put("binTask", "Script");
ja.add(jo6);
JSONObject jo7 = new JSONObject();
jo7.put("blockId", IdUtil.simpleUUID());
jo7.put("location", inst.getStart_point_code());
jo7.put("binTask", "ForkLoad");
ja.add(jo7);
//取货完成
JSONObject jo2 = new JSONObject(); JSONObject jo2 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID()); jo2.put("blockId", IdUtil.simpleUUID());
jo2.put("location", inst.getStart_point_code() + "OUTGET"); jo2.put("location", pointCode + "OUTGET");
jo2.put("operation", "script"); jo2.put("operation", "script");
jo2.put("id", inst.getStart_point_code() + "OUTGET"); jo2.put("id", pointCode + "OUTGET");
jo2.put("script_name", "userpy/interact.py"); jo2.put("script_name", "userpy/interact.py");
JSONObject script_args2 = new JSONObject(); JSONObject script_args2 = new JSONObject();
script_args2.put("addr", addr); script_args2.put("addr", addr);
JSONObject data2 = new JSONObject(); JSONObject data2 = new JSONObject();
JSONObject reach2 = new JSONObject(); JSONObject reach2 = new JSONObject();
reach2.put("task_code", inst.getInstruction_code()); reach2.put("task_code", inst.getInstruction_code());
reach2.put("address", inst.getStart_point_code() + "OUTGET"); reach2.put("address", pointCode + "OUTGET");
data2.put("reach", reach2); data2.put("reach", reach2);
script_args2.put("data", data2); script_args2.put("data", data2);
script_args2.put("protocol", "HTTP"); script_args2.put("protocol", "HTTP");
jo2.put("script_args", script_args2); jo2.put("script_args", script_args2);
ja.add(jo2); ja.add(jo2);
}
//起点
Device nextDevice = deviceAppService.findDeviceByCode(inst.getNext_device_code());
//忽略放货校验
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) {
//放货前等待
JSONObject jo3 = new JSONObject();
jo3.put("blockId", IdUtil.simpleUUID());
jo3.put("location", inst.getNext_point_code() + "INPUT");
jo3.put("operation", "script");
jo3.put("id", inst.getNext_point_code() + "INPUT");
jo3.put("script_name", "userpy/interact.py");
JSONObject script_args3 = new JSONObject();
script_args3.put("addr", addr);
JSONObject data3 = new JSONObject();
JSONObject reach3 = new JSONObject();
reach3.put("task_code", inst.getInstruction_code());
reach3.put("address", inst.getNext_point_code() + "INPUT");
data3.put("reach", reach3);
script_args3.put("data", data3);
script_args3.put("protocol", "HTTP");
jo3.put("script_args", script_args3);
ja.add(jo3);
}
//ForkUnload(货叉卸载货物,会将叉车的状态变成非载货中) //ForkUnload(货叉卸载货物,会将叉车的状态变成非载货中)
JSONObject jo2 = new JSONObject(); JSONObject jo8 = new JSONObject();
jo2.put("blockId", IdUtil.simpleUUID()); jo8.put("blockId", IdUtil.simpleUUID());
jo2.put("location", inst.getStart_point_code()); jo8.put("location", inst.getStart_point_code()+"OUTGET");
jo2.put("operation", "ForkUnload"); jo8.put("binTask", "OutForkHeight");
//行走高度 ja.add(jo8);
jo2.put("start_height", "0.2");
//放货高度
jo2.put("end_height", inst.getNext_height());
ja.add(jo2);
JSONObject jo9 = new JSONObject();
jo9.put("blockId", IdUtil.simpleUUID());
jo9.put("location", inst.getNext_point_code());
jo9.put("binTask", "ForkUnload");
ja.add(jo9);
//忽略放货校验 JSONObject jo10 = new JSONObject();
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) { jo10.put("blockId", IdUtil.simpleUUID());
//放货完成等待 jo10.put("location", inst.getNext_point_code()+"OUTPUT");
com.alibaba.fastjson.JSONObject jo5 = new com.alibaba.fastjson.JSONObject(); jo10.put("binTask", "OutForkHeight");
jo5.put("blockId", IdUtil.simpleUUID()); ja.add(jo10);
jo5.put("location", inst.getNext_point_code() + "OUTPUT");
jo5.put("operation", "script");
jo5.put("id", inst.getNext_point_code() + "OUTPUT");
jo5.put("script_name", "userpy/interact.py");
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject();
script_args5.put("addr", addr);
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject();
com.alibaba.fastjson.JSONObject reach5 = new com.alibaba.fastjson.JSONObject();
reach5.put("task_code", inst.getInstruction_code());
reach5.put("address", inst.getNext_point_code() + "OUTPUT");
data5.put("reach", reach5);
script_args5.put("data", data5);
script_args5.put("protocol", "HTTP");
jo5.put("script_args", script_args5);
ja.add(jo5);
}
return ja; return ja;
} }

View File

@@ -1,22 +1,18 @@
package org.nl.acs.device_driver.conveyor.belt_conveyor; package org.nl.acs.device_driver.conveyor.belt_conveyor;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; 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.agv.server.AgvService; import org.nl.acs.agv.server.AgvService;
import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.common.base.CommonFinalParam;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device.enums.ErrorType;
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.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
@@ -24,13 +20,11 @@ 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.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO; import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum;
import org.nl.acs.enums.StorageTypeEnum; import org.nl.acs.enums.StorageTypeEnum;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.enums.InstructionStatusEnum; import org.nl.acs.instruction.enums.InstructionStatusEnum;
@@ -41,7 +35,6 @@ import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.task.enums.TaskStatusEnum; import org.nl.acs.task.enums.TaskStatusEnum;
import org.nl.acs.task.enums.TaskTypeEnum;
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.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
@@ -52,12 +45,9 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import static redis.clients.jedis.HostAndPort.localhost;
/** /**
* 输送线 * 输送线
*/ */
@@ -244,13 +234,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
to_container_no = this.itemProtocol.getContainer_direction(); to_container_no = this.itemProtocol.getContainer_direction();
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move==0 && last_move==1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
@@ -275,7 +260,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
//申请空托盘出库 //申请空托盘出库
if (mode == 8 && !requireSucess) { if (mode == 8 && !requireSucess) {
if (container_type==0){ if (container_type==0){
message = "universal_notCreateInstMessage7"; message = "托盘类型为空";
} }
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
@@ -284,10 +269,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = "universal_off-line"; message = "脱机";
} else if (error != 0) { } else if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有报警";
} else { } else {
this.setIsonline(true); this.setIsonline(true);
@@ -369,10 +354,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
map2.put("code","to_task"); map2.put("code","to_task");
map2.put("value","0"); map2.put("value","0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code","to_container_type");
map4.put("value","0"); map4.put("value","0");
@@ -419,6 +400,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param); String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请空托盘出入库,返回参数:" + jo.getString("body");
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -511,6 +493,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
String route_plan_code = taskDtoHandCode.getRoute_plan_code(); String route_plan_code = taskDtoHandCode.getRoute_plan_code();
String next_device_code = taskDtoHandCode.getNext_device_code(); String next_device_code = taskDtoHandCode.getNext_device_code();
String interactionJson = taskDtoHandCode.getInteraction_json(); String interactionJson = taskDtoHandCode.getInteraction_json();
String vehicleCode = taskDtoHandCode.getVehicle_code();
String containerType = ""; String containerType = "";
if (StrUtil.isNotEmpty(interactionJson)) { if (StrUtil.isNotEmpty(interactionJson)) {
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
@@ -539,7 +522,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) { if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
next_point_code = next_device_code + "-" + taskDtoHandCode.getTo_y() + "-" + taskDtoHandCode.getTo_z(); next_point_code = next_device_code + "-" + taskDtoHandCode.getTo_y() + "-" + taskDtoHandCode.getTo_z();
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType); packageData(instdto, route_plan_code, taskDtoHandCode, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType,vehicleCode);
try { try {
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {
@@ -569,6 +552,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
String start_point_code = taskdto.getStart_point_code(); String start_point_code = taskdto.getStart_point_code();
String start_device_code = taskdto.getStart_device_code(); String start_device_code = taskdto.getStart_device_code();
String route_plan_code = taskdto.getRoute_plan_code(); String route_plan_code = taskdto.getRoute_plan_code();
String vehicleCode = taskdto.getVehicle_code();
String next_device_code = ""; String next_device_code = "";
String containerType = ""; String containerType = "";
String interactionJson = taskdto.getInteraction_json(); String interactionJson = taskdto.getInteraction_json();
@@ -641,7 +626,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
return false; return false;
} }
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
packageData(instdto, route_plan_code, taskdto, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType); packageData(instdto, route_plan_code, taskdto, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority, containerType, vehicleCode);
log.error("=================================,{}", instdto.getCreate_by()); log.error("=================================,{}", instdto.getCreate_by());
try { try {
instructionService.create(instdto); instructionService.create(instdto);
@@ -704,7 +689,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
this.writing(list3); this.writing(list3);
} }
private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority, String containerType) { private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority, String containerType, String vehicleCode) {
instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code); instdto.setRoute_plan_code(route_plan_code);
instdto.setRemark(taskdto.getRemark()); instdto.setRemark(taskdto.getRemark());
@@ -723,6 +708,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
instdto.setInstruction_status("0"); instdto.setInstruction_status("0");
instdto.setExecute_device_code(start_point_code); instdto.setExecute_device_code(start_point_code);
instdto.setVehicle_type(containerType); instdto.setVehicle_type(containerType);
instdto.setVehicle_code(vehicleCode);
} }
public void writeData(String next_addr, Instruction instdto, Map map) { public void writeData(String next_addr, Instruction instdto, Map map) {
@@ -813,7 +799,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
if (this.getMove() == 0) { if (this.getMove() == 0) {
move = LangProcess.msg("universal_no"); move = LangProcess.msg("universal_no");

View File

@@ -206,20 +206,15 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
} }
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move==0 && last_move==1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = "universal_off-line"; message = "脱机";
//有报警 //有报警
@@ -228,7 +223,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.setIserror(false); this.setIserror(false);
if (error != 0) { if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有警报";
} }
Instruction instruction = null; Instruction instruction = null;
@@ -296,10 +291,6 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
map2.put("code","to_task"); map2.put("code","to_task");
map2.put("value","0"); map2.put("value","0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code","to_container_type");
map4.put("value","0"); map4.put("value","0");
@@ -397,6 +388,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "二楼到一楼输送线申请行架任务,参数:" + param); logServer.deviceExecuteLog(this.device_code, "", "", "二楼到一楼输送线申请行架任务,参数:" + param);
String response = acsToWmsService.applyTowToOne(param); String response = acsToWmsService.applyTowToOne(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "二楼到一楼输送线申请行架任务,返回参数:" + jo.getString("body");
if (response == null || jo.getInteger("status") == 200) { if (response == null || jo.getInteger("status") == 200) {
List list1 = new ArrayList(); List list1 = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
@@ -463,7 +455,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
return false; return false;
} }
} }
message = "universal_message5"; message = "下发电气任务号成功";
requireSucess = true; requireSucess = true;
return true; return true;
} }
@@ -682,7 +674,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
map.put("requireSucess", requireSucess); map.put("requireSucess", requireSucess);
map.put("driver_type", "siemens_conveyor"); map.put("driver_type", "siemens_conveyor");
map.put("message", LangProcess.msg(message)); map.put("message",message);
map.put("inst_message", this.inst_message); map.put("inst_message", this.inst_message);
map.put("last_inst_message", this.last_inst_message); map.put("last_inst_message", this.last_inst_message);
map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));

View File

@@ -204,13 +204,8 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
} }
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move == 0 && last_move == 1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
@@ -224,7 +219,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.setIserror(false); this.setIserror(false);
if (error != 0) { if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有报警";
} }
Instruction instruction = null; Instruction instruction = null;
@@ -237,8 +232,8 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
case 19: case 19:
//申请AGV任务 //申请AGV任务
if (move == 1 && !requireSucess) { if (move == 1 && !requireSucess) {
if (StrUtil.isEmpty(material_barcode)){ if (StrUtil.isEmpty(material_barcode)) {
message = "universal_notCreateInstMessage8"; message = "条码为空";
} }
applyAgvTask(); applyAgvTask();
@@ -248,7 +243,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
//申请任务 //申请任务
if (move > 0 && !requireSucess) { if (move > 0 && !requireSucess) {
instruction_require(); instruction_require();
}else { } else {
String remark = ""; String remark = "";
; ;
if (mode != 2) { if (mode != 2) {
@@ -290,25 +285,21 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
private void clearWrite() { private void clearWrite() {
List list = new ArrayList<>(); List list = new ArrayList<>();
Map map = new HashMap<>(); Map map = new HashMap<>();
map.put("code","to_target"); map.put("code", "to_target");
map.put("value","0"); map.put("value", "0");
list.add(map); list.add(map);
Map map2 = new HashMap<>(); Map map2 = new HashMap<>();
map2.put("code","to_task"); map2.put("code", "to_task");
map2.put("value","0"); map2.put("value", "0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code", "to_container_type");
map4.put("value","0"); map4.put("value", "0");
list.add(map4); list.add(map4);
this.writing(list); this.writing(list);
message=null; message = null;
vehicle_code=null; vehicle_code = null;
} }
@@ -343,11 +334,9 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
.content("申请AGV任务,参数,接口返回:" + jo) .content("申请AGV任务,参数,接口返回:" + jo)
.build(); .build();
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
if (ObjectUtil.isEmpty(jo)) { message = "申请AGV任务,参数,接口返回:" + jo;
message = "one_message15";
} else {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
message = "one_message16";
List list1 = new ArrayList(); List list1 = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_command"); map.put("code", "to_command");
@@ -361,9 +350,6 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
requireSucess = true; requireSucess = true;
} else {
message = "one_message17";
}
} }
return; return;
} }
@@ -376,12 +362,9 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数"); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数");
JSONObject jo = JSON.parseObject(str); JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) {
message = "one_message15"; message = "申请AGV任务,参数,接口返回:" + jo;
// requireSucess = true;
} else {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
message = "one_message16";
List list = new ArrayList(); List list = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_command"); map.put("code", "to_command");
@@ -390,9 +373,6 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.writing(list); this.writing(list);
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
requireSucess = true; requireSucess = true;
} else {
message = "one_message17";
}
} }
} }
@@ -464,7 +444,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("hand_barcode", hand_barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
jo.put("is_click", true); jo.put("is_click", true);
@@ -575,7 +555,6 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
return false; return false;
} }
} }
message = "universal_message5";
requireSucess = true; requireSucess = true;
return true; return true;
} }

View File

@@ -117,8 +117,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
int to_length = 0; int to_length = 0;
int last_to_length = 0; int last_to_length = 0;
int to_weight = 0;
int last_to_weight = 0;
int to_height = 0; int to_height = 0;
int last_to_height = 0; int last_to_height = 0;
@@ -209,13 +208,8 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
} }
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move==0 && last_move==1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
@@ -223,7 +217,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = "universal_off-line"; message = "脱机";
//有报警 //有报警
@@ -232,7 +226,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
this.setIserror(false); this.setIserror(false);
if (error != 0) { if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有警报";
} }
Instruction instruction = null; Instruction instruction = null;
@@ -318,7 +312,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
last_to_target = to_target; last_to_target = to_target;
last_material_barcode = material_barcode; last_material_barcode = material_barcode;
last_to_length = to_length; last_to_length = to_length;
last_to_weight = to_weight;
last_to_height = to_height; last_to_height = to_height;
} }
@@ -332,10 +325,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
map2.put("code","to_task"); map2.put("code","to_task");
map2.put("value","0"); map2.put("value","0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code","to_container_type");
map4.put("value","0"); map4.put("value","0");
@@ -354,7 +343,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
this.require_apply_strangulation_time = date; this.require_apply_strangulation_time = date;
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task)); Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) { if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) {
message = "one_message11"; message = "指令为空、或者托盘码未空";
return; return;
} }
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@@ -369,6 +358,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.deviceApplyTwo(param); String response = acsToWmsService.deviceApplyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请捆扎,参数,接口返回:" + jo;
if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) { if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -404,7 +394,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
// //
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task)); Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
if (StrUtil.isEmpty(inst.getVehicle_code())) { if (StrUtil.isEmpty(inst.getVehicle_code())) {
message = "one_message11"; message = "托盘码为空";
return; return;
} }
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@@ -428,7 +418,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
try { try {
this.writing(list); this.writing(list);
} catch (Exception e) { } catch (Exception e) {
message = "universal_write_erro"; message = "写入异常";
} }
// Map datas = applyLabelingAndBindingResponse.getData(); // Map datas = applyLabelingAndBindingResponse.getData();
requireSucess = true; requireSucess = true;
@@ -466,7 +456,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
map.put("value", length); map.put("value", length);
list.add(map); list.add(map);
Map map2 = new HashMap(); Map map2 = new HashMap();
map2.put("code", "to_weight"); map2.put("code", "to_width");
map2.put("value", width); map2.put("value", width);
list.add(map2); list.add(map2);
Map map3 = new HashMap(); Map map3 = new HashMap();
@@ -516,7 +506,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
map.put("value", length); map.put("value", length);
list.add(map); list.add(map);
Map map2 = new HashMap(); Map map2 = new HashMap();
map2.put("code", "to_weight"); map2.put("code", "to_width");
map2.put("value", width); map2.put("value", width);
list.add(map2); list.add(map2);
Map map3 = new HashMap(); Map map3 = new HashMap();
@@ -579,7 +569,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
map.put("value", length); map.put("value", length);
list.add(map); list.add(map);
Map map2 = new HashMap(); Map map2 = new HashMap();
map2.put("code", "to_weight"); map2.put("code", "to_width");
map2.put("value", width); map2.put("value", width);
list.add(map2); list.add(map2);
Map map3 = new HashMap(); Map map3 = new HashMap();
@@ -610,7 +600,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
try { try {
this.writing(list); this.writing(list);
} catch (Exception e) { } catch (Exception e) {
message = "universal_write_erro"; message = "写入异常";
} }
this.setRequireSucess(true); this.setRequireSucess(true);
@@ -700,7 +690,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("hand_barcode", hand_barcode); jo.put("hand_barcode", hand_barcode);
jo.put("is_click", true); jo.put("is_click", true);
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
@@ -812,7 +802,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
return false; return false;
} }
} }
message = "universal_message5";
requireSucess = true; requireSucess = true;
return true; return true;
} }

View File

@@ -209,13 +209,8 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
} }
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move==0 && last_move==1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
@@ -233,12 +228,12 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = "universal_off-line"; message = "脱机";
//有报警 //有报警
} else if (error != 0) { } else if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有报警";
//无报警 //无报警
} else { } else {
this.setIsonline(true); this.setIsonline(true);
@@ -250,7 +245,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
//申请空托盘入库 //申请空托盘入库
if (mode == 9 && move == 1 && !requireSucess) { if (mode == 9 && move == 1 && !requireSucess) {
if (container_type==0){ if (container_type==0){
message = "universal_notCreateInstMessage7"; message = "托盘类型为空";
} }
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
@@ -260,7 +255,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
//申请空托盘出库 //申请空托盘出库
if (mode == 8 && !requireSucess) { if (mode == 8 && !requireSucess) {
if (container_type==0){ if (container_type==0){
message = "universal_notCreateInstMessage7"; message = "托盘类型为空";
} }
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode); applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(), mode);
@@ -327,10 +322,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
map2.put("code","to_task"); map2.put("code","to_task");
map2.put("value","0"); map2.put("value","0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code","to_container_type");
map4.put("value","0"); map4.put("value","0");
@@ -382,7 +373,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
return false; return false;
} }
} }
message = "universal_message5";
requireSucess = true; requireSucess = true;
return true; return true;
} }
@@ -600,6 +590,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param); String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请空托盘出入库,参数,接口返回:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -676,7 +667,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage));

View File

@@ -243,13 +243,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
} }
if (mode != last_mode) {
requireSucess = false; if (move != last_move && move==0 && last_move==1) {
if(mode == 2){
clearWrite();
}
}
if (move != last_move && move==0) {
requireSucess = false; requireSucess = false;
clearWrite(); clearWrite();
} }
@@ -292,7 +287,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//有报警 //有报警
} else if (error != 0) { } else if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "one_mode5"; message = "有报警";
//申请异常位任务 //申请异常位任务
applyErrorTask(); applyErrorTask();
} else { } else {
@@ -304,7 +299,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//木箱入库申请入库任务 //木箱入库申请入库任务
if (mode == 6 && !requireSucess){ if (mode == 6 && !requireSucess){
if (StrUtil.isEmpty(barcode)){ if (StrUtil.isEmpty(barcode)){
message = "universal_notCreateInstMessage8"; message = "托盘条码为空";
} }
applyIn(StorageTypeEnum.BOX_IN.getType(),mode); applyIn(StorageTypeEnum.BOX_IN.getType(),mode);
@@ -313,7 +308,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//子卷入库申请入库任务 //子卷入库申请入库任务
if (mode == 7 && move == 1 && !requireSucess){ if (mode == 7 && move == 1 && !requireSucess){
if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){ if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){
message = "universal_notCreateInstMessage8"; message = "托盘条码为空、或者子卷码为空";
} }
applyIn(StorageTypeEnum.STORAGE.getType(),mode); applyIn(StorageTypeEnum.STORAGE.getType(),mode);
@@ -323,7 +318,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//申请空托盘入库 //申请空托盘入库
if (mode == 9 && move == 1 && !requireSucess){ if (mode == 9 && move == 1 && !requireSucess){
if (container_type==0){ if (container_type==0){
message = "universal_notCreateInstMessage7"; message = "托盘类型为空";
} }
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
@@ -332,14 +327,15 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
//申请退货入库 //申请退货入库
if (mode == 18 && move == 1 && !requireSucess){ if (mode == 18 && move == 1 && !requireSucess){
if (StrUtil.isEmpty(barcode)){ if (StrUtil.isEmpty(barcode)){
message = "universal_notCreateInstMessage8"; message = "托盘条码为空";
} }
applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode); applyBoxReturnTask(StorageTypeEnum.BOX_RETURN.getType(), mode);
} }
//申请高度
if (mode == 23 && !requireSucess){ if (mode == 23 && !requireSucess){
if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){ if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){
message = "universal_notCreateInstMessage8"; message = "条码为空";
} }
applyErrorHeight(); applyErrorHeight();
@@ -413,6 +409,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.getBoxInfo(param); String response = acsToWmsService.getBoxInfo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请高度等级,返回参数:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -468,6 +465,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param); String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请退货入库,返回参数:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -506,10 +504,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
map2.put("code","to_task"); map2.put("code","to_task");
map2.put("value","0"); map2.put("value","0");
list.add(map2); list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>(); Map map4 = new HashMap<>();
map4.put("code","to_container_type"); map4.put("code","to_container_type");
map4.put("value","0"); map4.put("value","0");
@@ -574,6 +568,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param); String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "申请空托盘出入库,返回参数:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -623,6 +618,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param); String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "木箱、子卷入库申请入库任务,返回参数:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -787,7 +783,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
map3.put("code", "to_container_type"); map3.put("code", "to_container_type");
map3.put("value", containerType); map3.put("value", containerType);
list.add(map3); list.add(map3);
this.writing(list); this.writing(list);
List list2 = new ArrayList(); List list2 = new ArrayList();
Map map4 = new HashMap(); Map map4 = new HashMap();
@@ -977,7 +972,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateTaskMessage", notCreateTaskMessage);
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
jo.put("feedMessage", LangProcess.msg(feedMessage)); jo.put("feedMessage", LangProcess.msg(feedMessage));

View File

@@ -191,7 +191,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = "universal_off-line"; message = "脱机";
//有报警 //有报警
@@ -200,15 +200,15 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
this.setIserror(false); this.setIserror(false);
if (error != 0) { if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "有报警";
} }
Instruction instruction = instructionService.findByCode(String.valueOf(task)); Instruction instruction = instructionService.findByCode(String.valueOf(task));
//空箱出库开盖位,申请开盖 //空箱出库开盖位,申请开盖
if (mode == 7 && move == 1 && task > 0 ) { if (mode == 15 && move == 1 && task > 0 ) {
//不允许开盖,完成出库任务,自动去扫码位 //不允许开盖,完成出库任务,自动去扫码位
if (StrUtil.isEmpty(instruction.getVehicle_code())){ if (StrUtil.isEmpty(instruction.getVehicle_code())){
message = "universal_notCreateInstMessage8"; message = "任务托盘码为空";
} }
applyUnbox(instruction.getVehicle_code()); applyUnbox(instruction.getVehicle_code());
@@ -252,6 +252,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.getBoxInfo(param); String response = acsToWmsService.getBoxInfo(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
message = "木箱开盖,返回参数:" + jo;
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -266,7 +267,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
List list1 = new ArrayList(); List list1 = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_command"); map.put("code", "to_command");
map.put("value", 7); map.put("value", 15);
list1.add(map); list1.add(map);
this.writing(list1); this.writing(list1);
}else { }else {
@@ -316,7 +317,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
try { try {
this.writing(list); this.writing(list);
} catch (Exception e) { } catch (Exception e) {
message = "universal_write_erro"; message = "写入异常";
} }
this.setRequireSucess(true); this.setRequireSucess(true);
@@ -412,7 +413,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("hand_barcode", hand_barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
jo.put("is_click", true); jo.put("is_click", true);
@@ -512,7 +513,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
return false; return false;
} }
} }
message = "universal_message5"; message = "申请任务成功";
requireSucess = true; requireSucess = true;
return true; return true;
} }

View File

@@ -382,11 +382,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} }
String start_device_code = dto.getStart_device_code(); String start_device_code = dto.getStart_device_code();
if(StrUtil.isNotEmpty(dto.getTask_code())){ if (StrUtil.isNotEmpty(dto.getTask_code())) {
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class) List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class)
.eq(InstructionMybatis::getTask_code, dto.getTask_code())); .eq(InstructionMybatis::getTask_code, dto.getTask_code()));
if(CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code() if (CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code()
.equals(start_device_code))){ .equals(start_device_code))) {
return; return;
} }
} }
@@ -501,26 +501,28 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} }
} }
//判断是否是仙工AGV //判断是否是仙工AGV
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code()); Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
if (StrUtil.equals(task.getRequest_again_success(), "1")) { // if (StrUtil.equals(task.getRequest_again_success(), "1")) {
//追加订单 // //追加订单
HttpResponse result = xiangGongAgvService.addOrderSequences(dto); // HttpResponse result = xiangGongAgvService.addOrderSequences(dto);
if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) { // if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
dto.setSend_status("2"); // dto.setSend_status("2");
} else { // } else {
dto.setSend_status("1"); // dto.setSend_status("1");
} // }
//
// } else
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
//仙工叉车 //仙工叉车
} else if (deviceByCode.getDeviceDriver() instanceof BeltConveyorDeviceDriver&& dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto); HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) { if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2"); dto.setSend_status("2");
} else { } else {
dto.setSend_status("1"); dto.setSend_status("1");
} }
} else { } else if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
//创建运单序列 //一楼agv任务创建运单序列
HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto); HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) { if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2"); dto.setSend_status("2");
@@ -534,7 +536,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
log.error(e.getMessage()); log.error(e.getMessage());
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("创建指令报错") .device_code("创建指令报错")
.content("任务号"+ dto.getTask_code()+ "报错原因:" + e.getMessage()) .content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(2);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1527,7 +1529,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
Iterator<Instruction> it = instructions.iterator(); Iterator<Instruction> it = instructions.iterator();
while (it.hasNext()) { while (it.hasNext()) {
Instruction inst = it.next(); Instruction inst = it.next();
if (StrUtil.equals(devicecode, inst.getNext_device_code()) && Integer.parseInt(inst.getInstruction_status())<=Integer.parseInt(InstructionStatusEnum.BUSY.getIndex())) { if (StrUtil.equals(devicecode, inst.getNext_device_code()) && Integer.parseInt(inst.getInstruction_status()) <= Integer.parseInt(InstructionStatusEnum.BUSY.getIndex())) {
return inst; return inst;
} }
} }
@@ -1867,7 +1869,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} }
private boolean regional(String start_device_code, String next_device_code) { private boolean regional(String start_device_code, String next_device_code) {
Device startdevice = deviceAppService.findDeviceByCode(start_device_code); Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);

View File

@@ -157,3 +157,8 @@ sa-token:
token-prefix: Bearer token-prefix: Bearer
is-read-cookie: false is-read-cookie: false
is-read-body: false is-read-body: false
agvToAcs:
addr: http://http://10.1.3.96:8011

View File

@@ -1,4 +1,4 @@
universal_null = \u7A7A universal_null =\u7A7A
universal_off-line=\u8131\u673A universal_off-line=\u8131\u673A
universal_stand-alone=\u5355\u673A universal_stand-alone=\u5355\u673A
universal_standby=\u5F85\u673A universal_standby=\u5F85\u673A