|
@@ -5,6 +5,7 @@ import com.zy.bms.common.Constant;
|
|
|
import com.zy.bms.entity.DeviceBase;
|
|
|
import com.zy.bms.entity.lp.LpInfoState;
|
|
|
import com.zy.bms.mapper.DeviceBaseMapper;
|
|
|
+import com.zy.bms.pojo.vo.DeviceWxListVo;
|
|
|
import com.zy.bms.service.IDeviceBaseService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zy.bms.service.lp.ILpInfoStateService;
|
|
@@ -13,6 +14,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 设备静态信息 服务实现类
|
|
@@ -38,24 +41,31 @@ public class DeviceBaseServiceImpl extends ServiceImpl<DeviceBaseMapper, DeviceB
|
|
|
public List listByGroupIdWx(String groupId) {
|
|
|
String type = baseMapper.getTypeByGroupId(groupId);
|
|
|
switch (type) {
|
|
|
- case Constant.TYPE.UBI: {
|
|
|
+ case Constant.DEVICE_TYPE.UBI: {
|
|
|
return ubiInfoStateService.listByGroupIdWx(groupId);
|
|
|
}
|
|
|
- case Constant.TYPE.LP: {
|
|
|
+ case Constant.DEVICE_TYPE.LP: {
|
|
|
return lpInfoStateService.listByGroupIdWx(groupId);
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, List<DeviceWxListVo>> listByGroupIdsWx(List<String> groupIds) {
|
|
|
+ List<DeviceWxListVo> list = baseMapper.listByGroupIds(groupIds);
|
|
|
+ if (list.isEmpty()) return null;
|
|
|
+ return list.stream().collect(Collectors.groupingBy(DeviceWxListVo::getGroupId));
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Object getDetailWx(String openNum) {
|
|
|
String type = baseMapper.selectOne(new QueryWrapper<DeviceBase>().eq("open_num", openNum)).getType();
|
|
|
switch (type) {
|
|
|
- case Constant.TYPE.UBI: {
|
|
|
+ case Constant.DEVICE_TYPE.UBI: {
|
|
|
return ubiInfoStateService.getDetailWx(openNum);
|
|
|
}
|
|
|
- case Constant.TYPE.LP: {
|
|
|
+ case Constant.DEVICE_TYPE.LP: {
|
|
|
return lpInfoStateService.getOne(new QueryWrapper<LpInfoState>().eq("open_num", openNum));
|
|
|
}
|
|
|
}
|