This commit is contained in:
Van0313
2025-04-27 21:35:47 +08:00
parent 4151ba2f3c
commit e599e00bb7

View File

@@ -1570,7 +1570,7 @@ public class JDUtil {
logger.error("sendOrderToWxByOrderD 订单数量格式错误,请输入正确的数字", e);
}
for (int i = 0; i < num; i++) {
count++; // 递增计数器
count++; // 递增计数器
logger.info("sendOrderToWxByOrderD.count inFor {}", count);
// 将新的计数器值保存回 Redis
@@ -1600,14 +1600,14 @@ public class JDUtil {
public void sendOrderToWxByOrderP(String order, String fromWxid) {
// 检查是否命中“评”指令
if ("".equals(order)) {
if ("".equals(order)) {
// 初始化用户交互状态
String key = INTERACTION_STATE_PREFIX + fromWxid;
UserInteractionState state = loadOrCreateState(key);
try {
// 设置当前状态为生成评论流程
state.setCurrentState(UserInteractionState.ProcessState.PRODUCT_PROMOTION);
state.setCurrentState(UserInteractionState.ProcessState.COMMENT_GENERATION);
state.setCurrentField("commentTypeSelection");
// 提示用户选择评论类型
@@ -1662,16 +1662,13 @@ public class JDUtil {
}
}
/**
* 生成评论内容
*/
private void generateComment(String fromWxid, String productType) {
// 这里可以调用缓存或AI生成文案目前先返回固定模板
String commentTemplate = "这是一条关于%s的评论\n" +
"1. 性能非常出色,使用体验极佳。\n" +
"2. 安装方便,操作简单。\n" +
"3. 售后服务到位,值得信赖。\n" +
"感谢您的购买与支持!";
String commentTemplate = "这是一条关于%s的评论\n" + "1. 性能非常出色,使用体验极佳。\n" + "2. 安装方便,操作简单。\n" + "3. 售后服务到位,值得信赖。\n" + "感谢您的购买与支持!";
String comment = String.format(commentTemplate, productType);
wxUtil.sendTextMessage(fromWxid, comment, 1, fromWxid, false);
@@ -1722,7 +1719,7 @@ public class JDUtil {
// 推荐使用枚举管理状态
public enum ProcessState {
INIT, GIFT_MONEY_FLOW, PRODUCT_PROMOTION
INIT, GIFT_MONEY_FLOW, PRODUCT_PROMOTION, COMMENT_GENERATION
}
public enum GiftMoneyStep {