|
@@ -69,64 +69,23 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
|
|
|
@Override
|
|
|
public IPage<ArchivesAuto> pageByArchivesAuto(ArchivesAutoVO vo) {
|
|
|
- IPage<ArchivesAuto> page = new Page<>(vo.getCurrent(),vo.getSize());
|
|
|
- LambdaQueryWrapper<ArchivesAuto> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(ArchivesAuto::getProjectId,vo.getProjectId());
|
|
|
- //过滤日期
|
|
|
- if (StringUtils.isNotBlank(vo.getYear())){
|
|
|
- if (StringUtils.isNotBlank(vo.getMonth())){
|
|
|
- int day;
|
|
|
- if (Arrays.asList("1,3,5,7,8,10,12".split(",")).contains(vo.getMonth())){
|
|
|
- day = 31;
|
|
|
- }else if (Arrays.asList("1,3,5,7,8,10,12".split(",")).contains(vo.getMonth())){
|
|
|
- day = 30;
|
|
|
- }else {
|
|
|
- if (Integer.parseInt(vo.getYear()) % 4 == 0){
|
|
|
- day = 29;
|
|
|
- }else {
|
|
|
- day = 28;
|
|
|
- }
|
|
|
- }
|
|
|
- lqw.ge(ArchivesAuto::getStartDate,LocalDateTime.of(Integer.parseInt(vo.getYear()), Integer.parseInt(vo.getMonth()), 1, 0, 0, 0));
|
|
|
- lqw.le(ArchivesAuto::getEndDate,LocalDateTime.of(Integer.parseInt(vo.getYear()), Integer.parseInt(vo.getMonth()), day, 0, 0, 0));
|
|
|
- }else {
|
|
|
- lqw.ge(ArchivesAuto::getStartDate,LocalDateTime.of(Integer.parseInt(vo.getYear()), 1, 1, 0, 0, 0));
|
|
|
- lqw.ge(ArchivesAuto::getEndDate,LocalDateTime.of(Integer.parseInt(vo.getYear()), 12, 31, 0, 0, 0));
|
|
|
- }
|
|
|
- }else if (StringUtils.isNotBlank(vo.getMonth())){
|
|
|
- throw new RuntimeException("请选择年");
|
|
|
+ IPage<ArchivesAuto> page = new Page<>();
|
|
|
+ if (StringUtils.isNotBlank(vo.getStorageTime())) {
|
|
|
+ vo.setStorageTimes(Arrays.asList(vo.getStorageTime().split(",")));
|
|
|
}
|
|
|
- lqw.eq(StringUtils.isNotBlank(vo.getStorageTime()),ArchivesAuto::getStorageTime,vo.getStorageTime())
|
|
|
- .eq(StringUtils.isNotBlank(vo.getSecretLevel()),ArchivesAuto::getSecretLevel,vo.getSecretLevel())
|
|
|
- .eq(StringUtils.isNotBlank(vo.getCarrierType()),ArchivesAuto::getCarrierType,vo.getCarrierType());
|
|
|
- //按案卷搜索完成,判断是否按文件搜索
|
|
|
- if (vo.getSearchType() == 1){
|
|
|
- lqw.like(StringUtils.isNotBlank(vo.getQueryValue()),ArchivesAuto::getName,vo.getQueryValue());
|
|
|
- this.page(page,lqw);
|
|
|
- return page;
|
|
|
- }else {
|
|
|
- List<ArchivesAuto> list = this.list(lqw);
|
|
|
- list = list.stream().filter(auto -> {
|
|
|
- List<ArchiveFile> files = archiveFileClient.getArchiveFileByArchivesId(auto.getId() + "", "");
|
|
|
- if (files != null && files.size() > 0){
|
|
|
- files = files.stream().filter(file->file.getFileName().contains(vo.getQueryValue())).collect(Collectors.toList());
|
|
|
- }
|
|
|
- if (files != null && files.size() > 0){
|
|
|
- return true;
|
|
|
- }else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }).collect(Collectors.toList());
|
|
|
- if (list != null && list.size() > 0){
|
|
|
- List<Long> ids = list.stream().map(l -> l.getId()).collect(Collectors.toList());
|
|
|
- this.page(page,new LambdaQueryWrapper<ArchivesAuto>().in(ArchivesAuto::getId,ids));
|
|
|
- return page;
|
|
|
- }else {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
+ if (StringUtils.isNotBlank(vo.getSecretLevel())){
|
|
|
+ vo.setSecretLevels(Arrays.asList(vo.getSecretLevel().split(",")));
|
|
|
}
|
|
|
-
|
|
|
+ if (StringUtils.isNotBlank(vo.getCarrierType())) {
|
|
|
+ vo.setCarrierTypes(Arrays.asList(vo.getCarrierType().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getYear())) {
|
|
|
+ vo.setYears(Arrays.asList(vo.getYear().split(",")));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(vo.getMonth())) {
|
|
|
+ vo.setMonths(Arrays.asList(vo.getMonth().split(",")));
|
|
|
+ }
|
|
|
+ return page.setRecords(baseMapper.pageByArchivesAuto(page,vo));
|
|
|
}
|
|
|
|
|
|
@Override
|