增加实体类,以及部分逻辑修改
This commit is contained in:
parent
8531da830c
commit
c68b1919b5
|
|
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
|
@ -25,7 +26,7 @@ public class IntroduceController {
|
|||
private AppGuideService appGuideService;
|
||||
|
||||
@GetMapping({"/common", "/common/{code}"})
|
||||
public Result<String> billIntro(@PathVariable(value = "code", required = false) String code) {
|
||||
public Result<String> billIntro(@PathVariable(value = "code", required = false) String code, HttpServletRequest httpServletRequest) {
|
||||
if (StringUtils.isEmpty(code)) {
|
||||
String html = "<p><img src=\"https://www.shouyinbei.net/resources/images/upload/82031620725808697.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/86751620725811158.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/38401620725814105.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/14561620725816223.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/45071620725822267.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/31221620725827105.jpg\" style=\"\"/></p><p><img src=\"https://www.shouyinbei.net/resources/images/upload/68211620725829889.jpg\" style=\"\"/></p><p><br/></p>";
|
||||
return ResultGenerator.genSuccessResult(html);
|
||||
|
|
@ -36,6 +37,12 @@ public class IntroduceController {
|
|||
return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent());
|
||||
}
|
||||
if (Objects.equals(entity.getType(), "1")) {
|
||||
String type = httpServletRequest.getHeader("type");
|
||||
if ("1".equals(type)){
|
||||
return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent());
|
||||
}else if ("2".equals(type)){
|
||||
return ResultGenerator.genFailResult("");
|
||||
}
|
||||
return ResultGenerator.genSuccessResult(entity == null ? "" : entity.getContent());
|
||||
}else {
|
||||
return ResultGenerator.genFailResult("");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package cn.pluss.platform.mapper;
|
||||
|
||||
import cn.pluss.platform.entity.UserManageProfit;
|
||||
import cn.pluss.platform.entity.UserPromotion;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UserPromotionMapper extends BaseMapper<UserPromotion> {
|
||||
}
|
||||
|
|
@ -91,6 +91,16 @@ public class UserInfo {
|
|||
private String oldPhone;
|
||||
@TableField(exist = false)
|
||||
private String roleIds;
|
||||
/**
|
||||
* 用户注册选择身份
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String typeCode;
|
||||
/**
|
||||
* 费率
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String currentFee;
|
||||
|
||||
/**
|
||||
* 生成一个新的用户对象
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户推广费率对照表
|
||||
* @author lyf
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_pluss_user_promotion")
|
||||
public class UserPromotion {
|
||||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@TableField(value = "type_code")
|
||||
private String typeCode;
|
||||
|
||||
@TableField(value = "current_fee")
|
||||
private String currentFee;
|
||||
|
||||
@TableField(value = "parent_user_id")
|
||||
private String parentUserId;
|
||||
|
||||
@TableField(value = "create_time")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(value = "update_time")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package cn.pluss.platform.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 分佣相关
|
||||
* @author lyf
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_pluss_user_type")
|
||||
public class UserType {
|
||||
/**
|
||||
* 分佣类型(层级)
|
||||
*/
|
||||
@TableField(value = "type_code")
|
||||
private String typeCode;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@TableField(value = "type_name")
|
||||
private String typeName;
|
||||
/**
|
||||
* 当前层级费率
|
||||
*/
|
||||
@TableField(value = "current_fee")
|
||||
private BigDecimal currentFee;
|
||||
/**
|
||||
* 下级推广费率
|
||||
*/
|
||||
@TableField(value = "low_fee")
|
||||
private BigDecimal lowFee;
|
||||
|
||||
@TableField(value = "create_time")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@TableField(value = "update_time")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -12,7 +12,9 @@ import cn.pluss.platform.dto.BankCardDTO;
|
|||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.klk.vo.CallBackVo;
|
||||
import cn.pluss.platform.klk.vo.FeesSetVo;
|
||||
import cn.pluss.platform.mapper.AccountMapper;
|
||||
import cn.pluss.platform.mapper.MerchantChannelFeeMapper;
|
||||
import cn.pluss.platform.mapper.UserAppMapper;
|
||||
import cn.pluss.platform.mcc.MccReflectService;
|
||||
import cn.pluss.platform.merchant.AccountService;
|
||||
|
|
@ -39,6 +41,7 @@ import cn.pluss.platform.ys.impl.v20220527.entity.*;
|
|||
import cn.pluss.platform.ys.impl.v20220527.service.YsAuditServiceV3;
|
||||
import cn.pluss.platform.ysExtension.v20220615.YsConstantV3;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
|
@ -118,6 +121,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
private SubMerchantService smService;
|
||||
@Resource
|
||||
private SxfMerAuditHandler handler;
|
||||
@Resource
|
||||
private MerchantChannelFeeMapper merchantChannelFeeMapper;
|
||||
// @Autowired
|
||||
// private MercChangeRecordService mcrService;
|
||||
|
||||
|
|
@ -214,7 +219,7 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
rateFeeInfo.setBank1creditPayFee(new RateFeeDetail("0", "0.61", "1", "999900"));
|
||||
rateFeeInfo.setBank2debitPayFee(new RateFeeDetail("0", "0.60", "1", "999900"));
|
||||
rateFeeInfo.setBank2creditPayFee(new RateFeeDetail("0", "0.60", "1"));
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.48", "1");
|
||||
RateFeeDetail codeScanD0Fee = new RateFeeDetail("0", "0.10", "1");
|
||||
rateInfo.setCodeScanD0Fee(codeScanD0Fee);
|
||||
rateInfo.setCodeScanT1Fee(rateFeeInfo);
|
||||
|
||||
|
|
@ -222,6 +227,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
//保存费率
|
||||
channelFee(0.48d,0.48d, channel, mcs.getMerchantCode());
|
||||
}else {
|
||||
RateInfoD1 rateInfoD1 = new RateInfoD1();
|
||||
rateInfoD1.setCustId(custId);
|
||||
|
|
@ -243,6 +250,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
if (!Objects.equals(respEntity.getSubCode(), YsConfigV3.BIZ_SUCCESS)) {
|
||||
throw new MsgException("银盛云商服3.0商户签约申请请求失败, {}", respEntity.getSubMsg());
|
||||
}
|
||||
//保存费率
|
||||
channelFee(0.38d,0.38d, channel, mcs.getMerchantCode());
|
||||
}
|
||||
|
||||
JSONObject businessData = JSON.parseObject(respEntity.getBusinessData());
|
||||
|
|
@ -746,7 +755,6 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
// bizContentMap.put("appletId", "wxc2bb94c0ddda1032");
|
||||
// ysServiceV3.req(ReqMethod.appIdAddOrUpdate, bizContentMap);
|
||||
break;
|
||||
//TODO 失败和错误时没有处理
|
||||
case YsConfigV3.STATUS_REFUSE:
|
||||
String note1 = authData.getNote();
|
||||
mcs.setRemark(note1);
|
||||
|
|
@ -823,6 +831,8 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
JSONObject param = new JSONObject();
|
||||
param.put(YsConstant.MERC_ID, mcs.getMerchantId());
|
||||
param.put("option", "ON");
|
||||
param.put("rateFee", "0.38");
|
||||
param.put("rateBottom", "1");
|
||||
ysServiceV3.req(ReqMethod.openOnlinePay, param, mcs.getChannel());
|
||||
} catch (Exception e) {
|
||||
log.error("云商服3.0开通线上D0接口报错: {}", e.getMessage());
|
||||
|
|
@ -1830,4 +1840,27 @@ public class YSAuditServiceV3 implements cn.pluss.platform.channel.ys.YSAuditSer
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
public void channelFee(Double WECHAT, Double ALIPAY, Integer channel, String merchantCode){
|
||||
JSONArray array = new JSONArray();
|
||||
Set<FeesSetVo> feesSet = new HashSet<>();
|
||||
FeesSetVo w = new FeesSetVo();
|
||||
w.setFeeCode("WECHAT");
|
||||
w.setFeeValue(WECHAT);
|
||||
array.add(w);
|
||||
|
||||
FeesSetVo a = new FeesSetVo();
|
||||
a.setFeeCode("ALIPAY");
|
||||
a.setFeeValue(ALIPAY);
|
||||
array.add(a);
|
||||
|
||||
feesSet.add(w);
|
||||
feesSet.add(a);
|
||||
MerchantChannelFee merchantChannelFee = new MerchantChannelFee();
|
||||
merchantChannelFee.setChannel(channel);
|
||||
merchantChannelFee.setMerchantCode(merchantCode);
|
||||
merchantChannelFee.setFeeStr(array.toJSONString());
|
||||
merchantChannelFee.setCreateTime(new Date());
|
||||
merchantChannelFeeMapper.insert(merchantChannelFee);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -350,38 +350,38 @@ public class MerchantBaseInfoServiceImpl extends ServiceImpl<MerchantBaseInfoMap
|
|||
merchantStore.setMerchantName(mbi.getAlias());
|
||||
merchantStoreService.updateMerchantStore(merchantStore);
|
||||
|
||||
MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus();
|
||||
merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
||||
MerchantBaseInfo merchantBaseInfo = getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||
QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||
.eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||
MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||
//String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||
String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append("?title=").append(mbi.getAlias());
|
||||
sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||
String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||
try {
|
||||
String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||
sb.append("&address=").append(decodeAddress);
|
||||
String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||
sb.append("&area=").append(decodeArea);
|
||||
String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||
sb.append("&logo=").append(logo);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||
if (lnxMap != null) {
|
||||
sb.append("&location_x=").append(lnxMap.get("x"));
|
||||
sb.append("&location_y=").append(lnxMap.get("y"));
|
||||
}
|
||||
// 请求生成店铺j
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||
// MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus();
|
||||
// merchantStore = merchantStoreMapper.selectOne(new QueryWrapper<>(merchantStore));
|
||||
// MerchantBaseInfo merchantBaseInfo = getMerchantBaseInfoByMerchantCode(merchantChannelStatus.getMerchantCode());
|
||||
// QueryWrapper<MerchantImage> queryWrapper = new QueryWrapper<MerchantImage>()
|
||||
// .eq("merchantCode", merchantChannelStatus.getMerchantCode()).eq("photoType", "06");
|
||||
// MerchantImage merchantImage = merchantImageMapper.selectOne(queryWrapper);
|
||||
// //String baseUrl = "https://life.sxczgkj.cn/web/wmerchant.php?c=site&a=entry&ctrl=store&ac=oauth&op=add_merchan&do=web&m=we7_wmall&i=1";
|
||||
// String baseUrl = "https://kysh.sxczgkj.cn/javaApi/java-api/add-store";
|
||||
// StringBuilder sb = new StringBuilder(baseUrl);
|
||||
// sb.append("?title=").append(mbi.getAlias());
|
||||
// sb.append("&syb_m_id=").append(merchantStore.getId());
|
||||
// sb.append("&addressNo=").append(merchantBaseInfo.getAddressNo());
|
||||
// String address = merchantBaseInfo.getProvince() + merchantBaseInfo.getCity() + merchantBaseInfo.getDistrict() + merchantBaseInfo.getAddress();
|
||||
// String area = merchantBaseInfo.getProvince() +"-"+ merchantBaseInfo.getCity() +"-"+ merchantBaseInfo.getDistrict();
|
||||
// try {
|
||||
// String decodeAddress = URLEncoder.encode(address, "UTF-8");
|
||||
// sb.append("&address=").append(decodeAddress);
|
||||
// String decodeArea = URLEncoder.encode(area, "UTF-8");
|
||||
// sb.append("&area=").append(decodeArea);
|
||||
// String logo = URLEncoder.encode(merchantImage.getPicUrl(), "GBK");
|
||||
// sb.append("&logo=").append(logo);
|
||||
// } catch (UnsupportedEncodingException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// Map<String, String> lnxMap = IpUtils.getLocationByAddress(address);
|
||||
// if (lnxMap != null) {
|
||||
// sb.append("&location_x=").append(lnxMap.get("x"));
|
||||
// sb.append("&location_y=").append(lnxMap.get("y"));
|
||||
// }
|
||||
// // 请求生成店铺j
|
||||
// RestTemplate restTemplate = new RestTemplate();
|
||||
// String result = restTemplate.getForObject(sb.toString(), String.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -429,8 +429,9 @@ public class MerchantServiceImpl implements MerchantService {
|
|||
}else if(channel.getChannel()==5){
|
||||
//拉卡拉的主扫接口
|
||||
result=lkLPayServiceImpl.tradePay(order,channel,merchant);
|
||||
}
|
||||
else {
|
||||
} else if (channel.getChannel() == 6) {
|
||||
|
||||
}else {
|
||||
MsgException.throwException("未知通道");
|
||||
}
|
||||
if (ResultCode.SUCCESS.code() != result.getInteger("code")) {
|
||||
|
|
|
|||
|
|
@ -400,32 +400,32 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||
// }
|
||||
|
||||
// 如果不存在D0的结算信息,则直接将D1的结算信息带过来
|
||||
LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
|
||||
qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D0);
|
||||
int count = baseMapper.selectCount(qWrapperAccountD1);
|
||||
if (count == 0) {
|
||||
account.setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
save(account);
|
||||
}
|
||||
//TODO
|
||||
// 如果不存在D1的结算信息,则直接将D0的结算信息带过来
|
||||
LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
|
||||
qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
|
||||
int countD0 = baseMapper.selectCount(qWrapperAccountD0);
|
||||
if (countD0 == 0) {
|
||||
account.setChannelType(Account.CHANNEL_TYPE_D1);
|
||||
save(account);
|
||||
}
|
||||
// LambdaQueryWrapper<Account> qWrapperAccountD1 = Wrappers.lambdaQuery();
|
||||
// qWrapperAccountD1.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D0);
|
||||
// int count = baseMapper.selectCount(qWrapperAccountD1);
|
||||
// if (count == 0) {
|
||||
// account.setChannelType(Account.CHANNEL_TYPE_D0);
|
||||
// save(account);
|
||||
// }
|
||||
// //TODO
|
||||
// // 如果不存在D1的结算信息,则直接将D0的结算信息带过来
|
||||
// LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
|
||||
// qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
|
||||
// int countD0 = baseMapper.selectCount(qWrapperAccountD0);
|
||||
// if (countD0 == 0) {
|
||||
// account.setChannelType(Account.CHANNEL_TYPE_D1);
|
||||
// save(account);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void realNameAudit(CertificationDTO certificationDTO) {
|
||||
//验证唯一性
|
||||
Integer countIdCard = idCardService.getCountIdCard(certificationDTO.getCertnum());
|
||||
if (countIdCard > 0){
|
||||
throw new MsgException("身份证已注册");
|
||||
}
|
||||
// Integer countIdCard = idCardService.getCountIdCard(certificationDTO.getCertnum());
|
||||
// if (countIdCard > 0){
|
||||
// throw new MsgException("身份证已注册");
|
||||
// }
|
||||
UserApp tokenUa = uaService.queryUserAppByToken();
|
||||
if ("agent".equals(tokenUa.getUserType()) && "ZY_BST".equals(tokenUa.getRoleCode())) {
|
||||
IdCard condition = new IdCard().setCertNo(certificationDTO.getCertnum());
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import cn.pluss.platform.constants.CommonError;
|
|||
import cn.pluss.platform.dto.ChangePwdDTO;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.ipLocation.IpLocationService;
|
||||
import cn.pluss.platform.mapper.*;
|
||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||
import cn.pluss.platform.merchant.MerchantRateNewRecordService;
|
||||
|
|
@ -38,20 +37,13 @@ import lombok.Setter;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -215,6 +207,9 @@ public abstract class BaseUserInfoService extends ServiceImpl<UserInfoMapper, Us
|
|||
} else {
|
||||
userApp.setParentId(parentApp.getUserId());
|
||||
}
|
||||
//查找代理
|
||||
// userPromotionService.getBaseMapper();
|
||||
// parentApp.set
|
||||
}
|
||||
return userApp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ public class UserInfoServiceImpl extends BaseUserInfoService {
|
|||
|
||||
UserApp.setSort(parentApp, userApp);
|
||||
UserApp.setRoleInfo(parentApp, userApp,null);
|
||||
//查找代理
|
||||
|
||||
|
||||
// 保存信息
|
||||
userAppService.save(userApp);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.pluss.platform.systemConfig.SystemConfigService;
|
|||
import cn.pluss.platform.user.UserIpRecordService;
|
||||
import cn.pluss.platform.userInfo.UserInfoService;
|
||||
import cn.pluss.platform.util.MD5Util;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -105,8 +106,10 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
|
|||
RoleUserInfo role = new RoleUserInfo();
|
||||
role.setRoleId(roleId);
|
||||
role.setUserId(userInfo.getId());
|
||||
//如果没有邀请码默认是平台用户
|
||||
UserApp userApp = getSaveUserAppInfo(userInfo);
|
||||
userApp.setInviteNum(null);
|
||||
userApp.setParentId(new Long(244));
|
||||
userApp.setInviteNum(getRandomNum());
|
||||
// 保存信息
|
||||
userAppService.save(userApp);
|
||||
roleUserInfoService.saveRoleUserInfo(role);
|
||||
|
|
@ -145,4 +148,17 @@ public class UserInfoServiceNewImpl extends BaseUserInfoService {
|
|||
|
||||
|
||||
}
|
||||
private String getRandomNum() {
|
||||
String inviteNum;
|
||||
UserApp condition = new UserApp();
|
||||
|
||||
do {
|
||||
inviteNum = StringUtil.genRandomNum(5);
|
||||
condition.setInviteNum(inviteNum);
|
||||
UserApp userApp = userAppService.queryUserApp(condition);
|
||||
if (userApp == null) {
|
||||
return inviteNum;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue