| | |
| | | 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; |
| | |
| | | save(lightReportError); |
| | | } |
| | | |
| | | public List<LightReportErrorBo> listReportError(int pageNo, int pageSize, String 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, null); |
| | | }else{ |
| | | lightReportErrorBos = baseMapper.listReportError(keyword, SecurityUtils.getUserId()); |
| | | lightReportErrorBos = baseMapper.listReportError(keyword, error_code, null); |
| | | } else { |
| | | lightReportErrorBos = baseMapper.listReportError(keyword, error_code, SecurityUtils.getUserId()); |
| | | } |
| | | |
| | | for (LightReportErrorBo lightReportErrorBo : lightReportErrorBos) { |
| | |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | } |