|
@@ -1,7 +1,5 @@
|
|
|
package com.ydtech.modules.admin.service.impl;
|
|
package com.ydtech.modules.admin.service.impl;
|
|
|
|
|
|
|
|
-import cn.dev33.satoken.session.SaSession;
|
|
|
|
|
-import cn.dev33.satoken.stp.StpUtil;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
@@ -15,7 +13,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.ydtech.constants.InsuranceImageEnum;
|
|
import com.ydtech.constants.InsuranceImageEnum;
|
|
|
import com.ydtech.constants.SysConstants;
|
|
import com.ydtech.constants.SysConstants;
|
|
|
-import com.ydtech.constants.sys.SysPasswordEnum;
|
|
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageResult;
|
|
import com.ydtech.core.page.PageResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
@@ -60,7 +57,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -72,11 +68,8 @@ import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
-import static com.ydtech.constants.RedisConstant.PHONE_VERIFICATION_CODE_KEY;
|
|
|
|
|
-import static com.ydtech.constants.RedisConstant.PHONE_VERIFICATION_CODE_KEY_TIME;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -164,6 +157,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
throw new SystemException("必传标识未传递");
|
|
throw new SystemException("必传标识未传递");
|
|
|
}
|
|
}
|
|
|
IPage<SysUserBaseVO> userList = sysUserMapper.findUserList(page, sysUserVO);
|
|
IPage<SysUserBaseVO> userList = sysUserMapper.findUserList(page, sysUserVO);
|
|
|
|
|
+ List<SysUserBaseVO> records = userList.getRecords();
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(records)) {
|
|
|
|
|
+ for (SysUserBaseVO record : records) {
|
|
|
|
|
+ if (record.getType() != 0) {
|
|
|
|
|
+ String referrerId = record.getReferrerId();
|
|
|
|
|
+ if (StringUtils.isNotEmpty(referrerId)) {
|
|
|
|
|
+ record.setReferrerId(referrerId);
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectById(record.getReferrerId());
|
|
|
|
|
+ record.setReferrerName(sysUser.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return userList;
|
|
return userList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -190,8 +196,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
if (sysUserDto.getAgentFlag() == null) {
|
|
if (sysUserDto.getAgentFlag() == null) {
|
|
|
throw new SystemException("必传标识未传递");
|
|
throw new SystemException("必传标识未传递");
|
|
|
}
|
|
}
|
|
|
|
|
+ IPage<SysUserBaseVO> backUserList = sysUserMapper.findBackUserList(page, sysUserDto);
|
|
|
|
|
+ List<SysUserBaseVO> records = backUserList.getRecords();
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(records)) {
|
|
|
|
|
+ for (SysUserBaseVO record : records) {
|
|
|
|
|
+ if (record.getType() != 0) {
|
|
|
|
|
+ Integer level = record.getLevel();
|
|
|
|
|
+ if (level == null || level != 1) {
|
|
|
|
|
+ String referrerId = record.getReferrerId();
|
|
|
|
|
+ if (StringUtils.isNotEmpty(referrerId)) {
|
|
|
|
|
+ record.setReferrerId(referrerId);
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectById(record.getReferrerId());
|
|
|
|
|
+ record.setReferrerName(sysUser.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return sysUserMapper.findBackUserList(page, sysUserDto);
|
|
|
|
|
|
|
+ return backUserList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|