Commit c8f955d6 by guojuxing

协作人接口

parent dd9fed5f
package com.gic.auth.dao.mapper;
import com.gic.auth.dto.CollaboratorListDTO;
import com.gic.auth.entity.TabSysCollaborator;
import com.gic.auth.qo.CollaboratorListQO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabSysCollaboratorMapper {
/**
* 根据主键删除
*
* @param collaboratorId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer collaboratorId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysCollaborator record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysCollaborator record);
/**
* 根据主键查询
*
* @param collaboratorId 主键
* @return 实体对象
*/
TabSysCollaborator selectByPrimaryKey(Integer collaboratorId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysCollaborator record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysCollaborator record);
/**
* 查询列表数据
* @Title: list

* @Description:

 * @author guojuxing
* @param params

* @return java.util.List<com.gic.auth.dto.CollaboratorListDTO>


 */
List<CollaboratorListDTO> list(CollaboratorListQO params);
/**
* 查询列表数据
* @Title: listByCollaboratorIdList

* @Description:

 * @author guojuxing
* @param collaboratorIdList

* @return java.util.List<com.gic.auth.entity.TabSysCollaborator>


 */
List<TabSysCollaborator> listByCollaboratorIdList(@Param("list") List<Integer> collaboratorIdList);
/**
* 查询不在范围内的列表
* @Title: listNotInCollaboratorIdList

* @Description:

 * @author guojuxing
* @param collaboratorIdList
* @param search
* @param enterpriseId

* @return java.util.List<com.gic.auth.entity.TabSysCollaborator>


 */
List<TabSysCollaborator> listNotInCollaboratorIdList(@Param("list") List<Integer> collaboratorIdList,
@Param("search") String search, @Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
......@@ -63,15 +63,15 @@ public interface TabSysUserMapper {
* @param enterpriseId
* @return
*/
int countByPhone(@Param("phone") String phone, @Param("userId") Integer userId, @Param("enterpriseId") Integer enterpriseId);
int countByPhone(@Param("phone") String phone, @Param("userId") Integer userId,
@Param("enterpriseId") Integer enterpriseId);
TabSysUser selectByEnterpriseId(@Param("enterpriseId") Integer enterpriseId);
List<TabSysUser> listAllUserByPhoneNumber(@Param("phoneNumber") String phoneNumber);
TabSysUser login(@Param("phoneNumber") String phoneNumber,
@Param("password") String password,
@Param("enterpriseId") Integer enterpriseId);
TabSysUser login(@Param("phoneNumber") String phoneNumber, @Param("password") String password,
@Param("enterpriseId") Integer enterpriseId);
/**
* 列表查询
......@@ -106,7 +106,9 @@ public interface TabSysUserMapper {

 * @author guojuxing
* @param userIdList

* @param search
* @param enterpriseId
* @return java.util.List<com.gic.auth.entity.TabSysUser>


 */
List<TabSysUser> listUserNotInIdList(@Param("ids") List<Integer> userIdList, @Param("search") String search);
List<TabSysUser> listUserNotInIdList(@Param("ids") List<Integer> userIdList, @Param("search") String search,
@Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
package com.gic.auth.entity;
import java.util.Date;
/**
* tab_sys_collaborator
*/
public class TabSysCollaborator {
/**
* ID
*/
private Integer collaboratorId;
/**
* 名称
*/
private String collaboratorName;
/**
* 商户
*/
private Integer enterpriseId;
/**
* 手机号码
*/
private String phone;
/**
* 应用ID
*/
private String appId;
/**
* 应用名称
*/
private String appName;
/**
* 添加人名称
*/
private String creator;
/**
* 子应用ids,可以多选,用_隔开_2_3_
*/
private String subAppIds;
/**
* 状态: 0:无效 1:youxiao
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getCollaboratorId() {
return collaboratorId;
}
public void setCollaboratorId(Integer collaboratorId) {
this.collaboratorId = collaboratorId;
}
public String getCollaboratorName() {
return collaboratorName;
}
public void setCollaboratorName(String collaboratorName) {
this.collaboratorName = collaboratorName;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getSubAppIds() {
return subAppIds;
}
public void setSubAppIds(String subAppIds) {
this.subAppIds = subAppIds;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file
package com.gic.auth.service;
import com.gic.auth.dto.CollaboratorDTO;
import com.gic.auth.dto.CollaboratorListDTO;
import com.gic.auth.entity.TabSysCollaborator;
import com.gic.auth.qo.CollaboratorListQO;
import com.github.pagehelper.Page;
import java.util.List;
/**
* 协作人接口
* @ClassName: CollaboratorService

* @Description: 

* @author guojuxing

* @date 2019/11/1 4:20 PM

*/
public interface CollaboratorService {
/**
* 新增协作人
* @Title: save

* @Description:

 * @author guojuxing
* @param dto

* @return java.lang.Integer


 */
Integer save(CollaboratorDTO dto);
/**
* 分页查询协作人列表
* @Title: page

* @Description:

 * @author guojuxing
* @param params

* @return com.github.pagehelper.Page<com.gic.auth.dto.CollaboratorListDTO>


 */
Page<CollaboratorListDTO> page(CollaboratorListQO params);
/**
* 列表查询
* @Title: listByEnterpriseId

* @Description:

 * @author guojuxing
* @param collaboratorIdList

* @return java.util.List<com.gic.auth.entity.TabSysCollaborator>


 */
List<TabSysCollaborator> listByCollaboratorIdList(List<Integer> collaboratorIdList);
/**
* 查询不在范围内的数据
* @Title: listNotInCollaboratorIdList

* @Description:

 * @author guojuxing
* @param collaboratorIdList

* @param search
* @param enterpriseId
* @return java.util.List<com.gic.auth.entity.TabSysCollaborator>


 */
List<TabSysCollaborator> listNotInCollaboratorIdList(List<Integer> collaboratorIdList, String search,
Integer enterpriseId);
}
......@@ -96,7 +96,9 @@ public interface UserService {
* @Description:

 * @author guojuxing
* @param userIdList

* @param search
* @param enterpriseId
* @return java.util.List<com.gic.auth.entity.TabSysUser>


 */
List<TabSysUser> listUserNotInIdList(List<Integer> userIdList, String search);
List<TabSysUser> listUserNotInIdList(List<Integer> userIdList, String search, Integer enterpriseId);
}
package com.gic.auth.service.impl;
import com.gic.auth.dao.mapper.TabSysCollaboratorMapper;
import com.gic.auth.dto.CollaboratorDTO;
import com.gic.auth.dto.CollaboratorListDTO;
import com.gic.auth.entity.TabSysCollaborator;
import com.gic.auth.qo.CollaboratorListQO;
import com.gic.auth.service.CollaboratorService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("collaboratorService")
public class CollaboratorServiceImpl implements CollaboratorService {
@Autowired
private TabSysCollaboratorMapper tabSysCollaboratorMapper;
@Override
public Integer save(CollaboratorDTO dto) {
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
dto.setStatus(1);
TabSysCollaborator record = EntityUtil.changeEntityNew(TabSysCollaborator.class, dto);
tabSysCollaboratorMapper.insertSelective(record);
return record.getCollaboratorId();
}
@Override
public Page<CollaboratorListDTO> page(CollaboratorListQO params) {
PageHelper.startPage(params.getCurrentPage(), params.getPageSize());
return (Page<CollaboratorListDTO>) tabSysCollaboratorMapper.list(params);
}
@Override
public List<TabSysCollaborator> listByCollaboratorIdList(List<Integer> collaboratorIdList) {
return tabSysCollaboratorMapper.listByCollaboratorIdList(collaboratorIdList);
}
@Override
public List<TabSysCollaborator> listNotInCollaboratorIdList(List<Integer> collaboratorIdList, String search,
Integer enterpriseId) {
return tabSysCollaboratorMapper.listNotInCollaboratorIdList(collaboratorIdList, search, enterpriseId);
}
}
......@@ -106,7 +106,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public List<TabSysUser> listUserNotInIdList(List<Integer> userIdList, String search) {
return tabSysUserMapper.listUserNotInIdList(userIdList, search);
public List<TabSysUser> listUserNotInIdList(List<Integer> userIdList, String search, Integer enterpriseId) {
return tabSysUserMapper.listUserNotInIdList(userIdList, search, enterpriseId);
}
}
......@@ -4,6 +4,8 @@ import java.util.*;
import com.gic.auth.dto.AccountGroupListDTO;
import com.gic.auth.dto.AccountGroupRelDTO;
import com.gic.auth.entity.TabSysCollaborator;
import com.gic.auth.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -16,10 +18,6 @@ import com.gic.auth.dto.AccountGroupMemberDTO;
import com.gic.auth.entity.TabSysAccountGroup;
import com.gic.auth.entity.TabSysAccountGroupRel;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.service.AccountGroupApiService;
import com.gic.auth.service.AccountGroupRelService;
import com.gic.auth.service.AccountGroupService;
import com.gic.auth.service.UserService;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.valid.ValidParamsUtils;
......@@ -32,6 +30,8 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
private AccountGroupRelService accountGroupRelService;
@Autowired
private UserService userService;
@Autowired
private CollaboratorService collaboratorService;
@Override
public ServiceResponse<Integer> save(AccountGroupDTO dto) {
......@@ -142,8 +142,9 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
List<AccountGroupMemberDTO> result = new ArrayList<>();
List<TabSysAccountGroupRel> list = listByAccountGroupId(accountGroupId);
//查询管理员列表
result.addAll(getMemberOfUser(AccountGroupMemberTypeEnum.ADMIN.getCode(), list, false, search));
//todo 查询协作人列表
result.addAll(getMemberOfUser(list, false, search, record.getEnterpriseId()));
// 查询协作人列表
result.addAll(getMemberOfCollaborator(list, true, search, record.getEnterpriseId()));
return ServiceResponse.success(result);
}
......@@ -157,8 +158,9 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
List<AccountGroupMemberDTO> result = new ArrayList<>();
List<TabSysAccountGroupRel> list = listByAccountGroupId(accountGroupId);
//查询管理员列表
result.addAll(getMemberOfUser(AccountGroupMemberTypeEnum.ADMIN.getCode(), list, true, search));
//todo 查询协作人列表
result.addAll(getMemberOfUser(list, true, search, record.getEnterpriseId()));
// 查询协作人列表
result.addAll(getMemberOfCollaborator(list, true, search, record.getEnterpriseId()));
return ServiceResponse.success(result);
}
......@@ -234,20 +236,19 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
/**
* 获取管理员列表
* @param type
* @param accountGroupRelList
* @param isIn 是否在分组内
* @return
*/
private List<AccountGroupMemberDTO> getMemberOfUser(int type, List<TabSysAccountGroupRel> accountGroupRelList,
boolean isIn, String search) {
List<Integer> userIdList = getUserIdList(type, accountGroupRelList);
private List<AccountGroupMemberDTO> getMemberOfUser(List<TabSysAccountGroupRel> accountGroupRelList, boolean isIn,
String search, Integer enterpriseId) {
List<Integer> userIdList = getUserIdList(AccountGroupMemberTypeEnum.ADMIN.getCode(), accountGroupRelList);
List<TabSysUser> userList;
//查询管理员列表
if (isIn) {
userList = userService.listUserByIdList(userIdList);
} else {
userList = userService.listUserNotInIdList(userIdList, search);
userList = userService.listUserNotInIdList(userIdList, search, enterpriseId);
}
return userToMember(userList);
}
......@@ -267,6 +268,34 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
return result;
}
private List<AccountGroupMemberDTO> getMemberOfCollaborator(List<TabSysAccountGroupRel> accountGroupRelList,
boolean isIn, String search, Integer enterpriseId) {
List<Integer> collaboratorIdList = getUserIdList(AccountGroupMemberTypeEnum.COLLABORATOR.getCode(),
accountGroupRelList);
List<TabSysCollaborator> collaboratorList;
if (isIn) {
collaboratorList = collaboratorService.listByCollaboratorIdList(collaboratorIdList);
} else {
collaboratorList = collaboratorService.listNotInCollaboratorIdList(collaboratorIdList, search, enterpriseId);
}
return collaboratorToMember(collaboratorList);
}
private List<AccountGroupMemberDTO> collaboratorToMember(List<TabSysCollaborator> userList) {
List<AccountGroupMemberDTO> result = new ArrayList<>();
if (CollectionUtils.isNotEmpty(userList)) {
for (TabSysCollaborator user : userList) {
AccountGroupMemberDTO dto = new AccountGroupMemberDTO();
dto.setMemberName(user.getCollaboratorName());
dto.setUserId(user.getCollaboratorId());
dto.setPhone(user.getPhone());
dto.setType(AccountGroupMemberTypeEnum.COLLABORATOR.getCode());
result.add(dto);
}
}
return result;
}
private ServiceResponse<Void> grouping(List<Integer> userIdList, List<Integer> accountGroupId, Integer enterpriseId,
int type) {
//先删除
......
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.CollaboratorDTO;
import com.gic.auth.dto.CollaboratorListDTO;
import com.gic.auth.qo.CollaboratorListQO;
import com.gic.auth.service.CollaboratorApiService;
import com.gic.auth.service.CollaboratorService;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.utils.valid.ValidParamsUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("collaboratorApiService")
public class CollaboratorApiServiceImpl implements CollaboratorApiService{
@Autowired
private CollaboratorService collaboratorService;
@Override
public ServiceResponse<Integer> save(CollaboratorDTO dto) {
//新增参数校验
ServiceResponse paramValid = ValidParamsUtils.allCheckValidate(dto, CollaboratorDTO.SaveValid.class);
if (!paramValid.isSuccess()) {
return paramValid;
}
collaboratorService.save(dto);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Page<CollaboratorListDTO>> page(CollaboratorListQO params) {
com.github.pagehelper.Page<CollaboratorListDTO> page = collaboratorService.page(params);
Page<CollaboratorListDTO> resultPage = PageHelperUtils.changePageHelperToCurrentPage(page);
return ServiceResponse.success(resultPage);
}
}
......@@ -45,5 +45,7 @@
</dubbo:reference>
<!--账号分组-->
<dubbo:service interface="com.gic.auth.service.AccountGroupApiService" ref="accountGroupApiService" timeout="6000" />
<!--协作人-->
<dubbo:service interface="com.gic.auth.service.CollaboratorApiService" ref="collaboratorApiService" timeout="6000" />
<!--角色-->
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.auth.dao.mapper.TabSysCollaboratorMapper">
<resultMap id="BaseResultMap" type="com.gic.auth.entity.TabSysCollaborator">
<id column="collaborator_id" jdbcType="INTEGER" property="collaboratorId" />
<result column="collaborator_name" jdbcType="VARCHAR" property="collaboratorName" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="app_name" jdbcType="VARCHAR" property="appName" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="sub_app_ids" jdbcType="VARCHAR" property="subAppIds" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
collaborator_id, collaborator_name, enterprise_id, phone, app_id, app_name, creator, sub_app_ids, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_collaborator
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_collaborator
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysCollaborator">
insert into tab_sys_collaborator (collaborator_id, collaborator_name,
enterprise_id, phone, app_id,
app_name,
creator, sub_app_ids, status,
create_time, update_time)
values (#{collaboratorId,jdbcType=INTEGER}, #{collaboratorName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
#{appName,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{subAppIds,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysCollaborator" useGeneratedKeys="true" keyProperty="collaboratorId">
insert into tab_sys_collaborator
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="collaboratorId != null">
collaborator_id,
</if>
<if test="collaboratorName != null">
collaborator_name,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="phone != null">
phone,
</if>
<if test="appId != null">
app_id,
</if>
<if test="appName != null">
app_name,
</if>
<if test="creator != null">
creator,
</if>
<if test="subAppIds != null">
sub_app_ids,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="collaboratorId != null">
#{collaboratorId,jdbcType=INTEGER},
</if>
<if test="collaboratorName != null">
#{collaboratorName,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="appName != null">
#{appName,jdbcType=VARCHAR},
</if>
<if test="creator != null">
#{creator,jdbcType=VARCHAR},
</if>
<if test="subAppIds != null">
#{subAppIds,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.auth.entity.TabSysCollaborator">
update tab_sys_collaborator
<set>
<if test="collaboratorName != null">
collaborator_name = #{collaboratorName,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="appName != null">
app_name = #{appName,jdbcType=VARCHAR},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="subAppIds != null">
sub_app_ids = #{subAppIds,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysCollaborator">
update tab_sys_collaborator
set collaborator_name = #{collaboratorName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
app_name = #{appName,jdbcType=VARCHAR},
creator = #{creator,jdbcType=VARCHAR},
sub_app_ids = #{subAppIds,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</update>
<select id="list" parameterType="com.gic.auth.qo.CollaboratorListQO" resultType="com.gic.auth.dto.CollaboratorListDTO">
select
a.collaborator_id collaboratorId,
a.collaborator_name collaboratorName,
a.enterprise_id enterpriseId,
b.enterprise_name enterpriseName,
a.phone phone,
a.appId appId,
a.app_name appName,
a.creator,
a.status,
a.create_time createTime
from tab_sys_collaborator a
left join tab_enterprise b on a.enterprise_id = b.enterprise_id
where 1=1
<if test="search != null and search != '' ">
and (a.collaborator_name like concat('%', search, '%') or a.phone like concat('%', search, '%') or b.enterprise_name like concat('%', search, '%') )
</if>
<if test="appId != null and appId != '' ">
and a.app_id in (#{appId})
</if>
<if test="status != null">
and a.status = #{status}
</if>
</select>
<select id="listByCollaboratorIdList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
from tab_sys_collaborator
where 1=1
<if test="list != null and list.size() > 0">
and collaborator_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="listNotInCollaboratorIdList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
from tab_sys_collaborator
where enterprise_id = #{enterpriseId}
<if test="list != null and list.size() > 0">
and collaborator_id not in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="search != null and search != '' ">
and ( collaborator_name like concat('%', #{search}, '%') or phone like concat('%', #{search}, '%') )
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -313,6 +313,7 @@
<include refid="Base_Column_List" />
from tab_sys_user
where status = 1
and enterprise_id = #{enterpriseId}
<if test="search != null and search != '' ">
and ( user_name like concat('%', #{search}, '%') or phone_number like concat('%', #{search}, '%') )
</if>
......
......@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull;
import com.alibaba.fastjson.JSON;
import com.gic.auth.dto.AccountGroupMemberDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -131,6 +132,12 @@ public class AccountGroupController {
@RequestMapping("/add-group-member")
public RestResponse addGroupMember(String memberArr) {
List<AccountGroupMemberDTO> list = JSON.parseArray(memberArr, AccountGroupMemberDTO.class);
if (CollectionUtils.isNotEmpty(list)) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
for (AccountGroupMemberDTO temp : list) {
temp.setEnterpriseId(enterpriseId);
}
}
return ResultControllerUtils
.commonResult(accountGroupApiService.saveAccountGroupRelFetch(list));
}
......
......@@ -57,4 +57,6 @@
<dubbo:reference interface="com.gic.goods.api.service.GoodsRightsSelectorApiService" id="goodsRightsSelectorApiService" timeout="60000" retries="0" />
<!--账号分组-->
<dubbo:reference interface="com.gic.auth.service.AccountGroupApiService" id="accountGroupApiService" timeout="6000" />
<!--协作人-->
<dubbo:reference interface="com.gic.auth.service.CollaboratorApiService" id="collaboratorApiService" timeout="6000" />
</beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment