Commit 3f4fe8ff2cba3aa98fcf9f3b27e2d09bb51f97ee

Authored by wangqian
1 parent b324584b

首页统计接口修改

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/enums/CommonConstants.java
@@ -10,4 +10,8 @@ public interface CommonConstants { @@ -10,4 +10,8 @@ public interface CommonConstants {
10 10
11 public static final String DEFAULT_COUNT = "0"; 11 public static final String DEFAULT_COUNT = "0";
12 12
  13 + public static final String QUERY_TYPE_ORDER_TYPE = "order_type";
  14 +
  15 + public static final String QUERY_TYPE_SOURCE_ID = "source_id";
  16 +
13 } 17 }
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/homepage/MaintainSummaryServiceImpl.java
@@ -195,8 +195,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { @@ -195,8 +195,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
195 if(null == companyId || companyId == 0L || companyId == 100L){ 195 if(null == companyId || companyId == 0L || companyId == 100L){
196 companyId = null; 196 companyId = null;
197 } 197 }
198 - if ("order_type".equals(req.getQueryType())) {  
199 - //工单类型 Q:快速工单,C:普通工单, A:ai工单,W:网格工单,O:12345工单 198 + if (CommonConstants.QUERY_TYPE_ORDER_TYPE.equals(req.getQueryType())) {
  199 + //工单类型 Q:快速工单,C:普通工单
200 // 1. 定义工单类型数组(便于后续扩展,新增类型只需在数组中添加) 200 // 1. 定义工单类型数组(便于后续扩展,新增类型只需在数组中添加)
201 List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList(DictTypeConstants.WORKORDER_TYPE); 201 List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList(DictTypeConstants.WORKORDER_TYPE);
202 List<String> orderTypes = dictDataList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList()); 202 List<String> orderTypes = dictDataList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
@@ -218,32 +218,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService { @@ -218,32 +218,8 @@ public class MaintainSummaryServiceImpl implements MaintainSummaryService {
218 } 218 }
219 } 219 }
220 } 220 }
221 - //合并C和Q  
222 - // 1. 获取respMap中C和Q的原始值  
223 - Object cObj = respMap.get("C");  
224 - Object qObj = respMap.get("Q");  
225 -  
226 - // 2. 初始化C和Q的数值为0(避免空值或转换失败导致异常)  
227 - long cNum = 0;  
228 - long qNum = 0;  
229 -  
230 - // 3. 转换C值为数字(兼容String/Integer/Long类型,处理格式异常)  
231 - if (ObjectUtil.isNotEmpty(cObj)) {  
232 - cNum = Long.parseLong(cObj.toString().trim());  
233 - }  
234 - // 4. 转换Q值为数字(同C值,兼容多类型并处理异常)  
235 - if (ObjectUtil.isNotEmpty(qObj)) {  
236 - qNum = Long.parseLong(qObj.toString().trim());  
237 - }  
238 - // 5. 求和后赋值给C键,覆盖原有C值  
239 - long totalCQ = cNum + qNum;  
240 - respMap.put("C", totalCQ);  
241 -  
242 - // 6. 删除Q键,确保最终返回的Map中无Q键  
243 - respMap.remove("Q");  
244 -  
245 return respMap; 221 return respMap;
246 - } else if ("source_id".equals(req.getQueryType())){ 222 + } else if (CommonConstants.QUERY_TYPE_SOURCE_ID.equals(req.getQueryType())){
247 //来源 事件来源 1、巡查,2、游客居民,3、12345,4、网格 5、大区经理 6、ai 223 //来源 事件来源 1、巡查,2、游客居民,3、12345,4、网格 5、大区经理 6、ai
248 // 1. 定义工单类型数组(便于后续扩展,新增类型只需在数组中添加) 224 // 1. 定义工单类型数组(便于后续扩展,新增类型只需在数组中添加)
249 List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList(DictTypeConstants.WORKORDER_SOURCE_TYPE); 225 List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList(DictTypeConstants.WORKORDER_SOURCE_TYPE);