|
@@ -2,10 +2,14 @@ package cn.com.ty.lift.system.user.service.impl;
|
|
|
|
|
|
import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
import cn.com.ty.lift.system.user.dao.entity.MTCompanyUser;
|
|
|
+import cn.com.ty.lift.system.user.dao.entity.UserAccount;
|
|
|
import cn.com.ty.lift.system.user.dao.entity.UserRole;
|
|
|
import cn.com.ty.lift.system.user.dao.entity.model.MTCompany;
|
|
|
import cn.com.ty.lift.system.user.dao.mapper.MTCompanyUserMapper;
|
|
|
import cn.com.ty.lift.system.user.service.IMTCompanyUserService;
|
|
|
+import cn.com.ty.lift.system.user.service.IUserAccountService;
|
|
|
+import cn.com.ty.lift.system.user.service.IUserRoleService;
|
|
|
+import cn.com.ty.lift.system.utils.ProjectUtils;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -13,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @author huangyuan
|
|
|
* @date 2019-12-03
|
|
@@ -22,7 +28,10 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
public class MTCompanyUserService extends ServiceImpl<MTCompanyUserMapper, MTCompanyUser> implements IMTCompanyUserService {
|
|
|
|
|
|
@Autowired
|
|
|
- private UserRoleService userRoleService;
|
|
|
+ private IUserRoleService userRoleService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserAccountService userAccountService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -56,4 +65,13 @@ public class MTCompanyUserService extends ServiceImpl<MTCompanyUserMapper, MTCom
|
|
|
userRoleService.save(userRole);
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_SUCCESS, "分配角色成功");
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public RestResponse getCompanyMembers(MTCompany mtCompany) {
|
|
|
+ List<MTCompanyUser> mtCompanyUserList = this.list(new QueryWrapper<MTCompanyUser>()
|
|
|
+ .eq("mt_company_id", mtCompany.getCompanyId()));
|
|
|
+ List<String> userIdList = ProjectUtils.getAttrList(mtCompanyUserList, "userId", null);
|
|
|
+ List<UserAccount> userAccountList = (List<UserAccount>) userAccountService.listByIds(userIdList);
|
|
|
+ return RestResponse.ok(userAccountList, ApiConstants.RESULT_SUCCESS, "获取团队用户成功");
|
|
|
+ }
|
|
|
}
|