|
@@ -313,9 +313,9 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
User user = getInfo();
|
|
User user = getInfo();
|
|
//修改昵称后 修改企业账户信息
|
|
//修改昵称后 修改企业账户信息
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
- enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId,user.getId());
|
|
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
List<UserEnterprise> list = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
|
|
List<UserEnterprise> list = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
|
|
- if (null!=list&&list.size()>0){
|
|
|
|
|
|
+ if (null != list && list.size() > 0) {
|
|
for (UserEnterprise userEnterprise : list) {
|
|
for (UserEnterprise userEnterprise : list) {
|
|
userEnterprise.setNickname(request.getNickname());
|
|
userEnterprise.setNickname(request.getNickname());
|
|
userEnterpriseService.updateById(userEnterprise);
|
|
userEnterpriseService.updateById(userEnterprise);
|
|
@@ -1172,7 +1172,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, user.getId());
|
|
List<UserEnterprise> one = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
|
|
List<UserEnterprise> one = userEnterpriseService.list(enterpriseLambdaQueryWrapper);
|
|
- if (null!=one&one.size()>0){
|
|
|
|
|
|
+ if (null != one & one.size() > 0) {
|
|
for (UserEnterprise userEnterprise : one) {
|
|
for (UserEnterprise userEnterprise : one) {
|
|
BigDecimal usedLineOfCredit = userEnterprise.getUsedLineOfCredit();
|
|
BigDecimal usedLineOfCredit = userEnterprise.getUsedLineOfCredit();
|
|
int i = usedLineOfCredit.compareTo(BigDecimal.valueOf(0));
|
|
int i = usedLineOfCredit.compareTo(BigDecimal.valueOf(0));
|
|
@@ -1184,7 +1184,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
}
|
|
}
|
|
|
|
|
|
userEnterpriseService.remove(enterpriseLambdaQueryWrapper);
|
|
userEnterpriseService.remove(enterpriseLambdaQueryWrapper);
|
|
- if (null != one&&one.size()>0) {
|
|
|
|
|
|
+ if (null != one && one.size() > 0) {
|
|
for (UserEnterprise userEnterprise : one) {
|
|
for (UserEnterprise userEnterprise : one) {
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(UserBypassAccount::getEnterpriseId, userEnterprise.getId());
|
|
queryWrapper.eq(UserBypassAccount::getEnterpriseId, userEnterprise.getId());
|
|
@@ -1240,6 +1240,51 @@ public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserS
|
|
}
|
|
}
|
|
UserAdminDetailResponse response = new UserAdminDetailResponse();
|
|
UserAdminDetailResponse response = new UserAdminDetailResponse();
|
|
BeanUtils.copyProperties(user, response);
|
|
BeanUtils.copyProperties(user, response);
|
|
|
|
+ Integer isEnterpriseUser = user.getIsEnterpriseUser();
|
|
|
|
+ if (null != isEnterpriseUser) {
|
|
|
|
+ if (2 == user.getIsEnterpriseUser()) {
|
|
|
|
+ response.setUserType("企业主账号");
|
|
|
|
+ LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getUserId, response.getId());
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
|
|
|
|
+ UserEnterprise userEnterprise1 = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
|
|
|
|
+ if (null != userEnterprise1) {
|
|
|
|
+ response.setCompName(userEnterprise1.getEnterpriseName());
|
|
|
|
+ } else {
|
|
|
|
+ response.setUserType("企业主账号");
|
|
|
|
+ response.setCompName("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (3 == user.getIsEnterpriseUser()) {
|
|
|
|
+ response.setUserType("企业子账号");
|
|
|
|
+ LambdaQueryWrapper<UserBypassAccount> userBypassAccountLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ userBypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getUserId, response.getId());
|
|
|
|
+ userBypassAccountLambdaQueryWrapper.eq(UserBypassAccount::getIsDelete, 0);
|
|
|
|
+ UserBypassAccount one = userBypassAccountService.getOne(userBypassAccountLambdaQueryWrapper);
|
|
|
|
+ if (null != one) {
|
|
|
|
+ Integer enterpriseId = one.getEnterpriseId();
|
|
|
|
+ LambdaQueryWrapper<UserEnterprise> enterpriseLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getId, enterpriseId);
|
|
|
|
+ enterpriseLambdaQueryWrapper.eq(UserEnterprise::getIsDelete, 0);
|
|
|
|
+ UserEnterprise userEnterprise2 = userEnterpriseService.getOne(enterpriseLambdaQueryWrapper);
|
|
|
|
+ if (null != userEnterprise2) {
|
|
|
|
+ response.setCompName(userEnterprise2.getEnterpriseName());
|
|
|
|
+ } else {
|
|
|
|
+ response.setUserType("企业子账号");
|
|
|
|
+ response.setCompName("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ response.setUserType("企业子账号");
|
|
|
|
+ response.setCompName("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ response.setUserType("普通用户");
|
|
|
|
+ response.setCompName("");
|
|
|
|
+ }
|
|
|
|
+
|
|
if (user.getSpreadUid() > 0) {
|
|
if (user.getSpreadUid() > 0) {
|
|
User spreadUser = getById(user.getSpreadUid());
|
|
User spreadUser = getById(user.getSpreadUid());
|
|
response.setSpreadName(spreadUser.getNickname());
|
|
response.setSpreadName(spreadUser.getNickname());
|