|
@@ -3,10 +3,14 @@ package cn.newfeifan.mall.module.trade.utils.push;
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
-import cn.newfeifan.mall.module.member.service.user.MemberUserService;
|
|
|
+import cn.newfeifan.mall.module.system.controller.admin.auth.vo.AuthLoginRespVO;
|
|
|
import cn.newfeifan.mall.module.system.dal.dataobject.config.SystemConfigDO;
|
|
|
+import cn.newfeifan.mall.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
+import cn.newfeifan.mall.module.system.enums.logger.LoginLogTypeEnum;
|
|
|
+import cn.newfeifan.mall.module.system.service.auth.AdminAuthService;
|
|
|
import cn.newfeifan.mall.module.system.service.config.SystemConfigService;
|
|
|
import cn.newfeifan.mall.module.system.service.permission.PermissionService;
|
|
|
+import cn.newfeifan.mall.module.system.service.user.AdminUserService;
|
|
|
import cn.newfeifan.mall.module.trade.controller.admin.jpushmessagelog.vo.JPushMessageLogSaveReqVO;
|
|
|
import cn.newfeifan.mall.module.trade.enums.wxmessage.WcChatMessageTemplateIdEnum;
|
|
|
import cn.newfeifan.mall.module.trade.service.jpushmessagelog.JPushMessageLogService;
|
|
@@ -45,9 +49,11 @@ public class JPushUtils {
|
|
|
@Resource
|
|
|
private SystemConfigService configService;
|
|
|
@Resource
|
|
|
- private MemberUserService memberUserService;
|
|
|
- @Resource
|
|
|
private PermissionService permissionService;
|
|
|
+ @Resource
|
|
|
+ private AdminAuthService authService;
|
|
|
+ @Resource
|
|
|
+ private AdminUserService adminUserService;
|
|
|
|
|
|
/**
|
|
|
* 获取请求体
|
|
@@ -89,25 +95,38 @@ public class JPushUtils {
|
|
|
/**
|
|
|
* 获取url
|
|
|
* @param title 标题
|
|
|
- * @param memberUserId 用户id
|
|
|
+ * @param systemUserId 系统用户id
|
|
|
* @param objectId 对象id
|
|
|
* @return url
|
|
|
*/
|
|
|
- public String getUrl(String title, Long memberUserId, Long objectId){
|
|
|
+ public String getUrl(String title, Long objectId, Long systemUserId){
|
|
|
SystemConfigDO redisConfig = configService.getRedisConfig();
|
|
|
- String username = memberUserService.getUsernameByUserId(memberUserId);
|
|
|
if (title.equals(WcChatMessageTemplateIdEnum.ORDER_DELIVERY2.getName())) {
|
|
|
//订单已发货
|
|
|
- return redisConfig.getMallDomain() + "/#/pages/order/detail?id=" + objectId + "&username=" + username;
|
|
|
+ return redisConfig.getMallDomain() + "/#/pages/order/detail?id=" + objectId;
|
|
|
} else if (title.equals(WcChatMessageTemplateIdEnum.AFTER_SALE_CHECK2.getName())) {
|
|
|
//售后订单审核完成
|
|
|
- return redisConfig.getMallDomain() + "/#/pages/order/aftersale/detail?id=" + objectId + "&username=" + username;
|
|
|
+ return redisConfig.getMallDomain() + "/#/pages/order/aftersale/detail?id=" + objectId;
|
|
|
} else if (title.equals(WcChatMessageTemplateIdEnum.AFTER_SALE_NO_CHECK2.getName())) {
|
|
|
//售后订单待审核
|
|
|
- return redisConfig.getMerchantDomain() + "/after-sale";
|
|
|
+ AdminUserDO systemUser = adminUserService.getUser(systemUserId);
|
|
|
+ AuthLoginRespVO token = authService.createTokenAfterLoginSuccess(systemUser.getId(), systemUser.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME);
|
|
|
+// return redisConfig.getMerchantDomain() + "/after-sale";
|
|
|
+ return redisConfig.getMerchantDomain() + "/login" + "?accessToken=" + token.getAccessToken() + "&refreshToken=" + token.getRefreshToken();
|
|
|
} else if (title.equals(WcChatMessageTemplateIdEnum.ORDER_NO_DELIVERY2.getName())) {
|
|
|
//订单待发货
|
|
|
- return redisConfig.getMerchantDomain() + "/order";
|
|
|
+ AdminUserDO systemUser = adminUserService.getUser(systemUserId);
|
|
|
+ AuthLoginRespVO token = authService.createTokenAfterLoginSuccess(systemUser.getId(), systemUser.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME);
|
|
|
+// return redisConfig.getMerchantDomain() + "/order";
|
|
|
+ return redisConfig.getMerchantDomain() + "/login" + "?accessToken=" + token.getAccessToken() + "&refreshToken=" + token.getRefreshToken();
|
|
|
+ } else if(title.equals(WcChatMessageTemplateIdEnum.MERCHANT_APPLY_CHECK.getName())){
|
|
|
+ // 商户入驻申请审批通知
|
|
|
+ AdminUserDO systemUser = adminUserService.getUser(systemUserId);
|
|
|
+ AuthLoginRespVO token = authService.createTokenAfterLoginSuccess(systemUser.getId(), systemUser.getUsername(), LoginLogTypeEnum.LOGIN_USERNAME);
|
|
|
+ return redisConfig.getPlatformDomain() + "/login" + "?accessToken=" + token.getAccessToken() + "&refreshToken=" + token.getRefreshToken();
|
|
|
+ } else if(title.equals(WcChatMessageTemplateIdEnum.MERCHANT_APPLY_CHECK_RESULT.getName())){
|
|
|
+ // 商户入驻审核结果通知
|
|
|
+ return redisConfig.getMallDomain() + "/#/pages/public/merchant";
|
|
|
}
|
|
|
return null;
|
|
|
}
|