|
@@ -0,0 +1,39 @@
|
|
|
|
+package org.springblade.modules.home.service.impl;
|
|
|
|
+
|
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
|
+import org.springblade.modules.finance.entity.Order;
|
|
|
|
+import org.springblade.modules.finance.service.impl.OrderServiceImpl;
|
|
|
|
+import org.springblade.modules.home.service.IHomeService;
|
|
|
|
+import org.springblade.modules.home.vo.StatisticalVO;
|
|
|
|
+import org.springblade.modules.shopping.entity.ConsignConfig;
|
|
|
|
+import org.springblade.modules.shopping.service.impl.ConsignConfigServiceImpl;
|
|
|
|
+import org.springblade.modules.system.entity.User;
|
|
|
|
+import org.springblade.modules.system.service.impl.UserServiceImpl;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+@Service
|
|
|
|
+public class HomeServiceImpl implements IHomeService {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserServiceImpl userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private OrderServiceImpl orderService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ConsignConfigServiceImpl consignConfigService;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public StatisticalVO statistical() {
|
|
|
|
+ StatisticalVO vo = new StatisticalVO();
|
|
|
|
+ // 查询app用户数
|
|
|
|
+ Integer userTotal = userService.getBaseMapper().selectCount(Condition.getQueryWrapper(new User()).eq("user_type", 2).eq("is_deleted", 0));
|
|
|
|
+ // 查询订单总数
|
|
|
|
+ Integer orderTotal = orderService.getBaseMapper().selectCount(Condition.getQueryWrapper(new Order()).eq("is_deleted", 0).notIn("pay_flag", 1, 2));
|
|
|
|
+ // 查询抢购场次
|
|
|
|
+ Integer snapTotal = consignConfigService.getBaseMapper().selectCount(Condition.getQueryWrapper(new ConsignConfig()).eq("is_deleted", 0).eq("is_enabled", 2));
|
|
|
|
+ vo.setOrderTotal(orderTotal);
|
|
|
|
+ vo.setSnapTotal(snapTotal);
|
|
|
|
+ vo.setUserTotal(userTotal);
|
|
|
|
+ return vo;
|
|
|
|
+ }
|
|
|
|
+}
|