推送消息完善,推送关系绑定 fix bug
This commit is contained in:
parent
ad2ea0756f
commit
cf2ad10fd3
@ -21,11 +21,12 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.log4j.Log4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -39,7 +40,7 @@ import java.util.Map;
|
|||||||
* @author Xinze
|
* @author Xinze
|
||||||
* @since 2021-03-30
|
* @since 2021-03-30
|
||||||
*/
|
*/
|
||||||
@Log4j
|
@Slf4j
|
||||||
@Api(tags = "用户基本信息表")
|
@Api(tags = "用户基本信息表")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/mobile/account/login")
|
@RequestMapping("/mobile/account/login")
|
||||||
@ -239,8 +240,24 @@ public class LoginController extends BaseControllerImpl {
|
|||||||
|
|
||||||
@ApiOperation(value = "商家版注册与登录")
|
@ApiOperation(value = "商家版注册与登录")
|
||||||
@RequestMapping(value = "/doMerchSmsRegisterAndLogin", method = RequestMethod.POST)
|
@RequestMapping(value = "/doMerchSmsRegisterAndLogin", method = RequestMethod.POST)
|
||||||
public CommonResult doMerchSmsRegisterAndLogin(@RequestBody JSONObject paramJSON) {
|
public CommonResult doMerchSmsRegisterAndLogin(HttpServletRequest request, @RequestBody JSONObject paramJSON) {
|
||||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"), paramJSON.getStr("rand_key"), paramJSON.getStr("verify_code"));
|
if (paramJSON == null) {
|
||||||
|
return CommonResult.failed("缺少必要参数!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String userMobile = paramJSON.getStr("user_mobile");
|
||||||
|
String randKey = paramJSON.getStr("rand_key");
|
||||||
|
String verifyCode = paramJSON.getStr("verify_code");
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(userMobile) || StrUtil.isBlank(randKey) || StrUtil.isBlank(verifyCode)) {
|
||||||
|
return CommonResult.failed("缺少必要参数!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String cid = paramJSON.getStr("cid");
|
||||||
|
String osType = paramJSON.getStr("osType");
|
||||||
|
|
||||||
|
|
||||||
|
return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, cid, osType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "微信用户一键登录和注册")
|
@ApiOperation(value = "微信用户一键登录和注册")
|
||||||
@ -271,7 +288,10 @@ public class LoginController extends BaseControllerImpl {
|
|||||||
@ApiOperation(value = "忘记密码-更改新密码")
|
@ApiOperation(value = "忘记密码-更改新密码")
|
||||||
@RequestMapping(value = "/edit/forgetPassword", method = RequestMethod.POST)
|
@RequestMapping(value = "/edit/forgetPassword", method = RequestMethod.POST)
|
||||||
public CommonResult editForgetPassword(@RequestBody JSONObject paramJSON) {
|
public CommonResult editForgetPassword(@RequestBody JSONObject paramJSON) {
|
||||||
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"), paramJSON.getStr("rand_key"), paramJSON.getStr("verify_code"));
|
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"),
|
||||||
|
paramJSON.getStr("rand_key"),
|
||||||
|
paramJSON.getStr("verify_code"),
|
||||||
|
paramJSON.getStr("cid"), paramJSON.getStr("osType"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("退出登录")
|
@ApiOperation("退出登录")
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||||
|
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||||
|
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||||
|
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||||
|
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.suisung.mall.account.controller.admin;
|
||||||
|
|
||||||
|
import com.suisung.mall.account.service.AccountUserBindGeTuiService;
|
||||||
|
import com.suisung.mall.common.modules.account.AccountUserBindGeTui;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "用户推送关系绑定表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/account/account-user-bind-getui")
|
||||||
|
public class AccountUserBindGeTuiController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AccountUserBindGeTuiService accountUserBindGeTuiService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "用户绑定", notes = "用户绑定")
|
||||||
|
@RequestMapping(value = "/selectAccountUserBindGeTuiListByUserId", method = RequestMethod.POST)
|
||||||
|
public List<AccountUserBindGeTui> list(@RequestParam(name = "userId", defaultValue = "0") Integer userId) {
|
||||||
|
return accountUserBindGeTuiService.selectAccountUserBindGeTuiListByUserId(userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -121,9 +121,11 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
|
|||||||
* @param user_mobile
|
* @param user_mobile
|
||||||
* @param rand_key 防机器人刷验证码
|
* @param rand_key 防机器人刷验证码
|
||||||
* @param verify_code
|
* @param verify_code
|
||||||
|
* @param cid 推送 cid
|
||||||
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code);
|
CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, String cid, String osType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序一键登录注册接口
|
* 微信小程序一键登录注册接口
|
||||||
|
|||||||
@ -10,4 +10,12 @@ public interface AccountUserBindGeTuiService extends IBaseService<AccountUserBin
|
|||||||
Boolean saveAccountUserBindGeTui(AccountUserBindGeTui accountUserBindGeTui);
|
Boolean saveAccountUserBindGeTui(AccountUserBindGeTui accountUserBindGeTui);
|
||||||
|
|
||||||
List<AccountUserBindGeTui> getActive(AccountUserBindGeTui accountUserBindGeTui);
|
List<AccountUserBindGeTui> getActive(AccountUserBindGeTui accountUserBindGeTui);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户 Id 获取账号绑定关系列表记录
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AccountUserBindGeTui> selectAccountUserBindGeTuiListByUserId(Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2811,10 +2811,12 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
* @param user_mobile
|
* @param user_mobile
|
||||||
* @param rand_key 防机器人刷验证码
|
* @param rand_key 防机器人刷验证码
|
||||||
* @param verify_code
|
* @param verify_code
|
||||||
|
* @param cid 推送 cid
|
||||||
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code) {
|
public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, String cid, String osType) {
|
||||||
// 流程:通过手机号检查是否有绑定关系?没有就直接注册,有就直接登录,返回登录后的所有信息,附加是否已经申请入驻标记?
|
// 流程:通过手机号检查是否有绑定关系?没有就直接注册,有就直接登录,返回登录后的所有信息,附加是否已经申请入驻标记?
|
||||||
// 商家入驻账号,都是需要手机号绑定的。账号组成:1000000+(数字加法)自增ID,密码随机6位数
|
// 商家入驻账号,都是需要手机号绑定的。账号组成:1000000+(数字加法)自增ID,密码随机6位数
|
||||||
if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) {
|
if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) {
|
||||||
@ -2846,7 +2848,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
|
|
||||||
// 找出手机对应的绑定用户
|
// 找出手机对应的绑定用户
|
||||||
// 是否为手机号注册,密码6位随机数
|
// 是否为手机号注册,密码6位随机数
|
||||||
return doMobileBindLogin(verifyMobile, CommonConstant.USER_TYPE_MCH);
|
return doMobileBindLogin(verifyMobile, CommonConstant.USER_TYPE_MCH, cid, osType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3024,6 +3026,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
* 使用到的:后台管理员或商家登录,客户c端
|
* 使用到的:后台管理员或商家登录,客户c端
|
||||||
*
|
*
|
||||||
* @param user_mobile
|
* @param user_mobile
|
||||||
|
* @param password
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public CommonResult doMobileBindLogin(String user_mobile, String password) {
|
public CommonResult doMobileBindLogin(String user_mobile, String password) {
|
||||||
@ -3059,9 +3062,11 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
*
|
*
|
||||||
* @param user_mobile 带+86的中国号码
|
* @param user_mobile 带+86的中国号码
|
||||||
* @param userType 用户类型:0-普通用户;1-管理员;2-入驻商户
|
* @param userType 用户类型:0-普通用户;1-管理员;2-入驻商户
|
||||||
|
* @param cid 推送 cid
|
||||||
|
* @param osType 手机系统类型 :1-Android;2-iOS;3-微信小程序;
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public CommonResult doMobileBindLogin(String user_mobile, Integer userType) {
|
public CommonResult doMobileBindLogin(String user_mobile, Integer userType, String cid, String osType) {
|
||||||
if (StrUtil.isBlank(user_mobile) || userType == null) {
|
if (StrUtil.isBlank(user_mobile) || userType == null) {
|
||||||
return CommonResult.failed("缺少必要参数!");
|
return CommonResult.failed("缺少必要参数!");
|
||||||
}
|
}
|
||||||
@ -3104,8 +3109,13 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
params.put("password", "");
|
params.put("password", "");
|
||||||
params.put("user_mobile", user_mobile);
|
params.put("user_mobile", user_mobile);
|
||||||
params.put("is_merch", "1"); // 是否为商家入驻 1-是;其他-否
|
params.put("is_merch", "1"); // 是否为商家入驻 1-是;其他-否
|
||||||
params.put("cid", getParameter("cid")); // 个推客户端Id
|
|
||||||
params.put("osType", getParameter("osType"));// 个推客系统类别 1-Android;2-iOS
|
if (StrUtil.isNotBlank(cid)) {
|
||||||
|
params.put("cid", cid); // 个推客户端Id
|
||||||
|
params.put("osType", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||||
|
logger.info("推送参数2 cid:{}, osType:{}", cid, osType);
|
||||||
|
}
|
||||||
|
|
||||||
return login(params);
|
return login(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.suisung.mall.account.mapper.UserDeviceBindMapper;
|
import com.suisung.mall.account.mapper.UserDeviceBindMapper;
|
||||||
import com.suisung.mall.account.service.AccountUserBindGeTuiService;
|
import com.suisung.mall.account.service.AccountUserBindGeTuiService;
|
||||||
|
import com.suisung.mall.common.constant.CommonConstant;
|
||||||
import com.suisung.mall.common.modules.account.AccountUserBindGeTui;
|
import com.suisung.mall.common.modules.account.AccountUserBindGeTui;
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -66,4 +68,16 @@ public class AccountUserBindGeTuiServiceImpl extends BaseServiceImpl<UserDeviceB
|
|||||||
wrapper.eq("user_id", accountUserBindGeTui.getUserId()).orderByDesc("updated_at");
|
wrapper.eq("user_id", accountUserBindGeTui.getUserId()).orderByDesc("updated_at");
|
||||||
return list(wrapper);
|
return list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户 Id 获取账号推送绑定关系列表记录
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AccountUserBindGeTui> selectAccountUserBindGeTuiListByUserId(Integer userId) {
|
||||||
|
if (userId == null || userId <= 0) return Collections.singletonList(new AccountUserBindGeTui());
|
||||||
|
return list(new QueryWrapper<AccountUserBindGeTui>().eq("user_id", userId).eq("status", CommonConstant.Enable));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,4 +222,13 @@ public interface AccountService {
|
|||||||
|
|
||||||
@PostMapping("/admin/account/pushNotificationTocid")
|
@PostMapping("/admin/account/pushNotificationTocid")
|
||||||
String pushNotificationTocid(@RequestParam("userId") String userId, @RequestBody PushTemplate pushTemplate);
|
String pushNotificationTocid(@RequestParam("userId") String userId, @RequestBody PushTemplate pushTemplate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户 Id 获取账号推送绑定关系列表记录
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("admin/account/account-user-bind-getui/selectAccountUserBindGeTuiListByUserId")
|
||||||
|
List<AccountUserBindGeTui> selectAccountUserBindGeTuiListByUserId(@RequestParam(name = "userId", defaultValue = "0") Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -262,10 +262,10 @@ public class ShopMchEntry implements Serializable {
|
|||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建该商家入驻记录的用户")
|
@ApiModelProperty(value = "创建该商家入驻记录的用户")
|
||||||
private String created_by;
|
private Integer created_by;
|
||||||
|
|
||||||
@ApiModelProperty(value = "最后修改该商家入驻记录的用户")
|
@ApiModelProperty(value = "最后修改该商家入驻记录的用户")
|
||||||
private String updated_by;
|
private Integer updated_by;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商家入驻记录的创建时间")
|
@ApiModelProperty(value = "商家入驻记录的创建时间")
|
||||||
private Date created_at;
|
private Date created_at;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import com.suisung.mall.common.modules.store.ShopStoreBase;
|
|||||||
import com.suisung.mall.common.utils.*;
|
import com.suisung.mall.common.utils.*;
|
||||||
import com.suisung.mall.shop.lakala.service.*;
|
import com.suisung.mall.shop.lakala.service.*;
|
||||||
import com.suisung.mall.shop.lakala.utils.LakalaUtil;
|
import com.suisung.mall.shop.lakala.utils.LakalaUtil;
|
||||||
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
import com.suisung.mall.shop.message.service.ShopMessageTemplateService;
|
import com.suisung.mall.shop.message.service.ShopMessageTemplateService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderLklService;
|
import com.suisung.mall.shop.order.service.ShopOrderLklService;
|
||||||
import com.suisung.mall.shop.page.service.OssService;
|
import com.suisung.mall.shop.page.service.OssService;
|
||||||
@ -149,6 +150,10 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
@Resource
|
@Resource
|
||||||
private LklOrderSeparateService lklOrderSeparateService;
|
private LklOrderSeparateService lklOrderSeparateService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private PushMessageService pushMessageService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OssService ossService;
|
private OssService ossService;
|
||||||
|
|
||||||
@ -558,6 +563,8 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
// 【小发同城商家】恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!
|
// 【小发同城商家】恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!
|
||||||
shopMessageTemplateService.aliyunSmsSend(mchMobile, "SMS_489795044", null);//SMS_479760276
|
shopMessageTemplateService.aliyunSmsSend(mchMobile, "SMS_489795044", null);//SMS_479760276
|
||||||
|
|
||||||
|
pushMessageService.noticeMerchantSignEcContract(shopMchEntry.getCreated_by());
|
||||||
|
|
||||||
|
|
||||||
return Pair.of(true, "商家入网申请电子合同成功");
|
return Pair.of(true, "商家入网申请电子合同成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,10 +17,10 @@ public interface PushMessageService {
|
|||||||
/**
|
/**
|
||||||
* 异步发送推送通知 商户签约电子合同
|
* 异步发送推送通知 商户签约电子合同
|
||||||
*
|
*
|
||||||
* @param mchMobile
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CompletableFuture<Boolean> noticeMerchantSignEcContract(String mchMobile);
|
CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
package com.suisung.mall.shop.message.service.impl;
|
package com.suisung.mall.shop.message.service.impl;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.suisung.mall.common.feignService.AccountService;
|
||||||
|
import com.suisung.mall.common.modules.account.AccountUserBindGeTui;
|
||||||
import com.suisung.mall.common.service.UniCloudPushService;
|
import com.suisung.mall.common.service.UniCloudPushService;
|
||||||
import com.suisung.mall.shop.message.service.PushMessageService;
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
||||||
@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -36,28 +39,62 @@ public class PushMessageServiceImpl implements PushMessageService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ShopStoreEmployeeService shopStoreEmployeeService;
|
private ShopStoreEmployeeService shopStoreEmployeeService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private AccountService accountService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步发送推送通知 商户签约电子合同
|
* 异步发送推送通知 商户签约电子合同
|
||||||
*
|
*
|
||||||
* @param mchMobile
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Async("pushAsyncExecutor")
|
@Async("pushAsyncExecutor")
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Boolean> noticeMerchantSignEcContract(String mchMobile) {
|
public CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId) {
|
||||||
// 获取 商家的 cid
|
try {
|
||||||
Pair<Boolean, String> result = uniCloudPushService.sendPushMessage(null,
|
// 获取商家的 cid 列表,确保用户 ID 有效
|
||||||
|
if (userId == null || userId <= 0) {
|
||||||
|
log.warn("无效的用户ID:{}", userId);
|
||||||
|
return CompletableFuture.completedFuture(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<AccountUserBindGeTui> accountUserBindGeTuiList = accountService.selectAccountUserBindGeTuiListByUserId(userId);
|
||||||
|
|
||||||
|
// 检查返回的列表是否为空或包含无效数据
|
||||||
|
if (accountUserBindGeTuiList == null || accountUserBindGeTuiList.isEmpty()) {
|
||||||
|
log.info("未找到与用户ID相关的设备绑定信息:{}", userId);
|
||||||
|
return CompletableFuture.completedFuture(false); // 无设备无需推送
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取 cid 列表,过滤掉可能的 null 值
|
||||||
|
List<String> cidList = accountUserBindGeTuiList.stream()
|
||||||
|
.map(AccountUserBindGeTui::getCid)
|
||||||
|
.filter(cid -> cid != null && !cid.trim().isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 检查 cid 列表是否为空
|
||||||
|
if (cidList.isEmpty()) {
|
||||||
|
log.info("提取的 cid 列表为空,用户ID:{}", userId);
|
||||||
|
return CompletableFuture.completedFuture(false); // 无有效 cid 无需推送
|
||||||
|
}
|
||||||
|
|
||||||
|
Pair<Boolean, String> result = uniCloudPushService.sendPushMessageBatch(cidList,
|
||||||
appName + "邀请您签署入驻合同",
|
appName + "邀请您签署入驻合同",
|
||||||
"恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!",
|
"恭喜您的开店入驻申请已审核通过!请尽快登录APP平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!",
|
||||||
null);
|
null);
|
||||||
|
|
||||||
if (!result.getFirst()) {
|
if (!result.getFirst()) {
|
||||||
log.error("商家入驻申请电子合同推送失败:{}", result.getSecond());
|
log.error("商家入驻申请电子合同推送失败,用户ID:{},错误信息:{}", userId, result.getSecond());
|
||||||
return CompletableFuture.completedFuture(false);
|
return CompletableFuture.completedFuture(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CompletableFuture.completedFuture(true);
|
return CompletableFuture.completedFuture(true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("执行 noticeMerchantSignEcContract 方法时发生异常,用户ID:{}", userId, e);
|
||||||
|
return CompletableFuture.completedFuture(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.constant.CommonConstant;
|
import com.suisung.mall.common.constant.CommonConstant;
|
||||||
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||||
import com.suisung.mall.common.utils.BankUtil;
|
import com.suisung.mall.common.utils.BankUtil;
|
||||||
import com.suisung.mall.common.utils.DateTimeUtils;
|
import com.suisung.mall.common.utils.DateTimeUtils;
|
||||||
@ -47,6 +48,8 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商家入驻申请表
|
* 商家入驻申请表
|
||||||
*/
|
*/
|
||||||
@ -96,10 +99,10 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CommonResult storeBusinessCategoryList() {
|
public CommonResult storeBusinessCategoryList() {
|
||||||
// UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
// if (user == null) {
|
if (user == null) {
|
||||||
// return CommonResult.failed("无权限操作!");
|
return CommonResult.failed("无权限操作!");
|
||||||
// }
|
}
|
||||||
|
|
||||||
String businessCategoryList = accountBaseConfigService.getConfig("shop_business_category");
|
String businessCategoryList = accountBaseConfigService.getConfig("shop_business_category");
|
||||||
if (StrUtil.isBlank(businessCategoryList)) {
|
if (StrUtil.isBlank(businessCategoryList)) {
|
||||||
@ -123,13 +126,13 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
@Override
|
@Override
|
||||||
public CommonResult shopMerchEntryApply(JSONObject shopMerchEntryJSON) {
|
public CommonResult shopMerchEntryApply(JSONObject shopMerchEntryJSON) {
|
||||||
// 检查是否已登录?
|
// 检查是否已登录?
|
||||||
String userId = "0";
|
Integer userId = 0;
|
||||||
|
|
||||||
// UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
// if (user == null || user.getId() == null) {
|
if (user == null || user.getId() == null) {
|
||||||
// return CommonResult.failed("请先登录!");
|
return CommonResult.failed("请先登录!");
|
||||||
// }
|
}
|
||||||
// userId = user.getId().toString();
|
userId = user.getId();
|
||||||
|
|
||||||
// 参数校验流程
|
// 参数校验流程
|
||||||
if (shopMerchEntryJSON == null) {
|
if (shopMerchEntryJSON == null) {
|
||||||
@ -298,13 +301,13 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
@Override
|
@Override
|
||||||
public CommonResult shopMerchEntryReApply(JSONObject shopMerchEntryJSON) {
|
public CommonResult shopMerchEntryReApply(JSONObject shopMerchEntryJSON) {
|
||||||
// 检查是否已登录?
|
// 检查是否已登录?
|
||||||
String userId = "0";
|
Integer userId = 0;
|
||||||
|
|
||||||
// UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
// if (user == null || user.getId() == null) {
|
if (user == null || user.getId() == null) {
|
||||||
// return CommonResult.failed("请先登录!");
|
return CommonResult.failed("请先登录!");
|
||||||
// }
|
}
|
||||||
// userId = user.getId().toString();
|
userId = user.getId();
|
||||||
|
|
||||||
|
|
||||||
// 参数校验流程
|
// 参数校验流程
|
||||||
@ -383,10 +386,15 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
record.setLogin_mobile(null);// 手机号不能更改
|
record.setLogin_mobile(null);// 手机号不能更改
|
||||||
record.setCreated_by(userId);
|
|
||||||
record.setApproval_status(CommonConstant.MCH_APPR_STA_PADDING);
|
record.setApproval_status(CommonConstant.MCH_APPR_STA_PADDING);
|
||||||
record.setApproval_remark("您的重新申请入驻平台材料已提交,待审中,请耐心等待!");
|
record.setApproval_remark("您的重新申请入驻平台材料已提交,待审中,请耐心等待!");
|
||||||
record.setApproval_invalid_col("[]"); // 清除历史审核无效字段
|
record.setApproval_invalid_col("[]"); // 清除历史审核无效字段
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(oldRecord.getCreated_by())) {
|
||||||
|
oldRecord.setCreated_by(userId);
|
||||||
|
}
|
||||||
|
record.setCreated_by(oldRecord.getCreated_by());
|
||||||
record.setUpdated_by(userId);
|
record.setUpdated_by(userId);
|
||||||
record.setUpdated_at(new Date());
|
record.setUpdated_at(new Date());
|
||||||
// 重置审核状态,合同等相关字段
|
// 重置审核状态,合同等相关字段
|
||||||
@ -591,13 +599,13 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
@Override
|
@Override
|
||||||
public CommonResult shopMerchEntryApproval(Long id, Integer approvalStatus, String approvalRemark, String approvalInvalidCol) {
|
public CommonResult shopMerchEntryApproval(Long id, Integer approvalStatus, String approvalRemark, String approvalInvalidCol) {
|
||||||
// 固定用户ID(模拟管理员)
|
// 固定用户ID(模拟管理员)
|
||||||
String userId = "0";
|
Integer userId = 0;
|
||||||
|
|
||||||
// UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
// if (!user.isAdmin()) {
|
if (!user.isAdmin()) {
|
||||||
// return CommonResult.failed("权限不足!");
|
return CommonResult.failed("权限不足!");
|
||||||
// }
|
}
|
||||||
// userId = user.getId().toString();
|
userId = user.getId();
|
||||||
|
|
||||||
// 参数校验流程
|
// 参数校验流程
|
||||||
if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(approvalStatus)) {
|
if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(approvalStatus)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user