|
|
@@ -3,6 +3,8 @@ package com.cyksj.web.controller.manage;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alipay.api.AlipayApiException;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
|
@@ -411,9 +413,9 @@ public class CmsUserController{
|
|
|
*/
|
|
|
@GetMapping("/get/consume/large/user")
|
|
|
public Result<SearchResult<UserView>> getLargeConsumer() {
|
|
|
- MapBuilder builder = MapUtils.builder();
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
String largeLimit = "200000";
|
|
|
- String fu = String.format("(select user_id from order_don o where o.relation_id != 0 and o.status not in ('close','noPayment','refund') group by user_id, date_format(o.created_time,'%%Y-%%m-%%d')" +
|
|
|
+ String fu = String.format("(select distinct user_id from order_don o where o.relation_id != 0 and o.status not in ('close','noPayment','refund') group by user_id, date_format(o.created_time,'%%Y-%%m-%%d')" +
|
|
|
"having sum(money) > %s) ln inner join", largeLimit);
|
|
|
String fuOn = " on ln.user_id = u.id";
|
|
|
builder.put("fu", fu);
|
|
|
@@ -421,4 +423,15 @@ public class CmsUserController{
|
|
|
SearchResult<UserView> search = beanSearcher.search(UserView.class, builder.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否有最新的用户产生
|
|
|
+ */
|
|
|
+ @GetMapping("/get/consume/large/newUser")
|
|
|
+ public Result<Boolean> getLargeNewConsumer() {
|
|
|
+ String largeLimit = "200000";
|
|
|
+ DateTime beginOfDay = DateUtil.beginOfDay(DateTime.now());
|
|
|
+ Integer newConsumerCount = userMapper.getLargeNewConsumer(beginOfDay, largeLimit);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(newConsumerCount > 0 ? true : false);
|
|
|
+ }
|
|
|
}
|