REV 专机设备、缓存线

This commit is contained in:
2023-06-08 18:32:55 +08:00
parent 105e5d52e9
commit 756a2daf34
6 changed files with 25 additions and 8 deletions

View File

@@ -482,6 +482,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
if (taskDto != null) {
taskDto.setExt_param(new HashMap<>());
taskDto.setTask_status(StatusEnum.TASK_RUNNING.getCode());
taskDto.getExt_param().put("inbox", "" + docking_barcode);
taskDto.setVehicle_code(String.valueOf(docking_barcode));
taskserver.update(taskDto);
@@ -535,12 +536,12 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
this.noFeedAgvMessage = this.replace(noFeedMessage);
}
} else if (agvphase == 0x10 || agvphase == 0x27) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_agv_get_finish", "1");
map.put("to_agv_put_finish", "0");
this.writing(map);
//agv取空框1完毕或取空框2完毕
if (mode == 1 && move == 0 && ObjectUtil.isNotEmpty(inst)) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_agv_get_finish", "1");
map.put("to_agv_put_finish", "0");
this.writing(map);
if (mode == 1 && move == 0 && task_finish == 1 && ObjectUtil.isNotEmpty(inst)) {
inst.setExecute_status(InstActionEnum.EXECUTE_GET_EMPTY_FINISH.getCode());
instructionService.update(inst);
byte[] data = agvService.sendAgvTwoModeInst(agvphase, index, 0);
@@ -558,6 +559,11 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
.findFirst()
.orElse(null);
if (instruction != null) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
instructionService.issuedCacheInfo(instruction);
logServer.deviceExecuteLog(device_code, "", "", "第一条指令完成,指令号:'" + inst.getInstruction_code() + "',下发第二条指令,指令号:'" + instruction.getInstruction_code() + "'");
}
@@ -632,6 +638,11 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_agv_get_finish", "1");
if (task == 0 || Integer.parseInt(inst.getTask_code()) == task) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
map.put("to_task_finish", "1");
}
this.writing(map);

View File

@@ -330,7 +330,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
map.put("to_confirm_finished", "1");
}
//map.put("to_order", "0");
map.put("to_clear", "1");
//map.put("to_clear", "1");
this.writing(map);
}

View File

@@ -287,6 +287,9 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
redisUtils.setExpire(this.device_code, null, ApplyTaskTime.APPLY_TIME, TimeUnit.SECONDS);
//判断是否需要AGV搬运 需要就申请任务 不需要不申请
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder()));
if (produceshiftorderDto == null) {
produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder()));
}
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
JSONObject reqParam = new JSONObject();
reqParam.put("device_code", this.getDevice_code());

View File

@@ -304,7 +304,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
map.put("to_confirm_finished", "1");
}
//map.put("to_order", "0");
map.put("to_clear", "1");
//map.put("to_clear", "1");
this.writing(map);
}

View File

@@ -291,6 +291,9 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//判断是否需要AGV搬运 需要就申请任务 不需要不申请
JSONObject reqParam = new JSONObject();
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(this.getOrder()));
if (produceshiftorderDto == null) {
produceshiftorderDto = produceshiftorderService.findByCode(String.valueOf(this.getOrder()));
}
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
reqParam.put("type", StatusEnum.FULL_REQ.getCode());
reqParam.put("device_code", this.getDevice_code());

View File

@@ -147,7 +147,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
@Override
public ProduceshiftorderDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
JSONObject json = wo.query("order_code ='" + code + "' and is_deleted = '0'").uniqueResult(0);
JSONObject json = wo.query("order_code ='" + code + "' and is_deleted = '0'","create_time").uniqueResult(0);
if (ObjectUtil.isEmpty(json)) {
return null;
}