From 535edf767afafe0bebdfb1df46bb066c8594ada5 Mon Sep 17 00:00:00 2001 From: FCL Date: Fri, 27 Mar 2026 14:28:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=AE=BE=E5=A4=87=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/DeviceProductController.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java index 3823bf40..ed0390bb 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/resource/device/controller/admin/DeviceProductController.java @@ -98,17 +98,22 @@ public class DeviceProductController extends AbstractFileUploadController implem reqVO.setProductIdList(productIdList); reqVO.setPageNo(1); reqVO.setPageSize(-1); + String[] allDomain = {"dailyCheck","period","maintain","calibration"}; List ruleList = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(reqVO).getList(); for(DeviceProductDO product: list){ Long id = product.getId(); JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.indexOf(product)); + for(String domain: allDomain){ + jsonObject.put(domain + "_on", "0"); + jsonObject.put(domain + "_count", 0); + } for(DeviceConfigBusinessRuleRespVO rule: ruleList){ Long productId = rule.getProductId(); - if(!Objects.equals(productId, id)) - continue; String businessDomain = rule.getBusinessDomain(); - jsonObject.put(businessDomain + "_on", "1"); - jsonObject.put(businessDomain + "_count", rule.getItemCount()); + if(Objects.equals(productId, id)){ + jsonObject.put(businessDomain + "_on", "1"); + jsonObject.put(businessDomain + "_count", rule.getItemCount()); + } } jsonArray.set(jsonArray.indexOf(product), jsonObject); }