‘linchangsheng’ 1 month ago
parent
commit
3a1a6dd70b

+ 12 - 6
mall-server-api/src/main/java/com/gree/mall/manager/logic/big/BigLogic.java

@@ -262,19 +262,25 @@ public class BigLogic {
 
         if (!StringUtil.isEmpty(province)) {
 
-            List<String> orderBaseId = pgOrderProductService.lambdaQuery().select(PgOrderProduct::getOrderBaseId)
-                    .list().stream().map(PgOrderProduct::getOrderBaseId).collect(Collectors.toList());
 
-            List<PgOrderBase> pgOrderBases = pgOrderBaseService.lambdaQuery().in(PgOrderBase::getId, orderBaseId).select(PgOrderBase::getOrderStatus, PgOrderBase::getId).list();
+            Integer countAll = pgOrderBaseService.lambdaQuery()
+                    .eq(PgOrderBase::getProvince, province)
+                    .select(PgOrderBase::getOrderStatus, PgOrderBase::getId).count();
 
             List<String> never = new ArrayList<>();
             never.add("YWG");
             never.add("YJS");
             never.add("YQX");
 
-            largeOneBean.setAllWorkerOrderNum(pgOrderBases.size());
-            int neverNum = pgOrderBases.stream().filter(item -> never.contains(item.getOrderStatus())).collect(Collectors.toList()).size();
-            largeOneBean.setNeverWorkerNum(neverNum);
+            largeOneBean.setAllWorkerOrderNum(countAll);
+
+            Integer countNever = pgOrderBaseService.lambdaQuery()
+                    .eq(PgOrderBase::getProvince, province)
+                    .notIn(PgOrderBase::getOrderStatus,never)
+                    .select(PgOrderBase::getOrderStatus, PgOrderBase::getId).count();
+
+
+            largeOneBean.setNeverWorkerNum(countNever);
 
             Integer count = orderInfoService.lambdaQuery().count();
             largeOneBean.setSalesOrderNum(count);