| | |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | | import org.apache.commons.lang3.BooleanUtils; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private DataUploadRecordMonthMapperImpl dataUploadRecordMonthMapper; |
| | | @Autowired |
| | | private WaterFacilityParameterMapperImpl waterFacilityParameterMapper; |
| | | |
| | | private static final Logger DEBUG_LOGGER = LoggerUtil.get(ELogger.DEBUG); |
| | | private static final Logger ERROR_LOGGER = LoggerUtil.get(ELogger.SYS_ERROR); |
| | | public ExecutedResult<Long> create(ReqCreateDataUploadRecord request) { |
| | | // 转换po |
| | | DataUploadRecordPO item = DataUploadRecordConvert.INSTANCE.toCreate(request); |
| | |
| | | // } |
| | | // return ExecutedResult.success(); |
| | | // } |
| | | /** |
| | | * mqtt收到消息 |
| | | * @param topic 主题 |
| | | * @param msg 消息内容 |
| | | */ |
| | | public void mqttReceived(String topic, String msg) { |
| | | if (StringUtil.isNullOrEmpty(topic)) { |
| | | ERROR_LOGGER.error("主题不能为空"); |
| | | return; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(msg)) { |
| | | ERROR_LOGGER.error("消息不能为空"); |
| | | return; |
| | | } |
| | | if (msg.startsWith("{\"platform")) { |
| | | return; |
| | | } |
| | | //报文解析 |
| | | //添加参数报警记录 |
| | | List<WaterFacilityPO> facilityPOList = waterFacilityMapper.getList(); |
| | | FacilityAlarmRecordPO recordPO=new FacilityAlarmRecordPO(); |
| | | |
| | | } |
| | | public ExecutedResult<String> dataUpload(Long startTime, Long endTime, Integer type) { |
| | | List<WaterFacilityPO> facilityPOList = waterFacilityMapper.getList(); |
| | | List<WaterMonitoryPointPO> pointPOList = waterMonitoryPointMapper.getList(); |
| | | //获取所有设备参数 |
| | | List<WaterFacilityParameterPO> parameterPOList = waterFacilityParameterMapper.getList(); |
| | | |