Browse Source

车辆配置分享

root 2 years ago
parent
commit
8194c906ff

+ 0 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/ctrl/AlgorithmCtrl.java

@@ -84,7 +84,6 @@ public class AlgorithmCtrl {
 
     /**
      * 删除算法前校验
-     * @return
      */
     @RequestMapping("deleteCheck")
     @ResponseBody

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java

@@ -316,7 +316,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
                 }
                 String substring = stringBuilder.substring(0, stringBuilder.lastIndexOf(","));
                 map.put("substring",substring);
-                return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, "该算法已绑定ID为 " + substring + " 的自动运行项目,删除后该项目将停止自动运行。",map);
+                return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, "该算法已绑定 ID 为 " + substring + " 的自动运行项目,删除后该项目将停止自动运行。",map);
             } else {
                 map.put("substring","");
                 return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,"该算法未绑定自动运行项目。",map);

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/RelationConfigSensorMapper.java

@@ -10,5 +10,5 @@ public interface RelationConfigSensorMapper {
 
 
     @Delete("delete from relation_config_sensor where config_id = #{configId}")
-    void deleteByConfigId(@Param("projectId") String projectId);
+    void deleteByConfigId(@Param("configId") String configId);
 }

+ 2 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/ConfigService.java

@@ -230,12 +230,11 @@ public class ConfigService {
         // 传感器模型名称相同则覆盖,名称不同则新增
         List<ConfigVO> list = configMapper.checkConfigName(configPO);   // 查询公有车辆配置是否有重名
         if (ObjectUtil.isNotNull(list)) {   // 不为空说明有重名,则将参数覆盖,同时需要删除配置传感器关联表
-            String configId = list.get(0).getId();
+
             configPO.setModifyUserId(currentUserId);
             configPO.setModifyTime(currentTime);
             configPO.setIsDeleted(DictConstants.NO);
             configMapper.updateConfig(configPO);
-            relationConfigSensorMapper.deleteByConfigId(configId);  // 删除配置与传感器关联关系,方便后面重新添加
             LogUtil.update();
         } else {    // 为空说明是新增
             configPO.setCreateUserId(currentUserId);
@@ -332,6 +331,7 @@ public class ConfigService {
             });
         }
         if (ObjectUtil.isNotNull(configSensorPOs)) {
+            relationConfigSensorMapper.deleteByConfigId(configPO.getId());  // 删除配置与传感器关联关系,方便后面重新添加
             configMapper.insertConfigSensors(configSensorPOs);
         }
         return configPO;

+ 2 - 2
simulation-resource-server/src/main/resources/mapper/model/ConfigMapper.xml

@@ -104,7 +104,8 @@
     </select>
 
     <select id="checkConfigName" parameterType="api.common.pojo.po.model.ConfigPO" resultMap="ConfigVOMap">
-        select id
+        select id,
+               description as configDescription
         from model_config
         where is_deleted = '0'
           and config_name = #{configName,jdbcType=VARCHAR}
@@ -151,7 +152,6 @@
             config_name = #{configName,jdbcType=VARCHAR},
             description = #{description,jdbcType=VARCHAR},
             vehicle_id = #{vehicleId,jdbcType=VARCHAR},
-
             modify_time = #{modifyTime,jdbcType=TIMESTAMP},
             modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
         where id = #{id,jdbcType=VARCHAR}