rev 行架任务校验
This commit is contained in:
@@ -81,6 +81,9 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
@LokiLog(type = LokiLogType.AGV)
|
||||
@Override
|
||||
public void sendAgvInstToNDC(String agv_system_type, Instruction inst) {
|
||||
log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
|
||||
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
|
||||
",nextAddress:" + inst.getNext_point_code());
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||
if (!StrUtil.equals(agv_system_type, "1")) {
|
||||
String instcode = inst.getInstruction_code();
|
||||
|
||||
@@ -380,6 +380,14 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtos = this.sortTask(taskDtos);
|
||||
TaskDto taskDto = taskDtos.get(0);
|
||||
|
||||
//存在行架->暂存的AGV任务 需要过滤
|
||||
// 6 行架任务 8烘箱任务
|
||||
if(!StrUtil.equals(taskDto.getTask_type(),"6") || StrUtil.equals(taskDto.getTask_type(),"8")){
|
||||
taskDto = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code());
|
||||
String start_device_code = instruction.getStart_device_code();
|
||||
String next_device_code = instruction.getNext_device_code();
|
||||
@@ -465,11 +473,18 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} else {
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtoList = this.sortTask(taskDtoList);
|
||||
task = taskDtoList.get(0);
|
||||
for(int j=0; j <taskDtoList.size();j++ ){
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtoList = this.sortTask(taskDtoList);
|
||||
task = taskDtoList.get(j);
|
||||
// 6 行架任务 8烘箱任务
|
||||
if(!StrUtil.equals(task.getTask_type(),"6") || StrUtil.equals(task.getTask_type(),"8")){
|
||||
task = null;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(task)) {
|
||||
|
||||
@@ -32,6 +32,9 @@ public class ItemProtocol {
|
||||
//重量
|
||||
public static String item_weight = "weight";
|
||||
|
||||
public static String item_height = "height";
|
||||
|
||||
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
@@ -68,10 +71,14 @@ public class ItemProtocol {
|
||||
public int getMove() {
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return this.getOpcIntegerValue(item_weight);
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return this.getOpcIntegerValue(item_height);
|
||||
}
|
||||
public int getCarrier_direction() {
|
||||
return this.getOpcIntegerValue(item_carrier_direction);
|
||||
}
|
||||
@@ -140,6 +147,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_barcode_length, "条码长度", "DB101.B800"));
|
||||
list.add(new ItemDto(item_barcode, "条码", "DB101.STRING802.50"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB101.D702"));
|
||||
list.add(new ItemDto(item_height, "高度", "DB101.D704"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
int error = 0;
|
||||
int task = 0;
|
||||
int weight = 0;
|
||||
|
||||
int height = 0;
|
||||
String plcbarcode = null;
|
||||
String last_plcbarcode = null;
|
||||
int plcbarcode_length = 0;
|
||||
@@ -112,6 +114,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
int last_error = 0;
|
||||
int last_task = 0;
|
||||
int last_weight = 0;
|
||||
|
||||
int last_height = 0;
|
||||
|
||||
String last_container;
|
||||
String inst_message;
|
||||
String device_code;
|
||||
@@ -215,6 +220,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
task = this.itemProtocol.getTask();
|
||||
plcbarcode = this.itemProtocol.getplcBarCode();
|
||||
plcbarcode_length = this.itemProtocol.getBarCode_length();
|
||||
height = this.itemProtocol.getHeight();
|
||||
to_command = this.itemProtocol.getTo_command();
|
||||
to_target = this.itemProtocol.getTo_target();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
@@ -279,6 +285,9 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号plcbarcode:" + last_plcbarcode + "->" + plcbarcode);
|
||||
}
|
||||
|
||||
if (height != last_height){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号height:" + last_height + "->" + height);
|
||||
}
|
||||
if (task != last_task) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
@@ -341,10 +350,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
}
|
||||
}
|
||||
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcode) && !requireSucess) {
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcode) && !requireSucess && height>0) {
|
||||
instruction_require(newBarcode.trim());
|
||||
}
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcode) && !applySucess) {
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcode) && !applySucess && height>0) {
|
||||
instruction_apply(newBarcode.trim());
|
||||
}
|
||||
break;
|
||||
@@ -363,7 +372,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
}
|
||||
}
|
||||
// 申请贴标
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcodes) && !requireSucess) {
|
||||
if (move > 0 && !StrUtil.isEmpty(newBarcodes) && !requireSucess ) {
|
||||
applyLabeling(newBarcodes);
|
||||
}
|
||||
break;
|
||||
@@ -859,6 +868,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("vehicle_code", container_code);
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("height", height);
|
||||
apply.put("type", "1");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请入库,木箱号:"+ container_code + ",请求参数:" + apply.toString());
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
@@ -1074,6 +1084,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
jo.put("inst_message", this.inst_message);
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("barcode", plcbarcode);
|
||||
jo.put("height", height);
|
||||
jo.put("barcode_length", plcbarcode_length);
|
||||
String requireSucess = "0";
|
||||
if (this.requireSucess) {
|
||||
|
||||
@@ -395,8 +395,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
||||
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
|
||||
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
|
||||
log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ task.getAgv_system_type());
|
||||
log.warn("下发AGV指令数据,"+ "指令号:" + dto.getInstruction_code() + ",AGV系统类型:"+ dto.getAgv_system_type()
|
||||
+ ",AGV指令类型:" + dto.getInstruction_type() );
|
||||
try {
|
||||
if(StrUtil.isEmpty(dto.getAgv_inst_type()) || StrUtil.isEmpty(dto.getAgv_system_type())){
|
||||
log.info("sendAgvInstToNDC 指令校验:" + dto.getInstruction_code() + ",inst_type:" +dto.getInstruction_type()
|
||||
+",inst_system_type:" + dto.getAgv_system_type());
|
||||
}
|
||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||
} catch (Exception e){
|
||||
dto.setSend_status("2");
|
||||
|
||||
@@ -146,7 +146,7 @@ public class AutoCreateInst {
|
||||
//判断agv系统
|
||||
//1、1楼叉车系统
|
||||
//2、2楼1区域AGV系统
|
||||
//3、2楼2区域AGV系统
|
||||
//3、2楼2区域AGV系统 -已废弃
|
||||
if (!StrUtil.equals(agv_system_type, "1")) {
|
||||
// task_type
|
||||
//1、生箔; Itype=1:取空,取满,放空,放满;
|
||||
@@ -164,11 +164,13 @@ public class AutoCreateInst {
|
||||
instdto.setAgv_inst_type("3");
|
||||
} else if (StrUtil.equals(task_type, "8")) {
|
||||
instdto.setAgv_inst_type("2");
|
||||
} else {
|
||||
log.info("未找到对应的AGV指令类型,任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type()) ;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
instdto.setAgv_inst_type("4");
|
||||
}
|
||||
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -56,14 +56,14 @@ public class DictController {
|
||||
|
||||
@ApiOperation("查询字典")
|
||||
@GetMapping(value = "/all")
|
||||
@SaCheckPermission("dict:list")
|
||||
// @SaCheckPermission("dict:list")
|
||||
public ResponseEntity<Object> queryAll(){
|
||||
return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询字典")
|
||||
@GetMapping
|
||||
@SaCheckPermission("dict:list")
|
||||
// @SaCheckPermission("dict:list")
|
||||
public ResponseEntity<Object> query(DictQueryCriteria resources, Pageable pageable){
|
||||
return new ResponseEntity<>(dictService.queryAll(resources,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.modules.quartz.task.AutoCreateInst" level="info" additivity="false">
|
||||
<logger name="org.nl.modules.quartz.task.AutoCreateInst" level="info" additivity="true">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
@@ -38,6 +38,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<include resource="log/LkToAcs.xml"/>
|
||||
<include resource="log/AcsToWms.xml"/>
|
||||
<include resource="log/WmsToAcs.xml"/>
|
||||
<include resource="log/AutoCreateInst.xml"/>
|
||||
<include resource="log/OpcUtil.xml"/>
|
||||
<include resource="log/TwoNDCSocketConnectionAutoRun.xml"/>
|
||||
<include resource="log/AgvNdcTwoDeviceDriver.xml"/>
|
||||
|
||||
Reference in New Issue
Block a user