Commit 62c2c69f authored by zhangfeng's avatar zhangfeng

Merge branch 'refs/heads/feature_member_score' into feature_member_score_zhangfeng

parents b32084eb a7735247
...@@ -71,7 +71,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi { ...@@ -71,7 +71,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi {
if (StringUtils.isBlank(req.getUniqueId())) { if (StringUtils.isBlank(req.getUniqueId())) {
throw exception(SCORE_OPERATE_MUST_HAVE_UNIQUE_ID); throw exception(SCORE_OPERATE_MUST_HAVE_UNIQUE_ID);
} }
MemberUserScoreLogDO memberUserScoreLogDO = logService.getByUniqueId(req.getUniqueId()); MemberUserScoreLogDO memberUserScoreLogDO = logService.getByUniqueId(req.getSourceType() + "_" + req.getUniqueId());
if (memberUserScoreLogDO != null) { if (memberUserScoreLogDO != null) {
throw exception(SCORE_OPERATE_IDEMPOTENT_ERROR); throw exception(SCORE_OPERATE_IDEMPOTENT_ERROR);
} }
...@@ -200,7 +200,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi { ...@@ -200,7 +200,7 @@ public class MemberUserScoreApiImpl implements MemberUserScoreApi {
req.getOperateType().getValue() : req.getSourceType().getOperateType().getValue()) req.getOperateType().getValue() : req.getSourceType().getOperateType().getValue())
.sourceType(req.getSourceType().getValue()) .sourceType(req.getSourceType().getValue())
.extParam(req.getExtParam()) .extParam(req.getExtParam())
.uniqueId(req.getUniqueId()) .uniqueId(req.getSourceType() + "_" + req.getUniqueId())
.build()); .build());
} }
} }
...@@ -64,7 +64,7 @@ public class MemberUserScoreExpireTask implements JobHandler { ...@@ -64,7 +64,7 @@ public class MemberUserScoreExpireTask implements JobHandler {
.memberId(memberUserScoreDetailDO.getMemberId()) .memberId(memberUserScoreDetailDO.getMemberId())
.scoreCount(memberUserScoreDetailDO.getRemainCount()) .scoreCount(memberUserScoreDetailDO.getRemainCount())
.sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED) .sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED)
.uniqueId(ScoreSourceTypeEnum.SYSTEM_EXPIRED +"_"+ memberUserScoreDetailDO.getId() + "_" + System.currentTimeMillis()) .uniqueId(memberUserScoreDetailDO.getId() + "_" + System.currentTimeMillis())
.extParam(extParam) .extParam(extParam)
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -60,7 +60,7 @@ public class MemberUserScoreController { ...@@ -60,7 +60,7 @@ public class MemberUserScoreController {
.operateType(ScoreOperateTypeEnum.parseByValue(query.getOperateType())) .operateType(ScoreOperateTypeEnum.parseByValue(query.getOperateType()))
.sourceType(ScoreSourceTypeEnum.MANUAL_OPERATE) .sourceType(ScoreSourceTypeEnum.MANUAL_OPERATE)
.extParam(extParam) .extParam(extParam)
.uniqueId(ScoreSourceTypeEnum.MANUAL_OPERATE + "_" + System.currentTimeMillis()) .uniqueId(String.valueOf(System.currentTimeMillis()))
.build()); .build());
return success(null); return success(null);
} }
......
...@@ -43,4 +43,7 @@ public class AppAuthRegReqVO { ...@@ -43,4 +43,7 @@ public class AppAuthRegReqVO {
@ApiModelProperty(value = "英文名称", required = false, example = "+86") @ApiModelProperty(value = "英文名称", required = false, example = "+86")
private String englishName; private String englishName;
@ApiModelProperty(value = "推荐码", required = false)
private String referralCode;
} }
...@@ -95,6 +95,8 @@ public class MemberUserDO extends TenantBaseDO { ...@@ -95,6 +95,8 @@ public class MemberUserDO extends TenantBaseDO {
*/ */
private String controlPassword; private String controlPassword;
private String referralCode;
///** ///**
// * 是否身份认证 // * 是否身份认证
// */ // */
......
...@@ -55,7 +55,7 @@ public class MemberUserScoreDetailExpireListener { ...@@ -55,7 +55,7 @@ public class MemberUserScoreDetailExpireListener {
.memberId(detail.getMemberId()) .memberId(detail.getMemberId())
.scoreCount(detail.getRemainCount()) .scoreCount(detail.getRemainCount())
.sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED) .sourceType(ScoreSourceTypeEnum.SYSTEM_EXPIRED)
.uniqueId(ScoreSourceTypeEnum.SYSTEM_EXPIRED +"_"+ detail.getId() + "_" + System.currentTimeMillis()) .uniqueId(detail.getId() + "_" + System.currentTimeMillis())
.extParam(extParam) .extParam(extParam)
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
......
...@@ -117,7 +117,7 @@ public class MemberAuthServiceImpl implements MemberAuthService { ...@@ -117,7 +117,7 @@ public class MemberAuthServiceImpl implements MemberAuthService {
} }
// 获得获得注册用户 // 获得获得注册用户
MemberUserDO user = userService.createUser(reqVO.getMobile(), userIp, reqVO.getPassword(),reqVO.getAreaCode(), reqVO.getEnglishName()); MemberUserDO user = userService.createUser(reqVO.getMobile(), userIp, reqVO.getPassword(),reqVO.getAreaCode(), reqVO.getEnglishName(), reqVO.getReferralCode());
Assert.notNull(user, "创建用户失败,结果为空"); Assert.notNull(user, "创建用户失败,结果为空");
//记录日志 //记录日志
......
package cn.iocoder.yudao.module.member.service.user; package cn.iocoder.yudao.module.member.service.user;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.validation.Mobile;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO; import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.member.api.user.dto.UserSelectReqVO; import cn.iocoder.yudao.module.member.api.user.dto.UserSelectReqVO;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.UserBackVO; import cn.iocoder.yudao.module.member.controller.admin.user.vo.UserBackVO;
...@@ -51,9 +50,10 @@ public interface MemberUserService { ...@@ -51,9 +50,10 @@ public interface MemberUserService {
* @param mobile * @param mobile
* @param registerIp * @param registerIp
* @param password * @param password
* @param referralCode
* @return * @return
*/ */
MemberUserDO createUser(String mobile, String registerIp, String password, String areaCode, String englishName); MemberUserDO createUser(String mobile, String registerIp, String password, String areaCode, String englishName, String referralCode);
/** /**
* 更新用户的最后登陆信息 * 更新用户的最后登陆信息
......
...@@ -172,7 +172,7 @@ public class MemberUserServiceImpl implements MemberUserService { ...@@ -172,7 +172,7 @@ public class MemberUserServiceImpl implements MemberUserService {
} }
String englishName = maskMobileNumber(mobile); String englishName = maskMobileNumber(mobile);
// 用户不存在,则进行创建 // 用户不存在,则进行创建
user = this.createUser(mobile, registerIp, null, areaCode, englishName); user = this.createUser(mobile, registerIp, null, areaCode, englishName, null);
//记录日志 //记录日志
UserOperationLogCreateReqVO userOperationLogCreateReqVO = new UserOperationLogCreateReqVO(); UserOperationLogCreateReqVO userOperationLogCreateReqVO = new UserOperationLogCreateReqVO();
...@@ -202,7 +202,7 @@ public class MemberUserServiceImpl implements MemberUserService { ...@@ -202,7 +202,7 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public MemberUserDO createUser(String mobile, String registerIp, String password, String areacode, String englishName) { public MemberUserDO createUser(String mobile, String registerIp, String password, String areacode, String englishName, String referralCode) {
// 生成密码 // 生成密码
/* if (StrUtil.isBlank(password)) { /* if (StrUtil.isBlank(password)) {
password = IdUtil.fastSimpleUUID(); password = IdUtil.fastSimpleUUID();
...@@ -222,6 +222,7 @@ public class MemberUserServiceImpl implements MemberUserService { ...@@ -222,6 +222,7 @@ public class MemberUserServiceImpl implements MemberUserService {
user.setEnglishName(englishName); user.setEnglishName(englishName);
user.setNickname(englishName); user.setNickname(englishName);
user.setCode(getNextMemberCode()); user.setCode(getNextMemberCode());
user.setReferralCode(referralCode);
memberUserMapper.insert(user); memberUserMapper.insert(user);
//站内信 //站内信
InternalMessageCreateDto dto = InternalMessageCreateDto.builder().toIdList(Arrays.asList(user.getId())) InternalMessageCreateDto dto = InternalMessageCreateDto.builder().toIdList(Arrays.asList(user.getId()))
......
...@@ -116,7 +116,7 @@ public class RedeemRewardApiImpl implements RedeemRewardApi { ...@@ -116,7 +116,7 @@ public class RedeemRewardApiImpl implements RedeemRewardApi {
.sourceType(ScoreSourceTypeEnum.EXCHANGE_REWARD) .sourceType(ScoreSourceTypeEnum.EXCHANGE_REWARD)
.scoreCount(redeemRewardReqVO.getRewardCount() * rewardDO.getPointsRequire()) .scoreCount(redeemRewardReqVO.getRewardCount() * rewardDO.getPointsRequire())
.releationId(String.valueOf(redeemId)) .releationId(String.valueOf(redeemId))
.uniqueId(ScoreSourceTypeEnum.EXCHANGE_REWARD + "_" + redeemId) .uniqueId(String.valueOf(redeemId))
.extParam(extParam) .extParam(extParam)
.build()); .build());
} }
......
...@@ -274,7 +274,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper, ...@@ -274,7 +274,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
.scoreCount(rewardRedeemDO.getScoreCount()) .scoreCount(rewardRedeemDO.getScoreCount())
.extParam(extParam) .extParam(extParam)
.releationId(String.valueOf(req.getId())) .releationId(String.valueOf(req.getId()))
.uniqueId(ScoreSourceTypeEnum.EXCHANGE_REWARD_CANCEL + "_" + req.getId()) .uniqueId(String.valueOf(req.getId()))
.build()); .build());
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment