zqy
2024-06-11 41704e538bd0402b8e8ca826404ba84f6de56fe5
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java
@@ -13,10 +13,7 @@
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ZfPetMapper;
import com.ruoyi.service.ZAuthorityService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfMasterService;
import com.ruoyi.service.ZfPetService;
import com.ruoyi.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +22,7 @@
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -67,6 +65,11 @@
        //要查自己家庭的
        ZInfoUser myself = zInfoUserService.getMyself();
        if(myself==null)
        {
            //   System.out.println("ssssss");
            return AjaxResult.success("您没加入到对应的家庭,请联系管理员");
        }
        Long familyId = myself.getFamilyId();
        //也要查别人授权的
        List<ZAuthority> authority = zAuthorityService.getAuthority();
@@ -98,7 +101,7 @@
                        bean.setOwnData(0);
                    }
                }
        ).collect(Collectors.toList());
        ).sorted((a,b)-> b.getOwnData()-a.getOwnData()).collect(Collectors.toList());
    }
@@ -192,6 +195,9 @@
        }
    }
    @Resource
    ZfLogService zfLogService;
    @Override
    public AjaxResult updateData(ZfPet zfPet) {
        ZInfoUser myself = zInfoUserService.getMyself();
@@ -208,6 +214,13 @@
            throw new RuntimeException("你没有权限操作此家庭的数据");
        }
        //操作后加入日志
        ZfLog zfLog = new ZfLog();
        zfLog.setUpdateTime(LocalDateTime.now());
        zfLog.setModule("魅宠");
        zfLog.setUpdater(zInfoUserService.getMyself().getNickName());
        zfLogService.save(zfLog);
        if(updateById(zfPet)){
            return AjaxResult.success();
        }else {