Jelajahi Sumber

fix 代码错误

zoujiajian 3 tahun lalu
induk
melakukan
e7b7a42194

+ 3 - 3
netflix-service/src/main/java/com/cyksj/task/StatisticsDataScheduler.java

@@ -108,9 +108,9 @@ public class StatisticsDataScheduler {
 
 		statisticsUserData.setNumOfDistributeUser(statisticsUserDataMapper.getNumOfDistributeUserToday(yesZeroDate, thisZeroDate));
 
-		Integer numOfCorpUser = corpUserAuthMapper.selectCount(Wrappers.lambdaQuery(CorpUserAuth.class)
-				.between(CorpUserAuth::getCreatedTime, yesZeroDate, thisZeroDate)
-				.groupBy(CorpUserAuth::getExternalUserid));
+		List<CorpUserAuth> corpUserAuths = corpUserAuthMapper.selectList(Wrappers.lambdaQuery(CorpUserAuth.class)
+				.between(CorpUserAuth::getCreatedTime, yesZeroDate, thisZeroDate).select(CorpUserAuth::getExternalUserid).groupBy(CorpUserAuth::getExternalUserid));
+		Integer numOfCorpUser = corpUserAuths.isEmpty() ? 0 : corpUserAuths.size();
 		statisticsUserData.setNumOfCorpUser(numOfCorpUser);
 		MapBuilder builder = MapUtils.builder()
 				.put("time", String.format("ct.created_time between '%s' and '%s'", yesZeroDate, thisZeroDate))

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/statistics/StatisticsDataController.java

@@ -185,9 +185,9 @@ public class StatisticsDataController {
 
 		statisticsUserDataView.setNumOfDistributeUser(statisticsUserDataMapper.getNumOfDistributeUserToday(thisZero, thisEnd));
 
-		Integer numOfCorpUser = corpUserAuthMapper.selectCount(Wrappers.lambdaQuery(CorpUserAuth.class)
-				.between(CorpUserAuth::getCreatedTime, thisZero, thisEnd)
-				.groupBy(CorpUserAuth::getExternalUserid));
+		List<CorpUserAuth> corpUserAuths = corpUserAuthMapper.selectList(Wrappers.lambdaQuery(CorpUserAuth.class)
+				.between(CorpUserAuth::getCreatedTime, thisZero, thisEnd).select(CorpUserAuth::getExternalUserid).groupBy(CorpUserAuth::getExternalUserid));
+		Integer numOfCorpUser = corpUserAuths.isEmpty() ? 0 : corpUserAuths.size();
 		statisticsUserDataView.setNumOfCorpUser(numOfCorpUser);
 		MapBuilder builder = MapUtils.builder()
 				.put("time", String.format("ct.created_time between '%s' and '%s'", thisZero, thisEnd))