2021与蓝度共同重构项目,服务端
liuhaonan
2022-08-24 1d4a103bb50013b86abf683a2870eb5b1850111f
ximon-admin/src/main/java/com/sandu/ximon/admin/service/C3ChargingService.java
@@ -1,6 +1,5 @@
package com.sandu.ximon.admin.service;
import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sandu.common.domain.CommonPage;
@@ -104,7 +103,7 @@
        System.out.println("同步时间戳结束");
        //设置费率
        System.out.println("设置费率开始");  // todo 充电桩设备设置费率
        System.out.println("设置费率开始");
        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) {//费率表中没有此充电桩数据时  添加默认费率
@@ -317,7 +316,7 @@
            chargingDto.setC3Id(one.getC3Id());
            //C3Mac
            chargingDto.setC3Mac(one.getC3Mac());
            //在线状态
            //在线状态 1.空闲 2.充电中 3.充电中断,等待服务器确认 4.充电结束,等待服务器确认 5.有故障 6.与充电桩对接中
            chargingDto.setStatusBit(Integer.valueOf(beatDataPackage.getStatusBit()));
            //电压
            chargingDto.setGridVoltage(beatDataPackage.getGridVoltage());
@@ -329,6 +328,10 @@
            chargingDto.setPoleId(pole.getId());
            //费率
            BigDecimal bigDecimal = SpringContextHolder.getBean(C3mChargingChargeService.class).getchargeDecimalByC3id(one.getC3Id());
            //已充电量
            chargingDto.setChargedCapacity(beatDataPackage.getChargedCapacity());
            //充电时长
            chargingDto.setAlreadyChargingTime(beatDataPackage.getAlreadyChargingTime());
            chargingDto.setRate(bigDecimal);
        }
@@ -442,7 +445,7 @@
        if (order == null) {
            throw new BusinessException("充电桩没有进行中的订单");
        }
        if (!openId.equals(order.getOrderId())) {
        if (!openId.equals(order.getUserCode())) {
            throw new BusinessException("不能操作不属于您的订单");
        }