|
|
@@ -221,8 +221,8 @@ public class StatisticsDataController {
|
|
|
statisticsUserDataView.setNumOfCorpAccountUser(accounts.intValue());
|
|
|
|
|
|
statisticsUserDataView.setUserData(beanSearcher.search(StatisticsUserData.class, MapUtils.flatBuilder(request.getParameterMap()).build()));
|
|
|
- StatisticsUserData statisticsUserData = beanSearcher.searchFirst(StatisticsUserData.class, MapUtils.builder().field(StatisticsUserData::getStatisticsDate, thisZero.toDateStr()).onlySelect(StatisticsUserData::getNumOfRedBookUser).build());
|
|
|
- Integer numOfRedBookUser = statisticsUserData != null ? statisticsUserData.getNumOfRedBookUser() : 0;
|
|
|
+ Number redBookUsers = beanSearcher.searchSum(StatisticsUserData.class, MapUtils.flatBuilder(request.getParameterMap()).build(), "numOfRedBookUser");
|
|
|
+ Integer numOfRedBookUser = redBookUsers.intValue();
|
|
|
statisticsUserDataView.setNumOfRedBookUser(numOfRedBookUser);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(statisticsUserDataView);
|
|
|
}
|
|
|
@@ -507,6 +507,8 @@ public class StatisticsDataController {
|
|
|
List<NewCorpUserView> newCorpUserViews = beanSearcher.searchAll(NewCorpUserView.class, MapUtils.builder().field(NewCorpUserView::getDate, first, end).op(Operator.Between).build());
|
|
|
newUserStatisticsView.setNewCorpUserData(newCorpUserViews);
|
|
|
|
|
|
+ List<NewRedBookUsersView> newRedBookUserViews = beanSearcher.searchAll(NewRedBookUsersView.class, MapUtils.builder().field(NewRedBookUsersView::getDate, first, end).op(Operator.Between).build());
|
|
|
+ newUserStatisticsView.setNewRedBookUserData(newRedBookUserViews);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(newUserStatisticsView);
|
|
|
}
|
|
|
|
|
|
@@ -515,11 +517,11 @@ public class StatisticsDataController {
|
|
|
*/
|
|
|
@PutMapping("/update/redBookUsers")
|
|
|
public Result<String> updateRedBookUsers(@RequestBody List<RedBookReq> redBooks) {
|
|
|
- DateTime beginOfDay = DateUtil.beginOfDay(DateTime.now());
|
|
|
+ DateTime endOfDay = DateUtil.beginOfDay(DateTime.now());
|
|
|
redBooks.forEach(redBook -> {
|
|
|
try {
|
|
|
DateTime dateTime = DateUtil.parseDate(redBook.getDate());
|
|
|
- if (dateTime.isAfter(beginOfDay)) {
|
|
|
+ if (dateTime.isAfter(endOfDay)) {
|
|
|
return;
|
|
|
}
|
|
|
Optional.ofNullable(statisticsUserDataMapper.selectOne(Wrappers.lambdaQuery(StatisticsUserData.class).eq(StatisticsUserData::getStatisticsDate, dateTime).last("limit 1")))
|