zqy
3 天以前 3eb37463a952fb69d586769ca660886b956cb016
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java
@@ -75,6 +75,35 @@
    /**
     *  根据用户的id查询另外一个家族的全部成员信息
     *
     */
    @GetMapping("/getAnotherFamInfo/{userId}")
    public  AjaxResult getAnotherFamInfo(@PathVariable("userId") Long userId)
    {
        ZInfoUser zInfoUser = new ZInfoUser();
        zInfoUser.setSysId(userId);
        System.out.println(userId);
        List<ZInfoUser> zInfoUsers = zInfoUserService.selectByCondition(zInfoUser);
        if(!zInfoUsers.isEmpty())
        {
            ZInfoUser zi = new ZInfoUser();
            zi.setUaid(zInfoUsers.get(0).getUaid());
            zi.setSysId(userId);
            ZInfoUser zss = zInfoUserService.selectByUaidAndUid(zi);
            return zInfoUserService.listAllFamilyPeople(zss.getClanId());
        //    return AjaxResult.success("查询成功",zss);
        }
        else
        {
            return AjaxResult.success("没有另外的家族信息", null);
        }
    }
    /**
     * 导出个人详细信息记录列表
     */
//    @PreAuthorize("@ss.hasPermi('system:property:export')")
@@ -129,6 +158,7 @@
        ZInfoUser zInfoUser = zInfoUserService.getInfoById(userId);
        if(zInfoUser!=null)
        {
            zInfoUser.setUpdateTime(zInfoUser.getUpdateTime()==null?zInfoUser.getCreateTime():zInfoUser.getUpdateTime());
            return AjaxResult.success(zInfoUser);
        }
        else
@@ -142,7 +172,10 @@
        //查询sys_user表
        //  SysUser sysUser = sysUserService.selectUserById(userId);
        return AjaxResult.success(zInfoUserService.getInfoById(userId));
        ZInfoUser infoById = zInfoUserService.getInfoById(userId);
        if (infoById != null) infoById.setUpdateTime(infoById.getUpdateTime()==null?infoById.getCreateTime():infoById.getUpdateTime());
        return AjaxResult.success(infoById);
    }
//
@@ -176,6 +209,7 @@
//        if (!Pattern.matches("^[\\d]+(?:,[\\d]+)*$",zInfoUser.getFamilyId())) {
//            throw new RuntimeException("请输入只有数字和英文逗号的字符串,且数字和逗号必须交替出现");
//        }
        Date currentDate = new Date();
        SysUser user = SecurityUtils.getLoginUser().getUser();
        Long userId = user.getUserId();
        zInfoUser.setSysId(userId);
@@ -192,11 +226,15 @@
        user.setSex(zInfoUser.getSex()+"");
        user.setUserName(zInfoUser.getOldName());
        user.setPhonenumber(zInfoUser.getPhoneNumber());
        user.setEmail(zInfoUser.getEmail());
        user.setUpdateTime(zInfoUser.getUpdateTime()!=null?zInfoUser.getUpdateTime():currentDate);
        String oriUaid = zInfoUser.getUaid();
        String originalString = zInfoUser.getOldName()+"-"+zInfoUser.getPhoneNumber();
        String uniqueId = UUID.nameUUIDFromBytes(originalString.getBytes()).toString();
        zInfoUser.setUaid(uniqueId);
//
//        us.setUserId(user.getSysId());
@@ -243,7 +281,7 @@
            return toAjax(zInfoUserService.updateBatchById(list));
        }
        else
        // uw.eq(ZInfoUser::getSysId,userId).set(ZInfoUser::getSelfIntroduction,zInfoUser.getSelfIntroduction());
            // uw.eq(ZInfoUser::getSysId,userId).set(ZInfoUser::getSelfIntroduction,zInfoUser.getSelfIntroduction());
            return toAjax(zInfoUserService.saveOrUpdate(zInfoUser));
        //    saveOrUpdate(zInfoUser));
    }
@@ -356,7 +394,7 @@
        List<HashMap<Long,String>> satisfyIds = new ArrayList<>();
        HashMap<Long,String> bs = new HashMap<>();
        for (ZInfoUser zInfoUser:zInfoUsers) {
                bs.put(zInfoUser.getUserId(),zInfoUser.getNickName());
            bs.put(zInfoUser.getUserId(),zInfoUser.getNickName());
        }
        satisfyIds.add(bs);
        return AjaxResult.success(satisfyIds);
@@ -486,4 +524,4 @@
        return zInfoUserService.findUserNameAClan(strings1);
    }
}
}