|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.common.ResultCode;
|
|
import com.fdkankan.fusion.entity.Model;
|
|
import com.fdkankan.fusion.entity.Model;
|
|
import com.fdkankan.fusion.entity.TmCamera;
|
|
import com.fdkankan.fusion.entity.TmCamera;
|
|
|
|
+import com.fdkankan.fusion.entity.TmDepartment;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
import com.fdkankan.fusion.common.PageInfo;
|
|
import com.fdkankan.fusion.common.PageInfo;
|
|
import com.fdkankan.fusion.httpClient.FdService;
|
|
import com.fdkankan.fusion.httpClient.FdService;
|
|
@@ -30,10 +31,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.security.Security;
|
|
import java.security.Security;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -93,14 +91,7 @@ public class SceneService implements ISceneService {
|
|
long total = 0;
|
|
long total = 0;
|
|
if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4){ //看看,看见 ,深时obj
|
|
if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4){ //看看,看见 ,深时obj
|
|
//获取四维(看看,看见)场景数据
|
|
//获取四维(看看,看见)场景数据
|
|
- FdkkResponse fdkkResponse = null;
|
|
|
|
-// if(param.getNumList() == null || param.getNumList().size()<=0){
|
|
|
|
-// param.setStatus(2);
|
|
|
|
-// fdkkResponse = fdKKClient.sceneList(param,fdService.getFdToken(token));
|
|
|
|
-// }else {
|
|
|
|
-// fdkkResponse = fdKKClient.sceneList(param);
|
|
|
|
-// }
|
|
|
|
- fdkkResponse = fdKKClient.sceneList(param);
|
|
|
|
|
|
+ FdkkResponse fdkkResponse = fdKKClient.sceneList(param);
|
|
if(fdkkResponse.getCode() !=0){
|
|
if(fdkkResponse.getCode() !=0){
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
}
|
|
}
|
|
@@ -123,26 +114,12 @@ public class SceneService implements ISceneService {
|
|
if(param.getNumList() != null && param.getNumList().size() >0){
|
|
if(param.getNumList() != null && param.getNumList().size() >0){
|
|
laserSceneParam.setSceneCodes(param.getNumList());
|
|
laserSceneParam.setSceneCodes(param.getNumList());
|
|
}
|
|
}
|
|
- FdkkResponse fdkkResponse = null;
|
|
|
|
-// if(param.getNumList() == null || param.getNumList().size()<=0){
|
|
|
|
-// fdkkResponse = laserClient.sceneList(laserSceneParam, fdService.getFdToken(token));
|
|
|
|
-// }else {
|
|
|
|
-// fdkkResponse = laserClient.sceneList(laserSceneParam);
|
|
|
|
-// }
|
|
|
|
- fdkkResponse = laserClient.sceneList(laserSceneParam);
|
|
|
|
|
|
+ FdkkResponse fdkkResponse = laserClient.sceneList(laserSceneParam);
|
|
if(fdkkResponse.getCode() !=200){
|
|
if(fdkkResponse.getCode() !=200){
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
|
|
}
|
|
}
|
|
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()));
|
|
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()));
|
|
- JSONArray list = null;
|
|
|
|
-// if(param.getNumList() == null || param.getNumList().size()<=0){
|
|
|
|
-// list = jsonObject.getJSONObject("pageInfo").getJSONArray("list");
|
|
|
|
-// total = jsonObject.getJSONObject("pageInfo").getLong("total");
|
|
|
|
-// }else {
|
|
|
|
-// list = jsonObject.getJSONArray("list");
|
|
|
|
-// total =jsonObject.getLong("total");
|
|
|
|
-// }
|
|
|
|
- list = jsonObject.getJSONArray("list");
|
|
|
|
|
|
+ JSONArray list = jsonObject.getJSONArray("list");
|
|
total =jsonObject.getLong("total");
|
|
total =jsonObject.getLong("total");
|
|
for (Object o : list) {
|
|
for (Object o : list) {
|
|
String res = JSONObject.toJSONString(o);
|
|
String res = JSONObject.toJSONString(o);
|
|
@@ -157,6 +134,15 @@ public class SceneService implements ISceneService {
|
|
sceneVoList.add(vo);
|
|
sceneVoList.add(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Set<String> snCodes = sceneVoList.stream().map(SceneVo::getSnCode).collect(Collectors.toSet());
|
|
|
|
+ HashMap<String, TmDepartment> map = tmCameraService.getMapBySnCodes(snCodes);
|
|
|
|
+ for (SceneVo sceneVo : sceneVoList) {
|
|
|
|
+ TmDepartment tmDepartment = map.get(sceneVo.getSnCode().toUpperCase());
|
|
|
|
+ if(tmDepartment != null){
|
|
|
|
+ sceneVo.setDeptId(tmDepartment.getId());
|
|
|
|
+ sceneVo.setDeptName(tmDepartment.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
Page<SceneVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());
|
|
Page<SceneVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());
|
|
voPage.setRecords(sceneVoList);
|
|
voPage.setRecords(sceneVoList);
|
|
voPage.setTotal(total);
|
|
voPage.setTotal(total);
|