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