替换收银呗字样,更改创客错误状态,更改提现时手机号显示,分享注册,提现算法列表,后台推广员列表补充推送

This commit is contained in:
liuyingfang
2023-07-18 15:37:00 +08:00
parent 0a7da333b2
commit b92f72b53e
18 changed files with 139 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
package cn.pluss.platform.controller.home;
import cn.hutool.core.util.ObjectUtil;
import cn.pluss.platform.IdCardService;
import cn.pluss.platform.activityActivate.ActivityActivateService;
import cn.pluss.platform.activityConsumReturn.ActivityConsumReturnService;
@@ -25,6 +26,7 @@ import cn.pluss.platform.leshua.LeshuaSignature;
import cn.pluss.platform.mapper.JftReceiptInfoMapper;
import cn.pluss.platform.mapper.JftReceiptOrderMapper;
import cn.pluss.platform.mapper.UserInfoMapper;
import cn.pluss.platform.mapper.UserPromotionMapper;
import cn.pluss.platform.memberOrder.MemberOrderService;
import cn.pluss.platform.merchant.*;
import cn.pluss.platform.merchant.move.MerchantMoveRecordsService;
@@ -2490,7 +2492,8 @@ public class MerchantController {
@PostMapping("/goRegister")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public Result<?> goRegister(String inviteNum, String phoneverify, String phone, String password) {
public Result<?> goRegister(String inviteNum, String phoneverify, String phone, String password,
String typeCode, String currentFee) {
if (StringUtil.isEmpty(inviteNum)) {
return ResultGenerator.genFailResult("推荐人不能为空");
}
@@ -2514,7 +2517,7 @@ public class MerchantController {
UserInfo ui = userInfoService.getById(parentInfo.getUserId());
if (Objects.equals(ui.getStatus(), UserInfo.STATUS_NO_SPREAD)) {
throw new MsgException("当前推广服务商存在违规行为, 已被关闭推广权限, 请联系收银呗客服申诉");
throw new MsgException("当前推广服务商存在违规行为, 已被关闭推广权限, 请联系银收客客服申诉");
}
// if (!"1".equals(parentInfo.getSpreadFlag())) {
@@ -2540,6 +2543,8 @@ public class MerchantController {
userInfo.setPhone(phone);
userInfo.setPassword(password);
userInfo.setCreateTime(new Date());
userInfo.setTypeCode(typeCode == null? userInfo.getTypeCode(): typeCode);
userInfo.setCurrentFee(currentFee== null? userInfo.getCurrentFee(): currentFee);
userInfoService.saveUserInfo(userInfo);
UserApp userApp = new UserApp();
userApp.setUserId(userInfo.getId());
@@ -2560,6 +2565,44 @@ public class MerchantController {
userApp.setCreateDt(new Date());
userApp.setInviteNum(StringUtil.genRandomNum(5));
//查找代理
UserPromotion promotion = getUserPromotionByUserId(appInfo.getUserId().toString());
String parenId = promotion.getUserId().toString();
promotion=new UserPromotion();
promotion.setUserId(userInfo.getId());
promotion.setParentUserId(parenId);
if (currentFee.isEmpty()){
promotion.setCurrentFee("0.38");
}else {
promotion.setCurrentFee(currentFee);
}
if (typeCode.isEmpty()){
promotion.setTypeCode("MC");
}else {
promotion.setTypeCode(typeCode);
}
if(userInfo.getTypeCode().equals("FB")){
if (promotion.getCurrentFee().compareTo(userInfo.getCurrentFee()) >0||
userInfo.getCurrentFee().compareTo(getUserPromotionByUserId("244").getCurrentFee()) < 0){
MsgException.checkNull(null,"错误的费率信息");
}
}
if(userInfo.getTypeCode().equals("SB")){
if (promotion.getCurrentFee().compareTo(userInfo.getCurrentFee()) >0||
userInfo.getCurrentFee().compareTo(getUserPromotionByUserId("244").getCurrentFee()) < 0){
MsgException.checkNull(null,"错误的费率信息");
}
}
promotion.setIsExtend(promotion.getTypeCode().equals("MC")?"0":"1");
promotion.setCreateTime(new Date());
userPromotionMapper.insert(promotion);
// 可能和数据库存储的数据不一致
userInfo.setCreateTime(null);
userAppService.save(userApp);
ipRecordService.saveRegIp(userInfo.getId() + "", userInfo.getId() + "");
PhoneValidateCode phoneValidate = new PhoneValidateCode();
@@ -2575,6 +2618,23 @@ public class MerchantController {
return ResultGenerator.genFailResult("验证码输入有误!");
}
@Resource
private UserPromotionMapper userPromotionMapper;
private UserPromotion getUserPromotionByUserId(String userId){
UserPromotion userPromotion = new UserPromotion();
userPromotion.setUserId(Long.valueOf(userId));
UserPromotion promotion = userPromotionMapper.selectOne(new QueryWrapper<>(userPromotion));
if(ObjectUtil.isNotEmpty(promotion)){
if("MG".equals(promotion.getTypeCode())||"FB".equals(promotion.getTypeCode())||
"AG".equals(promotion.getTypeCode())|| "SB".equals(promotion.getTypeCode())||
"2".equals(promotion.getIsExtend()) || "1".equals(promotion.getIsExtend())){
return promotion;
}
}
getUserPromotionByUserId(promotion.getParentUserId());
return promotion;
}
/**
* registerSuccess:(分享注册成功). <br/>
*