feat:修改bug
This commit is contained in:
1 parent
a694547960
commit
7bd97ee83d
20 files changed
+291
-14
No files matched your search
+5
@@ -65,4 +65,9 @@ public interface MemberUserApi {
|
||||
*/
|
||||
void validateUser(Long id);
|
||||
|
||||
/**
|
||||
* 调用`消息通知`用户给`targetUserId`用户发送文本消息
|
||||
*/
|
||||
boolean messageUserSendText(Long targetUserId, String text);
|
||||
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ public enum MemberRecentTagEnum {
|
||||
NEW_PERSON("2", "新人"),
|
||||
HOME_RECOMMEND("3", "首页推荐"),
|
||||
VIP("4", "VIP用户"),
|
||||
GODDESS("4", "女神"),
|
||||
GODDESS("5", "女神"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
+13
@@ -1,6 +1,9 @@
|
||||
package cn.iocoder.yudao.module.member.api.user;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.user.ChatPrivateMessageSendResVO;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
@@ -26,6 +29,8 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||
|
||||
@Resource
|
||||
private MemberUserService userService;
|
||||
@Resource
|
||||
private ChatApi chatApi;
|
||||
|
||||
@Override
|
||||
public MemberUserRespDTO getUser(Long id) {
|
||||
@@ -56,4 +61,12 @@ public class MemberUserApiImpl implements MemberUserApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用`消息通知`用户给`targetUserId`用户发送文本消息
|
||||
*/
|
||||
@Override
|
||||
public boolean messageUserSendText(Long targetUserId, String text) {
|
||||
ChatPrivateMessageSendResVO vo = chatApi.messageUserSendText(targetUserId, text);
|
||||
return ObjectUtil.isNotEmpty(vo);
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.member.client.constant;
|
||||
|
||||
|
||||
public final class ChatConstant {
|
||||
|
||||
/**
|
||||
* 消息通知用户id
|
||||
*/
|
||||
public static final Long COM_MESSAGE_USER_ID = -100L;
|
||||
public static final String COM_MESSAGE_USER_NAME = "消息通知";
|
||||
public static final String COM_MESSAGE_USER_AVATAR = "https://chatapi.zianxin.com/admin-api/infra/file/4/get/3dab7a0921d4d2ea6f7daee399114e9241145e754f7a1e4e1a955fada4542116.png";
|
||||
|
||||
/**
|
||||
* 客服用户id
|
||||
*/
|
||||
public static final Long COM_SERVICE_USER_ID = -200L;
|
||||
public static final String COM_SERVICE_USER_NAME = "荷塘月色客服";
|
||||
public static final String COM_SERVICE_USER_AVATAR = "https://chatapi.zianxin.com/admin-api/infra/file/4/get/b85e0bc2e4338c9919ac13e1f12cb3ac40dc7ba807a0e65ef83c822ef7d2f1a2.png";
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.member.client.init;
|
||||
|
||||
import cn.iocoder.yudao.module.member.client.constant.ChatConstant;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.user.ChatCreateOrUpdateUserReqVO;
|
||||
import cn.iocoder.yudao.module.member.framework.web.config.ThirdAlConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Component
|
||||
public class ChatInit {
|
||||
|
||||
@Resource
|
||||
private ChatApi chatApi;
|
||||
|
||||
/**
|
||||
* 聊天初始化
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 初始化公共的用户
|
||||
initCommonUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化公共的用户
|
||||
*/
|
||||
public void initCommonUser() {
|
||||
// 添加消息通知用户
|
||||
ChatCreateOrUpdateUserReqVO comMessageUser = new ChatCreateOrUpdateUserReqVO();
|
||||
comMessageUser.setUserId(ChatConstant.COM_MESSAGE_USER_ID);
|
||||
comMessageUser.setUserName(ChatConstant.COM_MESSAGE_USER_NAME);
|
||||
comMessageUser.setPhone("15555555555");
|
||||
comMessageUser.setNickName(ChatConstant.COM_MESSAGE_USER_NAME);
|
||||
comMessageUser.setAvatar(ChatConstant.COM_MESSAGE_USER_AVATAR);
|
||||
this.chatApi.createOrUpdate(comMessageUser);
|
||||
// 添加客服用户
|
||||
ChatCreateOrUpdateUserReqVO comServiceUser = new ChatCreateOrUpdateUserReqVO();
|
||||
comServiceUser.setUserId(ChatConstant.COM_SERVICE_USER_ID);
|
||||
comServiceUser.setNickName(ChatConstant.COM_SERVICE_USER_NAME);
|
||||
comServiceUser.setPhone("15555555444");
|
||||
comServiceUser.setUserName(ChatConstant.COM_SERVICE_USER_NAME);
|
||||
comServiceUser.setAvatar(ChatConstant.COM_SERVICE_USER_AVATAR);
|
||||
this.chatApi.createOrUpdate(comServiceUser);
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -34,6 +34,11 @@ public interface ChatApi {
|
||||
*/
|
||||
boolean addFriend(@Valid ChatAddFriendReqVO dto);
|
||||
|
||||
/**
|
||||
* 添加`消息通知`
|
||||
*/
|
||||
boolean addMessageFriend(Long userId);
|
||||
|
||||
/* *************************************** end 用户相关 end *************************************** */
|
||||
|
||||
/* *************************************** start 敏感词 start *************************************** */
|
||||
@@ -67,6 +72,11 @@ public interface ChatApi {
|
||||
*/
|
||||
ChatPrivateMessageSendResVO send(ChatPrivateMessageSendReqVO dto);
|
||||
|
||||
/**
|
||||
* 调用`消息通知`用户给`targetUserId`用户发送文本消息
|
||||
*/
|
||||
ChatPrivateMessageSendResVO messageUserSendText(Long targetUserId, String text);
|
||||
|
||||
/**
|
||||
* 私聊消息分页
|
||||
*/
|
||||
|
||||
+32
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.member.client.service;
|
||||
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.module.member.client.constant.ChatConstant;
|
||||
import cn.iocoder.yudao.module.member.client.tool.ChatApiTool;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.ChatBaseRespVO;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.ChatTableRespVO;
|
||||
@@ -147,6 +149,21 @@ public class ChatApiImpl implements ChatApi {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addMessageFriend(Long userId) {
|
||||
ChatAddFriendReqVO selfDto = new ChatAddFriendReqVO();
|
||||
selfDto.setUserId(userId);
|
||||
selfDto.setTargetUserId(ChatConstant.COM_MESSAGE_USER_ID);
|
||||
boolean selfStatus = addFriend(selfDto);
|
||||
|
||||
ChatAddFriendReqVO serviceDto = new ChatAddFriendReqVO();
|
||||
serviceDto.setUserId(ChatConstant.COM_MESSAGE_USER_ID);
|
||||
serviceDto.setTargetUserId(userId);
|
||||
boolean targetStatus = addFriend(serviceDto);
|
||||
|
||||
return selfStatus && targetStatus;
|
||||
}
|
||||
|
||||
/* *************************************** end 用户相关 end *************************************** */
|
||||
|
||||
/* *************************************** start 敏感词 start *************************************** */
|
||||
@@ -319,6 +336,21 @@ public class ChatApiImpl implements ChatApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用`消息通知`用户给`targetUserId`用户发送文本消息
|
||||
*/
|
||||
@Override
|
||||
public ChatPrivateMessageSendResVO messageUserSendText(Long targetUserId, String text) {
|
||||
ChatPrivateMessageSendReqVO dto = new ChatPrivateMessageSendReqVO();
|
||||
dto.setSendId(ChatConstant.COM_MESSAGE_USER_ID);
|
||||
dto.setTerminal(1);
|
||||
dto.setTmpId(System.currentTimeMillis() + "_" + targetUserId);
|
||||
dto.setRecvId(targetUserId);
|
||||
dto.setContent(text);
|
||||
dto.setType(0);
|
||||
return this.send(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私聊消息分页
|
||||
*/
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import java.util.Date;
|
||||
@Schema(description = "chat用户发送消息resp")
|
||||
public class ChatPrivateMessageSendResVO {
|
||||
|
||||
@Schema(description = " 消息id")
|
||||
@Schema(description = " 消息id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "临时id")
|
||||
|
||||
+1
-1
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.controller.admin.opentype;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypeRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.opentype.OpenTypeUserDO;
|
||||
import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
|
||||
import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -33,7 +34,6 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.opentype.OpenTypeDO;
|
||||
import cn.iocoder.yudao.module.member.service.opentype.OpenTypeService;
|
||||
|
||||
+15
-4
@@ -5,16 +5,15 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.keyresolver.impl.UserIdempotentKeyResolver;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserAdminOpenReqVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.opentype.OpenTypeUserDO;
|
||||
import cn.iocoder.yudao.module.member.service.opentype.OpenTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
@@ -33,6 +32,18 @@ public class OpenTypeUserController {
|
||||
@Resource
|
||||
private OpenTypeService openTypeService;
|
||||
|
||||
@GetMapping("/last-by-user-id")
|
||||
@Operation(summary = "获取最后一条会员开通记录")
|
||||
public CommonResult<OpenTypeUserDO> lastByUserId(@RequestParam("userId") Long userId) {
|
||||
return success(openTypeService.lastByUserId(userId));
|
||||
}
|
||||
|
||||
@PostMapping("/admin-open")
|
||||
@Operation(summary = "admin开通会员")
|
||||
public CommonResult<Boolean> adminOpen(@Valid @RequestBody OpenTypeUserAdminOpenReqVo dto) {
|
||||
return success(openTypeService.adminOpen(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员开通记录分页")
|
||||
public CommonResult<PageResult<OpenTypeUserRespVO>> getOpenTypePage(@Valid OpenTypeUserReqVO pageReqVO) {
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class OpenTypeUserAdminOpenReqVo {
|
||||
|
||||
@Schema(description = "会员id")
|
||||
@NotNull(message = "会员id不能为空")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "会员开通天数")
|
||||
@NotNull(message = "会员开通天数不能为空")
|
||||
private Integer dayCount;
|
||||
|
||||
}
|
||||
+2
-2
@@ -9,10 +9,10 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class AppRecentOperateReqVo {
|
||||
|
||||
@Schema(description = "用户标号")
|
||||
@Schema(description = "用户编号")
|
||||
private Long memberId;
|
||||
|
||||
@Schema(description = "操作用户标号")
|
||||
@Schema(description = "操作用户编号")
|
||||
private Long operatorMemberId;
|
||||
|
||||
@Schema(description = "用户朋友圈编号")
|
||||
|
||||
+4
@@ -263,6 +263,8 @@ public class MemberAuthServiceImpl implements MemberAuthService {
|
||||
memberRecentTagService.createOrUpdateNewPersonTag(user.getId());
|
||||
// 初始化用户朋友圈配置
|
||||
memberRecentCfgService.getOrCreate(user.getId());
|
||||
// 为用户添加`消息通知`
|
||||
chatApi.addMessageFriend(user.getId());
|
||||
return serviceToken;
|
||||
}
|
||||
|
||||
@@ -289,6 +291,8 @@ public class MemberAuthServiceImpl implements MemberAuthService {
|
||||
memberRecentTagService.createOrUpdateNewPersonTag(user.getId());
|
||||
// 初始化用户朋友圈配置
|
||||
memberRecentCfgService.getOrCreate(user.getId());
|
||||
// 为用户添加`消息通知`
|
||||
chatApi.addMessageFriend(user.getId());
|
||||
return serviceToken;
|
||||
}
|
||||
|
||||
|
||||
+34
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.service.ThirdFaceVerifyService;
|
||||
import cn.iocoder.yudao.module.member.client.vo.thirdfaceverify.ThirdFaceVerifyReqVO;
|
||||
import cn.iocoder.yudao.module.member.client.vo.thirdfaceverify.ThirdFaceVerifyResVO;
|
||||
@@ -72,6 +73,9 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
@Resource
|
||||
private MemberRecentTagService memberRecentTagService;
|
||||
|
||||
@Resource
|
||||
private ChatApi chatApi;
|
||||
|
||||
/**
|
||||
* 创建微信错误认证
|
||||
*/
|
||||
@@ -306,6 +310,36 @@ public class ComAuthServiceImpl implements ComAuthService {
|
||||
operationMapper.updateById(operationObj);
|
||||
}
|
||||
}
|
||||
// 后续操作-发送消息
|
||||
String message = "";
|
||||
// 真人认证
|
||||
List<String> truePersonAuthList = Arrays.asList(MemberComAuthEnum.MAN_MEMBER_TRUE.getType(), MemberComAuthEnum.WOMAN_MEMBER_TRUE.getType());
|
||||
if (truePersonAuthList.contains(detail.getBizType())) {
|
||||
if (ObjectUtil.equals(updateReqVO.getAuthStatus(), MemberComAuthStatusEnum.CHECK_PASS.getType())) {
|
||||
message = "您好,您已通过真人认证";
|
||||
} else {
|
||||
message = "您好,您未通过真人认证,请重新上传";
|
||||
}
|
||||
}
|
||||
// 微信号认证
|
||||
if (ObjectUtil.equals(detail.getBizType(), MemberComAuthEnum.WECHAT_NUMBER.getType())) {
|
||||
if (ObjectUtil.equals(updateReqVO.getAuthStatus(), MemberComAuthStatusEnum.CHECK_PASS.getType())) {
|
||||
message = "您好,经核实您绑定的微信信息正确";
|
||||
} else {
|
||||
message = "您好,经核实您绑定的微信信息错误,请重新上传";
|
||||
}
|
||||
}
|
||||
// 微信号错误
|
||||
if (ObjectUtil.equals(detail.getBizType(), MemberComAuthEnum.WECHAT_NUMBER_ERROR.getType())) {
|
||||
if (ObjectUtil.equals(updateReqVO.getAuthStatus(), MemberComAuthStatusEnum.CHECK_PASS.getType())) {
|
||||
message = "您好,经核实此微信不存在,已退还您一次查看微信号的机会";
|
||||
} else {
|
||||
message = "您好,经核实此微信是存在的";
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(message) && ObjectUtil.notEqual(-1L, detail.getAuthMemberId())) {
|
||||
chatApi.messageUserSendText(detail.getAuthMemberId(), message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+12
@@ -4,11 +4,13 @@ import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserAdminOpenReqVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.opentype.vo.AppPayOpenReqType;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.opentype.OpenTypeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.opentype.OpenTypeUserDO;
|
||||
import cn.iocoder.yudao.module.member.service.opentype.BO.OpenTypeExtBO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,6 +20,16 @@ import java.util.List;
|
||||
*/
|
||||
public interface OpenTypeService {
|
||||
|
||||
/**
|
||||
* 获取最后一条会员开通记录
|
||||
*/
|
||||
OpenTypeUserDO lastByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* admin开通会员
|
||||
*/
|
||||
Boolean adminOpen(OpenTypeUserAdminOpenReqVo dto);
|
||||
|
||||
/**
|
||||
* 创建会员类型
|
||||
*/
|
||||
|
||||
+44
@@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.member.client.vo.chat.privatemsg.ChatPrivateTotal
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.privatemsg.ChatPrivateTotalMessageTotalResVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openType.OpenTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserAdminOpenReqVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.opentype.vo.openTypeUser.OpenTypeUserRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.opentype.vo.AppPayOpenReqType;
|
||||
@@ -89,6 +90,44 @@ public class OpenTypeServiceImpl implements OpenTypeService {
|
||||
@Resource
|
||||
private PayRefundApi payRefundApi;
|
||||
|
||||
/**
|
||||
* 获取最后一条会员开通记录
|
||||
*/
|
||||
@Override
|
||||
public OpenTypeUserDO lastByUserId(Long userId) {
|
||||
return openTypeUserMapper.selectEnableByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* admin开通会员
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean adminOpen(OpenTypeUserAdminOpenReqVo dto) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
OpenTypeUserDO openTypeUserObj = OpenTypeUserDO.builder()
|
||||
.openTypeId(-1L)
|
||||
.memberId(dto.getMemberId())
|
||||
.payPrice(0)
|
||||
.startTime(now)
|
||||
.status(OpenTypeUserStatusEnum.EFFICIENT.getType())
|
||||
.payStatus(true)
|
||||
.build();
|
||||
// 查看用户有没有开通过并且没有过期的会员
|
||||
OpenTypeUserDO openTypeUserDO = openTypeUserMapper.selectEnableByUserId(dto.getMemberId());
|
||||
if (ObjectUtil.isNotEmpty(openTypeUserDO)) {
|
||||
openTypeUserObj.setEndTime(openTypeUserDO.getEndTime().plusDays(dto.getDayCount()));
|
||||
} else {
|
||||
openTypeUserObj.setEndTime(now.plusDays(dto.getDayCount()));
|
||||
}
|
||||
// 新增会员开通表
|
||||
openTypeUserMapper.insert(openTypeUserObj);
|
||||
// 添加会员tag
|
||||
memberRecentTagService.createOrUpdateVipTag(openTypeUserDO.getMemberId());
|
||||
String message = String.format("已赠送您%d天的会员,有效期至%s", dto.getDayCount(), LocalDateTimeUtil.format(openTypeUserObj.getEndTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
this.chatApi.messageUserSendText(dto.getMemberId(), message);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建会员类型
|
||||
@@ -364,6 +403,8 @@ public class OpenTypeServiceImpl implements OpenTypeService {
|
||||
}
|
||||
// 查询订单
|
||||
PayOrderRespDTO payOrder = validatePayOrderPaid(openTypeUserDO, payOrderId);
|
||||
// 查询开通会员类型
|
||||
OpenTypeDO openType = openTypeMapper.selectById(openTypeUserDO.getOpenTypeId());
|
||||
|
||||
// 更新会员开通的支付状态
|
||||
LambdaUpdateWrapper<OpenTypeUserDO> updateWrapper = new LambdaUpdateWrapper<OpenTypeUserDO>()
|
||||
@@ -378,6 +419,9 @@ public class OpenTypeServiceImpl implements OpenTypeService {
|
||||
}
|
||||
// 添加会员tag
|
||||
memberRecentTagService.createOrUpdateVipTag(openTypeUserDO.getMemberId());
|
||||
|
||||
String message = String.format("恭喜您购买成功,此次购买的产品:%s", openType.getTitle());
|
||||
this.chatApi.messageUserSendText(openTypeUserDO.getMemberId(), message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+22
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.api.thirdauth.ThirdAuthVo;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.service.TxMapApi;
|
||||
import cn.iocoder.yudao.module.member.client.vo.txmap.geocoder.TxMapGeocoderReqVO;
|
||||
import cn.iocoder.yudao.module.member.client.vo.txmap.geocoder.TxMapGeocoderRespVO;
|
||||
@@ -99,6 +100,8 @@ public class RecentServiceImpl implements RecentService {
|
||||
|
||||
@Resource
|
||||
private TxMapApi txMapApi;
|
||||
@Resource
|
||||
private ChatApi chatApi;
|
||||
|
||||
/**
|
||||
* 创建朋友圈
|
||||
@@ -299,6 +302,22 @@ public class RecentServiceImpl implements RecentService {
|
||||
operationDO.setBizType(dto.getAction().getType());
|
||||
operationDO.setTapTime(LocalDateTime.now());
|
||||
operationMapper.insert(operationDO);
|
||||
|
||||
// 给用户发送消息
|
||||
String message = "";
|
||||
switch (dto.getAction()) {
|
||||
// 举报
|
||||
case RECENT_REPORT:
|
||||
case MEMBER_REPORT:
|
||||
message = "您的反馈已经收到,为能更好的处理您的问题,请向客服发送相关截图。";
|
||||
if (ObjectUtil.isNotEmpty(dto.getReportPic())) {
|
||||
message = "您的反馈已经收到,我们会尽快核实,感谢您对应用生态所提供的意见";
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(message)) {
|
||||
chatApi.messageUserSendText(dto.getOperatorMemberId(), message);
|
||||
}
|
||||
return operationDO.getId();
|
||||
}
|
||||
|
||||
@@ -612,6 +631,9 @@ public class RecentServiceImpl implements RecentService {
|
||||
convertRecentPageResVoSetupLocation(result, currentUserLastLocation);
|
||||
// 添加用户相册
|
||||
convertRecentPageResVoSetupPhoto(result);
|
||||
// 获取用户tag
|
||||
List<MemberTagExtBO> memberTagExtBO = memberRecentTagService.getUserTagExtList(userId);
|
||||
result.setMemberTagList(memberTagExtBO);
|
||||
// 查询用户操作状态
|
||||
OperationStatusVo operation = operationService.getUserOperationStatus(operateUserId, userId);
|
||||
if (ObjectUtil.isNotEmpty(operation)) {
|
||||
|
||||
-1
@@ -343,7 +343,6 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}
|
||||
// 更新用户新人tag
|
||||
memberRecentTagService.createOrUpdateNewPersonTag(updateReqVO.getId());
|
||||
|
||||
memberUserMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
|
||||
import cn.iocoder.yudao.framework.pay.core.enums.refund.PayRefundStatusRespEnum;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
@@ -223,8 +224,7 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
|
||||
// 4. 更新钱包余额
|
||||
// TODO @jason:这样的话,未来提现会不会把充值的,也提现走哈。类似先充 100,送 110;然后提现 110;
|
||||
// TODO 需要钱包中加个可提现余额
|
||||
payWalletService.addWalletBalance(recharge.getWalletId(), String.valueOf(id),
|
||||
PayWalletBizTypeEnum.RECHARGE, recharge.getTotalPrice());
|
||||
payWalletService.addWalletBalance(recharge.getWalletId(), String.valueOf(id), PayWalletBizTypeEnum.RECHARGE, recharge.getTotalPrice());
|
||||
|
||||
// 添加分销记录
|
||||
List<BrokerageAddDTO> brokerageList = new ArrayList<BrokerageAddDTO>() {{
|
||||
@@ -240,6 +240,9 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
|
||||
tradeBrokerageRecordApi.addRecentBrokerage(user.getId(), BrokerageRecordBizTypeEnum.ORDER, brokerageList);
|
||||
// 5. 发送订阅消息
|
||||
getSelf().sendWalletRechargerPaidMessage(payOrderId, recharge);
|
||||
|
||||
String message = String.format("恭喜您购买成功,此次购买的产品:充值砖石%s", MoneyUtils.fenToYuanStr(recharge.getTotalPrice()));
|
||||
this.memberUserApi.messageUserSendText(user.getId(), message);
|
||||
}
|
||||
|
||||
@Async
|
||||
|
||||
@@ -240,8 +240,8 @@ pf4j:
|
||||
pluginsDir: ../plugins
|
||||
|
||||
chat:
|
||||
# base-url: http://127.0.0.1:8888
|
||||
base-url: http://chatsever.zianxin.com
|
||||
base-url: http://127.0.0.1:8888
|
||||
# base-url: http://chatsever.zianxin.com
|
||||
app-key: 4H2HkBLygMsxaQKO
|
||||
app-secret: JIizm84av3TK5xaQdsng7X5mqLPjbeQ0
|
||||
|
||||
|
||||
Reference in new issue
Block a user