| 
					
				 | 
			
			
				@@ -3,6 +3,7 @@ package com.gree.mall.manager.logic.workorder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hutool.core.bean.BeanUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hutool.core.convert.Convert; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hutool.core.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.hutool.json.JSONUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.metadata.IPage; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.gree.mall.manager.bean.admin.AdminUserCom; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -477,12 +478,14 @@ public class OrderBaseEsLogic { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         NativeSearchQuery crxcSearchQuery = new NativeSearchQueryBuilder() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .withQuery(queryBuilder.must(buildCrxcQuery()))  // 复用公共条件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .withPageable(PageRequest.of(1, 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                .addAggregation(this.getAggs(AggregationBuilders.filter("CRXC", QueryBuilders.matchAllQuery())))  // 因 query 已包含条件,filter 可简化 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .addAggregation(this.getAggs(AggregationBuilders.filter("CRXC", QueryBuilders.matchAllQuery()))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .build(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        log.info("CRXC的查询条件: {}", crxcSearchQuery.getQuery().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SearchHits crxcResponse = this.search(crxcSearchQuery, year); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         HashMap<String, Object> crxcMap = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        crxcMap.put("total", this.getWorkerOrderCountResult(crxcResponse.getAggregations(), "CRXC")); // 依赖正确的聚合解析 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        crxcMap.put("total", this.getWorkerOrderCountResult(crxcResponse.getAggregations(), "CRXC")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         crxcMap.put("orderStatus", "CRXC"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         maps.add(crxcMap); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -744,9 +747,6 @@ public class OrderBaseEsLogic { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .must(QueryBuilders.rangeQuery("create_time") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .gte(prevDay18)  // 修改点 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .lte(today759))  // 修改点 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                // 条件 2:create_time >= 当日8:30:00(原次日调整为当日) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                .must(QueryBuilders.rangeQuery("create_time") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//                        .lte(today830))  // 修改点 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 条件 3:appointment_time为空(保持不变) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .mustNot(QueryBuilders.existsQuery("appointment_time")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 条件 4:order_status排除(保持不变) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -789,6 +789,9 @@ public class OrderBaseEsLogic { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        return totalOrderNums; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ParsedFilter parsedFilter = aggregations.get(name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (name.equals("CRXC") && parsedFilter != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            log.info("CRXC {}, {}", parsedFilter.getDocCount(), JSONUtil.toJsonStr(parsedFilter)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return parsedFilter != null ? parsedFilter.getDocCount() : 0L; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |