feat:新增素材上传完成通知用户订阅消息

This commit is contained in:
2025-06-05 09:33:07 +08:00
parent df80d34709
commit 5676f373c8
2 changed files with 26 additions and 3 deletions
@@ -194,6 +194,7 @@ public class OrderStatusChangeListener {
*/
private void handleOrderComplete(Order order) {
try {
// 1. 检查是否开启一键成片
QrCode qrCode = qrCodeService.getByCodeId(order.getCodeId());
if (!isVideoEditEnabled(qrCode)) {
@@ -218,16 +219,34 @@ public class OrderStatusChangeListener {
task.setStatus(EditTaskStatus.PROCESSING);
editTaskService.saveOrUpdateTask(task);
// 发送小程序订阅消息,用户素材上传完成
SysUser sysUser = userCenterService.findUserById(order.getUserId());
Tourism tourism = tourismService.getTourismById(order.getTourismId());
if (sysUser.getOpenId() != null) {
String tip = "素材上传完成";
String orderName = tourism.getTourismName();
String pageUrl = "pages/task/task";
wxMiniSubscribeService.sendServiceProcessMsg(
sysUser.getOpenId(),
orderName,
tip,
order.getOrderNo(),
DateUtils.sdf.format(order.getPayTime()),
"",
pageUrl
);
}
// 新增:查找下一个排队用户
Order nextOrder = orderService.getNextQueueOrder(order.getTourismId(), order.getId());
if (nextOrder != null) {
SysUser nextUser = userCenterService.findUserById(nextOrder.getUserId());
Tourism tourism = tourismService.getTourismById(nextOrder.getTourismId());
if (nextUser != null && nextUser.getOpenId() != null && tourism != null) {
String activityName = tourism.getTourismName(); // 活动名称
String remark = "即将为您进行拍摄服务";
String activityNo = nextOrder.getOrderNo(); // 活动编号
String pageUrl = "pages/task/task";
String pageUrl = "pages/album/album";
wxMiniSubscribeService.sendServiceProcessMsg(
nextUser.getOpenId(),
activityName,
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
@@ -24,6 +25,9 @@ import org.springframework.context.annotation.Configuration;
@AutoConfigureAfter({FeignAutoConfiguration.class, WebMvcAutoConfiguration.class})
public class WechatAutoConfiguration {
@Value("${zlt.tenant.id}")
private String defaultTenantId;
@Bean
@ConditionalOnBean(WechatConfigService.class)
public WxMpService wxMpService(WechatConfigService configService) {
@@ -70,6 +74,6 @@ public class WechatAutoConfiguration {
}
private String getCurrentTenantId() {
return "webApp";
return defaultTenantId;
}
}