【代码优化】SYSTEM:微信小程序的订阅

This commit is contained in:
YunaiV
2024-07-31 19:48:02 +08:00
parent 1f65dd2ec9
commit ba18788517
10 changed files with 26 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.afterNow;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.beforeNow;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.promotion.enums.MessageTemplateConstants.COMBINATION_RESULT;
import static cn.iocoder.yudao.module.promotion.enums.MessageTemplateConstants.COMBINATION_SUCCESS;
// TODO 芋艿:等拼团记录做完,完整 review 下
@@ -212,10 +212,10 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
}
updateRecords.add(updateRecord);
});
Boolean result = combinationRecordMapper.updateBatch(updateRecords);
Boolean updateSuccess = combinationRecordMapper.updateBatch(updateRecords);
// 3. 拼团成功发送订阅消息
if (result && isFull) {
if (updateSuccess && isFull) {
records.forEach(item -> {
getSelf().sendCombinationResultMessage(item);
});
@@ -227,7 +227,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
// 构建并发送模版消息
socialClientApi.sendWxaSubscribeMessage(new SocialWxaSubscribeMessageSendReqDTO()
.setUserId(record.getUserId()).setUserType(UserTypeEnum.MEMBER.getValue())
.setTemplateTitle(COMBINATION_RESULT)
.setTemplateTitle(COMBINATION_SUCCESS)
.setPage("pages/order/detail?id=" + record.getOrderId()) // 订单详情页
.addMessage("thing1", "商品拼团活动") // 活动标题
.addMessage("thing2", "恭喜您拼团成功!我们将尽快为您发货。")); // 温馨提示