whycxzp
2025-03-06 dfd45b0998e4b9279e8ed8a33fbf82fc4e8b6015
src/main/java/com/whyc/service/Fbs9100StateService.java
@@ -6,6 +6,7 @@
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.constant.DeviceConstant;
import com.whyc.constant.YamlProperties;
import com.whyc.dto.BattTestData;
import com.whyc.dto.Response;
import com.whyc.dto.paramter.FbsStatePar;
@@ -248,7 +249,12 @@
            List<Fbs9100State> fbs9100StateList = mapper.getListWithoutZJDYBTSE2(userId,type);
            //上面的分组字段 只要能区分 不同的设备就行了. 因为如果是一拖二的情况,也可通过后面的状态优先级来覆盖,设备不会重复
            //太供可以通过ip来确定是哪台设备
            Map<String, List<Fbs9100State>> deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(Fbs9100State::getDevIp));
            Map<String, List<Fbs9100State>> deviceMap = null;
            if(YamlProperties.systemSubType == 3){ //晋源 - 因为所有设备共用一个ip, 所以需要加上devId
                deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state ->  String.format("%s_%s",state.getDevIp(), state.getDevId())));
            }else{ //默认通用
                deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state -> String.valueOf(state.getDevIp())));
            }
            //Map<String, List<Fbs9100State>> deviceMap = fbs9100StateList.stream().collect(Collectors.groupingBy(state ->
            //        String.format("%s_%s",state.getDevIp(), state.getDevId())));
            Set<String> deviceSet = deviceMap.keySet();