TASK:卖家审核通知
This commit is contained in:
@@ -29,4 +29,6 @@ public interface MessageCenterService extends IService<Notification> {
|
||||
void publishSystemNotification(PublishSysNotificationDTO message);
|
||||
|
||||
void videoFinishedMsg(Long userId, String projectName, boolean isSuccess);
|
||||
|
||||
void sellerApprovalNotice(Long userId, boolean isApproved);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.common.utils.MinioUtil;
|
||||
import com.ai.da.common.utils.RedisUtil;
|
||||
import com.ai.da.common.utils.SendEmailUtil;
|
||||
import com.ai.da.common.websocket.NotificationConnection;
|
||||
import com.ai.da.mapper.primary.*;
|
||||
import com.ai.da.mapper.primary.entity.*;
|
||||
@@ -441,4 +442,50 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
|
||||
pushMessage("system", userId);
|
||||
}
|
||||
|
||||
private final static String APPROVED_MESSAGE = "尊敬的用户,您的卖家权限已开通。" +
|
||||
"现在可通过“成为卖家”的同一入口进入卖家中心。\\n在卖家中心中,您可以:" +
|
||||
"\\n·从设计项目中批量选择服装设计,并创建上架内容 " +
|
||||
"\\n·将设计及高级工具媒体转为可售卖的数字商品 " +
|
||||
"\\n·编辑、保存、发布并管理商品状态" +
|
||||
"\\n\\nDear User, your seller access has been enabled. " +
|
||||
"You can now enter the Seller Dashboard from the same entry point used to become a seller.\\nIn the Seller Dashboard, you can:" +
|
||||
"\\n·Batch select apparel designs from a design project and create listings" +
|
||||
"\\n·Turn designs and Advanced Tools media into sellable digital items " +
|
||||
"\\n·Edit, save, publish, and manage item status";
|
||||
|
||||
private final static String REJECTED_MESSAGE = "尊敬的用户,您的卖家权限申请审批未通过。 请检查您提交的信息,并确保您的卖家资料符合平台要求。您可以更新相关信息后重新提交申请。\\n\\n" +
|
||||
"Dear User, your seller access request was not approved. Please review the information you submitted and make sure your seller profile meets the platform requirements. You may update the relevant information and resubmit your application.";
|
||||
|
||||
public void sellerApprovalNotice(Long userId, boolean isApproved) {
|
||||
if (userId != null && userId != 0) {
|
||||
PublishSysNotificationDTO sysNotificationDTO = new PublishSysNotificationDTO();
|
||||
Notification notification = new Notification();
|
||||
notification.setType("system");
|
||||
notification.setReceiverId(userId);
|
||||
if (isApproved) {
|
||||
sysNotificationDTO.setTitle("卖家权限审批通过 Seller Access Enabled");
|
||||
sysNotificationDTO.setContent(APPROVED_MESSAGE);
|
||||
|
||||
} else {
|
||||
sysNotificationDTO.setTitle("卖家权限审批不通过 Seller Access Not Approved");
|
||||
sysNotificationDTO.setContent(REJECTED_MESSAGE);
|
||||
|
||||
}
|
||||
notification.setContent(JSON.toJSONString(sysNotificationDTO));
|
||||
notification.setIsRead(0);
|
||||
notification.setCreateTime(LocalDateTime.now());
|
||||
// 保存消息内容
|
||||
save(notification);
|
||||
// 推送系统消息
|
||||
pushMessage("system", userId);
|
||||
|
||||
Account account = accountService.getById(userId);
|
||||
if (account != null) {
|
||||
// 发送邮件
|
||||
SendEmailUtil.sellerApproval(account.getUserEmail(), isApproved);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user