| | |
| | | |
| | | import com.ld.igds.common.CoreDeviceService; |
| | | import com.ld.igds.constant.BizType; |
| | | import com.ld.igds.es.dto.EsData; |
| | | import com.ld.igds.es.service.CoreEsService; |
| | | import com.ld.igds.gas.CoreGasService; |
| | | import com.ld.igds.io.constant.OrderRespEnum; |
| | | import com.ld.igds.io.notify.NotifyWebInvoker; |
| | | import com.ld.igds.io.request.BaseRequest; |
| | | import com.ld.igds.io.request.CheckGasRequest; |
| | | import com.ld.igds.io.request.DeviceControlRequest; |
| | | import com.ld.igds.models.Gas; |
| | |
| | | private NotifyWebInvoker notifyInvoker; |
| | | @Autowired |
| | | private CoreGasService gasService; |
| | | @Autowired |
| | | private CoreEsService esService; |
| | | |
| | | |
| | | /** |
| | |
| | | notifyInvoker.notifyWeb(gas.getCompanyId(), OrderRespEnum.MSG_SUCCESS, BizType.GAS, request.getDepotId() + " 气体检测:结果返回成功."); |
| | | log.info("控制柜----->>>平台:气体解析完成-仓库={}", request.getDepotId()); |
| | | } |
| | | |
| | | /** |
| | | * 解析能耗数据 |
| | | * |
| | | * @param request |
| | | * @param result |
| | | */ |
| | | public void analysisEs(BaseRequest request, Number result) { |
| | | |
| | | log.debug("----------开始执行能耗结果解析----{}", request.getDepotId()); |
| | | |
| | | |
| | | //有功电能判断是否返回有效数据 |
| | | if (null == result) { |
| | | log.error("---能耗数据返回数据不完整,停止解析----{}", result.toString()); |
| | | return; |
| | | } |
| | | |
| | | EsData esData = new EsData(); |
| | | esData.setCompanyId(request.getCompanyId()); |
| | | esData.setDepotId(request.getDepotId()); |
| | | esData.setUpdateTime(new Date()); |
| | | |
| | | esData.setEp(result.doubleValue()); |
| | | esData.setEs(result.doubleValue()); |
| | | |
| | | log.info("Modbus电表----->>>平台:能耗数据解析完成-仓库={}", esData.getDepotId()); |
| | | esService.saveAndUpdateInc(esData); |
| | | } |
| | | } |