| | |
| | | public AjaxResult getInfo() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | // System.out.println(user); |
| | | // System.out.println("===========0-000000000000000000"); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | System.out.println(permissions); |
| | | // System.out.println(permissions); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | |
| | | public TableDataInfo list(SysUser user) |
| | | { |
| | | startPage(); |
| | | System.out.println(user.getClanId()); |
| | | System.out.println("----------------++++++++++++==0------------"); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return getDataTable(list); |
| | | } |
| | |
| | | @GetMapping(value = { "/", "/{userId}" }) |
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | // userService.checkUserDataScope(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | //如果是admin则直接返回所有的角色,否则就返回不是管理员的角色信息 |
| | |
| | | user.setSex(userAll.getSex()); |
| | | user.setRemark(userAll.getRemark()); |
| | | user.setUpdateBy(userAll.getUpdateBy()); |
| | | user.setClanId(userAll.getClanId()); |
| | | // user.setSex(userAll.getSex()=="男"?"1":"0"); |
| | | // user.setPostIds(userAll.getPostIds()); |
| | | // user.set |
| | |
| | | ZInfoUser mother = zInfoUserService.getById(userAll.getMid()); |
| | | if (father.getIsMyFamily() == 1){ |
| | | infoUser.setFamilyId(father.getFamilyId()); |
| | | infoUser.setClanId(father.getClanId());} |
| | | infoUser.setClanId(father.getClanId()); |
| | | } |
| | | else if (mother.getIsMyFamily() == 1){ |
| | | infoUser.setFamilyId(mother.getFamilyId()); |
| | | infoUser.setClanId(mother.getClanId()); |
| | |
| | | zu.setSpouseId(infoUser.getUserId()); |
| | | zInfoUserService.updateById(zu); |
| | | } |
| | | }} |
| | | } |
| | | } |
| | | |
| | | // zInfoUserService.saveOrUpdate(infoUser); |
| | | // LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | * 家根网 |
| | | */ |
| | | @GetMapping("/root") |
| | | public AjaxResult listAllPeopleWithTree(@PathParam("depth") Integer depth){ |
| | | return zInfoUserService.listWithTree(depth); |
| | | public AjaxResult listAllPeopleWithTree(@PathParam("depth") Integer depth,@PathParam("clanId") Integer clanId){ |
| | | return zInfoUserService.listWithTree(depth, clanId); |
| | | } |
| | | /** |
| | | * 根据家庭成员找到所有人 |
| | | */ |
| | | @GetMapping("/allFamInfo") |
| | | public AjaxResult listAllFamilyPeople() |
| | | public AjaxResult listAllFamilyPeople(@PathParam("clanId") Integer clanId) |
| | | { |
| | | return zInfoUserService.listAllFamilyPeople(); |
| | | return zInfoUserService.listAllFamilyPeople(clanId); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.ZfClan; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.AncestorHelper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.domain.AjaxResult.error; |
| | | import static com.ruoyi.common.core.page.TableSupport.*; |
| | | |
| | | @RestController |
| | |
| | | @Resource |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | |
| | | @Resource |
| | | private ZfFamilyService zfFamilyService; |
| | | |
| | | @GetMapping("/all/{clanId}") |
| | | public AjaxResult listAll(@PathVariable Integer clanId){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfAncestorService.selectDataList(clanId, pageNo, pageSize); |
| | | } |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(ZfAncestor zfAncestor){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfAncestorService.selectDataList(zfAncestor, pageNo, pageSize); |
| | | } |
| | | |
| | | |
| | | public Long addAncestor(ZfAncestor zfAncestor){ |
| | | |
| | |
| | | */ |
| | | @Log(title = "祖先", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfAncestor zfAncestor) |
| | | public AjaxResult add(@RequestBody AncestorHelper ancestorHelper) |
| | | { |
| | | Long sysId = zfAncestorService.addData(zfAncestor); |
| | | zfAncestor.setSpouseId(sysId.intValue()); |
| | | zfAncestor.setSysId(addAncestor(zfAncestor)); |
| | | zfAncestorService.updateById(zfAncestor); |
| | | //保存祖先 |
| | | System.out.println(ancestorHelper); |
| | | System.out.println("+++++++++++------------+++++++++"); |
| | | if(ancestorHelper.getRoleId()==4) { |
| | | |
| | | //新增一个默认的家庭号 |
| | | ZfFamily zfFamily = new ZfFamily(); |
| | | zfFamily.setName("默认一号家庭"); |
| | | zfFamily.setFid(0L); |
| | | zfFamily.setMid(0L); |
| | | zfFamily.setClanId(ancestorHelper.getClanId()); |
| | | zfFamilyService.addFamily(zfFamily); |
| | | |
| | | |
| | | |
| | | //写入sys_user表,其中的一个祖先 |
| | | SysUser us = new SysUser(); |
| | | us.setNickName(ancestorHelper.getName()); |
| | | // us.setStatus(String.valueOf(zfAncestor.getStatus())); |
| | | us.setSex(String.valueOf(ancestorHelper.getSex())); |
| | | us.setPassword("123456"); |
| | | us.setUserName(ancestorHelper.getName()); |
| | | us.setClanId(ancestorHelper.getClanId()); |
| | | if (!userService.checkUserNameUnique(us)) { |
| | | return error("新增祖先'" + us.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | |
| | | us.setPassword(SecurityUtils.encryptPassword(us.getPassword())); |
| | | userService.insertUser(us); |
| | | //写入sys_user表,另外一个祖先 |
| | | SysUser usa = new SysUser(); |
| | | usa.setNickName(ancestorHelper.getFname()); |
| | | // us.setStatus(String.valueOf(zfAncestor.getStatus())); |
| | | usa.setSex(String.valueOf(ancestorHelper.getFsex())); |
| | | usa.setPassword("123456"); |
| | | usa.setClanId(ancestorHelper.getClanId()); |
| | | usa.setUserName(ancestorHelper.getFname()); |
| | | if (!userService.checkUserNameUnique(usa)) { |
| | | return error("新增祖先1'" + usa.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | |
| | | us.setPassword(SecurityUtils.encryptPassword(usa.getPassword())); |
| | | userService.insertUser(usa); |
| | | |
| | | |
| | | |
| | | //写入到z_info_user表 |
| | | ZInfoUser infoUser = new ZInfoUser(); |
| | | infoUser.setSysId(us.getUserId()); |
| | | // infoUser.setUserId(user.getUserId()); |
| | | infoUser.setNickName(us.getNickName()); |
| | | infoUser.setOldName(us.getUserName()); |
| | | // infoUser.setPhoneNumber(userAll.getPhonenumber()); |
| | | infoUser.setSex(Integer.parseInt(us.getSex())); |
| | | infoUser.setFatherId(0L); |
| | | infoUser.setMomId(0L); |
| | | infoUser.setIsMyFamily(1); |
| | | infoUser.setFamilyId(zfFamily.getId()); |
| | | //少一个familyId |
| | | |
| | | //家族id |
| | | infoUser.setClanId(ancestorHelper.getClanId()); |
| | | infoUser.setRoleId(3L); |
| | | zInfoUserService.save(infoUser); |
| | | |
| | | |
| | | |
| | | //另外一个祖先写入z_info_user |
| | | ZInfoUser infoUsera = new ZInfoUser(); |
| | | infoUsera.setSysId(usa.getUserId()); |
| | | // infoUser.setUserId(user.getUserId()); |
| | | infoUsera.setNickName(usa.getNickName()); |
| | | infoUsera.setOldName(usa.getUserName()); |
| | | // infoUser.setPhoneNumber(userAll.getPhonenumber()); |
| | | infoUsera.setSex(Integer.parseInt(usa.getSex())); |
| | | infoUsera.setFatherId(0L); |
| | | infoUsera.setMomId(0L); |
| | | infoUsera.setIsMyFamily(1); |
| | | //少一个familyId |
| | | infoUsera.setFamilyId(zfFamily.getId()); |
| | | //家族id |
| | | infoUsera.setClanId(ancestorHelper.getClanId()); |
| | | infoUsera.setRoleId(3L); |
| | | infoUsera.setSpouseId(infoUser.getUserId()); |
| | | zInfoUserService.save(infoUsera); |
| | | |
| | | |
| | | //更新第一个祖先的配偶信息 |
| | | infoUser.setSpouseId(infoUsera.getUserId()); |
| | | zInfoUserService.saveOrUpdate(infoUser); |
| | | |
| | | |
| | | //保存祖先信息到zfAncestor |
| | | ZfAncestor zfAncestor = new ZfAncestor(); |
| | | zfAncestor.setClanId(ancestorHelper.getClanId()); |
| | | zfAncestor.setName(ancestorHelper.getName()); |
| | | zfAncestor.setSex(ancestorHelper.getSex()); |
| | | zfAncestor.setRoleId(4); |
| | | zfAncestor.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | zfAncestor.setStatus(0); |
| | | zfAncestor.setSysId(us.getUserId()); |
| | | zfAncestorService.addData(zfAncestor); |
| | | |
| | | //保存另外一个祖先信息 |
| | | ZfAncestor zfAncestor1 = new ZfAncestor(); |
| | | zfAncestor1.setClanId(ancestorHelper.getClanId()); |
| | | zfAncestor1.setName(ancestorHelper.getFname()); |
| | | zfAncestor1.setSex(ancestorHelper.getFsex()); |
| | | zfAncestor1.setRoleId(4); |
| | | zfAncestor1.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | zfAncestor1.setStatus(0); |
| | | zfAncestor1.setSysId(usa.getUserId()); |
| | | zfAncestorService.addData(zfAncestor1); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else{ |
| | | //保存祖先管理员,也先保存到sys_user |
| | | SysUser us = new SysUser(); |
| | | us.setNickName(ancestorHelper.getName()); |
| | | // us.setStatus(String.valueOf(zfAncestor.getStatus())); |
| | | us.setSex(String.valueOf(ancestorHelper.getSex())); |
| | | us.setPassword("123456"); |
| | | us.setUserName(ancestorHelper.getName()); |
| | | us.setClanId(ancestorHelper.getClanId()); |
| | | System.out.println(ancestorHelper.getClanId()); |
| | | System.out.println("0000_______+++++++++++++999999999999"); |
| | | if (!userService.checkUserNameUnique(us)) { |
| | | return error("新增祖先管理员'" + us.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | |
| | | us.setPassword(SecurityUtils.encryptPassword(us.getPassword())); |
| | | userService.insertUser(us); |
| | | |
| | | |
| | | //写到用户与角色对应的表 |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setUserId(us.getUserId()); |
| | | sysUserRole.setRoleId(1L); |
| | | List<SysUserRole> sysUserRoles = new ArrayList<>(); |
| | | sysUserRoles.add(sysUserRole); |
| | | sysUserRoleMapper.batchUserRole(sysUserRoles); |
| | | |
| | | |
| | | //保存祖先信息到zfAncestor |
| | | ZfAncestor zfAncestor = new ZfAncestor(); |
| | | zfAncestor.setClanId(ancestorHelper.getClanId()); |
| | | zfAncestor.setName(ancestorHelper.getName()); |
| | | zfAncestor.setSex(ancestorHelper.getSex()); |
| | | zfAncestor.setRoleId(2); |
| | | zfAncestor.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | zfAncestor.setStatus(0); |
| | | zfAncestor.setSysId(us.getUserId()); |
| | | |
| | | zfAncestorService.addData(zfAncestor); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return AjaxResult.success(); |
| | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.Meeting; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfClan; |
| | | import com.ruoyi.domain.ZfClean; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfClanService; |
| | | import com.ruoyi.system.mapper.SysUserRoleMapper; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(ZfClan zfClan){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfClanService.selectDataList(zfClan, pageNo, pageSize); |
| | | } |
| | | @GetMapping("/allZfInfo") |
| | | public AjaxResult listAllInfo(){ |
| | | |
| | | return zfClanService.selectData(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/satisfy") |
| | | public AjaxResult listSatisfy(ZfClan zfClan){ |
| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ZfClan zfClan) |
| | | { |
| | | |
| | | |
| | | |
| | | return zfClanService.addData(zfClan); |
| | | } |
| | |
| | | return zfClanService.deleteData(ids); |
| | | } |
| | | |
| | | /** |
| | | * 导出记录 |
| | | */ |
| | | @Log(title = "家族记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ZfClan zfClean) |
| | | { |
| | | List<ZfClan> list = zfClanService.selectByCondition(zfClean); |
| | | // log.info("导出记录为:{}",list); |
| | | ExcelUtil<ZfClan> util = new ExcelUtil<>(ZfClan.class); |
| | | util.exportExcel(response, list, "家族号"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfFamily; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM; |
| | | import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | |
| | | ZfFamilyService zfFamilyService; |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult getAllFamily(){ |
| | | return AjaxResult.success(zfFamilyService.list()); |
| | | public AjaxResult getAllFamily(ZfFamily zfFamily){ |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zfFamilyService.selectDataList(zfFamily, pageNo,pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.*; |
| | | |
| | | import lombok.Getter; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | |
| | | /** 角色ID */ |
| | | private Long roleId; |
| | | |
| | | |
| | | public Integer getClanId() { |
| | | return clanId; |
| | | } |
| | | |
| | | private Integer clanId; |
| | | |
| | | public void setClanId(Integer clanId) { |
| | | this.clanId = clanId; |
| | | } |
| | | |
| | | public SysUser() |
| | | { |
| | | |
| | |
| | | public static boolean isAdmin(Long userId) |
| | | { |
| | | //1号用户就是管理员 |
| | | //这里需要修改成管理员,查询数据库 |
| | | return userId != null && 1L == userId; |
| | | } |
| | | |
| | |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("userId", getUserId()) |
| | | .append("clanId", getClanId()) |
| | | |
| | | .append("deptId", getDeptId()) |
| | | .append("userName", getUserName()) |
| | | .append("nickName", getNickName()) |
| | |
| | | |
| | | |
| | | SysUser sysUser = userService.selectUserByUserName(username); |
| | | |
| | | Long userId = sysUser.getUserId(); |
| | | // 生成token |
| | | String token = tokenService.createToken(loginUser); |
| | |
| | | |
| | | public UserDetails createLoginUser(SysUser user) |
| | | { |
| | | // System.out.println(user); |
| | | // System.out.println("========--0023233333333333333"); |
| | | return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public List<SysMenu> selectMenuTreeAll(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据用户ID查询菜单 |
| | | * |
| | | * @return 菜单列表 |
| | | */ |
| | | public List<SysMenu> selectMenuTreeAllSuperAdmin(); |
| | | |
| | | /** |
| | | * 根据用户ID查询菜单 |
| | | * |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.constant.Constants; |
| | |
| | | |
| | | @Autowired |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private ZfAncestorService zfService; |
| | | |
| | | /** |
| | | * 根据用户查询系统菜单列表 |
| | |
| | | public List<SysMenu> selectMenuTreeByUserId(Long userId) |
| | | { |
| | | List<SysMenu> menus = null; |
| | | if (SecurityUtils.isAdmin(userId)) |
| | | ZfAncestor zfAncestor = new ZfAncestor(); |
| | | zfAncestor.setSysId(userId); |
| | | zfAncestor = zfService.selectZfAncestor(zfAncestor); |
| | | System.out.println("---------++++++++____________"); |
| | | System.out.println(zfAncestor); |
| | | //判断是否是超级管理员 |
| | | if(zfAncestor!=null && zfAncestor.getId()==1L && zfAncestor.getRoleId()==0L) |
| | | { |
| | | //如果是超级管理员,把左侧所有的目录和菜单都查出来 |
| | | menus = menuMapper.selectMenuTreeAllSuperAdmin(); |
| | | |
| | | } |
| | | else if(zfAncestor!=null && zfAncestor.getRoleId()==2) |
| | | { |
| | | //如果是普通管理员,把普通管理员的菜单显示出来 |
| | | menus = menuMapper.selectMenuTreeAll(); |
| | | } |
| | | else |
| | |
| | | @Override |
| | | public void checkUserDataScope(Long userId) |
| | | { |
| | | //判断是否是管理员 |
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId())) |
| | | { |
| | | SysUser user = new SysUser(); |
| | |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.menu_id in (1, 100, 118) |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | | <select id="selectMenuTreeAllSuperAdmin" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.menu_id in (11, 12, 13) |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m |
| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="clanId" column="clan_id" /> |
| | | <result property="remark" column="remark" /> |
| | | <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.clan_id,u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | where u.del_flag = '0' and u.clan_id = #{clanId} |
| | | <if test="userId != null and userId != 0"> |
| | | AND u.user_id = #{userId} |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> |
| | | select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | select distinct u.clan_id, u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | <if test="sex != null and sex != ''">sex,</if> |
| | | <if test="password != null and password != ''">password,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="clanId != null and clanId != 0">clan_id,</if> |
| | | |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | create_time |
| | |
| | | <if test="sex != null and sex != ''">#{sex},</if> |
| | | <if test="password != null and password != ''">#{password},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="clanId != null and clanId != ''">#{clanId},</if> |
| | | |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | sysdate() |
| | |
| | | */ |
| | | private Integer spouseId; |
| | | |
| | | /** |
| | | *密码 |
| | | */ |
| | | private String password; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | |
| | | /** |
| | | * 家族名称 |
| | | */ |
| | | @Excel(name = "名字") |
| | | private String clanName; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | private Integer clanId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain.dto; |
| | | |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | @Data |
| | | public class AncestorClan extends ZfAncestor implements Serializable { |
| | | |
| | | private String clanName; |
| | | |
| | | |
| | | private String roleName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AncestorHelper { |
| | | |
| | | private String name; |
| | | private String fname; |
| | | private Integer id; |
| | | /** |
| | | * 家族id |
| | | */ |
| | | private Integer clanId; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 祖先sysId |
| | | */ |
| | | private Long sysId; |
| | | |
| | | |
| | | private Long fsysId; |
| | | /** |
| | | * 祖先性别 |
| | | */ |
| | | private Integer sex; |
| | | |
| | | private Integer fsex; |
| | | /** |
| | | * 祖先类型 |
| | | */ |
| | | private Integer roleId; |
| | | } |
| | |
| | | |
| | | private Long userId; |
| | | |
| | | |
| | | private Integer clanId; |
| | | @Excel(name = "第几代") |
| | | private Integer identity; |
| | | |
| | |
| | | |
| | | private Long mid; |
| | | private Long sysId; |
| | | |
| | | |
| | | private Integer clanId; |
| | | } |
| | |
| | | |
| | | package com.ruoyi.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | @Mapper |
| | | public interface ZfAncestorMapper extends BaseMapper<ZfAncestor> { |
| | | |
| | | @Select("select * , zf_role.name as roleName from zf_ancestor, zf_clan,zf_role where zf_ancestor.clan_id = zf_clan.clan_id and zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") |
| | | Page<AncestorClan> selectInfo(Page page, @Param(Constants.WRAPPER) Wrapper<Object> queryWrapper); |
| | | |
| | | } |
| | |
| | | |
| | | // AjaxResult empower(EmpowerDto empowerDto); |
| | | |
| | | AjaxResult listWithTree(Integer depth); |
| | | AjaxResult listWithTree(Integer depth, Integer clanId); |
| | | |
| | | AjaxResult addParent(Long fatherId, Long motherId); |
| | | |
| | | AjaxResult listAllExceptAdmin(); |
| | | |
| | | AjaxResult listAllFamilyPeople(); |
| | | AjaxResult listAllFamilyPeople(Integer clanId); |
| | | |
| | | AjaxResult listMySelfAndSpouse(Long id); |
| | | |
| | |
| | | |
| | | public interface ZfAncestorService extends IService<ZfAncestor> { |
| | | AjaxResult selectDataList(Integer clanId, Integer pageNo, Integer pageSize); |
| | | AjaxResult selectDataList(ZfAncestor zfAncestor, Integer pageNo, Integer pageSize); |
| | | |
| | | boolean count(Integer clanId); |
| | | |
| | |
| | | |
| | | ZfAncestor update(ZfAncestor zfAncestor); |
| | | |
| | | ZfAncestor selectZfAncestor(ZfAncestor zfAncestor); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.Meeting; |
| | | import com.ruoyi.domain.ZfClan; |
| | | import com.ruoyi.domain.ZfClean; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ZfClanService extends IService<ZfClan> { |
| | | |
| | | AjaxResult selectDataList(ZfClan zfClan, Integer pageNo, Integer pageSize); |
| | | |
| | | AjaxResult selectData(); |
| | | AjaxResult addData(ZfClan zfClan); |
| | | |
| | | AjaxResult updateData(ZfClan zfClan); |
| | |
| | | |
| | | AjaxResult selectDataList(ZfClan zfClan); |
| | | |
| | | List<ZfClan> selectByCondition(ZfClan zfClan); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.domain.ZfProperty; |
| | | import com.ruoyi.domain.dto.UserInfoDto; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Service |
| | | public interface ZfFamilyService extends IService<ZfFamily> { |
| | | |
| | | public AjaxResult selectDataList(ZfFamily zfFamily, Integer pageNum, Integer pageSize); |
| | | ZfFamily getByNameAndUser(ZfFamily zfFamily); |
| | | /** |
| | | * 根据家庭名字查询家庭 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult listWithTree(Integer depth) { |
| | | |
| | | List<ZInfoUser> allPeopleList = list(); |
| | | public AjaxResult listWithTree(Integer depth, Integer clanId) { |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(clanId!=null, ZInfoUser::getClanId, clanId); |
| | | // List<ZfEvent> list = list(lqw); |
| | | List<ZInfoUser> allPeopleList = list(lqw); |
| | | List<ZInfoUser> result = null; |
| | | // try { |
| | | // result = allPeopleList.stream().filter(people -> people.getUserId()!=1&&(people.getFatherId() == 0||people.getMomId()==0)) |
| | |
| | | // System.out.println(people); |
| | | return people; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | System.out.println("--------------++++++++++++++++--------------"); |
| | | System.out.println(result); |
| | | // |
| | | //System.out.println("--------------++++++++++++++++--------------"); |
| | | //System.out.println(result); |
| | | return AjaxResult.success(result); |
| | | |
| | | } |
| | |
| | | lqw.eq(zInfoUser.getSex() != null, ZInfoUser::getSex, zInfoUser.getSex()); |
| | | lqw.like(StringUtils.isNotEmpty(zInfoUser.getNickName()), ZInfoUser::getNickName, zInfoUser.getNickName()); |
| | | // lqw.between(zInfoUser.getBirth() != null, ZInfoUser::getBirth, zInfoUser.getBirth(),zInfoUser.getBirth()); |
| | | |
| | | lqw.eq(zInfoUser.getClanId()!=null, ZInfoUser::getClanId,zInfoUser.getClanId()); |
| | | List<ZInfoUser> allPeopleList = list(lqw); |
| | | // List<ZInfoUser> allPeopleList = list(); |
| | | List<ZInfoUser> result = null; |
| | |
| | | public ZInfoUser getMyself() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | return getById(userId); |
| | | // System.out.println(userId); |
| | | //System.out.println("-----------------++++++++9999++++++++++----------"); |
| | | ZInfoUser zInfoUser = new ZInfoUser(); |
| | | zInfoUser.setSysId(userId); |
| | | LambdaQueryWrapper<ZInfoUser> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(zInfoUser.getSysId() != null, ZInfoUser::getSysId, zInfoUser.getSysId()); |
| | | List<ZInfoUser> list = list(lqw); |
| | | if(!list.isEmpty()) |
| | | return list.get(0); |
| | | else |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult listAllFamilyPeople() { |
| | | public AjaxResult listAllFamilyPeople(Integer clanId) { |
| | | // List<ZInfoUser> lis = list(); |
| | | // for(ZInfoUser tm: lis) |
| | | // { |
| | | // System.out.println(tm.getRoleId()); |
| | | // } |
| | | List<ZInfoUser> collect = list().stream().filter(zInfoUser -> zInfoUser!=null&&zInfoUser.getRoleId()!=null&&zInfoUser.getRoleId()== 3).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZInfoUser> zInfoUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | zInfoUserLambdaQueryWrapper.eq(ZInfoUser::getClanId, clanId); |
| | | List<ZInfoUser> lis = list(zInfoUserLambdaQueryWrapper); |
| | | List<ZInfoUser> collect = lis.stream().filter(zInfoUser -> zInfoUser!=null&&zInfoUser.getRoleId()!=null&&zInfoUser.getRoleId()== 3).collect(Collectors.toList()); |
| | | |
| | | |
| | | return AjaxResult.success(collect); |
| | | } |
| | | |
| | |
| | | |
| | | package com.ruoyi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.ZfClan; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | import com.ruoyi.mapper.ZfAncestorMapper; |
| | | import com.ruoyi.service.*; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | |
| | | private EsService esSer; |
| | | |
| | | @Resource |
| | | private ZfAncestorMapper zfAncestorMapper; |
| | | @Resource |
| | | ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | |
| | | private LambdaQueryWrapper<ZfAncestor> buildCondition(ZfAncestor zfAncestor) { |
| | | LambdaQueryWrapper<ZfAncestor> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfAncestor::getId); |
| | | lqw.eq(zfAncestor.getClanId() !=null , ZfAncestor::getClanId, zfAncestor.getClanId()); |
| | | lqw.eq(zfAncestor.getName()!=null, ZfAncestor::getName,zfAncestor.getName()); |
| | | |
| | | return lqw; |
| | | } |
| | |
| | | return AjaxResult.success(members); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectDataList(ZfAncestor zfAncestor, Integer pageNo, Integer pageSize) { |
| | | QueryWrapper<Object> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | queryWrapper.eq(zfAncestor.getClanId() !=null , " zf_ancestor.clan_id", zfAncestor.getClanId()); |
| | | queryWrapper.eq(zfAncestor.getSysId() !=null , " zf_ancestor.sys_id ", zfAncestor.getSysId()); |
| | | |
| | | Page<AncestorClan> info = zfAncestorMapper.selectInfo(new Page<>(pageNo, pageSize),queryWrapper); |
| | | //page(pa, wrapper); |
| | | // List<AncestorClan> orders = page(pa, wrapper); |
| | | List<AncestorClan> list =info.getRecords(); |
| | | HashMap<String, Object> data = MapUtils.getResult(info, list); |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Long addData(ZfAncestor zfAncestor) { |
| | | LambdaQueryWrapper<ZfAncestor> lqw = buildCondition(zfAncestor); |
| | | List<ZfAncestor> list = list(lqw); |
| | | Long sysID = 0L; |
| | | System.out.println("15dniwru/"+list); |
| | | if(list.size()>2){ |
| | | throw new RuntimeException("请勿重复添加祖先"); |
| | | } |
| | | // LambdaQueryWrapper<ZfAncestor> lqw = buildCondition(zfAncestor); |
| | | // List<ZfAncestor> list = list(lqw); |
| | | // Long sysID = 0L; |
| | | // System.out.println("15dniwru/"+list); |
| | | // if(list.size()>0){ |
| | | // throw new RuntimeException("请勿重复添加祖先"); |
| | | // } |
| | | |
| | | else if (list.size() == 1){ |
| | | if (list.get(0).getSex().equals(zfAncestor.getSex())){ |
| | | throw new RuntimeException("两位祖先不能为同性"); |
| | | } |
| | | // else if (list.size() == 1){ |
| | | // if (list.get(0).getSex().equals(zfAncestor.getSex())){ |
| | | // throw new RuntimeException("两位祖先不能为同性"); |
| | | // } |
| | | |
| | | |
| | | sysID = zInfoUserService.getInfoBysysId(list.get(0).getSysId()).getUserId(); |
| | | } |
| | | |
| | | // sysID = zInfoUserService.getInfoBysysId(list.get(0).getSysId()).getUserId(); |
| | | // } |
| | | // |
| | | |
| | | // if (!Long.valueOf(zfClanService.getById(zfClanManage.getClanId()).getAdminId()).equals(getUserId())) { |
| | | // throw new RuntimeException("您不是管理员,没有权力添加成员"); |
| | |
| | | // zInfoUserService.saveOrUpdate(zInfoUser); |
| | | |
| | | save(zfAncestor); |
| | | EsModel esModel = new EsModel(); |
| | | Integer inte = zfAncestor.getClanId(); |
| | | String uuid = UUID.randomUUID().toString().replace("-",""); |
| | | esModel.setId(uuid); |
| | | esModel.setCtId(Long.valueOf(inte)); |
| | | esModel.setCtTableName("家族管理"); |
| | | esModel.setBy1(zfAncestor.getName()); |
| | | |
| | | esModel.setBy5("/zfClanManage"); |
| | | // esModel.setFid(familyId); |
| | | esSer.insertTable(esModel); |
| | | // EsModel esModel = new EsModel(); |
| | | // Integer inte = zfAncestor.getClanId(); |
| | | // String uuid = UUID.randomUUID().toString().replace("-",""); |
| | | // esModel.setId(uuid); |
| | | // esModel.setCtId(Long.valueOf(inte)); |
| | | // esModel.setCtTableName("家族管理"); |
| | | // esModel.setBy1(zfAncestor.getName()); |
| | | // |
| | | // esModel.setBy5("/zfClanManage"); |
| | | //// esModel.setFid(familyId); |
| | | // esSer.insertTable(esModel); |
| | | // System.out.println(esModel); |
| | | |
| | | return sysID; |
| | | return 1L; |
| | | |
| | | } |
| | | |
| | |
| | | return zfAncestor2; |
| | | } |
| | | |
| | | @Override |
| | | public ZfAncestor selectZfAncestor(ZfAncestor zfAncestor) { |
| | | LambdaQueryWrapper<ZfAncestor> queryWraper = new LambdaQueryWrapper<>(); |
| | | |
| | | queryWraper.eq(zfAncestor.getSysId() !=null , ZfAncestor::getSysId, zfAncestor.getSysId()); |
| | | List lis = this.list(queryWraper); |
| | | if(lis.size()>0) |
| | | return (ZfAncestor) lis.get(0); |
| | | else |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | *通过家族id删除 |
| | |
| | | Page<ZfClan> pageResult = page(zfClanPage, lqw); |
| | | |
| | | List<ZfClan> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | // System.out.println(beanRecords); |
| | | |
| | | |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | return AjaxResult.success(data); } |
| | | |
| | | @Override |
| | | public AjaxResult selectData() { |
| | | List<ZfClan> lis = this.list(); |
| | | return AjaxResult.success(lis); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectDataList(ZfClan zfClan){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ZfClan> selectByCondition(ZfClan zfClan) { |
| | | |
| | | |
| | | LambdaQueryWrapper<ZfClan> lambdaQueryWrapper = buildCondition(zfClan); |
| | | List<ZfClan> beanRecords = list(lambdaQueryWrapper); |
| | | return beanRecords; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult addData(ZfClan zfClan) { |
| | | LambdaQueryWrapper<ZfClan> lqw = uniqueCondition(zfClan); |
| | | List<ZfClan> list = list(lqw); |
| | | |
| | | |
| | | if(list.size()>0){ |
| | | throw new RuntimeException("请勿新增重复家族"); |
| | |
| | | ZfLog zfLog = new ZfLog(); |
| | | zfLog.setUpdateTime(LocalDateTime.now()); |
| | | zfLog.setModule("家族"); |
| | | zfLog.setUpdater(zInfoUserService.getMyself().getNickName()); |
| | | // zfLog.setUpdater(zInfoUserService.getMyself().getNickName()); |
| | | zfLogService.save(zfLog); |
| | | // System.out.println("===================================="+meeting); |
| | | if(updateById(zfClan)){ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.domain.ZfProperty; |
| | | import com.ruoyi.domain.dto.UserInfoDto; |
| | | import com.ruoyi.mapper.ZfEventMapper; |
| | | import com.ruoyi.mapper.ZfFamilyMapper; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | ZfFamilyService zfFamilyService; |
| | | |
| | | @Override |
| | | public AjaxResult selectDataList(ZfFamily zfFamily, Integer pageNum, Integer pageSize) { |
| | | |
| | | |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | |
| | | lqw.eq(zfFamily.getClanId()!=null,ZfFamily::getClanId,zfFamily.getClanId()); |
| | | lqw.like(zfFamily.getName()!=null,ZfFamily::getName,zfFamily.getName()); |
| | | Page<ZfFamily> zfPropertyPage = new Page<>(pageNum, pageSize); |
| | | Page<ZfFamily> pageResult = page(zfPropertyPage, lqw); |
| | | |
| | | List<ZfFamily> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public ZfFamily getByNameAndUser(ZfFamily zfFamily) { |
| | | LambdaQueryWrapper<ZfFamily> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfFamily::getName,zfFamily.getName()).or().eq(ZfFamily::getFid, zfFamily.getFid()); |