Commit 89ffdf16 authored by 赵啸非's avatar 赵啸非

物联网1.0

parent b6ccd4b6
......@@ -141,7 +141,8 @@ export default {
//this.getSiteMatterTableData();
if (node.id.search(",")) {
this.query = { siteId: node.id.split(",")[0] };
//this.query = { siteId: node.id.split(",")[0] ,siteIdList:node.id.split(",")};
this.query = {siteIdList:node.id.split(",")};
} else {
this.query = { siteId: node.id };
}
......
......@@ -109,7 +109,7 @@ public class DeviceApiController {
DeviceResp deviceResp = new DeviceResp();
try {
DeviceEntity deviceEntity = checkDeviceExist(req);
if (deviceEntity.getDeviceStatus() != DeviceStatusEnum.未激活.getValue()) {
if (deviceEntity.getDeviceStatus() == DeviceStatusEnum.未激活.getValue()) {
throw new AppException("当前设备未激活,请在后台配置后再激活!");
}
// if (deviceEntity.getStatus() != StatusEnum.启用.getValue()) {
......@@ -326,6 +326,7 @@ public class DeviceApiController {
ServerInfo serverInfo = new ServerInfo();
serverInfo.setHomeUrl(platformEntity.getHomeUrl());
serverInfo.setServerUrl(platformEntity.getSendUrl());
registerResp.setServiceInfo(serverInfo);
String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR);
......
......@@ -27,10 +27,7 @@ import com.mortals.xhx.module.sitestat.model.SitestatEntity;
import com.mortals.xhx.module.sitestat.service.SitestatService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -65,8 +62,29 @@ public class SitestatServiceImpl extends AbstractCRUDServiceImpl<SitestatDao, Si
Result<SitestatEntity> res = new Result<>();
//根据站点查询所以站点子集列表
if(!ObjectUtils.isEmpty(entity.getSiteIdList())){
if (!ObjectUtils.isEmpty(entity.getSiteIdList())) {
// TODO: 2022/7/1 站点为多站点时候合并
List<SitestatEntity> collect = entity.getSiteIdList().stream().flatMap(siteId -> {
SitePdu sitePdu = new SitePdu();
sitePdu.setId(siteId);
Rest<List<SitePdu>> result = siteFeign.getFlatSitesBySiteId(sitePdu);
if (result.getCode() == YesNoEnum.YES.getValue()) {
//根据返回的id 筛选列表
Map<Long, SitestatEntity> collectMap = this.find(new SitestatEntity()).stream().collect(Collectors.toMap(x -> x.getSiteId(), y -> y, (o, n) -> n));
List<SitestatEntity> list = result.getData().stream().filter(f -> collectMap.containsKey(f.getId())).map(m -> collectMap.get(m.getId())).collect(Collectors.toList());
return list.stream();
}
return new ArrayList<SitestatEntity>().stream();
}).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(entity.getSiteName())) {
collect = MemoryPagination.search(entity.getSiteName(), collect);
}
pageInfo.setTotalResult(collect.size());
List<SitestatEntity> siteStatList = MemoryPagination.pagination(collect, pageInfo.getCurrPage(), pageInfo.getPrePageResult());
res.setList(siteStatList);
res.setPageInfo(pageInfo);
return res;
}
if (ObjectUtils.isEmpty(entity.getSiteId())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment