whycxzp
2022-06-11 fe93d0fc7bda6036e9800833b1c8dbb9e1cadc49
实时增加电池组标称单体电压,电池单体数量
2个文件已修改
15 ■■■■■ 已修改文件
src/main/java/com/whyc/service/BattInfService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/RealTimeWebsocket.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattInfService.java
@@ -477,4 +477,9 @@
    }
    public Battinf getBattGroupInfoByBattGroupId(int battGroupId) {
        QueryWrapper<Battinf> queryWrapper = Wrappers.query();
        queryWrapper.select("MonVolStd","MonCount").eq("BattGroupId",battGroupId);
        return battInfMapper.selectOne(queryWrapper);
    }
}
src/main/java/com/whyc/webSocket/RealTimeWebsocket.java
@@ -3,6 +3,7 @@
import com.whyc.dto.DeviceTypeDTO;
import com.whyc.dto.Response;
import com.whyc.dto.paramter.RealTimePar;
import com.whyc.pojo.Battinf;
import com.whyc.service.*;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -59,6 +60,8 @@
    private static Fbs9100ChargerstateService f9100Chargerstateservice;//Fbs9100Chargerstate
    private static Fbs9100sBuscoupleStateService fbs9100sBuscoupleStateService;
    private static BattInfService battInfService;
    private Session session;
@@ -138,6 +141,10 @@
    public void setService(Fbs9100sBuscoupleStateService fbs9100sBuscoupleStateService) {
        RealTimeWebsocket.fbs9100sBuscoupleStateService = fbs9100sBuscoupleStateService;
    }
    @Autowired
    public void setService(BattInfService battInfService) {
        RealTimeWebsocket.battInfService = battInfService;
    }
    @OnOpen
    public void  onOpen(Session session){
@@ -165,6 +172,9 @@
                            case "power1": res=getPower1(realTimePar);break;
                            case "totalInfo": res=getTotalInfo(realTimePar);break;
                        }
                        //实时显示调整,增加电池数量,标称单体电压,放置于返回结果的data2
                        Battinf battinf = battInfService.getBattGroupInfoByBattGroupId(realTimePar.getBattGroupId());
                        res.setData2(battinf);
                        if (session.isOpen()) {
                            //推送信息
                            synchronized (session) {