Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -247,9 +247,23 @@ public class BehaviortreeProcessor {
|
|||||||
//获取行为树重复名称个数
|
//获取行为树重复名称个数
|
||||||
Integer num = behaviortreeService.getCountName(newName);
|
Integer num = behaviortreeService.getCountName(newName);
|
||||||
if(num > 0){
|
if(num > 0){
|
||||||
Integer count = num + 1;
|
// 从2开始尝试,因为基础名称已经存在
|
||||||
behaviortree.setName(newName + count);
|
int count = 2;
|
||||||
behaviortree.setEnglishName(newEnglishName + count);
|
String finalName;
|
||||||
|
String finalEnglishName;
|
||||||
|
do {
|
||||||
|
finalName = newName + "_" + count;
|
||||||
|
finalEnglishName = newEnglishName + "_" + count;
|
||||||
|
// 检查当前生成的名称是否存在
|
||||||
|
num = behaviortreeService.getCountName(finalName);
|
||||||
|
count++;
|
||||||
|
} while(num > 0);
|
||||||
|
|
||||||
|
behaviortree.setName(finalName);
|
||||||
|
behaviortree.setEnglishName(finalEnglishName);
|
||||||
|
} else {
|
||||||
|
behaviortree.setName(newName);
|
||||||
|
behaviortree.setEnglishName(newEnglishName);
|
||||||
}
|
}
|
||||||
return this.create(behaviortree);
|
return this.create(behaviortree);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="englishName != null and englishName != ''">english_name,</if>
|
<if test="englishName != null and englishName != ''">english_name,</if>
|
||||||
<if test="xmlContent != null">xml_content,</if>
|
<if test="xmlContent != null">xml_content,</if>
|
||||||
<if test="platformId != null">platform_id,</if>
|
<if test="platformId != null">platform_id,</if>
|
||||||
|
<if test="scenarioId != null">scenario_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null and name != ''">#{name},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
@@ -81,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="englishName != null and englishName != ''">#{englishName},</if>
|
<if test="englishName != null and englishName != ''">#{englishName},</if>
|
||||||
<if test="xmlContent != null">#{xmlContent},</if>
|
<if test="xmlContent != null">#{xmlContent},</if>
|
||||||
<if test="platformId != null">#{platformId},</if>
|
<if test="platformId != null">#{platformId},</if>
|
||||||
|
<if test="scenarioId != null">#{scenarioId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user