Pārlūkot izejas kodu

Merge branch 'register'

zoujiajian 3 gadi atpakaļ
vecāks
revīzija
6c76c357f6

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

@@ -54,6 +54,16 @@ public class BackgroundDataView {
 	 */
 	private Integer totalExpiredAccountNum;
 
+	/**
+	 * 待注册账号数
+	 */
+	private Integer waitingRegisterNum;
+
+	/**
+	 * 注册失败账号数
+	 */
+	private Integer failRegisterNum;
+
 	/**
 	 * apple one数据
 	 */

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

@@ -22,6 +22,9 @@ import com.cyksj.service.mange.statistics.StatisticsDataService;
 import com.cyksj.service.order.OrderDonService;
 import com.cyksj.service.user.UserService;
 import com.cyksj.task.StatisticsDataScheduler;
+import com.ejlchina.searcher.BeanSearcher;
+import com.ejlchina.searcher.param.Operator;
+import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -61,6 +64,8 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 
 	private final GoodsDonSkuMapper goodsDonSkuMapper;
 
+	private final BeanSearcher beanSearcher;
+
 	@Override
 	public Result<BackgroundDataView> getStatisticsByCondition(Long startTime, Long endTime) {
 		BackgroundDataView backgroundDataView = new BackgroundDataView();
@@ -169,5 +174,14 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		//已到期主账号
 		List<Account> expiredAccounts = Optional.ofNullable(accountService.list(Wrappers.lambdaQuery(Account.class).le(Account::getExpiryTime, now))).orElse(new ArrayList<>());
 		backgroundDataView.setTotalExpiredAccountNum(expiredAccounts.size());
+		Number waitingRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
+				.field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.hasPayment.name()).op(Operator.Equal)
+				.onlySelect(RegisterOrderDon ::getId).build());
+		backgroundDataView.setWaitingRegisterNum(waitingRegisterNum.intValue());
+		Number errorRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
+				.field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.error.name()).op(Operator.Equal)
+				.onlySelect(RegisterOrderDon ::getId)
+				.build());
+		backgroundDataView.setFailRegisterNum(errorRegisterNum.intValue());
 	}
 }

+ 11 - 11
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -378,17 +378,17 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 						delRelation(groupsRelation.getId());
 
 						//车位空余发送模板消息
-						TASK_POOL.execute(() -> {
-							try {
-								List<CustomerService> customerServices = customerServiceMapper.selectList(null);
-								for (CustomerService customerService : customerServices) {
-									log.info("发送客服{}空车位通知消息", customerService.getNickName());
-									emptySendMsgNotify(orderDon, customerService.getOpenId());
-								}
-							} catch (Exception e) {
-								log.error("发送{}空车位模板消息至客服失败:{}", orderDon.getGoodsId(), e);
-							}
-						});
+//						TASK_POOL.execute(() -> {
+//							try {
+//								List<CustomerService> customerServices = customerServiceMapper.selectList(null);
+//								for (CustomerService customerService : customerServices) {
+//									log.info("发送客服{}空车位通知消息", customerService.getNickName());
+//									emptySendMsgNotify(orderDon, customerService.getOpenId());
+//								}
+//							} catch (Exception e) {
+//								log.error("发送{}空车位模板消息至客服失败:{}", orderDon.getGoodsId(), e);
+//							}
+//						});
 					}
 				}
 			}