| | |
| | | package com.ycl.controller.smoke; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | public CommonResult<String> getDetectorDailyStatsDocument(@RequestParam(value = "field", required = false) String field, |
| | | @RequestParam(value = "localeId", required = false) String localeId) { |
| | | OdsLocaleDocument odsLocaleDocument = documentService.getByLocaleId(localeId); |
| | | String value = getFieldValueByFieldName(field, odsLocaleDocument); |
| | | String value = ""; |
| | | if ("detectorDailySumDays".equals(field)) { |
| | | odsLocaleDocument.setTenHourData(""); |
| | | odsLocaleDocument.setDevices(""); |
| | | odsLocaleDocument.setMaintenance(""); |
| | | value = JSON.toJSONString(odsLocaleDocument); |
| | | } else { |
| | | value = getFieldValueByFieldName(field, odsLocaleDocument); |
| | | } |
| | | return CommonResult.success(value); |
| | | } |
| | | |
| | |
| | | Field field = object.getClass().getDeclaredField(fieldName); |
| | | //设置对象的访问权限,保证对private的属性的访问 |
| | | field.setAccessible(true); |
| | | return (String)field.get(object); |
| | | return (String) field.get(object); |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |