|
@@ -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;
|