zqy
2025-01-07 8ff279e89f7736c345f343b2b7f292786d5ffffe
zhang-content/src/main/java/com/ruoyi/service/impl/ZfShareDataServiceImpl.java
@@ -76,15 +76,15 @@
    }
//    public Long getSource(Long userId){
//        LambdaQueryWrapper<ZfShareData> lqw = new LambdaQueryWrapper<>();
//        lqw.orderByDesc(ZfShareData::getId);
//        lqw.eq(ZfShareData::getSharedId,userId);
//        if (list(lqw).size() == 0){
//            return userId;
//        }
//        return getSource(userId);
//    }
    public Long getSource(Long userId){
        LambdaQueryWrapper<ZfShareData> lqw = new LambdaQueryWrapper<>();
        lqw.orderByDesc(ZfShareData::getId);
        lqw.eq(ZfShareData::getSharedId,userId);
        if (list(lqw).size() == 0){
            return userId;
        }
        return getSource(list(lqw).get(0).getUserId().longValue());
    }
    @Override
    public AjaxResult addData(Long[] userIds) {
@@ -130,9 +130,9 @@
    }
    @Override
    public AjaxResult setAdmin(Long id) {
        List<ZfShareData> list = list(buildCondition(getUserId()));
        list.addAll(getShareId(getUserId()));
    public AjaxResult setAdmin(Long userId,Long id) {
        List<ZfShareData> list = list(buildCondition(getSource(userId)));
        list.addAll(getShareId(userId));
        for (ZfShareData zfShareData1:list){
            zfShareData1.setMasterAccount(id.intValue());
            updateById(zfShareData1);
@@ -142,7 +142,7 @@
    @Override
    public AjaxResult allUser(Long id) {
        List<ZfShareData> list = list(buildCondition(id));
        List<ZfShareData> list = list(buildCondition(getSource(id)));
        list.addAll(getShareId(id));
        for (ZfShareData zfShareData1:list){
            zfShareData1.setMasterAccount(0);