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 | 147 | && ObjectUtil.isNotEmpty(session.getCurrentTool().getSInputTabelName()) |
| 148 | 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 | 153 | if (ObjectUtil.isEmpty(sResponMessage)){ |
| ... | ... | @@ -193,19 +193,18 @@ public class XlyErpService { |
| 193 | 193 | * @return java.lang.String |
| 194 | 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 | 197 | String resultExplain = "信息模糊,请提供更具体的问题或指令"; |
| 198 | 198 | try{ |
| 199 | - int attempt = 0; | |
| 200 | 199 | while (attempt < maxRetries) { |
| 201 | 200 | try{ |
| 202 | - attempt++; | |
| 201 | + attempt = attempt+1; | |
| 203 | 202 | return getDynamicTableSqlExec( session, input, userId, userInput); |
| 204 | 203 | }catch (Exception e){ |
| 205 | 204 | if (attempt == maxRetries) { |
| 206 | 205 | return resultExplain; |
| 207 | 206 | } else { |
| 208 | - return getDynamicTableSql( session, input, userId, userInput, maxRetries); | |
| 207 | + return getDynamicTableSql( session, input, userId, userInput, attempt); | |
| 209 | 208 | } |
| 210 | 209 | } |
| 211 | 210 | } | ... | ... |