fix:设备业务配置接口增加配置标识
This commit is contained in:
@@ -98,17 +98,22 @@ public class DeviceProductController extends AbstractFileUploadController implem
|
|||||||
reqVO.setProductIdList(productIdList);
|
reqVO.setProductIdList(productIdList);
|
||||||
reqVO.setPageNo(1);
|
reqVO.setPageNo(1);
|
||||||
reqVO.setPageSize(-1);
|
reqVO.setPageSize(-1);
|
||||||
|
String[] allDomain = {"dailyCheck","period","maintain","calibration"};
|
||||||
List<DeviceConfigBusinessRuleRespVO> ruleList = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(reqVO).getList();
|
List<DeviceConfigBusinessRuleRespVO> ruleList = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(reqVO).getList();
|
||||||
for(DeviceProductDO product: list){
|
for(DeviceProductDO product: list){
|
||||||
Long id = product.getId();
|
Long id = product.getId();
|
||||||
JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.indexOf(product));
|
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){
|
for(DeviceConfigBusinessRuleRespVO rule: ruleList){
|
||||||
Long productId = rule.getProductId();
|
Long productId = rule.getProductId();
|
||||||
if(!Objects.equals(productId, id))
|
|
||||||
continue;
|
|
||||||
String businessDomain = rule.getBusinessDomain();
|
String businessDomain = rule.getBusinessDomain();
|
||||||
jsonObject.put(businessDomain + "_on", "1");
|
if(Objects.equals(productId, id)){
|
||||||
jsonObject.put(businessDomain + "_count", rule.getItemCount());
|
jsonObject.put(businessDomain + "_on", "1");
|
||||||
|
jsonObject.put(businessDomain + "_count", rule.getItemCount());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
jsonArray.set(jsonArray.indexOf(product), jsonObject);
|
jsonArray.set(jsonArray.indexOf(product), jsonObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user