|
@ -21,6 +21,7 @@ import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyor |
|
|
import org.nl.acs.device_driver.basedriver.haokai_auto_conveyor.HaoKaiAutoConveyorDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.haokai_auto_conveyor.HaoKaiAutoConveyorDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; |
|
|
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; |
|
|
|
|
|
import org.nl.acs.instruction.enums.InstTypeEnum; |
|
|
import org.nl.acs.instruction.service.InstructionService; |
|
|
import org.nl.acs.instruction.service.InstructionService; |
|
|
import org.nl.acs.instruction.service.dto.Instruction; |
|
|
import org.nl.acs.instruction.service.dto.Instruction; |
|
|
import org.nl.acs.opc.Device; |
|
|
import org.nl.acs.opc.Device; |
|
@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.concurrent.CopyOnWriteArrayList; |
|
|
import java.util.regex.Pattern; |
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -67,7 +69,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu |
|
|
DeviceAppService deviceAppService; |
|
|
DeviceAppService deviceAppService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
NDCAgvService ndcAgvService; |
|
|
NDCAgvService ndcAgvService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
ParamService paramService; |
|
|
ParamService paramService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
RouteLineService routeLineService; |
|
|
RouteLineService routeLineService; |
|
@ -290,7 +292,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu |
|
|
dto.setStart_parent_code(task.getStart_parent_code()); |
|
|
dto.setStart_parent_code(task.getStart_parent_code()); |
|
|
dto.setNext_parent_code(task.getNext_parent_code()); |
|
|
dto.setNext_parent_code(task.getNext_parent_code()); |
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotEmpty(task.getTask_type())){ |
|
|
if (ObjectUtil.isNotEmpty(task.getTask_type())) { |
|
|
dto.setInstruction_type(task.getTask_type()); |
|
|
dto.setInstruction_type(task.getTask_type()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -312,12 +314,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu |
|
|
RouteLineDto routeLineDto = shortPathsList.get(i); |
|
|
RouteLineDto routeLineDto = shortPathsList.get(i); |
|
|
String route_device = routeLineDto.getDevice_code(); |
|
|
String route_device = routeLineDto.getDevice_code(); |
|
|
String route_next_device = routeLineDto.getNext_device_code(); |
|
|
String route_next_device = routeLineDto.getNext_device_code(); |
|
|
if (route_device.equals(dto.getStart_device_code()) && route_next_device.equals(dto.getNext_device_code())){ |
|
|
if (route_device.equals(dto.getStart_device_code()) && route_next_device.equals(dto.getNext_device_code())) { |
|
|
route = routeLineDto; |
|
|
route = routeLineDto; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (ObjectUtil.isEmpty(route)){ |
|
|
if (ObjectUtil.isEmpty(route)) { |
|
|
throw new BadRequestException("未查询到相关路由!"); |
|
|
throw new BadRequestException("未查询到相关路由!"); |
|
|
} |
|
|
} |
|
|
if (StrUtil.equals(route.getType(), "1")) { |
|
|
if (StrUtil.equals(route.getType(), "1")) { |
|
@ -1192,7 +1194,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Instruction findByInstCodeFromCache(String inst_code) { |
|
|
public Instruction findByInstCodeFromCache(String inst_code) { |
|
|
for (int i = 0; i < this.instructions.size(); i++) { |
|
|
for (int i = 0; i < this.instructions.size(); i++) { |
|
@ -1204,6 +1205,16 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public boolean querySameTypeInst(String task_type) { |
|
|
|
|
|
long count = Optional.ofNullable(this.instructions) |
|
|
|
|
|
.orElse(new CopyOnWriteArrayList<>()) |
|
|
|
|
|
.stream() |
|
|
|
|
|
.filter(instruction -> instruction.getInstruction_type().equals(InstTypeEnum._1.getIndex()) |
|
|
|
|
|
|| instruction.getInstruction_type().equals(InstTypeEnum._2.getIndex())).count(); |
|
|
|
|
|
return count > 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Instruction findByContainer(String container_code) { |
|
|
public Instruction findByContainer(String container_code) { |
|
|
Iterator var3 = instructions.iterator(); |
|
|
Iterator var3 = instructions.iterator(); |
|
|