LingxinMeng 2 vuotta sitten
vanhempi
commit
bd33a392cc

+ 1 - 0
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/configuration/feign/VideoFeignClient.java

@@ -16,6 +16,7 @@ public interface VideoFeignClient {
 
     @GetMapping(value = "/generate")
     ResponseBodyVO<String> generateVideo(
+            @RequestParam("generateVideoKey") String generateVideoKey,
             @RequestParam("nodeName") String nodeName,
             @RequestParam("projectId") String projectId,
             @RequestParam("projectType") String projectType,

+ 9 - 6
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/controller/TaskController.java

@@ -24,24 +24,27 @@ public class TaskController {
      * 修改任务状态
      */
     @GetMapping("/state")
-    public void taskState(@RequestParam("taskId") String taskId, @RequestParam("state") String state, @RequestParam("podName") String podName) {
-        taskService.taskState(taskId, state, podName);
+    public void state(@RequestParam("taskId") String taskId, @RequestParam("state") String state, @RequestParam("podName") String podName) {
+        taskService.state(taskId, state, podName);
     }
 
+    //* -------------------------------- Comment --------------------------------
+
+
     /**
      * Pod 的心跳接口
      */
     @GetMapping("/tick")
-    public void taskTick(@RequestParam("taskId") String taskId) {
-        taskService.taskTick(taskId);
+    public void tick(@RequestParam("taskId") String taskId) {
+        taskService.tick(taskId);
     }
 
     /**
      * 任务执行前调用该接口,确定该任务没有被终止
      */
     @GetMapping("/confirm")
-    public Boolean taskConfirm(@RequestParam("taskId") String taskId) {
-        return taskService.taskConfirm(taskId);
+    public Boolean confirm(@RequestParam("taskId") String taskId) {
+        return taskService.confirm(taskId);
     }
 
 

+ 7 - 20
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/TaskService.java

@@ -16,24 +16,24 @@ import javax.annotation.Resource;
 @Service
 @Slf4j
 public class TaskService {
-    @Resource
-    private TaskUtil taskUtil;
     @Resource
     private TaskMapper taskMapper;
     @Resource
     private ProjectUtil projectUtil;
     @Resource
+    private TaskUtil taskUtil;
+    @Resource
     private CustomRedisClient customRedisClient;
 
 
     // -------------------------------- Comment --------------------------------
 
     @SneakyThrows
-    public void taskState(String taskId, String state, String podName) {
+    public void state(String taskId, String state, String podName) {
         TaskEntity taskEntity = taskMapper.selectById(taskId);
         String projectId = taskEntity.getPId(); // 项目 id
         String lock1 = "taskId:" + taskId + ":state:" + state + ":pod-name:" + podName;
-        String lock2 = "project:" + projectId + ":completed-lock";
+
         customRedisClient.lock(lock1, 1L, 30 * 60L);
         try {
             // 查询相关信息
@@ -43,34 +43,21 @@ public class TaskService {
             String userId = taskEntity.getCreateUserId();   // 用户 id
             PrefixEntity redisPrefix = projectUtil.getRedisPrefixByUserIdAndProjectIdAndTaskId(userId, projectId, taskId);
             // 判断是否完成
-            boolean projectCompleted = taskUtil.isProjectCompleted(redisPrefix, projectId, projectType, maxSimulationTime, taskId, state, podName);
-            if (projectCompleted) {
-                customRedisClient.tryLock(lock2, 10 * 60L);
-                log.info("项目 {} 开始打分。", projectId);
-                taskUtil.score(redisPrefix.getProjectRunningKey(), userId, projectId, projectType);
-                log.info("项目 {} 计算评价等级。", projectId);
-                taskUtil.evaluationLevel(projectId);
-                log.info("项目 {} 开始释放资源。", projectId);
-                taskUtil.done(redisPrefix, projectId, projectType);
-                log.info("项目 {} 运行结束。", projectId);
-            }
+            taskUtil.isProjectCompleted(redisPrefix, userId, projectId, projectType, maxSimulationTime, taskId, state, podName);
         } finally {
-            customRedisClient.unlock(lock2);
             customRedisClient.unlock(lock1);
         }
 
     }
 
 
-    public Boolean taskConfirm(String taskId) {
+    public Boolean confirm(String taskId) {
         return taskUtil.taskConfirm(taskId);
     }
 
-    public void taskTick(String taskId) {
+    public void tick(String taskId) {
         taskUtil.taskTick(taskId);
     }
-
-
 }
 
 

+ 3 - 3
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/ProjectUtil.java

@@ -428,7 +428,7 @@ public class ProjectUtil {
                 clusterId = clusterMapper.selectByUserId(parentUserId).getId();
             }
         } else {
-            throw new RuntimeException("未知账户类型,无法获取集群信息");
+            throw new RuntimeException("未知账户类型,无法获取集群信息");
         }
         String clusterPrefix = "cluster:" + clusterId;
         String clusterRunningPrefix = clusterPrefix + ":running";
@@ -478,7 +478,7 @@ public class ProjectUtil {
 
     public void resetNodeParallelism() {
         kubernetesConfiguration.getNodeList().forEach((node) -> customRedisClient.set("gpu-node:" + node.getHostname() + ":parallelism", node.getParallelism() + ""));
-        esminiConfiguration.getNodeList().forEach((node) -> customRedisClient.set("esmini-node:" + node.getHostname() + ":parallelism", node.getParallelism() + ""));
+        esminiConfiguration.getNodeList().forEach((node) -> customRedisClient.set("cpu-node:" + node.getHostname() + ":parallelism", node.getParallelism() + ""));
     }
 
     /**
@@ -490,7 +490,7 @@ public class ProjectUtil {
         ProjectMessageDTO projectMessageDTO = JsonUtil.jsonToBean(customRedisClient.get(redisPrefix.getProjectRunningKey()), ProjectMessageDTO.class);
         int taskTotal = projectMessageDTO.getTaskTotal();
         int taskCompleted = projectMessageDTO.getTaskCompleted();
-        log.info("complete() 项目 " + projectId + " 完成进度为:" + (taskCompleted + 1) + "/" + taskTotal);
+        log.info("项目 " + projectId + " 完成进度为:" + (taskCompleted + 1) + "/" + taskTotal);
         if (taskCompleted + 1 == taskTotal) {
             result = true;
         } else {    // 项目没有完成

+ 39 - 10
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/util/TaskUtil.java

@@ -4,6 +4,7 @@ import api.common.pojo.constants.DictConstants;
 import api.common.util.*;
 import com.css.simulation.resource.scheduler.configuration.feign.VideoFeignClient;
 import com.css.simulation.resource.scheduler.configuration.kubernetes.KubernetesConfiguration;
+import com.css.simulation.resource.scheduler.configuration.redis.CustomRedisClient;
 import com.css.simulation.resource.scheduler.entity.*;
 import com.css.simulation.resource.scheduler.mapper.*;
 import com.css.simulation.resource.scheduler.service.TaskIndexManager;
@@ -83,6 +84,10 @@ public class TaskUtil {
     private ApiClient apiClient;
     @Resource(name = "myKafkaAdmin")
     private Admin admin;
+    @Resource
+    private TaskUtil taskUtil;
+    @Resource
+    private CustomRedisClient customRedisClient;
 
     public void batchInsertTask(List<TaskEntity> taskEntityList) {
         try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false)) {
@@ -98,8 +103,8 @@ public class TaskUtil {
      * 加事务的话高并发情况下会死锁
      */
     @SneakyThrows
-    public boolean isProjectCompleted(PrefixEntity redisPrefix, String projectId, String projectType, String maxSimulationTime, String taskId, String state, String podName) {
-        boolean result;
+    public void isProjectCompleted(PrefixEntity redisPrefix, String userId, String projectId, String projectType, String maxSimulationTime, String taskId, String state, String podName) {
+        boolean isCompleted;
         String nodeName = projectUtil.getNodeNameOfPod(projectId, podName);
         if (DictConstants.TASK_RUNNING.equals(state)) {  // 运行中的 pod 无需删除
             // 将运行中的任务的 pod 名称放入 redis
@@ -107,7 +112,7 @@ public class TaskUtil {
             taskTick(taskId); // 刷新一下心跳
             log.info("修改任务 " + taskId + " 的状态为 " + state + ",pod 名称为:" + podName);
             taskMapper.updateStateWithStartTime(taskId, state, TimeUtil.getNowForMysql());
-            return false;
+            return;
         } else { // 结束的 pod 都直接删除,并判断项目是否完成
             // -------------------------------- 处理状态 --------------------------------
             log.info("修改任务 {} 的状态为 {} ,pod 名称为 {} ,并删除 pod。", taskId, state, podName);
@@ -143,25 +148,49 @@ public class TaskUtil {
                     log.info("项目 {} 使用 GPU 生成视频。", projectId);
                 } else if (DictConstants.VIDEO_CPU.equals(isChoiceGpu)) {
                     log.info("项目 {} 使用 CPU 生成视频。", projectId);
-                    videoFeignClient.generateVideo(nodeName, projectId, projectType, maxSimulationTime, taskId);
+                    String generateVideoKey = "task:" + taskId + ":generateVideo";
+                    customRedisClient.set(generateVideoKey, "0");
+                    videoFeignClient.generateVideo(generateVideoKey, nodeName, projectId, projectType, maxSimulationTime, taskId);
+                    while (true) {
+                        TimeUnit.SECONDS.sleep(1);
+                        final String generateVideoValue = customRedisClient.get(generateVideoKey);
+                        if (DictConstants.YES.equals(generateVideoValue)) {
+                            break;
+                        }
+                    }
                 } else {
                     throw new RuntimeException("未设置视频生成。");
                 }
             }
             // -------------------------------- 判断项目是否结束 --------------------------------
-            result = projectUtil.complete(redisPrefix, projectId);
-            if (!result) {
-                log.info("项目 " + projectId + " 还未运行完成。");
-                projectUtil.createNextPod(projectId, nodeName, podName);
-            } else {
+            isCompleted = projectUtil.complete(redisPrefix, projectId);
+            if (isCompleted) {
                 //如果项目已完成先把 pod 删除,并归还并行度
                 KubernetesUtil.deletePod2(apiClient, kubernetesConfiguration.getNamespace(), podName);
                 projectUtil.incrementOneParallelismOfGpuNode(nodeName);
+            } else {
+                log.info("项目 " + projectId + " 还未运行完成。");
+                projectUtil.createNextPod(projectId, nodeName, podName);
             }
             RedisUtil.deleteByPrefix(stringRedisTemplate, redisPrefix.getTaskMessageKey());
             RedisUtil.deleteByPrefix(stringRedisTemplate, redisPrefix.getTaskPodKey());
         }
-        return result;
+        //* -------------------------------- 打分 --------------------------------
+        String lock2 = "project:" + projectId + ":completed-lock";
+        try {
+            if (isCompleted) {
+                customRedisClient.tryLock(lock2, 10 * 60L);
+                log.info("项目 {} 开始打分。", projectId);
+                taskUtil.score(redisPrefix.getProjectRunningKey(), userId, projectId, projectType);
+                log.info("项目 {} 计算评价等级。", projectId);
+                taskUtil.evaluationLevel(projectId);
+                log.info("项目 {} 开始释放资源。", projectId);
+                taskUtil.done(redisPrefix, projectId, projectType);
+                log.info("项目 {} 运行结束。", projectId);
+            }
+        } finally {
+            customRedisClient.unlock(lock2);
+        }
     }
 
 

+ 8 - 8
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/FileController.java

@@ -34,10 +34,10 @@ public class FileController {
     private FileDownService fileDownService;
 
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public ResponseBodyVO<Map<String,String>> uploadWj(@RequestParam("file") MultipartFile multipartFile, HttpServletRequest request) {
+    public ResponseBodyVO<Map<String, String>> uploadWj(@RequestParam("file") MultipartFile multipartFile, HttpServletRequest request) {
         //获取文件类型
         String type = request.getParameter("type");
-        String objectPath = request.getParameter("objectPath");
+//        String objectPath = request.getParameter("objectPath");
         if (multipartFile != null) {
             String fileName = "";
             Integer nowTime = TimeUtil.getRq(new Date(), 0);
@@ -48,9 +48,9 @@ public class FileController {
                 new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "文件类型错误!");
             }
             ResponseBodyVO<String> response = fileDownService.upload(multipartFile, fileName);
-            if(response.isStatus()){
+            if (response.isStatus()) {
                 String previewUrl = response.getInfo();
-                Map<String,String> map = new HashMap<>();
+                Map<String, String> map = new HashMap<>();
                 map.put("previewUrl", previewUrl);
                 map.put("fileName", fileName);
                 return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, map);
@@ -61,7 +61,7 @@ public class FileController {
     }
 
     @PostMapping(value = "/download")
-    public void download( HttpServletResponse response, @RequestBody @Validated MinioParameter parms ) throws IOException {
+    public void download(HttpServletResponse response, @RequestBody @Validated MinioParameter parms) throws IOException {
         Response download = fileDownService.download(parms);
         Response.Body body = download.body();
         InputStream inputStream = body.asInputStream();
@@ -88,16 +88,16 @@ public class FileController {
 
     //从minio获取文件列表
     @PostMapping(value = "/queryList")
-    public List<String> queryList(@RequestBody @Validated MinioParameter parms ) throws IOException {
+    public List<String> queryList(@RequestBody @Validated MinioParameter parms) {
         List<String> list = fileDownService.list(parms).getInfo();
         return list;
     }
 
     @PostMapping(value = "/queryList1")
-    public List<String> queryList1(@RequestBody @Validated MinioParameter parms ) throws IOException {
+    public List<String> queryList1(@RequestBody @Validated MinioParameter parms) {
         List<String> list = fileDownService.listDeepOne(parms).getInfo();
         return list;
     }
 
 
-}
+}

+ 2 - 1
simulation-resource-video/src/main/java/com/css/simulation/resource/video/controller/VideoController.java

@@ -33,6 +33,7 @@ public class VideoController {
      */
     @GetMapping(value = "/generate")
     ResponseBodyVO<String> generateVideo(
+            @RequestParam("generateVideoKey") String generateVideoKey,
             @RequestParam("nodeName") String nodeName,
             @RequestParam("projectId") String projectId,
             @RequestParam("projectType") String projectType,
@@ -41,7 +42,7 @@ public class VideoController {
     ) {
         log.info("节点 nodeName 收到项目 " + projectId + " 的任务 " + taskId + " 生成 cpu 视频的请求。");
         new Thread(
-                () -> videoService.generateVideo(nodeName, projectId, projectType, maxSimulationTime, taskId),
+                () -> videoService.generateVideo(generateVideoKey, nodeName, projectId, projectType, maxSimulationTime, taskId),
                 "generateVideo-" + StringUtil.getRandomEightBitUUID()
         ).start();
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);

+ 1 - 1
simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/ConfigMapper.java → simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/ModelConfigMapper.java

@@ -5,7 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
 @Mapper
-public interface ConfigMapper {
+public interface ModelConfigMapper {
     @Select("select vehicle_id vehicleId\n" +
             "from model_config\n" +
             "where id = #{id}")

+ 1 - 1
simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/VehicleMapper.java → simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/ModelVehicleMapper.java

@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.type.JdbcType;
 
 @Mapper
-public interface VehicleMapper {
+public interface ModelVehicleMapper {
 
     @Results(id = "vehicle", value = {
             @Result(column = "id", property = "id", jdbcType = JdbcType.VARCHAR),

+ 1 - 1
simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/DictMapper.java → simulation-resource-video/src/main/java/com/css/simulation/resource/video/mapper/SystemDictMapper.java

@@ -5,7 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
 @Mapper
-public interface DictMapper {
+public interface SystemDictMapper {
     @Select("select dict_name \n" +
             "from system_dict\n" +
             "where dict_code= #{dictCode} and dict_type='carType' and is_deleted='0'")

+ 31 - 30
simulation-resource-video/src/main/java/com/css/simulation/resource/video/service/VideoService.java

@@ -7,9 +7,9 @@ import api.common.util.OsUtil;
 import api.common.util.StringUtil;
 import com.css.simulation.resource.video.configuration.redis.CustomRedisClient;
 import com.css.simulation.resource.video.data.entity.VehicleEntity;
-import com.css.simulation.resource.video.mapper.ConfigMapper;
+import com.css.simulation.resource.video.mapper.ModelConfigMapper;
 import com.css.simulation.resource.video.mapper.SimulationAutomaticProjectMapper;
-import com.css.simulation.resource.video.mapper.VehicleMapper;
+import com.css.simulation.resource.video.mapper.ModelVehicleMapper;
 import com.css.simulation.resource.video.util.MinioUtil;
 import io.minio.MinioClient;
 import lombok.SneakyThrows;
@@ -38,9 +38,9 @@ import java.util.Set;
 @Slf4j
 public class VideoService {
     @Resource
-    private VehicleMapper vehicleMapper;
+    private ModelVehicleMapper modelVehicleMapper;
     @Resource
-    private ConfigMapper configMapper;
+    private ModelConfigMapper modelConfigMapper;
     @Resource
     private SimulationAutomaticProjectMapper simulationAutomaticProjectMapper;
     @Resource
@@ -74,11 +74,11 @@ public class VideoService {
     /**
      * 生成视频
      */
-    public void generateVideo(String nodeName, String projectId, String projectType, String maxSimulationTime, String taskId) {
-        final Set<String> cpuNodeParallelismKeys = customRedisClient.keys("esmini-node*");
+    public void generateVideo(String generateVideoKey, String nodeName, String projectId, String projectType, String maxSimulationTime, String taskId) {
+        final Set<String> cpuNodeParallelismKeys = customRedisClient.keys("cpu-node*");
         // 获取本地 hostname
         final String hostName = OsUtil.getHostName();
-        String cpuNodeParallelismKey = "esmini-node:" + nodeName + ":parallelism";
+        String cpuNodeParallelismKey = "cpu-node:" + nodeName + ":parallelism";
         for (String tempCpuNodeParallelismKey : cpuNodeParallelismKeys) {
             if (tempCpuNodeParallelismKey.contains(hostName)) {
                 cpuNodeParallelismKey = tempCpuNodeParallelismKey;
@@ -112,8 +112,8 @@ public class VideoService {
             // 获取屏幕号创建新的虚拟屏幕
             final long newScreenNum = customRedisClient.increment("screen-number", 1);
             log.info("获取新的屏幕号:" + newScreenNum);
-            final String xvfbCommand2 = xvfbCommand.replaceAll("screen-num", newScreenNum + "");
-            final String esminiCommand2 = esminiCommand.replaceAll("screen-num", newScreenNum + "")
+            final String xvfbCommand2 = xvfbCommand.replaceAll("screen-num", String.valueOf(newScreenNum));
+            final String esminiCommand2 = esminiCommand.replaceAll("screen-num", String.valueOf(newScreenNum))
                     + " " + xoscPath + " " + pictureDirectoryPath + "/screenshot " + StringUtil.doubleToString(Double
                     .parseDouble(maxSimulationTime), 2);
             OsUtil.exec(xvfbCommand2);
@@ -148,6 +148,7 @@ public class VideoService {
         } finally {
             customRedisClient.increment(cpuNodeParallelismKey, 1);
             customRedisClient.unlock(lockName);
+            customRedisClient.set(generateVideoKey, "1");
         }
     }
 
@@ -213,9 +214,9 @@ public class VideoService {
                                         Element node4 = iterator4.next();
                                         if ("Performance".equals(node4.getName())) {
                                             Attribute maxSpeed = node4.attribute("maxSpeed");
-                                            maxSpeed.setText(po.getPerformanceMaxSpeed() + "");
+                                            maxSpeed.setText(String.valueOf(po.getPerformanceMaxSpeed()));
                                             Attribute maxDeceleration = node4.attribute("maxDeceleration");
-                                            maxDeceleration.setText(po.getPerformanceMaxDeceleration() + "");
+                                            maxDeceleration.setText(String.valueOf(po.getPerformanceMaxDeceleration()));
                                             Attribute maxAcceleration = node4.attribute("maxAcceleration");
                                             maxAcceleration.setText(po.getPerformanceMaxAcceleration());
                                         } else if ("BoundingBox".equals(node4.getName())) {
@@ -224,19 +225,19 @@ public class VideoService {
                                                 Element node5 = iterator5.next();
                                                 if ("Center".equals(node5.getName())) {
                                                     Attribute x = node5.attribute("x");
-                                                    x.setText(po.getCenterX() + "");
+                                                    x.setText(String.valueOf(po.getCenterX()));
                                                     Attribute y = node5.attribute("y");
-                                                    y.setText(po.getCenterY() + "");
+                                                    y.setText(String.valueOf(po.getCenterY()));
                                                     Attribute z = node5.attribute("z");
-                                                    z.setText(po.getCenterZ() + "");
+                                                    z.setText(String.valueOf(po.getCenterZ()));
                                                 }
                                                 if ("Dimensions".equals(node5.getName())) {
                                                     Attribute width = node5.attribute("width");
-                                                    width.setText(po.getDimensionsWidth() + "");
+                                                    width.setText(String.valueOf(po.getDimensionsWidth()));
                                                     Attribute length = node5.attribute("length");
-                                                    length.setText(po.getDimensionsHeight() + "");
+                                                    length.setText(String.valueOf(po.getDimensionsHeight()));
                                                     Attribute height = node5.attribute("height");
-                                                    height.setText(po.getDimensionsHeight() + "");
+                                                    height.setText(String.valueOf(po.getDimensionsHeight()));
                                                 }
                                             }
                                         } else if ("Axles".equals(node4.getName())) {
@@ -245,27 +246,27 @@ public class VideoService {
                                                 Element node5 = iterator5.next();
                                                 if ("FrontAxle".equals(node5.getName())) {
                                                     Attribute maxSteering = node5.attribute("maxSteering");
-                                                    maxSteering.setText(po.getFrontAxleMaxSteering() + "");
+                                                    maxSteering.setText(String.valueOf(po.getFrontAxleMaxSteering()));
                                                     Attribute wheelDiameter = node5.attribute("wheelDiameter");
-                                                    wheelDiameter.setText(po.getFrontAxleWheelDiameter() + "");
+                                                    wheelDiameter.setText(String.valueOf(po.getFrontAxleWheelDiameter()));
                                                     Attribute trackWidth = node5.attribute("trackWidth");
-                                                    trackWidth.setText(po.getFrontAxleTrackWidth() + "");
+                                                    trackWidth.setText(String.valueOf(po.getFrontAxleTrackWidth()));
                                                     Attribute positionX = node5.attribute("positionX");
-                                                    positionX.setText(po.getFrontAxlePositionX() + "");
+                                                    positionX.setText(String.valueOf(po.getFrontAxlePositionX()));
                                                     Attribute positionZ = node5.attribute("positionZ");
-                                                    positionZ.setText(po.getFrontAxlePositionZ() + "");
+                                                    positionZ.setText(String.valueOf(po.getFrontAxlePositionZ()));
                                                 }
                                                 if ("RearAxle".equals(node5.getName())) {
                                                     Attribute maxSteering = node5.attribute("maxSteering");
                                                     maxSteering.setText(po.getRearAxleMaxSteering());
                                                     Attribute wheelDiameter = node5.attribute("wheelDiameter");
-                                                    wheelDiameter.setText(po.getRearAxleWheelDiameter() + "");
+                                                    wheelDiameter.setText(String.valueOf(po.getRearAxleWheelDiameter()));
                                                     Attribute trackWidth = node5.attribute("trackWidth");
-                                                    trackWidth.setText(po.getRearAxleTrackWidth() + "");
+                                                    trackWidth.setText(String.valueOf(po.getRearAxleTrackWidth()));
                                                     Attribute positionX = node5.attribute("positionX");
-                                                    positionX.setText(po.getRearAxlePositionX() + "");
+                                                    positionX.setText(String.valueOf(po.getRearAxlePositionX()));
                                                     Attribute positionZ = node5.attribute("positionZ");
-                                                    positionZ.setText(po.getRearAxlePositionZ() + "");
+                                                    positionZ.setText(String.valueOf(po.getRearAxlePositionZ()));
                                                 }
                                             }
                                         }
@@ -324,10 +325,10 @@ public class VideoService {
             vehicle = simulationAutomaticProjectMapper.vehicleByZdId(projectId);
         }
         log.info("车辆配置 Id 为:" + vehicle);
-        String vehicleId = configMapper.getVehicleId(vehicle);
+        String vehicleId = modelConfigMapper.getVehicleId(vehicle);
 
         log.info("车辆 Id 为:" + vehicleId);
-        VehicleEntity vehicleInfo = vehicleMapper.getVehicleInfo(vehicleId);
+        VehicleEntity vehicleInfo = modelVehicleMapper.getVehicleInfo(vehicleId);
         log.info("车辆信息为:" + vehicleInfo);
 
         //自车模型
@@ -396,9 +397,9 @@ public class VideoService {
 
         po.setPerformanceMaxSpeed(vehicleInfo.getMaxSpeed());
         po.setPerformanceMaxDeceleration(vehicleInfo.getMaxDeceleration());
-        BigDecimal moπ = new BigDecimal("3.141516");
+        BigDecimal moPI = new BigDecimal("3.141516");
         BigDecimal mo180 = new BigDecimal("180");
-        po.setFrontAxleMaxSteering(vehicleInfo.getMaxSteeringAngle().multiply(moπ).divide(mo180, 6, RoundingMode.CEILING));
+        po.setFrontAxleMaxSteering(vehicleInfo.getMaxSteeringAngle().multiply(moPI).divide(mo180, 6, RoundingMode.CEILING));
         po.setFrontAxleWheelDiameter(vehicleInfo.getWheelDiameter());
         BigDecimal mo4 = new BigDecimal("4");
         BigDecimal mo5 = new BigDecimal("5");