Commit 76715c79 by 陶光胜

Merge branch 'master' into 'developer'

根据手机号查询用户列表

See merge request !1
parents 5dfc6a2b 8af52866
......@@ -61,4 +61,14 @@ public interface UserApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> bulkTransferAccountGroup(List<Integer> userIdList, Integer targetAccountGroupId);
/**
* @Title: listUserByPhone

* @Description:

* @author guojuxing
* @param nationCode 手机区号
* @param phone
手机号
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.UserDTO>>


*/
ServiceResponse<List<UserDTO>> listUserByPhone(String nationCode, String phone);
}
......@@ -70,4 +70,6 @@ public interface TabSysUserMapper {
void bulkTransferAccountGroup(@Param("userIdList") List<Integer> userIdList, @Param("targetAccountGroupId") Integer targetAccountGroupId);
List<UserDTO> countGroupByAccountGroupId(@Param("enterpriseId")Integer enterpriseId);
List<TabSysUser> listUserByPhone(@Param("nationCode") String nationCode, @Param("phone") String phone);
}
\ No newline at end of file
......@@ -34,4 +34,6 @@ public interface UserService {
void bulkTransferAccountGroup(List<Integer> userIdList, Integer targetAccountGroupId);
List<UserDTO> countGroupByAccountGroupId(Integer enterpriseId);
List<TabSysUser> listUserByPhone(String nationCode, String phone);
}
......@@ -79,4 +79,9 @@ public class UserServiceImpl implements UserService{
public List<UserDTO> countGroupByAccountGroupId(Integer enterpriseId) {
return tabSysUserMapper.countGroupByAccountGroupId(enterpriseId);
}
@Override
public List<TabSysUser> listUserByPhone(String nationCode, String phone) {
return tabSysUserMapper.listUserByPhone(nationCode, phone);
}
}
......@@ -9,13 +9,16 @@ import com.gic.cloud.qo.UserQO;
import com.gic.cloud.service.AccountGroupService;
import com.gic.cloud.service.UserApiService;
import com.gic.cloud.service.UserService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.error.ErrorCode;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -76,6 +79,15 @@ public class UserApiServiceImpl implements UserApiService{
return ServiceResponse.success();
}
@Override
public ServiceResponse<List<UserDTO>> listUserByPhone(String nationCode, String phone) {
List<TabSysUser> list = userService.listUserByPhone(nationCode, phone);
if (CollectionUtils.isNotEmpty(list)) {
return ServiceResponse.success(EntityUtil.changeEntityListNew(UserDTO.class, list));
}
return ServiceResponse.success(Collections.emptyList());
}
private ServiceResponse<Void> validParam(UserDTO dto) {
if (dto.getUserId() != null) {
TabSysUser record = userService.getUser(dto.getUserId());
......
......@@ -223,4 +223,12 @@
and status = 1
group by account_group_id
</select>
<select id="listUserByPhone" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_user
where nation_code = #{nationCode}
and phone = #{phone}
and status = 1
</select>
</mapper>
\ 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