1.机械手写入用新的重载写入
2.多压机请求叫料按压机顺序执行
This commit is contained in:
@@ -169,7 +169,9 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
hfStationDeviceDriver = (HfStationDeviceDriver) device.getDeviceDriver();
|
||||||
if (hfStationDeviceDriver.getMove() == 1) {
|
if (hfStationDeviceDriver.getMove() == 1) {
|
||||||
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手取货时,开始反馈电气信号");
|
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手取货时,开始反馈电气信号");
|
||||||
this.writing("to_command", "2");
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("to_command", "2");
|
||||||
|
this.writing(map);
|
||||||
} else {
|
} else {
|
||||||
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手取货时,取货位不满足有货条件");
|
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手取货时,取货位不满足有货条件");
|
||||||
}
|
}
|
||||||
@@ -183,11 +185,13 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
Instruction instructionDto = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction instructionDto = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
instructionService.cancel(instructionDto.getInstruction_id());
|
instructionService.cancel(instructionDto.getInstruction_id());
|
||||||
taskserver.cancel(instructionDto.getTask_id());
|
taskserver.cancel(instructionDto.getTask_id());
|
||||||
this.writing("to_onset", "0");
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
this.writing("to_target", "0");
|
map.put("to_onset", "0");
|
||||||
this.writing("to_task", "0");
|
map.put("to_target", "0");
|
||||||
this.writing("to_barcode", "0");
|
map.put("to_task", "0");
|
||||||
this.writing("to_command", "4");
|
map.put("to_barcode", "0");
|
||||||
|
map.put("to_command", "4");
|
||||||
|
this.writing(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
//申请放货
|
//申请放货
|
||||||
@@ -201,7 +205,9 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
int move = hfStationDeviceDriver.getMove();
|
int move = hfStationDeviceDriver.getMove();
|
||||||
if (move == 0) {
|
if (move == 0) {
|
||||||
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手放货时,开始反馈电气信号");
|
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手放货时,开始反馈电气信号");
|
||||||
this.writing("to_command", "3");
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("to_command", "3");
|
||||||
|
this.writing(map);
|
||||||
} else {
|
} else {
|
||||||
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手放货时,放货位不满足无货条件");
|
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手放货时,放货位不满足无货条件");
|
||||||
}
|
}
|
||||||
@@ -236,11 +242,13 @@ public class HfGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手任务完成,开始反馈电气信号");
|
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "机械手任务完成,开始反馈电气信号");
|
||||||
this.writing("to_onset", "0");
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
this.writing("to_target", "0");
|
map.put("to_onset", "0");
|
||||||
this.writing("to_task", "0");
|
map.put("to_target", "0");
|
||||||
this.writing("to_barcode", "0");
|
map.put("to_task", "0");
|
||||||
this.writing("to_command", "0");
|
map.put("to_barcode", "0");
|
||||||
|
map.put("to_command", "0");
|
||||||
|
this.writing(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -41,6 +42,9 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
private final String THIS_CLASS = YljCallMaterialTask.class.getName();
|
private final String THIS_CLASS = YljCallMaterialTask.class.getName();
|
||||||
|
|
||||||
|
|
||||||
|
private LinkedHashSet<String> set=new LinkedHashSet<>();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateTaskStatus(JSONObject task, String status) {
|
public void updateTaskStatus(JSONObject task, String status) {
|
||||||
@@ -230,6 +234,8 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
String create_mode = whereJson.getString("create_mode");
|
String create_mode = whereJson.getString("create_mode");
|
||||||
String is_auto_issue = whereJson.getString("is_auto_issue");
|
String is_auto_issue = whereJson.getString("is_auto_issue");
|
||||||
|
|
||||||
|
set.add(point_code2);
|
||||||
|
|
||||||
//生产工单表【PDM_BD_WorkOrder】
|
//生产工单表【PDM_BD_WorkOrder】
|
||||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||||
//任务表【SCH_BASE_Task】
|
//任务表【SCH_BASE_Task】
|
||||||
@@ -261,6 +267,12 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + workDevice + "' and order_status = '3' and is_delete ='0'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除");
|
||||||
|
|
||||||
|
//当前请求设备非优先级最高的设备或请求列表大于1非第二优先级生产任务(防止发了请求后面又不叫了)
|
||||||
|
if(!point_code2.equals(set.toArray()[0])||
|
||||||
|
(set.size()>1&&!point_code2.equals(set.toArray()[1]))){
|
||||||
|
throw new BadRequestException("当前设备"+point_code2+"非最先生产任务!");
|
||||||
|
}
|
||||||
|
|
||||||
SchTaskDto dto = SchTaskDto.builder()
|
SchTaskDto dto = SchTaskDto.builder()
|
||||||
.task_id(IdUtil.getLongId())
|
.task_id(IdUtil.getLongId())
|
||||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||||
@@ -282,6 +294,8 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
taskTab.insert(json);
|
taskTab.insert(json);
|
||||||
|
|
||||||
|
set.remove(point_code2);
|
||||||
|
|
||||||
//创建好立即下发
|
//创建好立即下发
|
||||||
this.immediateNotifyAcs();
|
this.immediateNotifyAcs();
|
||||||
return String.valueOf(dto.getTask_id());
|
return String.valueOf(dto.getTask_id());
|
||||||
@@ -342,4 +356,12 @@ public class YljCallMaterialTask extends AbstractAcsTask {
|
|||||||
throw new BadRequestException("任务已删除或者已完成!");
|
throw new BadRequestException("任务已删除或者已完成!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LinkedHashSet<String> getSet() {
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSet(LinkedHashSet<String> set) {
|
||||||
|
this.set = set;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user