|
|
|
@ -33,9 +33,9 @@ public class RCS { |
|
|
|
public static void init() { |
|
|
|
String fs = Joiner.on("\n").join(FileUtils.readLines(new File("./yvan-rcs-web/src/example/example1.json"), StandardCharsets.UTF_8)); |
|
|
|
JsonWrapper jw = new JsonWrapper(fs); |
|
|
|
if (LogisticsRuntimeService.findByEnvCode(1L) == null) { |
|
|
|
LogisticsRuntimeService.createEnv(1); |
|
|
|
LogisticsRuntime runtime = LogisticsRuntimeService.findByEnvCode(1); |
|
|
|
if (LogisticsRuntimeService.INSTANCE.findByEnvCode(1L) == null) { |
|
|
|
LogisticsRuntimeService.INSTANCE.createEnv(1); |
|
|
|
LogisticsRuntime runtime = LogisticsRuntimeService.INSTANCE.findByEnvCode(1); |
|
|
|
runtime.loadMap(jw); |
|
|
|
|
|
|
|
runtime.start(); |
|
|
|
@ -68,7 +68,7 @@ public class RCS { |
|
|
|
public static AddTaskResult addTask(long envId, AddTaskRequest request) { |
|
|
|
AddTaskResult result = new AddTaskResult(); |
|
|
|
|
|
|
|
LogisticsRuntime logisticsRuntime = LogisticsRuntimeService.findByEnvCode(envId); |
|
|
|
LogisticsRuntime logisticsRuntime = LogisticsRuntimeService.INSTANCE.findByEnvCode(envId); |
|
|
|
String bizTaskId = logisticsRuntime.taskService.addBizTask(request); |
|
|
|
result.bizTaskId = bizTaskId; |
|
|
|
|
|
|
|
@ -92,7 +92,7 @@ public class RCS { |
|
|
|
|
|
|
|
AddTaskResult result = RCS.addTask(envId, request); |
|
|
|
|
|
|
|
LogisticsRuntime logisticsRuntime = LogisticsRuntimeService.findByEnvCode(envId); |
|
|
|
LogisticsRuntime logisticsRuntime = LogisticsRuntimeService.INSTANCE.findByEnvCode(envId); |
|
|
|
RcsTaskBiz bizTask = logisticsRuntime.taskService.waitingTaskList.get(logisticsRuntime.taskService.waitingTaskList.size() - 1); |
|
|
|
|
|
|
|
|
|
|
|
@ -122,6 +122,6 @@ public class RCS { |
|
|
|
} |
|
|
|
|
|
|
|
public static LogisticsRuntime getDemo() { |
|
|
|
return LogisticsRuntimeService.findByEnvCode(1L); |
|
|
|
return LogisticsRuntimeService.INSTANCE.findByEnvCode(1L); |
|
|
|
} |
|
|
|
} |
|
|
|
|