| | |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.SupplementUtils; |
| | | import com.sandu.ximon.admin.param.C3ChargingAddParam; |
| | | import com.sandu.ximon.admin.param.C3ChargingParam; |
| | | import com.sandu.ximon.admin.redis.DeviceRedisKey; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.*; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.admin.vo.RedisDeviceStatus; |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | |
| | | private final C3mChargingChargeService c3mChargingChargeService; |
| | | private final PoleBindingService bindingService; |
| | | private final PoleService poleService; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | /** |
| | | * 保存上报C3充电设备心跳数据 |
| | |
| | | System.out.println("设置费率开始"); |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid).last("limit 1")); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list == null && list.size() == 0) {//费率表中没有此充电桩数据时 添加默认费率 |
| | | if (list.size() == 0) {//费率表中没有此充电桩数据时 添加默认费率 |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | String rateState = setRate(newC3Mac, list, true); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 向Redis中存入设备状态 |
| | | */ |
| | | // public void setCacheData() { |
| | | // list().forEach( |
| | | // device -> { |
| | | // RedisDeviceStatus deviceStatus = new RedisDeviceStatus(); |
| | | // deviceStatus.setDeviceId(device.getC3Id().toString()); |
| | | // if (device != null) { |
| | | // A5C3HeartbeatReportInnerFrame.HeartBeatDataPackage beatDataPackage = ReadTheHeartbeatPackage(device.getC3Id(), false); |
| | | // if (beatDataPackage != null) { |
| | | // //在线状态 1.空闲 2.充电中 3.充电中断,等待服务器确认 4.充电结束,等待服务器确认 5.有故障 6.与充电桩对接中 |
| | | // if (Integer.valueOf(beatDataPackage.getStatusBit()) == 5) { |
| | | // deviceStatus.setStatus(2); |
| | | // } else { |
| | | // deviceStatus.setStatus(0); |
| | | // } |
| | | // |
| | | // } else { |
| | | // deviceStatus.setStatus(1); |
| | | // } |
| | | // } |
| | | // redisUtils.set(DeviceRedisKey.C3M + device.getC3Id(), JSON.toJSONString(deviceStatus)); |
| | | //// redisUtils.delete(DeviceRedisKey.C3M + device.getC3Id()); |
| | | // } |
| | | // ); |
| | | // |
| | | // } |
| | | } |