| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | |
| | | /** |
| | |
| | | * @author project |
| | | */ |
| | | @EnableAsync |
| | | @EnableCaching |
| | | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
| | | public class ProjectApplication |
| | | { |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | |
| | | |
| | | @ApiOperation("获取同行人") |
| | | @GetMapping("/peerList") |
| | | @Cacheable(value = "sysUser:peerList") |
| | | public AjaxResult peerList(String nickName, String deptId) |
| | | { |
| | | List<SysUser> list = userService.list(userService.lq() |
| | |
| | | .ne(SysUser::getUserName,"admin") |
| | | .ne(SysUser::getUserId, SecurityUtils.getUserId()) |
| | | .like(StringUtils.isNotEmpty(nickName), SysUser::getNickName,nickName) |
| | | .eq(deptId!=null, SysUser::getDeptId,deptId) |
| | | .eq(deptId!=null, SysUser::getDeptId, deptId) |
| | | ); |
| | | list.forEach(user->{ |
| | | SysDept sysDept = deptService.selectDeptById(user.getDeptId()); |
| | |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class SysUser |
| | | public class SysUser implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | @CacheEvict(value = "sysUser:peerList",allEntries = true) |
| | | public int insertUser(SysUser user) |
| | | { |
| | | // 新增用户信息 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | @CacheEvict(value = "sysUser:peerList",allEntries = true) |
| | | public int updateUser(SysUser user) |
| | | { |
| | | Long userId = user.getUserId(); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | @CacheEvict(value = "sysUser:peerList",allEntries = true) |
| | | public int deleteUserById(Long userId) |
| | | { |
| | | // 删除用户与角色关联 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | @CacheEvict(value = "sysUser:peerList",allEntries = true) |
| | | public int deleteUserByIds(Long[] userIds) |
| | | { |
| | | for (Long userId : userIds) |