This commit is contained in:
2022-12-14 22:15:42 +08:00
parent 0cb0701378
commit 35d074c00e
4 changed files with 13 additions and 15 deletions

View File

@@ -109,6 +109,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
String device_code; String device_code;
//后工位申请任务请求时间 //后工位申请任务请求时间
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
//前工位申请任务请求时间 //前工位申请任务请求时间
@@ -139,6 +140,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
task2 = this.itemProtocol.getTask2(); task2 = this.itemProtocol.getTask2();
if (mode != last_mode) { if (mode != last_mode) {
if (mode == 2){
this.setRequireBackSucess(false);
this.setRequireHeadSucess(false);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
} }
@@ -151,16 +156,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
logServer.deviceExecuteLog(this.device_code, "", "", "信号status" + last_status + "->" + status); logServer.deviceExecuteLog(this.device_code, "", "", "信号status" + last_status + "->" + status);
} }
if (move1 != last_move1) { if (move1 != last_move1) {
if (move1 == 0) {
this.setRequireHeadSucess(false);
}
logServer.deviceItemValue(this.device_code, "move1", String.valueOf(move1)); logServer.deviceItemValue(this.device_code, "move1", String.valueOf(move1));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move1" + last_move1 + "->" + move1); logServer.deviceExecuteLog(this.device_code, "", "", "信号move1" + last_move1 + "->" + move1);
} }
if (move2 != last_move2) { if (move2 != last_move2) {
if (move2 == 0) {
this.setRequireBackSucess(false);
}
logServer.deviceItemValue(this.device_code, "move2", String.valueOf(move2)); logServer.deviceItemValue(this.device_code, "move2", String.valueOf(move2));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2" + last_move2 + "->" + move2); logServer.deviceExecuteLog(this.device_code, "", "", "信号move2" + last_move2 + "->" + move2);
} }
@@ -317,7 +316,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
} }
} }
//后工位取货时判断取货位光电信号 //后工位取货时判断取货位光电信号
if (mode == 3 && action2 == 2 && move2 == 0 && task2 > 0) { if (mode == 3 && action2 == 1 && move2 == 0 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2)); Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String start_device_code = inst1.getStart_device_code(); String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code); Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
@@ -385,14 +384,14 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
logServer.deviceExecuteLog(device_code, "", String.valueOf(task2), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task2), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireBackSucess:" + requireBackSucess);
} }
//前工位申请任务 //前工位申请任务
if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && task1 > 0 && !requireHeadSucess) { if (mode == 2 && move2 == 0 && action2 == 0 && task2 == 0 && move1 == 0 && !requireHeadSucess) {
instruction_require(); instruction_require();
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess);
} }
break; break;
case 3: case 3:
//前工位申请任务 //前工位申请任务
if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && action1 == 0 && !requireHeadSucess) { if (mode == 3 && move2 == 1 && action2 == 1 && move1 == 0 && !requireHeadSucess) {
instruction_require(); instruction_require();
logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess); logServer.deviceExecuteLog(device_code, "", String.valueOf(task1), "move2:" + move2 + ",action2:" + action2 + ",move1:" + move1 + ",task2:" + task2 + ",requireHeadSucess:" + requireHeadSucess);
} }

View File

@@ -852,7 +852,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String compound_task = acsTask.getCompound_task(); String compound_task = acsTask.getCompound_task();
String next_point_code = acsTask.getNext_point_code(); String next_point_code = acsTask.getNext_point_code();
String next_device_code = acsTask.getNext_device_code(); String next_device_code = acsTask.getNext_device_code();
String maxInstnumber = paramService.findByCode(AcsConfig.MAXINSTNUMBER).getValue();
/** /**
* 开始平均分解校验 * 开始平均分解校验

View File

@@ -143,7 +143,7 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
for (int i = 0; i < taskArr.size(); i++) { for (int i = 0; i < taskArr.size(); i++) {
JSONObject taskObj = taskArr.getJSONObject(i); JSONObject taskObj = taskArr.getJSONObject(i);
//区查询空盅缓存为是否有空位 如果有就生成到空盅缓存位的任务 //区查询空盅缓存为是否有空位 如果有就生成到空盅缓存位的任务
JSONObject json = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0); JSONObject json = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and point_code != 'KLZHC01'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) { if (ObjectUtil.isNotEmpty(json)) {
JSONObject ivtJson = ivtTab.query("point_code = '" + taskObj.getString("point_code1") + "'").uniqueResult(0); JSONObject ivtJson = ivtTab.query("point_code = '" + taskObj.getString("point_code1") + "'").uniqueResult(0);
json.put("lock_type", "2"); json.put("lock_type", "2");
@@ -261,7 +261,7 @@ public class KzdjwSendEmpVehicleTask extends AbstractAcsTask {
} else { } else {
this.updateTaskStatus(taskObj, "0"); this.updateTaskStatus(taskObj, "0");
} }
}else { } else {
throw new BadRequestException("任务已删除或者已完成!"); throw new BadRequestException("任务已删除或者已完成!");
} }
} }

View File

@@ -214,10 +214,10 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表 WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_END.getCode() + "'").getResultJSONArray(0); JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_END.getCode() + "'").getResultJSONArray(0);
for (int i = 0; i < taskArr.size(); i++) { for (int i = 0; i < taskArr.size(); i++) {
//确认终点的任务 //确认终点的任务 取空的任务
JSONObject taskObj = taskArr.getJSONObject(i); JSONObject taskObj = taskArr.getJSONObject(i);
String task_group_id = taskObj.getString("task_group_id"); String task_group_id = taskObj.getString("task_group_id");
//查询跟确认终点任务同一个任务组的确认起点的任务 //查询跟确认终点任务同一个任务组的确认起点的任务 取满的任务
JSONObject taskObj2 = taskTab.query("handle_class = '" + THIS_CLASS + "'and task_group_id = '" + task_group_id + "' and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_START.getCode() + "'").uniqueResult(0); JSONObject taskObj2 = taskTab.query("handle_class = '" + THIS_CLASS + "'and task_group_id = '" + task_group_id + "' and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_START.getCode() + "'").uniqueResult(0);
//1、查询未锁定,空料盅,空盅位暂存区的起始点位 如果有取空的点位 再判断取满时 是否有放货位 //1、查询未锁定,空料盅,空盅位暂存区的起始点位 如果有取空的点位 再判断取满时 是否有放货位
JSONObject json1 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '2' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0); JSONObject json1 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '2' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0);
@@ -255,7 +255,7 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
taskTab.update(taskObj2); taskTab.update(taskObj2);
} else { } else {
JSONObject json3 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "'").uniqueResult(0); JSONObject json3 = pointTab.query("is_used = '1' AND is_delete = '0' AND lock_type = '1' AND point_status = '1' AND region_code = '" + RegionTypeEnum.KLZHCQ.getCode() + "' and point_code = 'KLZHC12'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(json3)) { if (ObjectUtil.isNotEmpty(json3)) {
//锁定取空任务的起点 //锁定取空任务的起点
json1.put("lock_type", "2"); json1.put("lock_type", "2");