|
@@ -18,7 +18,9 @@ package org.springblade.archive.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.archive.entity.ArchivesAuto;
|
|
@@ -62,6 +64,43 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
|
|
|
return page.setRecords(baseMapper.selectArchivesAutoPage(page, archivesAuto));
|
|
|
}
|
|
|
|
|
|
+ @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("请选择年");
|
|
|
+ }
|
|
|
+ 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());
|
|
|
+
|
|
|
+ this.page(page,lqw);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<ArchivesAutoVO> selectArchivesAutoFilePage(ArchivesAutoVO vo) {
|
|
|
Query query = new Query();
|