2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-08-12 423b61bfb18ceab430303bada28f93631f0e8392
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightReportErrorService.java
@@ -1,6 +1,7 @@
package com.sandu.ximon.admin.service;
import com.github.pagehelper.PageHelper;
import com.sandu.common.object.BaseConditionVO;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5LightErrorCodeReportInnerFrame;
import com.sandu.ximon.admin.manager.iot.rrpc.enums.LightErrorEnum;
@@ -49,4 +50,28 @@
        }
        return lightReportErrorBos;
    }
    /**
     * 查询故常数据
     *
     * @return
     */
    public List<LightReportErrorBo> queryErrorCode(BaseConditionVO baseConditionVO) {
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        List<LightReportErrorBo> lightReportErrorBos = baseMapper.listError(SecurityUtils.getClientId());
        for (LightReportErrorBo lightReportErrorBo : lightReportErrorBos) {
            Integer errorCode = lightReportErrorBo.getErrorCode();
            StringBuilder sb = new StringBuilder();
            LightErrorEnum[] values = LightErrorEnum.values();
            for (LightErrorEnum value : values) {
                if ((value.getCode() & errorCode) > 0) {
                    sb.append(value.getMessage());
                }
            }
            lightReportErrorBo.setErrorMsg(sb.toString());
        }
        return lightReportErrorBos;
    }
}