zoujiajian 3 tahun lalu
induk
melakukan
3f59d78666

+ 0 - 10
netflix-dao/src/main/java/com/cyksj/model/views/BackgroundDataView.java

@@ -45,16 +45,6 @@ public class BackgroundDataView {
 	 */
 	private Integer totalExpiredAccountNum;
 
-	/**
-	 * 到期子账号总数
-	 */
-	private Integer totalNumOfExpiredSubAccount;
-
-	/**
-	 * 近5天将要到期的主账号列表
-	 */
-	private List<Account> willExpireAccountList;
-
 	/**
 	 * 已到期主账号列表
 	 */

+ 0 - 4
netflix-service/src/main/java/com/cyksj/service/mange/statistics/impl/StatisticsDataServiceImpl.java

@@ -159,23 +159,19 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		if (accountHead != null) {
 			BackgroundDataView dataView = (BackgroundDataView) accountHead;
 			backgroundDataView.setTotalNumOfWillExpireAccount(dataView.getTotalNumOfWillExpireAccount());
-			backgroundDataView.setWillExpireAccountList(dataView.getWillExpireAccountList());
 			backgroundDataView.setTotalExpiredAccountNum(dataView.getTotalExpiredAccountNum());
 			backgroundDataView.setExpiredAccountList(dataView.getExpiredAccountList());
-			backgroundDataView.setTotalNumOfExpiredSubAccount(dataView.getTotalNumOfExpiredSubAccount());
 		} else {
 			DateTime fiveDays = DateUtil.offsetDay(zero, 5);
 			//5天后将到期的主账号
 			List<Account> willExpireAccounts = Optional.ofNullable(accountService.list(Wrappers.lambdaQuery(Account.class).gt(Account::getExpiryTime, zero).le(Account::getExpiryTime, fiveDays))).orElse(new ArrayList<>());
 			backgroundDataView.setTotalNumOfWillExpireAccount(willExpireAccounts.size());
-			backgroundDataView.setWillExpireAccountList(willExpireAccounts);
 			//已到期主账号
 			List<Account> expiredAccounts = Optional.ofNullable(accountService.list(Wrappers.lambdaQuery(Account.class).le(Account::getExpiryTime, now))).orElse(new ArrayList<>());
 			backgroundDataView.setTotalExpiredAccountNum(expiredAccounts.size());
 			backgroundDataView.setExpiredAccountList(expiredAccounts);
 			//已到期子账号
 			List<GroupsRelation> expiredSubAccounts = Optional.ofNullable(groupsRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class).le(GroupsRelation::getExpiryTime, now))).orElse(new ArrayList<>());
-			backgroundDataView.setTotalNumOfExpiredSubAccount(expiredSubAccounts.size());
 			redisService.set(RedisService.key.CACHE_HEAR_DATA_KEY.getNameFormat(zero.toString()), backgroundDataView, RedisService.key.CACHE_HEAR_DATA_KEY.getTimeout());
 		}
 	}

+ 10 - 5
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -2,6 +2,7 @@ package com.cyksj.web.controller.manage.account;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
@@ -15,13 +16,14 @@ import com.cyksj.model.manage.views.AccountView;
 import com.cyksj.service.mange.CmsAccountService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
+import com.ejlchina.searcher.param.Operator;
+import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.Optional;
 
 /**
  * @author chan
@@ -44,10 +46,13 @@ public class CmsAccountController {
     private final GroupsMapper groupsMapper;
 
     @GetMapping("/get")
-    public Result<SearchResult<AccountView>> get(String account ,String expiryTime){
-        SearchResult<AccountView> search = beanSearcher.search(AccountView.class, MapUtils.flatBuilder(request.getParameterMap())
-                .build()
-        );
+    public Result<SearchResult<AccountView>> get(String account, String expiryStartTime, String expiryEndTime) {
+        MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
+        if (StrUtil.isNotEmpty(expiryStartTime) || StrUtil.isNotEmpty(expiryEndTime)) {
+            mapBuilder.field(AccountView::getExpiryTime, expiryStartTime, expiryEndTime)
+                    .op(Operator.Between);
+        }
+        SearchResult<AccountView> search = beanSearcher.search(AccountView.class, mapBuilder.build());
         search.getDataList().forEach((accountView)->{
             Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "uninvited"));
             GroupsTrips groupsTrips = groupsMapper.selectOne(Wrappers.lambdaQuery(GroupsTrips.class).eq(GroupsTrips::getAccountId, accountView.getId()).last(" limit 1"));