| | |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import com.ruoyi.service.ZfRoleService; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.websocket.server.PathParam; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZfRoleService zfRoleService; |
| | | |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | // @GetMapping("/all") |
| | | // public AjaxResult listAll(ZInfoUser zInfoUser){ |
| | |
| | | // return zInfoUserService.empower(empowerDto); |
| | | // } |
| | | /** |
| | | * 根据用户id判断是否是子孙 |
| | | * 根据用户id判断是否是子孙(uid:辈分高的id,tpfid:辈分低的id) |
| | | */ |
| | | @GetMapping("/uidAndUJd/{uid}/{tpfid}") |
| | | public AjaxResult findByUidAndUid(@PathVariable("uid") Long uid,@PathVariable("tpfid") Long tpfid) |
| | |
| | | return AjaxResult.success(zInfoUserService.findByuid(uid, tpfid)); |
| | | } |
| | | /** |
| | | * 根据用户id判断是否是异性 |
| | | */ |
| | | |
| | | @GetMapping("/sex/{uid}/{tpfid}") |
| | | public AjaxResult findBySex(@PathVariable("uid") Long uid,@PathVariable("tpfid") Long tpfid) |
| | | { |
| | | Integer sex = zInfoUserService.getInfoById(tpfid).getSex(); |
| | | //sex == 0 -> 男 |
| | | if (sex == 1){ |
| | | sex = 0; |
| | | } |
| | | else if (sex == 0){ |
| | | sex = 1; |
| | | } |
| | | List<ZInfoUser> zInfoUsers = zInfoUserService.getDataBySex(sex); |
| | | List<String> nickName = new ArrayList<>(); |
| | | for (ZInfoUser zInfoUser:zInfoUsers) { |
| | | if (!zInfoUserService.findByuid(uid, tpfid)){ |
| | | nickName.add(zInfoUser.getNickName()); |
| | | } |
| | | } |
| | | return AjaxResult.success(nickName); |
| | | } |
| | | /** |
| | | * 家根网 |
| | | */ |
| | | @GetMapping("/root") |