| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if(myself==null) |
| | | { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | bean.setOwnData(0); |
| | | } |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | ).sorted((a,b)-> b.getOwnData()-a.getOwnData()).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | ZfLogService zfLogService; |
| | | |
| | | @Override |
| | | public AjaxResult updateData(ZfPet zfPet) { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | |
| | | if (dataFamilyId!=null && !familyIdList.contains(dataFamilyId)) { |
| | | 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(); |
| | |
| | | LambdaQueryWrapper<ZfPet> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfPet::getCreateTime); |
| | | lqw.in(ZfPet::getFamilyId,familyIdList); |
| | | lqw.eq(zfPet.getId()!=null,ZfPet::getId,zfPet.getId()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getIdNum()),ZfPet::getIdNum,zfPet.getIdNum()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getSecurityCode()),ZfPet::getSecurityCode,zfPet.getSecurityCode()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getType()),ZfPet::getType,zfPet.getType()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getName()),ZfPet::getName,zfPet.getName()); |
| | | lqw.like(zfPet.getBirth()!=null,ZfPet::getBirth,zfPet.getBirth()); |
| | | // lqw.like(zfPet.getBirth()!=null,ZfPet::getBirth,zfPet.getBirth()); |
| | | lqw.between(zfPet.getBirthStart()!=null && zfPet.getBirthEnd()!=null,ZfPet::getBirth,zfPet.getBirthStart(),zfPet.getBirthEnd()); |
| | | lqw.like(zfPet.getSex()!=null,ZfPet::getSex,zfPet.getSex()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getColor()),ZfPet::getColor,zfPet.getColor()); |
| | | lqw.like(StringUtils.isNotEmpty(zfPet.getProperties()),ZfPet::getProperties,zfPet.getProperties()); |