15881625488@163.com 3 months ago
parent
commit
d3d98e7c7d
6 changed files with 111 additions and 7 deletions
  1. +16
    -7
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java
  2. +67
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/select/BzListDto.java
  3. +7
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java
  4. +7
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java
  5. +5
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java
  6. +9
    -0
      hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 16
- 7
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/PublicController.java View File

@ -18,6 +18,7 @@ import com.hxhq.business.service.*;
import com.hxhq.common.core.constant.CacheConstants; import com.hxhq.common.core.constant.CacheConstants;
import com.hxhq.common.core.exception.ServiceException; import com.hxhq.common.core.exception.ServiceException;
import com.hxhq.common.core.utils.DateUtils; import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.core.web.controller.BaseController; import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult; import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo; import com.hxhq.common.core.web.page.TableDataInfo;
@ -25,7 +26,6 @@ import com.hxhq.common.redis.service.RedisService;
import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.annotation.RequiresPermissions;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.service.ISysUserService; import com.hxhq.system.service.ISysUserService;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.weaver.loadtime.Aj; import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -144,19 +144,28 @@ public class PublicController extends BaseController {
if (study.getStatus() != null && study.getStatus().intValue() > 0) { if (study.getStatus() != null && study.getStatus().intValue() > 0) {
queryWrapper.eq("status", study.getStatus()); queryWrapper.eq("status", study.getStatus());
} }
if (com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getName())) {
queryWrapper.like("s.name", study.getName());
if (StringUtils.isNoneBlank(study.getName())) {
queryWrapper.like("name", study.getName());
} }
if (com.hxhq.common.core.utils.StringUtils.isNoneBlank(study.getSn())) {
queryWrapper.like("s.sn", study.getSn());
if (StringUtils.isNoneBlank(study.getSn())) {
queryWrapper.like("sn", study.getSn());
} }
if (study.getLeader() != null && study.getLeader().longValue() > 0) {
queryWrapper.eq("leader", study.getLeader());
if (StringUtils.isNoneBlank(study.getLeaderName())) {
queryWrapper.like("leader_name", study.getLeaderName());
} }
List<Study> list = studyService.list(queryWrapper); List<Study> list = studyService.list(queryWrapper);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询部长列表
*/
@GetMapping("/bzList")
public AjaxResult bzList()
{
return AjaxResult.success(sysUserService.selectBzList());
}
/** /**

+ 67
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/select/BzListDto.java View File

@ -0,0 +1,67 @@
package com.hxhq.business.dto.select;
/**
* @author memory
*/
public class BzListDto {
/**
* 用户id
*/
private Long userId;
/**
* 登录名
*/
private String userName;
/**
* 姓名
*/
private String nickName;
/**
* 部门id
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
}

+ 7
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/mapper/SysUserMapper.java View File

@ -2,6 +2,7 @@ package com.hxhq.system.mapper;
import java.util.List; import java.util.List;
import com.hxhq.business.dto.select.BzListDto;
import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.dto.select.DeptUserTreeDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
@ -179,4 +180,10 @@ public interface SysUserMapper
* @return * @return
*/ */
List<Long> selectStudyMethodUserIdExcludeCreate(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId,@Param("deptId") Long deptId,@Param("createUserId") Long createUserId); List<Long> selectStudyMethodUserIdExcludeCreate(@Param("studyId") Long studyId, @Param("studySubjectId") Long studySubjectId,@Param("deptId") Long deptId,@Param("createUserId") Long createUserId);
/**
* 获取部长列表
* @return
*/
List<BzListDto> selectBzList();
} }

+ 7
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/ISysUserService.java View File

@ -3,6 +3,7 @@ package com.hxhq.system.service;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.hxhq.business.dto.select.BzListDto;
import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.dto.select.DeptUserTreeDto;
import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.api.domain.SysUser;
@ -261,4 +262,10 @@ public interface ISysUserService
*/ */
Boolean checkPassword(SysUser user,String password,Boolean needName); Boolean checkPassword(SysUser user,String password,Boolean needName);
/**
* 获取部长列表
* @return
*/
List<BzListDto> selectBzList();
} }

+ 5
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/service/impl/SysUserServiceImpl.java View File

@ -7,6 +7,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
import com.hxhq.business.dto.select.BzListDto;
import com.hxhq.business.dto.select.DeptUserTreeDto; import com.hxhq.business.dto.select.DeptUserTreeDto;
import com.hxhq.system.domain.SysPost; import com.hxhq.system.domain.SysPost;
import com.hxhq.system.domain.SysUserPost; import com.hxhq.system.domain.SysUserPost;
@ -602,4 +603,8 @@ public class SysUserServiceImpl implements ISysUserService
throw new ServiceException((needName?user.getNickName():"")+"密码错误"); throw new ServiceException((needName?user.getNickName():"")+"密码错误");
} }
@Override
public List<BzListDto> selectBzList() {
return userMapper.selectBzList();
}
} }

+ 9
- 0
hxhq-modules/hxhq-system/src/main/resources/mapper/system/SysUserMapper.xml View File

@ -332,4 +332,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</select> </select>
<select id="selectBzList" resultType="com.hxhq.business.dto.select.BzListDto">
SELECT u.`user_id`,u.`user_name`,u.`nick_name`,u.`dept_id`,d.`dept_name` FROM `sys_user` u
JOIN `sys_dept` d ON u.`dept_id`=d.`dept_id`
JOIN `sys_user_role` ur ON u.`user_id`=ur.`user_id`
JOIN `sys_role` r ON ur.`role_id`=r.`role_id`
WHERE u.`del_flag`='0' AND r.`del_flag`='0' AND r.`role_key`='bz'
</select>
</mapper> </mapper>

Loading…
Cancel
Save