| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.ximon.admin.dto.ErrorMsgDto; |
| | | import com.sandu.ximon.dao.bo.C3ReportErrorBo; |
| | | import com.sandu.ximon.dao.bo.LightReportErrorBo; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.dao.domain.Light; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | |
| | | private final LightReportErrorService lightReportErrorService; |
| | | private final C3mReportErrorService c3mReportErrorService; |
| | | private final LightService lightService; |
| | | private final C3mReportErrorService c3mReportErrorService; |
| | | private final C3ChargingService c3ChargingService; |
| | | |
| | | |
| | | public List<ErrorMsgDto> listMsg(BaseConditionVO baseConditionVO) { |
| | |
| | | errorMsgDto.setErrorCode(lightReportError.getErrorCode()); |
| | | errorMsgDto.setErrorDesc(lightReportError.getErrorMsg()); |
| | | errorMsgDto.setErrorTime(lightReportError.getCreateTime()); |
| | | errorMsgDto.setDeviceType(0); |
| | | errorMsgDto.setDeviceType(1); |
| | | Light one = lightService.getOne(Wrappers.lambdaQuery(Light.class).eq(Light::getDeviceCode, lightReportError.getDeviceCode())); |
| | | if (one != null) { |
| | | errorMsgDto.setDeviceJson(JSON.toJSONString(one)); |
| | |
| | | } |
| | | |
| | | //充电桩故障数据 |
| | | List<C3ReportErrorBo> c3ReportErrorBos = c3mReportErrorService.listReportError(baseConditionVO); |
| | | if (!c3ReportErrorBos.isEmpty()) { |
| | | c3ReportErrorBos.forEach(c3ReportError -> { |
| | | ErrorMsgDto errorMsgDto = new ErrorMsgDto(); |
| | | errorMsgDto.setMac(c3ReportError.getC3Mac()); |
| | | errorMsgDto.setErrorDesc(c3ReportError.getErrorMsg()); |
| | | errorMsgDto.setErrorTime(c3ReportError.getCreateTime()); |
| | | errorMsgDto.setDeviceType(3); |
| | | C3mCharging one = c3ChargingService.getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getC3Mac, c3ReportError.getC3Mac())); |
| | | if (one != null) { |
| | | errorMsgDto.setDeviceJson(JSON.toJSONString(one)); |
| | | } |
| | | errorMsgDtos.add(errorMsgDto); |
| | | }); |
| | | } |
| | | |
| | | //大气故障数据 |
| | | |
| | | //对errorMsgDtos按创建时间倒叙 |
| | | errorMsgDtos.sort((a, b) -> b.getErrorTime().compareTo(a.getErrorTime())); |