| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.Physcial; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZYearInfo; |
| | | import com.ruoyi.mapper.PhyscialMapper; |
| | | import com.ruoyi.service.PhyscialService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class PhyscialServiceImpl extends ServiceImpl<PhyscialMapper, Physcial> implements PhyscialService { |
| | | @Autowired |
| | | PhyscialServiceImpl physcialService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | private LambdaQueryWrapper<Physcial> uniqueCondition(Physcial physcial) { |
| | | LambdaQueryWrapper<Physcial> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(StringUtils.isNotEmpty(physcial.getReport()), Physcial::getReport, physcial.getReport()) |
| | |
| | | .orderByDesc(Physcial::getCreateTime); |
| | | return lqw; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<Physcial> buildConditionSec(Physcial physcial, List<Long> userId) { |
| | | LambdaQueryWrapper<Physcial> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(Physcial::getUid, userId) |
| | | .like(StringUtils.isNotEmpty(physcial.getReport()), Physcial::getReport, physcial.getReport()) |
| | | .between(physcial.getHappenStartTime() != null && physcial.getHappenEndTime() != null, Physcial::getHappenTime, physcial.getHappenStartTime(), physcial.getHappenEndTime()) |
| | | .orderByDesc(Physcial::getCreateTime); |
| | | return lqw; |
| | | } |
| | | /** |
| | | * 分页查找 |
| | | */ |
| | |
| | | public AjaxResult selectDataList(Physcial physcial, Integer pageNum, Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<Physcial> lqw = buildCondition(physcial, userId); |
| | | |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<Physcial> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(physcial, fms); |
| | | else |
| | | lqw = buildCondition(physcial, userId); |
| | | Page<Physcial> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<Physcial> pageResult = page(pageBean, lqw); |
| | | |
| | |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.domain.TravelCount; |
| | | import com.ruoyi.domain.TravelDetail; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZProperty; |
| | | import com.ruoyi.mapper.TravelCountMapper; |
| | | import com.ruoyi.service.TravelCountService; |
| | | import com.ruoyi.service.TravelDetailService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | private TravelCountService travelCountService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Override |
| | | public AjaxResult selectDataList(Long userId, Integer pageNum, Integer pageSize, TravelCount travelCount, String happenStartTime, String happenEndTime) { |
| | | //设置查询条件 |
| | | LambdaQueryWrapper<TravelCount> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(TravelCount::getUid,userId); |
| | | // lqw.eq(TravelCount::getUid,userId); |
| | | if(travelCount!=null){ |
| | | lqw.like(travelCount.getName()!=null,TravelCount::getName,travelCount.getName()); |
| | | lqw.like(travelCount.getDestination()!=null,TravelCount::getDestination,travelCount.getDestination()); |
| | |
| | | } |
| | | lqw.orderByDesc(TravelCount::getCreateTime); |
| | | |
| | | |
| | | System.out.println("--sdfdsf000sfssssssssssssssssss"); |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | // LambdaQueryWrapper<TravelCount> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = lqw.in(TravelCount::getUid, fms); |
| | | else |
| | | lqw.eq(TravelCount::getUid,userId); |
| | | // else |
| | | // lqw = buildCondition(zProperty, userId); |
| | | |
| | | |
| | | Page<TravelCount> resultPage = page(new Page<>(pageNum, pageSize), lqw); |
| | | resultPage.getRecords().forEach(this::inputTotalData); |
| | | return AjaxResult.success(MapUtils.getResult(resultPage)); |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.domain.Physcial; |
| | | import com.ruoyi.domain.ZHealthHabit; |
| | | import com.ruoyi.domain.ZHealthHabit; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.dto.ZHealthHabitDto; |
| | | import com.ruoyi.domain.dto.ZHealthHabitDto; |
| | | import com.ruoyi.domain.health.*; |
| | | import com.ruoyi.mapper.ZHealthHabitMapper; |
| | | import com.ruoyi.service.ZHealthHabitService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class ZHealthHabitServiceImpl extends ServiceImpl<ZHealthHabitMapper, ZHealthHabit> implements ZHealthHabitService { |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Override |
| | | public AjaxResult selectData() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | LambdaQueryWrapper<ZHealthHabit> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZHealthHabit::getUid,userId); |
| | | ZHealthHabit zHealthHabit = getOne(lqw); |
| | | |
| | | if(zHealthHabit==null) |
| | | { |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | for(Long id:fms) |
| | | { |
| | | if(!id.equals(userId)) |
| | | { |
| | | lqw.eq(ZHealthHabit::getUid, id); |
| | | zHealthHabit = getOne(lqw); |
| | | break; |
| | | } |
| | | } |
| | | System.out.println("sdfsdf9990000"); |
| | | } |
| | | //如果是第一次进来,之前没有这个用户的数据,抛异常让用户先插入数据 |
| | | if(zHealthHabit == null){ |
| | | throw new RuntimeException("第一次进来,请先填写好数据"); |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.domain.ZHealthHabit; |
| | | import com.ruoyi.domain.ZHealthNote; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.mapper.ZHealthNoteMapper; |
| | | import com.ruoyi.service.ZHealthNoteService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | |
| | | **/ |
| | | @Service |
| | | public class ZHealthNoteServiceImpl extends ServiceImpl<ZHealthNoteMapper, ZHealthNote> implements ZHealthNoteService { |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Override |
| | | public AjaxResult listAll() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | LambdaQueryWrapper<ZHealthNote> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZHealthNote::getUid,userId); |
| | | ZHealthNote result = getOne(lqw); |
| | | if(result==null) |
| | | { |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | System.out.println("sdfsdf999000550"); |
| | | |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | for(Long id:fms) |
| | | { |
| | | if(!id.equals(userId)) |
| | | { |
| | | lqw.eq(ZHealthNote::getUid, id); |
| | | result = getOne(lqw); |
| | | break; |
| | | } |
| | | } |
| | | System.out.println("sdfsdf9990000"); |
| | | } |
| | | if(result == null){ |
| | | throw new RuntimeException("请先填写好生活习惯数据!"); |
| | | } |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZHonor; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZSecret; |
| | | import com.ruoyi.mapper.ZHonorMapper; |
| | | import com.ruoyi.service.ZHonorService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | ZHonorServiceImpl zHonorService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | ZHonorMapper zHonorMapper; |
| | | |
| | |
| | | .orderByDesc(ZHonor::getCreateTime); |
| | | return lqw; |
| | | } |
| | | private LambdaQueryWrapper<ZHonor> buildConditionSec(ZHonor zHonor,List<Long> userIds){ |
| | | LambdaQueryWrapper<ZHonor> lqw = new LambdaQueryWrapper<>(); |
| | | |
| | | lqw.in(ZHonor::getUserId, userIds) |
| | | .eq(StringUtils.isNotEmpty(zHonor.getName()),ZHonor::getName,zHonor.getName()) |
| | | .like(zHonor.getType()!=null,ZHonor::getType,zHonor.getType()) |
| | | .like(StringUtils.isNotEmpty(zHonor.getIdNo()),ZHonor::getIdNo,zHonor.getIdNo()) |
| | | .like(StringUtils.isNotEmpty(zHonor.getGrade()),ZHonor::getGrade,zHonor.getGrade()) |
| | | .like(StringUtils.isNotEmpty(zHonor.getLocation()),ZHonor::getLocation,zHonor.getLocation()) |
| | | .like(StringUtils.isNotEmpty(zHonor.getRemark()),ZHonor::getRemark,zHonor.getRemark()) |
| | | .orderByDesc(ZHonor::getCreateTime); |
| | | return lqw; |
| | | } |
| | | /** |
| | | * 分页查找 |
| | | */ |
| | |
| | | public AjaxResult selectDataList(ZHonor zHonor,Integer pageNum,Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZHonor> lqw = buildCondition(zHonor, userId); |
| | | |
| | | |
| | | |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZHonor> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(zHonor, fms); |
| | | else |
| | | lqw = buildCondition(zHonor, userId); |
| | | |
| | | // LambdaQueryWrapper<ZHonor> lqw = buildCondition(zHonor, userId); |
| | | |
| | | Page<ZHonor> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<ZHonor> pageResult = page(pageBean, lqw); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZHonor; |
| | | import com.ruoyi.domain.ZIdea; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.mapper.ZIdeaMapper; |
| | | import com.ruoyi.service.ZIdeaService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | ZIdeaServiceImpl zIdeaService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | private LambdaQueryWrapper<ZIdea> uniqueCondition(ZIdea zIdea) { |
| | | LambdaQueryWrapper<ZIdea> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(StringUtils.isNotEmpty(zIdea.getTitle()), ZIdea::getTitle, zIdea.getTitle()) |
| | |
| | | .orderByDesc(ZIdea::getCreateTime); |
| | | return lqw; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<ZIdea> buildConditionSec(ZIdea zIdea, List<Long> userIds){ |
| | | LambdaQueryWrapper<ZIdea> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ZIdea::getUid, userIds) |
| | | .like(StringUtils.isNotEmpty(zIdea.getTitle()), ZIdea::getTitle, zIdea.getTitle()) |
| | | .like(StringUtils.isNotEmpty(zIdea.getBeneficiary()), ZIdea::getBeneficiary, zIdea.getBeneficiary()) |
| | | .like(StringUtils.isNotEmpty(zIdea.getHeir()), ZIdea::getHeir, zIdea.getHeir()) |
| | | .like(StringUtils.isNotEmpty(zIdea.getDifficulty()), ZIdea::getDifficulty, zIdea.getDifficulty()) |
| | | .like(StringUtils.isNotEmpty(zIdea.getCause()), ZIdea::getCause, zIdea.getCause()) |
| | | .like(zIdea.getIsEffective()!=null, ZIdea::getIsEffective, zIdea.getIsEffective()) |
| | | .between(zIdea.getHappenStartTime() != null && zIdea.getHappenEndTime() != null, ZIdea::getHappenTime, zIdea.getHappenStartTime(), zIdea.getHappenEndTime()) |
| | | .orderByDesc(ZIdea::getCreateTime); |
| | | return lqw; |
| | | } |
| | | /** |
| | | * 分页查找 |
| | | */ |
| | |
| | | public AjaxResult selectDataList(ZIdea zIdea, Integer pageNum, Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZIdea> lqw = buildCondition(zIdea, userId); |
| | | |
| | | // LambdaQueryWrapper<ZIdea> lqw = buildCondition(zIdea, userId); |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZIdea> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(zIdea, fms); |
| | | else |
| | | lqw = buildCondition(zIdea, userId); |
| | | Page<ZIdea> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<ZIdea> pageResult = page(pageBean, lqw); |
| | | |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZHonor; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZProperty; |
| | | import com.ruoyi.mapper.ZPropertyMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZPropertyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | ZPropertyServiceImpl zPropertyService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | ZPropertyMapper zPropertyMapper; |
| | | |
| | |
| | | .orderByDesc(ZProperty::getCreateTime); |
| | | return lqw; |
| | | } |
| | | private LambdaQueryWrapper<ZProperty> buildConditionSec(ZProperty zProperty, List<Long> userId) { |
| | | LambdaQueryWrapper<ZProperty> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ZProperty::getUserId, userId) |
| | | .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getIncomeName()), ZProperty::getIncomeName, zProperty.getIncomeName()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getType()), ZProperty::getType, zProperty.getType()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getIsChange()),ZProperty::getIsChange,zProperty.getIsChange()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getRemark()), ZProperty::getRemark, zProperty.getRemark()) |
| | | .like(StringUtils.isNotEmpty(zProperty.getTimeLimit()),ZProperty::getTimeLimit,zProperty.getTimeLimit()) |
| | | .eq(zProperty.getStatus()!=null,ZProperty::getStatus,zProperty.getStatus()) |
| | | .between(zProperty.getHappenStartTime() != null && zProperty.getHappenEndTime() != null, ZProperty::getHappenTime, zProperty.getHappenStartTime(), zProperty.getHappenEndTime()) |
| | | .orderByDesc(ZProperty::getCreateTime); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * 分页查找 |
| | |
| | | public AjaxResult selectDataList(ZProperty zProperty, Integer pageNum, Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZProperty> lqw = buildCondition(zProperty, userId); |
| | | |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZProperty> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(zProperty, fms); |
| | | else |
| | | lqw = buildCondition(zProperty, userId); |
| | | |
| | | Page<ZProperty> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<ZProperty> pageResult = page(pageBean, lqw); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZSecret; |
| | | import com.ruoyi.domain.ZfEvent; |
| | | import com.ruoyi.mapper.ZSecretMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZSecretService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | ZSecretServiceImpl zSecretService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | ZSecretMapper zSecretMapper; |
| | | |
| | |
| | | .orderByDesc(ZSecret::getCreateTime); |
| | | return lqw; |
| | | } |
| | | private LambdaQueryWrapper<ZSecret> buildConditionSec(ZSecret zSecret, List<Long> userIds) { |
| | | LambdaQueryWrapper<ZSecret> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.eq(userId != null, ZSecret::getUserId, userId) |
| | | |
| | | lqw.in(ZSecret::getUserId,userIds) |
| | | |
| | | .like(StringUtils.isNotEmpty(zSecret.getType()), ZSecret::getType, zSecret.getType()) |
| | | .like(StringUtils.isNotEmpty(zSecret.getAccNo()), ZSecret::getAccNo, zSecret.getAccNo()) |
| | | .like(StringUtils.isNotEmpty(zSecret.getRemark()), ZSecret::getRemark, zSecret.getRemark()) |
| | | .like(StringUtils.isNotEmpty(zSecret.getLocation()), ZSecret::getLocation, zSecret.getLocation()) |
| | | .eq(zSecret.getIsFinger()!=null,ZSecret::getIsFinger,zSecret.getIsFinger()) |
| | | .eq(zSecret.getIsPrivate()!=null,ZSecret::getIsPrivate,zSecret.getIsPrivate()) |
| | | .le(zSecret.getValidityDate()!=null, ZSecret::getValidityDate, zSecret.getValidityDate()) |
| | | .eq(zSecret.getIsFace()!=null,ZSecret::getIsFace,zSecret.getIsFace()) |
| | | .between(zSecret.getHappenStartTime() != null && zSecret.getHappenEndTime() != null, ZSecret::getHappenTime, zSecret.getHappenStartTime(), zSecret.getHappenEndTime()) |
| | | .orderByDesc(ZSecret::getCreateTime); |
| | | return lqw; |
| | | } |
| | | /** |
| | | * 分页查找 |
| | | */ |
| | |
| | | public AjaxResult selectDataList(ZSecret zSecret, Integer pageNum, Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZSecret> lqw = buildCondition(zSecret, userId); |
| | | |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZSecret> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(zSecret, fms); |
| | | else |
| | | lqw = buildCondition(zSecret, userId); |
| | | |
| | | |
| | | |
| | | |
| | | Page<ZSecret> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<ZSecret> pageResult = page(pageBean, lqw); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZProperty; |
| | | import com.ruoyi.domain.ZYearInfo; |
| | | import com.ruoyi.mapper.ZYearInfoMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZYearInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Autowired |
| | | ZYearInfoServiceImpl zYearInfoService; |
| | | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | ZYearInfoMapper zYearInfoMapper; |
| | | |
| | |
| | | .orderByDesc(ZYearInfo::getCreateTime); |
| | | return lqw; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<ZYearInfo> buildConditionSec(ZYearInfo zYearInfo, List<Long> userId) { |
| | | LambdaQueryWrapper<ZYearInfo> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ZYearInfo::getUid, userId) |
| | | .like(StringUtils.isNotEmpty(zYearInfo.getType()), ZYearInfo::getType, zYearInfo.getType()) |
| | | .like(StringUtils.isNotEmpty(zYearInfo.getHospital()), ZYearInfo::getHospital, zYearInfo.getHospital()) |
| | | .like(StringUtils.isNotEmpty(zYearInfo.getTitle()), ZYearInfo::getTitle, zYearInfo.getTitle()) |
| | | .like(StringUtils.isNotEmpty(zYearInfo.getNotice()),ZYearInfo::getNotice,zYearInfo.getNotice()) |
| | | .like(StringUtils.isNotEmpty(zYearInfo.getRemark()),ZYearInfo::getRemark,zYearInfo.getRemark()) |
| | | .between(zYearInfo.getHappenStartTime() != null && zYearInfo.getHappenEndTime() != null, ZYearInfo::getCheckTime, zYearInfo.getHappenStartTime(), zYearInfo.getHappenEndTime()) |
| | | .orderByDesc(ZYearInfo::getCreateTime); |
| | | return lqw; |
| | | } |
| | | /** |
| | | * 分页查找 |
| | | */ |
| | |
| | | public AjaxResult selectDataList(ZYearInfo zYearInfo, Integer pageNum, Integer pageSize) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZYearInfo> lqw = buildCondition(zYearInfo, userId); |
| | | |
| | | // LambdaQueryWrapper<ZYearInfo> lqw = buildCondition(zYearInfo, userId); |
| | | //根据userId查询到infouser的uaid |
| | | ZInfoUser zInfoUser = zInfoUserService.getInfoBysysId(userId); |
| | | //拿到所有的sysid |
| | | List<Long> fms = zInfoUserService.findByUaidToFaid(zInfoUser.getUaid()).stream().map(ZInfoUser::getSysId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<ZYearInfo> lqw; |
| | | if(!fms.isEmpty()) |
| | | lqw = buildConditionSec(zYearInfo, fms); |
| | | else |
| | | lqw = buildCondition(zYearInfo, userId); |
| | | Page<ZYearInfo> pageBean = new Page<>(pageNum, pageSize); |
| | | Page<ZYearInfo> pageResult = page(pageBean, lqw); |
| | | |