rev 更新bug
This commit is contained in:
@@ -21,6 +21,7 @@ import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
|
||||
import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
@@ -234,7 +235,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
|
||||
if(mode == 2){
|
||||
clearWrite();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +271,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move == 1 && !requireSucess && task==0) {
|
||||
if (move == 1 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
@@ -481,6 +484,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
String start_device_code = taskdto.getStart_device_code();
|
||||
String route_plan_code = taskdto.getRoute_plan_code();
|
||||
String next_device_code = "";
|
||||
String interactionJson = taskdto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String containerType = interactionJsonDTO.getContainerType();
|
||||
/**
|
||||
* 开始平均分配
|
||||
*/
|
||||
@@ -519,7 +525,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
next_point_code = next_device_code;
|
||||
}
|
||||
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);
|
||||
packageData(instdto, route_plan_code, taskdto, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, priority,containerType);
|
||||
log.error("=================================,{}", instdto.getCreate_by());
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
@@ -554,7 +560,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
Map map1 = new HashMap();
|
||||
map1.put("code", "to_task");
|
||||
map1.put("value", inst.getInstruction_code());
|
||||
list2.add(map);
|
||||
list2.add(map1);
|
||||
this.writing(list2);
|
||||
List list4 = new ArrayList();
|
||||
Map map3 = new HashMap();
|
||||
@@ -570,7 +576,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
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) {
|
||||
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) {
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
instdto.setRemark(taskdto.getRemark());
|
||||
@@ -588,6 +594,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
instdto.setPriority(priority);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(start_point_code);
|
||||
instdto.setVehicle_type(containerType);
|
||||
}
|
||||
|
||||
public void writeData(String next_addr, Instruction instdto, Map map) {
|
||||
@@ -763,4 +770,30 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void clearWrite() {
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_target");
|
||||
map.put("value", "0");
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", "0");
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code", "to_container_type");
|
||||
map4.put("value", "0");
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
message = null;
|
||||
vehicle_code = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.led.led_screen.LedScreenDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
|
||||
import org.nl.acs.enums.StorageTypeEnum;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
@@ -306,7 +307,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
}
|
||||
if (move != 0) {
|
||||
if (move != 1) {
|
||||
remark = "universal_remark3";
|
||||
}
|
||||
if (task != 0) {
|
||||
@@ -475,6 +476,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
String vehiclecode = taskdto.getVehicle_code();
|
||||
String priority = taskdto.getPriority();
|
||||
Instruction instdto = new Instruction();
|
||||
String interactionJson = taskdto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
String containerType = interactionJsonDTO.getContainerType();
|
||||
if (TaskTypeEnum.AGV_Task.getIndex().equals(taskdto.getTask_type())){
|
||||
String route_plan_code = taskdto.getRoute_plan_code();
|
||||
|
||||
@@ -489,17 +493,18 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
Integer start = 0;
|
||||
String start_device_code = pathlist.get(start);
|
||||
String next_device_code = pathlist.get(start+1);
|
||||
|
||||
//判断有无出入库任务是相同路线
|
||||
TaskDto dto = taskserver.findByCodeAndExcute(taskdto.getNext_device_code(), taskdto.getStart_device_code());
|
||||
if (ObjectUtil.isNotEmpty(dto)){
|
||||
requireSucess = false;
|
||||
return false;
|
||||
}
|
||||
packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,start_device_code,next_device_code);
|
||||
packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,start_device_code,next_device_code,containerType);
|
||||
}else {
|
||||
|
||||
|
||||
packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,taskdto.getStart_device_code(),taskdto.getNext_device_code());
|
||||
packageInstrcutData(instdto, taskdto, taskid, taskcode, vehiclecode, priority,taskdto.getStart_device_code(),taskdto.getNext_device_code(),containerType);
|
||||
}
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
@@ -525,9 +530,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
map2.put("value", instdto.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_container_type");
|
||||
map3.put("value", instdto.getVehicle_type());
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
led_message = getLedMessage(instdto);
|
||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||
@@ -601,7 +611,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
return json;
|
||||
}
|
||||
|
||||
private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode) {
|
||||
private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode,String containerType) {
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(taskdto.getRoute_plan_code());
|
||||
instdto.setRemark(taskdto.getRemark());
|
||||
@@ -621,6 +631,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(device_code);
|
||||
instdto.setInstruction_type(taskdto.getTask_type());
|
||||
instdto.setVehicle_type(containerType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
List toInstructions;
|
||||
|
||||
//行架机械手申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
if (mode == 2 && move == 0 && !requireSucess) {
|
||||
boolean res = applyTask();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
@@ -407,10 +407,10 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
ManipulatorCacheDeviceDriver manipulatorCacheDeviceDriver;
|
||||
if (startDevice.getDeviceDriver() instanceof ManipulatorCacheDeviceDriver) {
|
||||
manipulatorCacheDeviceDriver = (ManipulatorCacheDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (manipulatorCacheDeviceDriver.getMode() != 2 && manipulatorCacheDeviceDriver.getAction() !=1) {
|
||||
notCreateInstMessage = "universal_notCreateInstMessage3";
|
||||
return false;
|
||||
}
|
||||
// if (manipulatorCacheDeviceDriver.getMode() != 2) {
|
||||
// notCreateInstMessage = "universal_notCreateInstMessage3";
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
String taskid = taskDto.getTask_id();
|
||||
|
||||
@@ -31,4 +31,9 @@ public class InteractionJsonDTO {
|
||||
*子卷长度
|
||||
*/
|
||||
private String len;
|
||||
|
||||
/**
|
||||
* 托盘类型
|
||||
*/
|
||||
private String containerType;
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
requireSucess = true;
|
||||
break;
|
||||
}
|
||||
if (ObjectUtil.isNotNull(list)) {
|
||||
if (list.size() != 0) {
|
||||
this.writing(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user