| | |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import com.ruoyi.common.core.domain.entity.sysUserInfo; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.domain.sysUserAndUserInfo; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | private ZfFamilyService zfFamilyService; |
| | | |
| | | @Resource |
| | | private ZfAncestorService zfAncestorService; |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | |
| | | // if(zfFamily!=null&&zfFamily.getMid()!=null) |
| | | // infoUser.setMomId(zfFamily.getMid()); |
| | | |
| | | |
| | | if (!zInfoUserService.getById(user.getUserId()).getFatherId().equals(user.getFid())){ |
| | | if (user.getFid() != null){ |
| | | ZInfoUser father = zInfoUserService.getById(user.getFid()); |
| | | if (father.getIsMyFamily() == 1) |
| | | System.out.println("11111111111111111111111111111111/"); |
| | | infoUser.setFamilyId(father.getFamilyId()); |
| | | } |
| | | } |
| | | if (!zInfoUserService.getById(user.getUserId()).getFatherId().equals(user.getFid())){ |
| | | ZInfoUser father = zInfoUserService.getById(user.getFid()); |
| | | System.out.println("11111111111111111111111111111111/"); |
| | | infoUser.setFamilyId(father.getFamilyId()); |
| | | infoUser.setClanId(father.getClanId()); |
| | | |
| | | }} |
| | | // else if(user.getMid() != null){ |
| | | // ZInfoUser mother = zInfoUserService.getById(user.getMid()); |
| | | // if (mother.getIsMyFamily() == 1) |
| | | // System.out.println("2222222222222222222222222222222222/"); |
| | | // infoUser.setFamilyId(mother.getFamilyId()); |
| | | // } |
| | | if (user.getSpouseId() != null){ |
| | | if ( !zInfoUserService.getById(user.getUserId()).getSpouseId().equals(user.getSpouseId())){ |
| | | if (zInfoUserService.getById(user.getUserId()).getIsMyFamily() == 0) { |
| | | ZInfoUser spouse = zInfoUserService.getById(user.getSpouseId()); |
| | | System.out.println("33333333333333333333333333333333333333333/"); |
| | | infoUser.setFamilyId(spouse.getFamilyId()); |
| | | infoUser.setSpouseId(user.getSpouseId()); |
| | | infoUser.setClanId(spouse.getClanId()); |
| | | } |
| | | } |
| | | }} |
| | | |
| | | zInfoUserService.saveOrUpdate(infoUser); |
| | | if(user.getSpouseId()!=null) { |
| | |
| | | zu.setSpouseId(infoUser.getUserId()); |
| | | zInfoUserService.updateById(zu); |
| | | } |
| | | |
| | | // zInfoUserService.update(infoUser); |
| | | // .saveOrUpdate(infoUser); |
| | | return AjaxResult.success(); |
| | |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | userService.insertUser(user); |
| | | //写入到 新建立的信息表里面 |
| | | // |
| | | |
| | | |
| | | // ZfFamily zfFamily = zfFamilyService.getByFamId(userAll.getFamilyId()); |
| | | ZInfoUser infoUser = new ZInfoUser(); |
| | | infoUser.setSysId(user.getUserId()); |
| | |
| | | if (userAll.getFid() != null && userAll.getMid() != null){ |
| | | ZInfoUser father = zInfoUserService.getById(userAll.getFid()); |
| | | ZInfoUser mother = zInfoUserService.getById(userAll.getMid()); |
| | | if (father.getIsMyFamily() == 1) |
| | | if (father.getIsMyFamily() == 1){ |
| | | infoUser.setFamilyId(father.getFamilyId()); |
| | | else if (mother.getIsMyFamily() == 1) |
| | | infoUser.setClanId(father.getClanId());} |
| | | else if (mother.getIsMyFamily() == 1){ |
| | | infoUser.setFamilyId(mother.getFamilyId()); |
| | | infoUser.setClanId(mother.getClanId()); |
| | | |
| | | } |
| | | } |
| | | else { |
| | | ZInfoUser spouse = zInfoUserService.getById(userAll.getSpouseId()); |
| | | infoUser.setFamilyId(spouse.getFamilyId()); |
| | | infoUser.setClanId(spouse.getClanId()); |
| | | } |
| | | |
| | | //前端保证了角色不为空 |