个推相关修改
This commit is contained in:
parent
dc2300397d
commit
5b897f371e
@ -1,6 +1,5 @@
|
|||||||
package com.suisung.mall.account.controller.mobile;
|
package com.suisung.mall.account.controller.mobile;
|
||||||
|
|
||||||
import com.getui.push.v2.sdk.api.PushApi;
|
|
||||||
import com.suisung.mall.account.service.AccountSinglePushService;
|
import com.suisung.mall.account.service.AccountSinglePushService;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.push.PushTemplate;
|
import com.suisung.mall.common.modules.push.PushTemplate;
|
||||||
@ -34,14 +33,14 @@ public class SinglePushController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/pushTocid")
|
@PostMapping("/pushTocid")
|
||||||
public CommonResult pushTocid(@RequestParam String userId, @RequestParam String message) {
|
public CommonResult pushTocid(@RequestParam Integer userId, @RequestParam String message) {
|
||||||
log.info("pushTocid");
|
log.info("pushTocid");
|
||||||
return accountSinglePushService.pushTocid(message, userId);
|
return accountSinglePushService.pushTocid(message, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/pushNotificationTocid")
|
@PostMapping("/pushNotificationTocid")
|
||||||
public CommonResult pushNotificationTocid(@RequestParam String userId,@RequestBody PushTemplate pushTemplate) {
|
public CommonResult pushNotificationTocid(@RequestParam Integer userId, @RequestBody PushTemplate pushTemplate) {
|
||||||
log.info("pushNotificationTocid");
|
log.info("pushNotificationTocid");
|
||||||
return accountSinglePushService.pushTocid(pushTemplate,userId);
|
return accountSinglePushService.pushTocid(pushTemplate, userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package com.suisung.mall.account.mapper;
|
package com.suisung.mall.account.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.suisung.mall.common.modules.singlepush.UserDeviceBind;
|
import com.suisung.mall.common.modules.singlepush.AccountUserBindGeTui;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface UserDeviceBindMapper extends BaseMapper<UserDeviceBind> {
|
public interface UserDeviceBindMapper extends BaseMapper<AccountUserBindGeTui> {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,8 @@
|
|||||||
package com.suisung.mall.account.service;
|
package com.suisung.mall.account.service;
|
||||||
|
|
||||||
import com.getui.push.v2.sdk.dto.req.message.PushMessage;
|
|
||||||
import com.getui.push.v2.sdk.dto.res.TokenDTO;
|
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.push.PushTemplate;
|
import com.suisung.mall.common.modules.push.PushTemplate;
|
||||||
import com.suisung.mall.common.service.SinglePushBaseService;
|
import com.suisung.mall.common.service.SinglePushBaseService;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
|
|
||||||
public interface AccountSinglePushService extends SinglePushBaseService {
|
public interface AccountSinglePushService extends SinglePushBaseService {
|
||||||
@ -17,15 +13,17 @@ public interface AccountSinglePushService extends SinglePushBaseService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 透传方式
|
* 透传方式
|
||||||
|
*
|
||||||
* @param message
|
* @param message
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
CommonResult pushTocid(String message,String userId);
|
CommonResult pushTocid(String message, Integer userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息通知方式
|
* 消息通知方式
|
||||||
|
*
|
||||||
* @param pushTemplate
|
* @param pushTemplate
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
CommonResult pushTocid(PushTemplate pushTemplate, String userId);
|
CommonResult pushTocid(PushTemplate pushTemplate, Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.suisung.mall.account.service;
|
||||||
|
|
||||||
|
import com.suisung.mall.common.modules.singlepush.AccountUserBindGeTui;
|
||||||
|
import com.suisung.mall.core.web.service.IBaseService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AccountUserBindGeTuiService extends IBaseService<AccountUserBindGeTui> {
|
||||||
|
|
||||||
|
Boolean addOrUpdate(AccountUserBindGeTui accountUserBindGeTui);
|
||||||
|
|
||||||
|
List<AccountUserBindGeTui> getActive(AccountUserBindGeTui accountUserBindGeTui);
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.suisung.mall.account.service;
|
|
||||||
|
|
||||||
import com.suisung.mall.common.modules.singlepush.UserDeviceBind;
|
|
||||||
import com.suisung.mall.core.web.service.IBaseService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface UserDeviceBindService extends IBaseService<UserDeviceBind> {
|
|
||||||
|
|
||||||
void saveUserDeviceBind(UserDeviceBind userDeviceBind);
|
|
||||||
|
|
||||||
List<UserDeviceBind> getActive(UserDeviceBind userDeviceBind);
|
|
||||||
}
|
|
||||||
@ -14,13 +14,11 @@ import com.getui.push.v2.sdk.dto.req.message.ios.Alert;
|
|||||||
import com.getui.push.v2.sdk.dto.req.message.ios.Aps;
|
import com.getui.push.v2.sdk.dto.req.message.ios.Aps;
|
||||||
import com.getui.push.v2.sdk.dto.req.message.ios.IosDTO;
|
import com.getui.push.v2.sdk.dto.req.message.ios.IosDTO;
|
||||||
import com.suisung.mall.account.service.AccountSinglePushService;
|
import com.suisung.mall.account.service.AccountSinglePushService;
|
||||||
import com.suisung.mall.account.service.UserDeviceBindService;
|
import com.suisung.mall.account.service.AccountUserBindGeTuiService;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.push.PushTemplate;
|
import com.suisung.mall.common.modules.push.PushTemplate;
|
||||||
import com.suisung.mall.common.modules.singlepush.UserDeviceBind;
|
import com.suisung.mall.common.modules.singlepush.AccountUserBindGeTui;
|
||||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
|
||||||
import com.suisung.mall.common.service.impl.SinglePushBaseServiceImpl;
|
import com.suisung.mall.common.service.impl.SinglePushBaseServiceImpl;
|
||||||
import org.checkerframework.checker.units.qual.A;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ import java.util.UUID;
|
|||||||
public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl implements AccountSinglePushService {
|
public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl implements AccountSinglePushService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserDeviceBindService userDeviceBindService;
|
private AccountUserBindGeTuiService accountUserBindGeTuiService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTokenString() {
|
public String getTokenString() {
|
||||||
@ -45,10 +43,10 @@ public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult pushTocid(String message, String userId) {
|
public CommonResult pushTocid(String message, Integer userId) {
|
||||||
UserDeviceBind userDeviceBind = new UserDeviceBind();
|
AccountUserBindGeTui accountUserBindGeTui = new AccountUserBindGeTui();
|
||||||
userDeviceBind.setUserId(userId);
|
accountUserBindGeTui.setUserId(userId);
|
||||||
List<UserDeviceBind> list = userDeviceBindService.getActive(userDeviceBind);
|
List<AccountUserBindGeTui> list = accountUserBindGeTuiService.getActive(accountUserBindGeTui);
|
||||||
if (CollectionUtil.isEmpty(list)) {
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
log.error("登录时绑定设备不存在");
|
log.error("登录时绑定设备不存在");
|
||||||
return CommonResult.failed("登录时绑定设备不存在");
|
return CommonResult.failed("登录时绑定设备不存在");
|
||||||
@ -67,18 +65,18 @@ public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl impl
|
|||||||
ApiResult<Map<String, Map<String, String>>> mapApiResult = pushApi.pushToSingleByCid(pushDTO);//,super.getTokenDTO()
|
ApiResult<Map<String, Map<String, String>>> mapApiResult = pushApi.pushToSingleByCid(pushDTO);//,super.getTokenDTO()
|
||||||
if (mapApiResult.getCode() != 0) {
|
if (mapApiResult.getCode() != 0) {
|
||||||
log.info("用户为{},cid为{}发送成功消息失败", list.get(0).getUserId(), list.get(0).getCid());
|
log.info("用户为{},cid为{}发送成功消息失败", list.get(0).getUserId(), list.get(0).getCid());
|
||||||
return CommonResult.failed("错误码:"+mapApiResult.getCode()+"错误消息"+mapApiResult.getMsg());
|
return CommonResult.failed("错误码:" + mapApiResult.getCode() + "错误消息" + mapApiResult.getMsg());
|
||||||
}
|
}
|
||||||
return CommonResult.success("success");
|
return CommonResult.success("success");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult pushTocid(PushTemplate pushTemplate, String userId) {
|
public CommonResult pushTocid(PushTemplate pushTemplate, Integer userId) {
|
||||||
UserDeviceBind userDeviceBind = new UserDeviceBind();
|
AccountUserBindGeTui accountUserBindGeTui = new AccountUserBindGeTui();
|
||||||
userDeviceBind.setUserId(userId);
|
accountUserBindGeTui.setUserId(userId);
|
||||||
List<UserDeviceBind> list = userDeviceBindService.getActive(userDeviceBind);
|
List<AccountUserBindGeTui> list = accountUserBindGeTuiService.getActive(accountUserBindGeTui);
|
||||||
if (CollectionUtil.isEmpty(list)) {
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
return CommonResult.failed("登录时绑定设备不存在");
|
return CommonResult.failed("登录时绑定设备不存在");
|
||||||
}
|
}
|
||||||
String cid = list.get(0).getCid();
|
String cid = list.get(0).getCid();
|
||||||
PushApi pushApi = this.getApiHelper().creatApi(PushApi.class);
|
PushApi pushApi = this.getApiHelper().creatApi(PushApi.class);
|
||||||
@ -90,7 +88,7 @@ public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl impl
|
|||||||
PushMessage pushMessage = new PushMessage();
|
PushMessage pushMessage = new PushMessage();
|
||||||
pushMessage.setDuration(this.getDuration());
|
pushMessage.setDuration(this.getDuration());
|
||||||
//在线消息 start
|
//在线消息 start
|
||||||
GTNotification gtNotification=new GTNotification();
|
GTNotification gtNotification = new GTNotification();
|
||||||
gtNotification.setTitle(pushTemplate.getTitle());
|
gtNotification.setTitle(pushTemplate.getTitle());
|
||||||
gtNotification.setBody(pushTemplate.getContent());
|
gtNotification.setBody(pushTemplate.getContent());
|
||||||
gtNotification.setClickType("payload");
|
gtNotification.setClickType("payload");
|
||||||
@ -99,20 +97,20 @@ public class AccountSinglePushServiceImpl extends SinglePushBaseServiceImpl impl
|
|||||||
//在线消息 end
|
//在线消息 end
|
||||||
pushDTO.setPushMessage(pushMessage);
|
pushDTO.setPushMessage(pushMessage);
|
||||||
//离线消息 start
|
//离线消息 start
|
||||||
PushChannel pushChannel=new PushChannel();
|
PushChannel pushChannel = new PushChannel();
|
||||||
//IOS
|
//IOS
|
||||||
IosDTO iosDTO=new IosDTO();
|
IosDTO iosDTO = new IosDTO();
|
||||||
iosDTO.setPayload(pushTemplate.getJson());
|
iosDTO.setPayload(pushTemplate.getJson());
|
||||||
Aps aps=new Aps();
|
Aps aps = new Aps();
|
||||||
Alert alert= new Alert();
|
Alert alert = new Alert();
|
||||||
alert.setTitle(pushTemplate.getTitle());
|
alert.setTitle(pushTemplate.getTitle());
|
||||||
alert.setBody(pushTemplate.getContent());
|
alert.setBody(pushTemplate.getContent());
|
||||||
aps.setAlert(alert);
|
aps.setAlert(alert);
|
||||||
iosDTO.setAps(aps);
|
iosDTO.setAps(aps);
|
||||||
pushChannel.setIos(iosDTO);
|
pushChannel.setIos(iosDTO);
|
||||||
//android 安卓离线只能透传
|
//android 安卓离线只能透传
|
||||||
AndroidDTO android =new AndroidDTO();
|
AndroidDTO android = new AndroidDTO();
|
||||||
Ups ups=new Ups();
|
Ups ups = new Ups();
|
||||||
ups.setTransmission(pushTemplate.getJson());
|
ups.setTransmission(pushTemplate.getJson());
|
||||||
android.setUps(ups);
|
android.setUps(ups);
|
||||||
pushChannel.setAndroid(android);
|
pushChannel.setAndroid(android);
|
||||||
|
|||||||
@ -50,7 +50,7 @@ import com.suisung.mall.common.modules.distribution.ShopDistributionUser;
|
|||||||
import com.suisung.mall.common.modules.distribution.ShopDistributionUserCommission;
|
import com.suisung.mall.common.modules.distribution.ShopDistributionUserCommission;
|
||||||
import com.suisung.mall.common.modules.pay.PayUserResource;
|
import com.suisung.mall.common.modules.pay.PayUserResource;
|
||||||
import com.suisung.mall.common.modules.plantform.ShopPlantformSubsiteUser;
|
import com.suisung.mall.common.modules.plantform.ShopPlantformSubsiteUser;
|
||||||
import com.suisung.mall.common.modules.singlepush.UserDeviceBind;
|
import com.suisung.mall.common.modules.singlepush.AccountUserBindGeTui;
|
||||||
import com.suisung.mall.common.pojo.dto.SmsDto;
|
import com.suisung.mall.common.pojo.dto.SmsDto;
|
||||||
import com.suisung.mall.common.pojo.req.WxUserInfoReq;
|
import com.suisung.mall.common.pojo.req.WxUserInfoReq;
|
||||||
import com.suisung.mall.common.service.MessageService;
|
import com.suisung.mall.common.service.MessageService;
|
||||||
@ -139,7 +139,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
@Autowired
|
@Autowired
|
||||||
private I18nUtil i18nUtil;
|
private I18nUtil i18nUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private UserDeviceBindService userDeviceBindService;
|
private AccountUserBindGeTuiService accountUserBindGeTuiService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult login(Map<String, String> params) {
|
public CommonResult login(Map<String, String> params) {
|
||||||
@ -221,21 +221,19 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
// data.put("merch_approval_status", shopService.shopMerchEntryApprovalStatus(params2));
|
// data.put("merch_approval_status", shopService.shopMerchEntryApprovalStatus(params2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 个推消息推送设备与用户绑定
|
||||||
String cid = params.get("cid");
|
String cid = params.get("cid");
|
||||||
if (StrUtil.isNotBlank(cid)) {
|
if (StrUtil.isNotBlank(cid)) {
|
||||||
UserDeviceBind userDeviceBind = new UserDeviceBind();
|
AccountUserBindGeTui accountUserBindGeTui = new AccountUserBindGeTui();
|
||||||
userDeviceBind.setCid(params.get("cid"));
|
accountUserBindGeTui.setUserId(user_id).setUserType(Convert.toInt(params.get("user_is_admin")))
|
||||||
userDeviceBind.setOsType(params.get("os_type"));
|
.setCid(cid).setOsType(Convert.toInt(params.get("os_type")));
|
||||||
this.saveUserDeviceBind(userDeviceBind);
|
accountUserBindGeTuiService.addOrUpdate(accountUserBindGeTui);
|
||||||
}
|
}
|
||||||
|
|
||||||
return restResult;
|
return restResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void saveUserDeviceBind(UserDeviceBind userDeviceBind) {
|
|
||||||
userDeviceBindService.saveUserDeviceBind(userDeviceBind);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getUserInfo(Integer user_id) {
|
public Map<String, Object> getUserInfo(Integer user_id) {
|
||||||
QueryWrapper<AccountUserBase> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<AccountUserBase> queryWrapper = new QueryWrapper<>();
|
||||||
@ -2876,7 +2874,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
if (StrUtil.isBlank(iddCode) || !PhoneNumberUtils.isValidCountryCode(iddCode)) {
|
if (StrUtil.isBlank(iddCode) || !PhoneNumberUtils.isValidCountryCode(iddCode)) {
|
||||||
iddCode = CommonConstant.IDD_ZH_CN;
|
iddCode = CommonConstant.IDD_ZH_CN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 带国家编码的手机号
|
// 带国家编码的手机号
|
||||||
String mobile = PhoneNumberUtils.convWithIDDCodePhoneNumber(wxUserInfoReq.getPhoneNumber(), iddCode);
|
String mobile = PhoneNumberUtils.convWithIDDCodePhoneNumber(wxUserInfoReq.getPhoneNumber(), iddCode);
|
||||||
|
|
||||||
@ -3080,10 +3078,6 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
|||||||
return CommonResult.failed("获取不到用户信息!");
|
return CommonResult.failed("获取不到用户信息!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (ObjectUtil.notEqual(userType, accountUserBase.getUser_is_admin())) {
|
|
||||||
// 不是入驻商家的情况,已经有普通用户使用了手机号了,提示已经被注册。
|
|
||||||
// return CommonResult.failed("已被注册,请换一个手机号码!");
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
// 手机号码未绑定的情况,直接去注册一个账号
|
// 手机号码未绑定的情况,直接去注册一个账号
|
||||||
Map<String, Object> userInfo = new HashMap<>();
|
Map<String, Object> userInfo = new HashMap<>();
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.suisung.mall.account.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.suisung.mall.account.mapper.UserDeviceBindMapper;
|
||||||
|
import com.suisung.mall.account.service.AccountUserBindGeTuiService;
|
||||||
|
import com.suisung.mall.common.modules.singlepush.AccountUserBindGeTui;
|
||||||
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class AccountUserBindGeTuiServiceImpl extends BaseServiceImpl<UserDeviceBindMapper, AccountUserBindGeTui> implements AccountUserBindGeTuiService {
|
||||||
|
@Override
|
||||||
|
public Boolean addOrUpdate(AccountUserBindGeTui accountUserBindGeTui) {
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isNull(accountUserBindGeTui) ||
|
||||||
|
StrUtil.isBlank(accountUserBindGeTui.getCid()) ||
|
||||||
|
ObjectUtil.isNull(accountUserBindGeTui.getUserId()) ||
|
||||||
|
ObjectUtil.isNull(accountUserBindGeTui.getOsType())) {
|
||||||
|
log.error("缺少必要参数:cid={}, userId={}, osType={}",
|
||||||
|
accountUserBindGeTui != null ? accountUserBindGeTui.getCid() : "",
|
||||||
|
accountUserBindGeTui != null ? accountUserBindGeTui.getUserId() : "",
|
||||||
|
accountUserBindGeTui != null ? accountUserBindGeTui.getOsType() : "");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<AccountUserBindGeTui> wrapper = new QueryWrapper<AccountUserBindGeTui>()
|
||||||
|
.eq("user_id", accountUserBindGeTui.getUserId())
|
||||||
|
.eq("cid", accountUserBindGeTui.getCid())
|
||||||
|
.eq("os_type", accountUserBindGeTui.getOsType());
|
||||||
|
AccountUserBindGeTui existAccountUserBindGeTui = getOne(wrapper);
|
||||||
|
|
||||||
|
if (existAccountUserBindGeTui == null) {
|
||||||
|
return this.add(accountUserBindGeTui);
|
||||||
|
}
|
||||||
|
|
||||||
|
accountUserBindGeTui.setId(existAccountUserBindGeTui.getId());
|
||||||
|
return this.updateById(accountUserBindGeTui);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("处理 addOrUpdate 时发生异常:{}", e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountUserBindGeTui> getActive(AccountUserBindGeTui accountUserBindGeTui) {
|
||||||
|
QueryWrapper<AccountUserBindGeTui> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("user_id", accountUserBindGeTui.getUserId()).orderByDesc("updated_at");
|
||||||
|
return list(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,60 +0,0 @@
|
|||||||
package com.suisung.mall.account.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.suisung.mall.account.mapper.UserDeviceBindMapper;
|
|
||||||
import com.suisung.mall.account.service.UserDeviceBindService;
|
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
|
||||||
import com.suisung.mall.common.modules.singlepush.UserDeviceBind;
|
|
||||||
import com.suisung.mall.common.utils.ContextUtil;
|
|
||||||
import com.suisung.mall.common.utils.StringUtils;
|
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@lombok.extern.slf4j.Slf4j
|
|
||||||
public class UserDeviceBindServiceImpl extends BaseServiceImpl<UserDeviceBindMapper, UserDeviceBind> implements UserDeviceBindService {
|
|
||||||
@Override
|
|
||||||
public void saveUserDeviceBind(UserDeviceBind userDeviceBind) {
|
|
||||||
if(StringUtils.isEmpty(userDeviceBind.getCid())){
|
|
||||||
throw new RuntimeException("绑定cid不能为空");
|
|
||||||
}
|
|
||||||
if(StringUtils.isEmpty(userDeviceBind.getOsType())){
|
|
||||||
throw new RuntimeException("操作系统类型不能为空");
|
|
||||||
}
|
|
||||||
QueryWrapper<UserDeviceBind> wrapper = new QueryWrapper<>();
|
|
||||||
wrapper.eq("user_id",userDeviceBind.getCid());
|
|
||||||
UserDeviceBind bind=getOne(wrapper);
|
|
||||||
if(bind==null){
|
|
||||||
UserDto userDto= ContextUtil.getCurrentUser();
|
|
||||||
assert userDto != null;
|
|
||||||
userDeviceBind.setUserId(userDto.getUser_account());
|
|
||||||
userDeviceBind.setUserType(userDto.getRole_id());
|
|
||||||
userDeviceBind.setLastActive(new Date());
|
|
||||||
userDeviceBind.setBindTime(new Date());
|
|
||||||
this.saveOrUpdate(userDeviceBind);
|
|
||||||
log.info("保存用户设备绑定关系实体成功");
|
|
||||||
}else {
|
|
||||||
if(!bind.getCid().equals(userDeviceBind.getCid())){
|
|
||||||
bind.setCid(userDeviceBind.getCid());
|
|
||||||
}
|
|
||||||
if(!bind.getOsType().equals(userDeviceBind.getOsType())){
|
|
||||||
bind.setCid(userDeviceBind.getOsType());
|
|
||||||
}
|
|
||||||
bind.setLastActive(new Date());
|
|
||||||
bind.setBindTime(new Date());
|
|
||||||
this.saveOrUpdate(bind);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UserDeviceBind> getActive(UserDeviceBind userDeviceBind) {
|
|
||||||
QueryWrapper<UserDeviceBind> wrapper = new QueryWrapper<>();
|
|
||||||
wrapper.eq("user_id",userDeviceBind.getUserId()).orderByDesc("bind_time");
|
|
||||||
return list(wrapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -40,7 +40,7 @@ public class GlobalExceptionHandler {
|
|||||||
location,
|
location,
|
||||||
e);
|
e);
|
||||||
|
|
||||||
return CommonResult.failed("系统异常:" + e.getMessage());
|
return CommonResult.failed(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(value = ApiException.class)
|
@ExceptionHandler(value = ApiException.class)
|
||||||
@ -69,10 +69,8 @@ public class GlobalExceptionHandler {
|
|||||||
location,
|
location,
|
||||||
e);
|
e);
|
||||||
|
|
||||||
if (errorCode != null) {
|
if (StrUtil.isNotBlank(message)) {
|
||||||
return CommonResult.failed(message);
|
return CommonResult.failed(message);
|
||||||
} else if (StrUtil.isNotBlank(message)) {
|
|
||||||
return CommonResult.failed("系统异常:" + message + " [" + location + "]");
|
|
||||||
} else {
|
} else {
|
||||||
return CommonResult.failed(ResultCode.FAILED);
|
return CommonResult.failed(ResultCode.FAILED);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
package com.suisung.mall.common.modules.singlepush;
|
package com.suisung.mall.common.modules.singlepush;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@ -10,15 +11,14 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("user_device_bind") // MyBatis-Plus 表名注解
|
@TableName("account_user_bind_getui") // MyBatis-Plus 表名注解
|
||||||
@ApiModel("用户设备绑定实体") // Swagger 模型描述
|
@ApiModel("用户设备绑定个推实体") // Swagger 模型描述
|
||||||
public class UserDeviceBind implements Serializable {
|
public class AccountUserBindGeTui implements Serializable {
|
||||||
|
|
||||||
@TableId(value = "id", type = IdType.AUTO) // 主键自增
|
@TableId(value = "id", type = IdType.AUTO) // 主键自增
|
||||||
@ApiModelProperty(value = "主键ID", hidden = true) // 隐藏此字段不展示在Swagger文档
|
@ApiModelProperty(value = "主键ID", hidden = true) // 隐藏此字段不展示在Swagger文档
|
||||||
@ -26,7 +26,7 @@ public class UserDeviceBind implements Serializable {
|
|||||||
|
|
||||||
@TableField("user_id") // 明确字段映射(可省略,默认自动转下划线)
|
@TableField("user_id") // 明确字段映射(可省略,默认自动转下划线)
|
||||||
@ApiModelProperty(value = "用户唯一标识", required = true, example = "U20231001")
|
@ApiModelProperty(value = "用户唯一标识", required = true, example = "U20231001")
|
||||||
private String userId;
|
private Integer userId;
|
||||||
|
|
||||||
@TableField("cid")
|
@TableField("cid")
|
||||||
@ApiModelProperty(value = "设备CID", required = true, example = "CID_ABCD1234")
|
@ApiModelProperty(value = "设备CID", required = true, example = "CID_ABCD1234")
|
||||||
@ -34,26 +34,33 @@ public class UserDeviceBind implements Serializable {
|
|||||||
|
|
||||||
@TableField("user_type")
|
@TableField("user_type")
|
||||||
@ApiModelProperty(
|
@ApiModelProperty(
|
||||||
value = "用户类型 (1=普通用户, 2=管理员, 3=商家)",
|
value = "用户类型:0-普通用户;1-管理员;2-入驻商户;默认是普通用户",
|
||||||
required = true,
|
|
||||||
example = "1",
|
example = "1",
|
||||||
notes = "1-普通用户, 2-管理员, 3-商家"
|
notes = "用户类型:0-普通用户;1-管理员;2-入驻商户;"
|
||||||
)
|
)
|
||||||
private Integer userType;
|
private Integer userType;
|
||||||
|
|
||||||
@TableField("os_type")
|
@TableField("os_type")
|
||||||
@ApiModelProperty(
|
@ApiModelProperty(
|
||||||
value = "手机系统类型",
|
value = "手机系统类型",
|
||||||
example = "Android",
|
example = "1",
|
||||||
notes = "Android, iOS"
|
notes = "手机系统类型 :1-Android;2-iOS"
|
||||||
)
|
)
|
||||||
private String osType;
|
private Integer osType;
|
||||||
|
|
||||||
@TableField("bind_time")
|
@TableField("status")
|
||||||
|
@ApiModelProperty(
|
||||||
|
value = "状态",
|
||||||
|
example = "1",
|
||||||
|
notes = "状态:1-有效;2-无效;"
|
||||||
|
)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@TableField("created_at")
|
||||||
@ApiModelProperty(value = "绑定时间", example = "2023-10-01 12:00:00")
|
@ApiModelProperty(value = "绑定时间", example = "2023-10-01 12:00:00")
|
||||||
private Date bindTime;
|
private Date createdAt;
|
||||||
|
|
||||||
@TableField("last_active")
|
@TableField("updated_at")
|
||||||
@ApiModelProperty(value = "最后活跃时间", example = "2023-10-05 14:30:00")
|
@ApiModelProperty(value = "最后活跃时间", example = "2023-10-05 14:30:00")
|
||||||
private Date lastActive;
|
private Date updatedAt;
|
||||||
}
|
}
|
||||||
@ -33,6 +33,10 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class GeTuiPushServiceImpl implements GeTuiPushService {
|
public class GeTuiPushServiceImpl implements GeTuiPushService {
|
||||||
@ -43,7 +47,6 @@ public class GeTuiPushServiceImpl implements GeTuiPushService {
|
|||||||
private String appkey;
|
private String appkey;
|
||||||
@Value("${getui.push.mastersecret}")
|
@Value("${getui.push.mastersecret}")
|
||||||
private String mastersecret;
|
private String mastersecret;
|
||||||
|
|
||||||
@Value("${getui.push.domain}")
|
@Value("${getui.push.domain}")
|
||||||
private String getuiDomain;
|
private String getuiDomain;
|
||||||
|
|
||||||
@ -61,6 +64,146 @@ public class GeTuiPushServiceImpl implements GeTuiPushService {
|
|||||||
return apiHelper.creatApi(PushApi.class);
|
return apiHelper.creatApi(PushApi.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送在线或离线消息到单个 CID
|
||||||
|
*
|
||||||
|
* @param cid 客户端 ID
|
||||||
|
* @param title 消息标题
|
||||||
|
* @param content 消息内容
|
||||||
|
* @param payloadJson 自定义透传内容(JSON 格式)
|
||||||
|
* String payloadJson = "{\"action\":\"openPage\",\"pageId\":\"12345\",\"extraInfo\":\"Welcome to the app!\"}";
|
||||||
|
* @return 是否发送成功
|
||||||
|
*/
|
||||||
|
public boolean sendMessageToSingleCid(String cid, String title, String content, String payloadJson) {
|
||||||
|
try {
|
||||||
|
// 参数校验
|
||||||
|
if (cid == null || cid.isEmpty() || title == null || content == null || payloadJson == null) {
|
||||||
|
log.error("参数无效:cid={}, title={}, content={}, payloadJson={}", cid, title, content, payloadJson);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置 Android 消息
|
||||||
|
AndroidDTO androidDTO = new AndroidDTO();
|
||||||
|
Ups ups = new Ups();
|
||||||
|
ups.setTransmission(payloadJson); // 设置透传内容
|
||||||
|
androidDTO.setUps(ups);
|
||||||
|
|
||||||
|
// 配置 iOS 消息
|
||||||
|
IosDTO iosDTO = new IosDTO();
|
||||||
|
iosDTO.setPayload(payloadJson); // 设置透传内容
|
||||||
|
Aps aps = new Aps();
|
||||||
|
Alert alert = new Alert();
|
||||||
|
alert.setTitle(title); // 设置标题
|
||||||
|
alert.setBody(content); // 设置内容
|
||||||
|
aps.setAlert(alert);
|
||||||
|
iosDTO.setAps(aps);
|
||||||
|
|
||||||
|
// 整合平台消息配置
|
||||||
|
PushChannel pushChannel = new PushChannel();
|
||||||
|
pushChannel.setAndroid(androidDTO);
|
||||||
|
pushChannel.setIos(iosDTO);
|
||||||
|
|
||||||
|
// 创建 PushMessage
|
||||||
|
PushMessage pushMessage = new PushMessage();
|
||||||
|
pushMessage.setTransmission(payloadJson); // 设置透传内容
|
||||||
|
|
||||||
|
// 创建 Audience
|
||||||
|
Audience audience = new Audience();
|
||||||
|
audience.addCid(cid);
|
||||||
|
|
||||||
|
// 创建 PushDTO
|
||||||
|
PushDTO<Audience> pushDTO = new PushDTO<>();
|
||||||
|
pushDTO.setPushChannel(pushChannel);
|
||||||
|
pushDTO.setPushMessage(pushMessage);
|
||||||
|
pushDTO.setAudience(audience);
|
||||||
|
pushDTO.setRequestId(UUID.randomUUID().toString()); // 设置唯一请求 ID
|
||||||
|
|
||||||
|
// 调用个推 API 发送消息
|
||||||
|
ApiResult<Map<String, Map<String, String>>> result = creatPushApi().pushToSingleByCid(pushDTO);
|
||||||
|
if (result.getCode() != 0) {
|
||||||
|
log.error("消息发送失败:code={}, message={}", result.getCode(), result.getMsg());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("消息发送成功,CID: {}", cid);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送消息时发生异常:{}", e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送在线或离线消息到多个 CID
|
||||||
|
*
|
||||||
|
* @param cids 客户端 ID 列表
|
||||||
|
* @param title 消息标题
|
||||||
|
* @param content 消息内容
|
||||||
|
* @param payloadJson 自定义透传内容(JSON 格式)
|
||||||
|
* String payloadJson = "{\"action\":\"openPage\",\"pageId\":\"12345\",\"extraInfo\":\"Welcome to the app!\"}";
|
||||||
|
* @return 是否全部发送成功
|
||||||
|
*/
|
||||||
|
public boolean sendMessageToMultipleCids(List<String> cids, String title, String content, String payloadJson) {
|
||||||
|
try {
|
||||||
|
// 参数校验
|
||||||
|
if (cids == null || cids.isEmpty() || title == null || content == null || payloadJson == null) {
|
||||||
|
log.error("参数无效:cids={}, title={}, content={}, payloadJson={}", cids, title, content, payloadJson);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置 Android 消息
|
||||||
|
AndroidDTO androidDTO = new AndroidDTO();
|
||||||
|
Ups ups = new Ups();
|
||||||
|
ups.setTransmission(payloadJson); // 设置透传内容
|
||||||
|
androidDTO.setUps(ups);
|
||||||
|
|
||||||
|
// 配置 iOS 消息
|
||||||
|
IosDTO iosDTO = new IosDTO();
|
||||||
|
iosDTO.setPayload(payloadJson); // 设置透传内容
|
||||||
|
Aps aps = new Aps();
|
||||||
|
Alert alert = new Alert();
|
||||||
|
alert.setTitle(title); // 设置标题
|
||||||
|
alert.setBody(content); // 设置内容
|
||||||
|
aps.setAlert(alert);
|
||||||
|
iosDTO.setAps(aps);
|
||||||
|
|
||||||
|
// 整合平台消息配置
|
||||||
|
PushChannel pushChannel = new PushChannel();
|
||||||
|
pushChannel.setAndroid(androidDTO);
|
||||||
|
pushChannel.setIos(iosDTO);
|
||||||
|
|
||||||
|
// 创建 PushMessage
|
||||||
|
PushMessage pushMessage = new PushMessage();
|
||||||
|
pushMessage.setTransmission(payloadJson); // 设置透传内容
|
||||||
|
|
||||||
|
// 创建 Audience
|
||||||
|
Audience audience = new Audience();
|
||||||
|
for (String cid : cids) {
|
||||||
|
audience.addCid(cid);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建 PushDTO
|
||||||
|
PushDTO<Audience> pushDTO = new PushDTO<>();
|
||||||
|
pushDTO.setPushChannel(pushChannel);
|
||||||
|
pushDTO.setPushMessage(pushMessage);
|
||||||
|
pushDTO.setAudience(audience);
|
||||||
|
pushDTO.setRequestId(UUID.randomUUID().toString()); // 设置唯一请求 ID
|
||||||
|
|
||||||
|
// 调用个推 API 发送消息
|
||||||
|
ApiResult<Map<String, Map<String, String>>> result = creatPushApi().pushToSingleByCid(pushDTO);
|
||||||
|
if (result.getCode() != 0) {
|
||||||
|
log.error("消息发送失败:code={}, message={}", result.getCode(), result.getMsg());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("消息发送成功,CIDs: {}", cids);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送消息时发生异常:{}", e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单个用户透传消息(支持H5、安卓、苹果系统)
|
* 单个用户透传消息(支持H5、安卓、苹果系统)
|
||||||
|
|||||||
@ -33,6 +33,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.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;
|
||||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||||
@ -121,6 +122,10 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ShopOrderLklService shopOrderLklService;
|
private ShopOrderLklService shopOrderLklService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private ShopMessageTemplateService shopMessageTemplateService;
|
||||||
|
|
||||||
// @Lazy
|
// @Lazy
|
||||||
// @Resource
|
// @Resource
|
||||||
// private
|
// private
|
||||||
@ -650,11 +655,12 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
// 先写入本地数据库表中
|
// 先写入本地数据库表中
|
||||||
LklLedgerEc record = new LklLedgerEc();
|
LklLedgerEc record = new LklLedgerEc();
|
||||||
record.setMch_id(shopMchEntry.getId());
|
record.setMch_id(shopMchEntry.getId());
|
||||||
record.setMch_mobile(shopMchEntry.getLogin_mobile());
|
record.setMch_mobile(mchMobile);
|
||||||
record.setReq_params(reqBody.toString());
|
record.setReq_params(reqBody.toString());
|
||||||
record.setNotify_url(retUrl);
|
record.setNotify_url(retUrl);
|
||||||
record.setEc_apply_id(respData.getLong("ec_apply_id"));
|
record.setEc_apply_id(respData.getLong("ec_apply_id"));
|
||||||
record.setResult_url(respData.getStr("result_url"));
|
String ecResultUrl = respData.getStr("result_url");
|
||||||
|
record.setResult_url(ecResultUrl);
|
||||||
record.setResp_body(respBody.toString());
|
record.setResp_body(respBody.toString());
|
||||||
Boolean success = lklLedgerEcService.addOrUpdateByMchId(record);
|
Boolean success = lklLedgerEcService.addOrUpdateByMchId(record);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
@ -663,6 +669,13 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
return Pair.of(false, errMsg);
|
return Pair.of(false, errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新拉卡拉的电子合同信息到商家入驻表中
|
||||||
|
shopMchEntryService.updateMerchEntryEcResultUrlByMchId(shopMchEntry.getId(), ecResultUrl);
|
||||||
|
|
||||||
|
// 发短信给商家,及时签署合同 SMS_488465246
|
||||||
|
// 商家您好,您的入驻申请已收到。请尽快登录小发同城商家 APP 完成合同签署,签署时效为 24 小时,望知晓。
|
||||||
|
shopMessageTemplateService.aliyunSmsSend(mchMobile, "SMS_488465246", null);//SMS_479760276
|
||||||
|
|
||||||
return Pair.of(true, "商家入网申请电子合同成功");
|
return Pair.of(true, "商家入网申请电子合同成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,7 +846,6 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
if (lklLedgerEc == null) {
|
if (lklLedgerEc == null) {
|
||||||
log.error("入网电子合同申请回调:找不到对应入网lklLedgerEc电子合同记录");
|
log.error("入网电子合同申请回调:找不到对应入网lklLedgerEc电子合同记录");
|
||||||
respData.put("message", "找不到对应入网电子合同记录!");
|
respData.put("message", "找不到对应入网电子合同记录!");
|
||||||
// throw new ApiException("找不到对应入网电子合同记录!");
|
|
||||||
return respData;
|
return respData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -958,10 +970,10 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
|||||||
File file = UploadUtil.convertBase64ToFile(fileBase64);
|
File file = UploadUtil.convertBase64ToFile(fileBase64);
|
||||||
|
|
||||||
// REMARK 把合同文件 url 上传到cos服务器
|
// REMARK 把合同文件 url 上传到cos服务器
|
||||||
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/").concat("contract")
|
String cosFileName = TENGXUN_DEFAULT_DIR.concat("/contract")
|
||||||
.concat("/")
|
.concat("/")
|
||||||
.concat(lklLedgerEc.getMch_mobile()).concat("/")
|
.concat(lklLedgerEc.getMch_mobile())
|
||||||
.concat("signed").concat("/")
|
.concat("/signed").concat("/")
|
||||||
.concat(ecApplyId.toString()).concat(".pdf");
|
.concat(ecApplyId.toString()).concat(".pdf");
|
||||||
log.debug("拉卡拉电子合同保存地址:{}", cosFileName);
|
log.debug("拉卡拉电子合同保存地址:{}", cosFileName);
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public class ShopOrderReturnController extends BaseControllerImpl {
|
|||||||
return shopOrderReturnService.doForceRefund(return_id, return_flag);
|
return shopOrderReturnService.doForceRefund(return_id, return_flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "确认收款", notes = "确认收款")
|
@ApiOperation(value = "确认退货", notes = "确认退货")
|
||||||
@RequestMapping(value = "/refund", method = RequestMethod.POST)
|
@RequestMapping(value = "/refund", method = RequestMethod.POST)
|
||||||
public CommonResult refund(@RequestParam(name = "return_id") String return_id) {
|
public CommonResult refund(@RequestParam(name = "return_id") String return_id) {
|
||||||
return CommonResult.success(shopOrderReturnService.refund(return_id));
|
return CommonResult.success(shopOrderReturnService.refund(return_id));
|
||||||
|
|||||||
@ -71,6 +71,18 @@ public class UserReturnController extends BaseControllerImpl {
|
|||||||
return shopOrderReturnService.addItem(orderReturnInput);
|
return shopOrderReturnService.addItem(orderReturnInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "添加退款退货-整单退货", notes = "添加退款退货-整单退货")
|
||||||
|
@RequestMapping(value = "/addWholeItems", method = RequestMethod.POST)
|
||||||
|
public CommonResult addWholeItems(@RequestParam(name = "order_id") String order_id) {
|
||||||
|
UserDto user = getCurrentUser();
|
||||||
|
|
||||||
|
if (user == null) {
|
||||||
|
throw new ApiUserException(I18nUtil._("用户信息异常!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return shopOrderReturnService.addWholeItems(order_id);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "取消退款订单", notes = "取消退款订单")
|
@ApiOperation(value = "取消退款订单", notes = "取消退款订单")
|
||||||
@RequestMapping(value = "/cancel", method = {RequestMethod.GET, RequestMethod.POST})
|
@RequestMapping(value = "/cancel", method = {RequestMethod.GET, RequestMethod.POST})
|
||||||
public CommonResult cancel(@RequestParam(name = "return_id") String return_id) {
|
public CommonResult cancel(@RequestParam(name = "return_id") String return_id) {
|
||||||
@ -85,17 +97,6 @@ public class UserReturnController extends BaseControllerImpl {
|
|||||||
return shopOrderReturnService.returnTrackingNumber(return_id, return_tracking_number, return_tracking_name);
|
return shopOrderReturnService.returnTrackingNumber(return_id, return_tracking_number, return_tracking_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "添加退款退货-整单退货", notes = "添加退款退货-整单退货")
|
|
||||||
@RequestMapping(value = "/addWholeItems", method = RequestMethod.POST)
|
|
||||||
public CommonResult addWholeItems(@RequestParam(name = "order_id") String order_id) {
|
|
||||||
UserDto user = getCurrentUser();
|
|
||||||
|
|
||||||
if (user == null) {
|
|
||||||
throw new ApiUserException(I18nUtil._("用户信息异常!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return shopOrderReturnService.addWholeItems(order_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "退货原因列表", notes = "退货原因列表")
|
@ApiOperation(value = "退货原因列表", notes = "退货原因列表")
|
||||||
@RequestMapping(value = "/returnReasonList", method = RequestMethod.GET)
|
@RequestMapping(value = "/returnReasonList", method = RequestMethod.GET)
|
||||||
|
|||||||
@ -731,7 +731,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认收款
|
* 确认退货
|
||||||
*
|
*
|
||||||
* @param return_id
|
* @param return_id
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -218,4 +218,12 @@ public interface ShopMchEntryService {
|
|||||||
*/
|
*/
|
||||||
Boolean updateMulStatus(String mchMobile, String merCupNo, Integer hasEcSigned, Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer hasApplyMer);
|
Boolean updateMulStatus(String mchMobile, String merCupNo, Integer hasEcSigned, Integer hasApplySplit, Integer hasApplyReceiver, Integer hasBindReceiver, Integer hasApplyMer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新商家入网电子合同结果通知地址
|
||||||
|
*
|
||||||
|
* @param mchId
|
||||||
|
* @param lklEcResultUrl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean updateMerchEntryEcResultUrlByMchId(Long mchId, String lklEcResultUrl);
|
||||||
}
|
}
|
||||||
@ -1019,6 +1019,30 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
|||||||
return update(updateWrapper);
|
return update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateMerchEntryEcResultUrlByMchId(Long mchId, String lklEcResultUrl) {
|
||||||
|
// 检查参数是否有效
|
||||||
|
if (mchId == null || StrUtil.isBlank(lklEcResultUrl)) {
|
||||||
|
log.error("参数无效: mchId={}, lklEcResultUrl={}", mchId, lklEcResultUrl);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 构建更新条件
|
||||||
|
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id", mchId) // 根据商家入驻申请 ID 进行匹配
|
||||||
|
.set("lkl_ec_result_url", lklEcResultUrl); // 设置拉卡拉电子合同结果 URL
|
||||||
|
|
||||||
|
// 执行更新操作
|
||||||
|
return update(updateWrapper);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 捕获异常并记录错误日志
|
||||||
|
log.error("更新 lklEcResultUrl 失败: mchId={}, 错误信息: {}", mchId, e.getMessage(), e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据商户号或商家手机号修改商户分账多个状态
|
* 根据商户号或商家手机号修改商户分账多个状态
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user