| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Override |
| | | public PaginationData getPhoto(PatchesParam param, String dkbh) { |
| | | LotInfo lotInfo=getLotinfoToDb(dkbh); |
| | | int statue=lotInfo.getIsPush(); |
| | | if (statue==1){ |
| | | Page<MediaFileMarkEntity> page = markMapper.selectPage(new Page<MediaFileMarkEntity>(param.getPage(), param.getPageSize()), |
| | | LotInfo lotInfo = getLotinfoToDb(dkbh); |
| | | int statue = lotInfo.getIsPush(); |
| | | |
| | | if (statue == 1) { |
| | | Page<MediaFileMarkEntity> page = markMapper.selectPage( |
| | | new Page<MediaFileMarkEntity>(param.getPage(), param.getPageSize()), |
| | | new LambdaQueryWrapper<MediaFileMarkEntity>().like(MediaFileMarkEntity::getFileName, "%" + dkbh + "~" + "%")); |
| | | |
| | | Map<String, MediaFileMarkEntity> uniqueFileMap = new LinkedHashMap<>(); |
| | | List<MediaFileMarkEntity> records = page.getRecords() |
| | | .stream() |
| | | .filter(mediaFile -> uniqueFileMap.putIfAbsent(mediaFile.getFileName(), mediaFile) == null) |
| | | .collect(Collectors.toList()); |
| | | return new PaginationData<MediaFileMarkEntity>(records, new Pagination(page));} |
| | | else { |
| | | Page<MediaFileEntity> page = fileMapper.selectPage(new Page<MediaFileEntity>(param.getPage(), param.getPageSize()), |
| | | |
| | | return new PaginationData<MediaFileMarkEntity>(records, new Pagination(page)); |
| | | } else { |
| | | Page<MediaFileEntity> page = fileMapper.selectPage( |
| | | new Page<MediaFileEntity>(param.getPage(), param.getPageSize()), |
| | | new LambdaQueryWrapper<MediaFileEntity>().like(MediaFileEntity::getFileName, "%" + dkbh + "~" + "%")); |
| | | |
| | | Map<String, MediaFileEntity> uniqueFileMap = new LinkedHashMap<>(); |
| | | List<MediaFileEntity> records = page.getRecords() |
| | | .stream() |
| | | .filter(mediaFile -> uniqueFileMap.putIfAbsent(mediaFile.getFileName(), mediaFile) == null) |
| | | .collect(Collectors.toList()); |
| | | return new PaginationData<MediaFileEntity>(records, new Pagination(page));} |
| | | |
| | | return new PaginationData<MediaFileEntity>(records, new Pagination(page)); |
| | | } |
| | | } |
| | | |
| | | |
| | | public List<MediaFileEntity> listPohto(String dkbh, String workspaceId) { |
| | | return fileMapper.selectList(new LambdaQueryWrapper<MediaFileEntity>().like(MediaFileEntity::getFileName, "%" + dkbh + "%") |
| | |
| | | public LotInfo getLotinfoToDb(String dkbh) { |
| | | return mapper.selectOne(new LambdaQueryWrapper<LotInfo>().eq(LotInfo::getDkbh, dkbh)); |
| | | } |
| | | |
| | | public List<LotInfo> getLotInfosByIds(List<Integer> ids) { |
| | | LambdaQueryWrapper<LotInfo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(LotInfo::getId, ids); |
| | | return mapper.selectList(queryWrapper); |
| | | } |
| | | public List<LotInfo> listLotinfo() { |
| | | return mapper.selectList(null); |
| | | } |