From 92dd324e32c231059321d43f2a4670a69abf3a33 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 25 Nov 2021 17:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcPartyActivityServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index c4121d354a..222a839148 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.IcPartyActivityDao; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; @@ -42,6 +43,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -60,6 +62,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); @@ -85,6 +95,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl list(PartyActivityFormDTO formDTO) { + if (null == formDTO.getStartTime()) { + Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setStartTime(startDate); + } + if (null == formDTO.getEndTime()) { + Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN); + formDTO.setEndTime(endDate); + } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId());