Commit e40a3e40bf6fec6ccdc6448e5ad14b7b44db30de
1 parent
4f782e6c
1111
Showing
1 changed file
with
4 additions
and
5 deletions
src/main/java/com/xly/service/XlyErpService.java
| @@ -147,7 +147,7 @@ public class XlyErpService { | @@ -147,7 +147,7 @@ public class XlyErpService { | ||
| 147 | && ObjectUtil.isNotEmpty(session.getCurrentTool().getSInputTabelName()) | 147 | && ObjectUtil.isNotEmpty(session.getCurrentTool().getSInputTabelName()) |
| 148 | && ObjectUtil.isNotEmpty(session.getCurrentTool().getSStructureMemo())) | 148 | && ObjectUtil.isNotEmpty(session.getCurrentTool().getSStructureMemo())) |
| 149 | ){ | 149 | ){ |
| 150 | - sResponMessage = getDynamicTableSql(session, input, userId, userInput,maxRetries); | 150 | + sResponMessage = getDynamicTableSql(session, input, userId, userInput,0); |
| 151 | } | 151 | } |
| 152 | //如果返回空的进入闲聊模式 | 152 | //如果返回空的进入闲聊模式 |
| 153 | if (ObjectUtil.isEmpty(sResponMessage)){ | 153 | if (ObjectUtil.isEmpty(sResponMessage)){ |
| @@ -193,19 +193,18 @@ public class XlyErpService { | @@ -193,19 +193,18 @@ public class XlyErpService { | ||
| 193 | * @return java.lang.String | 193 | * @return java.lang.String |
| 194 | * @Description 获取执行动态SQL | 194 | * @Description 获取执行动态SQL |
| 195 | **/ | 195 | **/ |
| 196 | - private String getDynamicTableSql(UserSceneSession session,String input,String userId,String userInput,Integer maxRetries){ | 196 | + private String getDynamicTableSql(UserSceneSession session,String input,String userId,String userInput,Integer attempt){ |
| 197 | String resultExplain = "信息模糊,请提供更具体的问题或指令"; | 197 | String resultExplain = "信息模糊,请提供更具体的问题或指令"; |
| 198 | try{ | 198 | try{ |
| 199 | - int attempt = 0; | ||
| 200 | while (attempt < maxRetries) { | 199 | while (attempt < maxRetries) { |
| 201 | try{ | 200 | try{ |
| 202 | - attempt++; | 201 | + attempt = attempt+1; |
| 203 | return getDynamicTableSqlExec( session, input, userId, userInput); | 202 | return getDynamicTableSqlExec( session, input, userId, userInput); |
| 204 | }catch (Exception e){ | 203 | }catch (Exception e){ |
| 205 | if (attempt == maxRetries) { | 204 | if (attempt == maxRetries) { |
| 206 | return resultExplain; | 205 | return resultExplain; |
| 207 | } else { | 206 | } else { |
| 208 | - return getDynamicTableSql( session, input, userId, userInput, maxRetries); | 207 | + return getDynamicTableSql( session, input, userId, userInput, attempt); |
| 209 | } | 208 | } |
| 210 | } | 209 | } |
| 211 | } | 210 | } |