|
@@ -2,10 +2,11 @@ package com.zhentao.shouye.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.zhentao.shouye.domain.Groups;
|
|
|
|
|
|
+import com.zhentao.groups.mapper.GroupsMapper;
|
|
|
|
+import com.zhentao.groups.pojo.Groupss;
|
|
|
|
+import com.zhentao.groups.service.GroupsService;
|
|
import com.zhentao.shouye.domain.UserShouye;
|
|
import com.zhentao.shouye.domain.UserShouye;
|
|
import com.zhentao.shouye.dto.UserShouyeDto;
|
|
import com.zhentao.shouye.dto.UserShouyeDto;
|
|
-import com.zhentao.shouye.service.GroupsService;
|
|
|
|
import com.zhentao.shouye.service.UserShouyeService;
|
|
import com.zhentao.shouye.service.UserShouyeService;
|
|
import com.zhentao.shouye.mapper.UserShouyeMapper;
|
|
import com.zhentao.shouye.mapper.UserShouyeMapper;
|
|
import com.zhentao.user.domain.UserLogin;
|
|
import com.zhentao.user.domain.UserLogin;
|
|
@@ -14,7 +15,6 @@ import com.zhentao.vo.Result;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.xml.ws.Action;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,7 +28,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
|
|
@Autowired
|
|
@Autowired
|
|
private UserLoginService userLoginService;
|
|
private UserLoginService userLoginService;
|
|
@Autowired
|
|
@Autowired
|
|
- private GroupsService groupsService;
|
|
|
|
|
|
+ private GroupsMapper groupsService;
|
|
public static boolean isLongNotNull(long value) {
|
|
public static boolean isLongNotNull(long value) {
|
|
// 如果值为0L,认为是“空”,返回false
|
|
// 如果值为0L,认为是“空”,返回false
|
|
return value != 0;
|
|
return value != 0;
|
|
@@ -45,7 +45,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
|
|
// 关联用户 群关联
|
|
// 关联用户 群关联
|
|
// 查出所有的用户信息
|
|
// 查出所有的用户信息
|
|
List<UserLogin> list1 = userLoginService.list();
|
|
List<UserLogin> list1 = userLoginService.list();
|
|
- List<Groups> list2 = groupsService.list();
|
|
|
|
|
|
+ List<Groupss> list2 = groupsService.selectList(null);
|
|
// 进行关联
|
|
// 进行关联
|
|
for (UserShouye u:list) {
|
|
for (UserShouye u:list) {
|
|
for (UserLogin l: list1) {
|
|
for (UserLogin l: list1) {
|
|
@@ -56,7 +56,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
|
|
}
|
|
}
|
|
System.err.println(list);
|
|
System.err.println(list);
|
|
for (UserShouye u:list) {
|
|
for (UserShouye u:list) {
|
|
- for (Groups g: list2) {
|
|
|
|
|
|
+ for (Groupss g: list2) {
|
|
if (u.getGid().equals(g.getGroupId()) && isLongNotNull(u.getGid())){
|
|
if (u.getGid().equals(g.getGroupId()) && isLongNotNull(u.getGid())){
|
|
u.setGroupss(g);
|
|
u.setGroupss(g);
|
|
}
|
|
}
|