| | |
| | | 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; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.bo.LightReportErrorBo; |
| | | import com.sandu.ximon.dao.domain.LightReportError; |
| | | import com.sandu.ximon.dao.mapper.LightReportErrorMapper; |
| | |
| | | save(lightReportError); |
| | | } |
| | | |
| | | public List<LightReportErrorBo> listReportError(int pageNo, int pageSize, String keyword) { |
| | | PageHelper.startPage(pageNo,pageSize); |
| | | List<LightReportErrorBo> lightReportErrorBos = baseMapper.listReportError(keyword); |
| | | public List<LightReportErrorBo> listReportError(int pageNo, int pageSize, String keyword, Integer error_code) { |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | List<LightReportErrorBo> lightReportErrorBos; |
| | | //为null的话是超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | lightReportErrorBos = baseMapper.listReportError(keyword, error_code, null); |
| | | } else { |
| | | lightReportErrorBos = baseMapper.listReportError(keyword, error_code, SecurityUtils.getUserId()); |
| | | } |
| | | |
| | | 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){ |
| | | if ((value.getCode() & errorCode) > 0) { |
| | | sb.append(value.getMessage()); |
| | | } |
| | | } |