| | |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | |
| | | //添加绑定关系 |
| | | Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName)); |
| | | if(pole != null){ |
| | | PoleBindingParam poleBindingParam = new PoleBindingParam(); |
| | | poleBindingParam.setDeviceType(2); |
| | | poleBindingParam.setDeviceCode(mcuUdid); |
| | | bindingService.bindPole(pole.getId(), poleBindingParam); |
| | | } |
| | | |
| | | } else { |
| | | //将设备信息添加到充电桩设备表 |
| | | one.setPoleDevicesCode(deviceName); |
| | |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | } |
| | | /** |
| | | * 添加绑定关系开始 |
| | | */ |
| | | Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName)); |
| | | if (pole == null) { |
| | | Pole pole1 = new Pole(); |
| | | pole1.setDeviceCode(deviceName); |
| | | pole1.setPoleName(deviceName); |
| | | pole1.setPoleCode(poleService.generatePoleCode()); |
| | | poleService.save(pole1); |
| | | } |
| | | |
| | | Long poleId = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getDeviceCode, deviceName)).getId(); |
| | | PoleBindingParam poleBindingParam = new PoleBindingParam(); |
| | | poleBindingParam.setDeviceType(2); |
| | | poleBindingParam.setDeviceCode(mcuUdid); |
| | | bindingService.bindPole(poleId, poleBindingParam); |
| | | |
| | | /** |
| | | * 添加绑定关系结束 |
| | | */ |
| | | |
| | | //同步时间戳 |
| | | String date = new SimpleDateFormat("yyMMddHHmmss").format(new Date()); |
| | | String s = SetCalendar(c3Mac, Integer.parseInt(date.substring(0, 2)), Integer.parseInt(date.substring(2, 4)), |
| | |
| | | |
| | | /** |
| | | * 查询充电桩 |
| | | * |
| | | * @return |
| | | */ |
| | | public C3mCharging getByC3Mac(String c3Mac){ |