zqy
2024-11-04 38bf6d26c02f2861abdbe95b8e2a1312e6f30202
删除宠物将对应的备忘本一并删除
3个文件已修改
28 ■■■■■ 已修改文件
zhang-content/src/main/java/com/ruoyi/service/ZfPetNoteService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetNoteServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfPetNoteService.java
@@ -1,6 +1,7 @@
package com.ruoyi.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfPetNote;
@@ -23,6 +24,8 @@
    AjaxResult getAllPetNoteByPetId(Integer pageNum,Integer pageSize,String pid,ZfPetNote zfPetNote);
    List<ZfPetNote> getPetNoteByPetId(String pid);
    AjaxResult mySave(ZfPetNote zfPetNote);
    List<ZfPetNote> selectByIds(Long[] ids);
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetNoteServiceImpl.java
@@ -51,20 +51,30 @@
        return list;
    }
    @Override
    public AjaxResult getAllPetNoteByPetId(Integer pageNum,Integer pageSize,String pid,ZfPetNote zfPetNote) {
        LambdaQueryWrapper<ZfPetNote> lqw = buildCondition(zfPetNote);
        lqw.eq(ZfPetNote::getPid,pid);
        lqw.orderByDesc(ZfPetNote::getCreateTime);
        Page<ZfPetNote> zfPetNotePage = new Page<>(pageNum, pageSize);
        Page<ZfPetNote> pageResult = page(zfPetNotePage, lqw);
        HashMap<String, Object> result = MapUtils.getResult(pageResult);
        return AjaxResult.success(result);
    }
    @Override
    public List<ZfPetNote> getPetNoteByPetId(String pid ) {
        ZfPetNote zfPetNote = new ZfPetNote();
        zfPetNote.setPid(pid);
        LambdaQueryWrapper<ZfPetNote> lqw = buildCondition(zfPetNote);
        lqw.eq(ZfPetNote::getPid,pid);
        lqw.orderByDesc(ZfPetNote::getCreateTime);
        return list(lqw);
    }
    @Override
    public AjaxResult mySave(ZfPetNote zfPetNote) {
        //判断是否有重复数据
zhang-content/src/main/java/com/ruoyi/service/impl/ZfPetServiceImpl.java
@@ -51,10 +51,8 @@
    ZAuthorityService zAuthorityService;
    @Resource
    ZfPetSharService zfPetSharService;
    ZfPetNoteService zfPetNoteService;
    @Resource
    ZfPetDownlService zfPetDownlService;
    @Override
    public AjaxResult selectDataList(ZfPet zfPet, Integer pageNum, Integer pageSize) {
//        LambdaQueryWrapper<ZfPet> lqw = buildCondition(zfPet);
@@ -79,7 +77,7 @@
            fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId();
        Long motherFaId = 0L;
        if(myself.getMomId()!=null)
            motherFaId = zInfoUserService.getInfoById(myself.getMomId()).getFamilyId();
            motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId();
        //也要查别人授权的
        List<ZAuthority> authority = zAuthorityService.getAuthority();
@@ -271,9 +269,8 @@
            if (!familyIdList.contains(data.getFamilyId())){
                throw new RuntimeException("你没有权限操作此家庭的数据");
            }
        }
        if (! (zfPetDownlService.deleteData(ids) && zfPetSharService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
            if (!zfPetNoteService.removeBatchByIds(zfPetNoteService.getPetNoteByPetId(data.getId())))
                return AjaxResult.error();
        }
        if (zfPetService.removeByIds(Arrays.asList(ids))) {