2021与蓝度共同重构项目,服务端
liuhaonan
2022-08-23 694962918618b6d9531d8ca876a6746e030387f1
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;
@@ -26,7 +27,7 @@
        save(lightReportError);
    }
    public List<LightReportErrorBo> listReportError(int pageNo, int pageSize, String keyword, int error_code) {
    public List<LightReportErrorBo> listReportError(int pageNo, int pageSize, String keyword, Integer error_code) {
        PageHelper.startPage(pageNo, pageSize);
        List<LightReportErrorBo> lightReportErrorBos;
        //为null的话是超管
@@ -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;
    }
}