| | |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.dao.domain.C3mChargingCharge; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | * @return 是否成功 |
| | | */ |
| | | public boolean updateReportState(String deviceName, String c3Mac, String statusBit, String deviceTemperature) { |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, c3Mac)); |
| | | C3mCharging one = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, deviceName)); |
| | | if (one != null) { |
| | | // one.setStatusBit(Integer.valueOf(statusBit)); |
| | | one.setDeviceTemperature(deviceTemperature); |
| | |
| | | c3mCharging.setPoleDevicesCode(deviceName); |
| | | c3mCharging.setC3Mac(c3Mac); |
| | | flag = save(c3mCharging); |
| | | //设置费率 |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list.size() == 0) {//费率表中没有此充电桩数据时 添加默认费率 |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | |
| | | } else { |
| | | //将设备信息添加到充电桩设备表 |
| | | one.setPoleDevicesCode(deviceName); |
| | | one.setC3Mac(c3Mac); |
| | | flag = updateById(one); |
| | | //设置费率 |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list.size() == 0) {//费率表中没有此充电桩数据时 添加默认费率 |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | } |
| | | //设置费率 |
| | | C3mCharging c3mCharging1 = getOne(Wrappers.lambdaQuery(C3mCharging.class).eq(C3mCharging::getMcuUdid, mcuUdid)); |
| | | List<C3mChargingCharge> list = c3mChargingChargeService.list(Wrappers.lambdaQuery(C3mChargingCharge.class).eq(C3mChargingCharge::getC3Id, c3mCharging1.getC3Id())); |
| | | if (list.size() == 0) {//费率表中没有此充电桩数据时 添加默认费率 |
| | | c3mChargingChargeService.initCharge((c3mCharging1.getC3Id()).intValue()); |
| | | } |
| | | // /** |
| | | // * 添加绑定关系开始 |