bug fix
This commit is contained in:
@@ -661,6 +661,9 @@ public class JDUtil {
|
||||
handleGiftMoneyFlow(fromWxid, message, state);
|
||||
break;
|
||||
|
||||
case COMMENT_GENERATION:
|
||||
handleCommentInteraction(fromWxid, message, state);
|
||||
break;
|
||||
default:
|
||||
resetState(fromWxid, state);
|
||||
wxUtil.sendTextMessage(fromWxid, "流程异常,请重新开始", 1, fromWxid, false);
|
||||
@@ -1599,11 +1602,14 @@ public class JDUtil {
|
||||
}
|
||||
|
||||
public void sendOrderToWxByOrderP(String order, String fromWxid) {
|
||||
logger.info("sendOrderToWxByOrderP.order {}", order);
|
||||
// 检查是否命中“评”指令
|
||||
UserInteractionState state = null;
|
||||
if ("".equals(order)) {
|
||||
// 初始化用户交互状态
|
||||
String key = INTERACTION_STATE_PREFIX + fromWxid;
|
||||
UserInteractionState state = loadOrCreateState(key);
|
||||
state = loadOrCreateState(key);
|
||||
logger.info("loadOrCreateState - 用户: {}, 状态: {}", fromWxid, state);
|
||||
|
||||
try {
|
||||
// 设置当前状态为生成评论流程
|
||||
@@ -1623,17 +1629,16 @@ public class JDUtil {
|
||||
}
|
||||
} else {
|
||||
// 如果未命中“评”指令,检查是否在生成评论流程中
|
||||
handleCommentInteraction(fromWxid, order);
|
||||
handleCommentInteraction(fromWxid, order, state);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理生成评论流程中的用户交互
|
||||
*/
|
||||
private void handleCommentInteraction(String fromWxid, String message) {
|
||||
private void handleCommentInteraction(String fromWxid, String message, UserInteractionState state) {
|
||||
String key = INTERACTION_STATE_PREFIX + fromWxid;
|
||||
UserInteractionState state = loadOrCreateState(key);
|
||||
|
||||
logger.info("处理生成评论流程中的用户交互 - 用户: {}, 状态: {}", fromWxid, state);
|
||||
try {
|
||||
// 检查当前状态是否为生成评论流程
|
||||
if (!"commentTypeSelection".equals(state.getCurrentField())) {
|
||||
@@ -1650,7 +1655,6 @@ public class JDUtil {
|
||||
break;
|
||||
default:
|
||||
wxUtil.sendTextMessage(fromWxid, "无效的选择,请回复 1 或 2", 1, fromWxid, false);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user