| | |
| | | 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); |