|
|
|
|
@@ -2,7 +2,6 @@ package com.gxwebsoft.common.system.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.DesensitizedUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
@@ -12,10 +11,7 @@ import com.gxwebsoft.common.core.utils.CommonUtil;
|
|
|
|
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
|
|
|
import com.gxwebsoft.common.core.web.PageParam;
|
|
|
|
|
import com.gxwebsoft.common.core.web.PageResult;
|
|
|
|
|
import com.gxwebsoft.common.system.entity.Company;
|
|
|
|
|
import com.gxwebsoft.common.system.entity.Role;
|
|
|
|
|
import com.gxwebsoft.common.system.entity.User;
|
|
|
|
|
import com.gxwebsoft.common.system.entity.UserRole;
|
|
|
|
|
import com.gxwebsoft.common.system.entity.*;
|
|
|
|
|
import com.gxwebsoft.common.system.mapper.UserMapper;
|
|
|
|
|
import com.gxwebsoft.common.system.param.UserParam;
|
|
|
|
|
import com.gxwebsoft.common.system.service.*;
|
|
|
|
|
@@ -27,12 +23,9 @@ import org.springframework.transaction.annotation.Isolation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.gxwebsoft.common.core.constants.PlatformConstants.MP_WEIXIN;
|
|
|
|
|
import static com.gxwebsoft.common.core.constants.PlatformConstants.WEB;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -57,6 +50,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
private CompanyService companyService;
|
|
|
|
|
@Resource
|
|
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
@Resource
|
|
|
|
|
private OrganizationService organizationService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageResult<User> pageRel(UserParam param) {
|
|
|
|
|
@@ -177,7 +172,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
throw new BusinessException("邮箱已存在");
|
|
|
|
|
}
|
|
|
|
|
// 更新用户等级
|
|
|
|
|
if (user.getGradeId() != null && !user.getGradeId().equals(0)){
|
|
|
|
|
if (user.getGradeId() != null && !user.getGradeId().equals(0)) {
|
|
|
|
|
userService.updateById(user);
|
|
|
|
|
}
|
|
|
|
|
boolean result = baseMapper.updateById(user) > 0;
|
|
|
|
|
@@ -245,15 +240,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
addUser.setNickname(DesensitizedUtil.mobilePhone(userParam.getPhone()));
|
|
|
|
|
addUser.setPlatform(WEB);
|
|
|
|
|
addUser.setGradeId(2);
|
|
|
|
|
if(userParam.getGradeId() != null){
|
|
|
|
|
if (userParam.getGradeId() != null) {
|
|
|
|
|
addUser.setGradeId(userParam.getGradeId());
|
|
|
|
|
}
|
|
|
|
|
if(userParam.getPhone() != null){
|
|
|
|
|
if (userParam.getPhone() != null) {
|
|
|
|
|
addUser.setPhone(userParam.getPhone());
|
|
|
|
|
}
|
|
|
|
|
if(userParam.getPassword() != null){
|
|
|
|
|
if (userParam.getPassword() != null) {
|
|
|
|
|
addUser.setPassword(encodePassword(userParam.getPassword()));
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
addUser.setPassword(encodePassword(CommonUtil.randomUUID16()));
|
|
|
|
|
}
|
|
|
|
|
addUser.setTenantId(userParam.getTenantId());
|
|
|
|
|
@@ -292,4 +287,19 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer userNumInPark(UserParam param) {
|
|
|
|
|
List<Organization> organizationList = organizationService.list(
|
|
|
|
|
new LambdaQueryWrapper<Organization>()
|
|
|
|
|
.eq(Organization::getPark, param.getPark())
|
|
|
|
|
);
|
|
|
|
|
if (organizationList != null && !organizationList.isEmpty()) {
|
|
|
|
|
return count(
|
|
|
|
|
new LambdaQueryWrapper<User>()
|
|
|
|
|
.in(User::getOrganizationId, organizationList.stream().map(Organization::getOrganizationId).collect(Collectors.toList()))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|