|
@@ -6,17 +6,12 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
import com.fdkankan.manage.common.PageInfo;
|
|
import com.fdkankan.manage.common.ResultData;
|
|
import com.fdkankan.manage.common.ResultData;
|
|
-import com.fdkankan.manage.entity.MqSendLog;
|
|
|
|
-import com.fdkankan.manage.entity.ScenePlus;
|
|
|
|
-import com.fdkankan.manage.entity.ScenePlusExt;
|
|
|
|
|
|
+import com.fdkankan.manage.entity.*;
|
|
import com.fdkankan.manage.httpClient.client.OverallClient;
|
|
import com.fdkankan.manage.httpClient.client.OverallClient;
|
|
import com.fdkankan.manage.httpClient.service.OverallService;
|
|
import com.fdkankan.manage.httpClient.service.OverallService;
|
|
import com.fdkankan.manage.httpClient.vo.OverallParam;
|
|
import com.fdkankan.manage.httpClient.vo.OverallParam;
|
|
import com.fdkankan.manage.httpClient.vo.OverallVo;
|
|
import com.fdkankan.manage.httpClient.vo.OverallVo;
|
|
-import com.fdkankan.manage.service.ICommonService;
|
|
|
|
-import com.fdkankan.manage.service.IMqSendLogService;
|
|
|
|
-import com.fdkankan.manage.service.IScenePlusExtService;
|
|
|
|
-import com.fdkankan.manage.service.IScenePlusService;
|
|
|
|
|
|
+import com.fdkankan.manage.service.*;
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
import com.fdkankan.manage.vo.response.SceneVo;
|
|
import com.fdkankan.manage.vo.response.SceneVo;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -49,7 +44,10 @@ public class OverallController {
|
|
ICommonService commonService;
|
|
ICommonService commonService;
|
|
@Autowired
|
|
@Autowired
|
|
IMqSendLogService mqSendLogService;
|
|
IMqSendLogService mqSendLogService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ IUserService userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ISceneColdStorageService sceneColdStorageService;
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
public ResultData list(@RequestBody OverallParam param){
|
|
public ResultData list(@RequestBody OverallParam param){
|
|
OverallVo vo = overallService.list(param);
|
|
OverallVo vo = overallService.list(param);
|
|
@@ -77,6 +75,16 @@ public class OverallController {
|
|
@PostMapping("/cameraSceneList")
|
|
@PostMapping("/cameraSceneList")
|
|
public ResultData cameraSceneList(@RequestBody OverallParam param){
|
|
public ResultData cameraSceneList(@RequestBody OverallParam param){
|
|
param.setType(2);
|
|
param.setType(2);
|
|
|
|
+ if(StringUtils.isNotBlank(param.getUserName())){
|
|
|
|
+ List<User> userList = userService.getLikeByUserName(param.getUserName());
|
|
|
|
+ List<Long> userIds = userList.stream().map(User::getId).collect(Collectors.toList());
|
|
|
|
+ List<ScenePlus> scenePluses = scenePlusService.getByUserIds(userIds);
|
|
|
|
+ if(scenePluses.isEmpty()){
|
|
|
|
+ return ResultData.ok(new PageInfo<>(param.getPageNum(), param.getPageSize(), 0, new ArrayList()));
|
|
|
|
+ }
|
|
|
|
+ List<String> numList = scenePluses.stream().map(ScenePlus::getNum).collect(Collectors.toList());
|
|
|
|
+ param.setNums(numList);
|
|
|
|
+ }
|
|
OverallVo vo = overallService.list(param);
|
|
OverallVo vo = overallService.list(param);
|
|
if(vo.getCode() != 0 ){
|
|
if(vo.getCode() != 0 ){
|
|
return ResultData.error(vo.getCode(),vo.getMsg());
|
|
return ResultData.error(vo.getCode(),vo.getMsg());
|
|
@@ -96,6 +104,13 @@ public class OverallController {
|
|
if(!numList.isEmpty()){
|
|
if(!numList.isEmpty()){
|
|
mqSendLogMap = mqSendLogService.getByNumList(numList);
|
|
mqSendLogMap = mqSendLogService.getByNumList(numList);
|
|
}
|
|
}
|
|
|
|
+ HashMap<String, SceneColdStorage> coldStorageMap = sceneColdStorageService.getByNumList(numList);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<Long> userIds = scenePluses.stream().map(ScenePlus::getUserId).collect(Collectors.toList());
|
|
|
|
+ HashMap<Long, User> userMap = userService.getByIds(userIds);
|
|
|
|
+ HashMap<String,Long> numUserIdMap = new HashMap<>();
|
|
|
|
+ scenePluses.forEach( e -> numUserIdMap.put(e.getNum(),e.getUserId()));
|
|
|
|
|
|
for (Object o : array) {
|
|
for (Object o : array) {
|
|
JSONObject obj = (JSONObject) o;
|
|
JSONObject obj = (JSONObject) o;
|
|
@@ -116,7 +131,6 @@ public class OverallController {
|
|
obj.put("gps",ext.getGps());
|
|
obj.put("gps",ext.getGps());
|
|
obj.put("addressComponent",commonService.getAddressComponent(ext.getGps()));
|
|
obj.put("addressComponent",commonService.getAddressComponent(ext.getGps()));
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
obj.put("statusString", SceneStatusUtil.getOverallStatusString(obj.getInteger("calcStatus")));
|
|
obj.put("statusString", SceneStatusUtil.getOverallStatusString(obj.getInteger("calcStatus")));
|
|
|
|
|
|
@@ -127,6 +141,18 @@ public class OverallController {
|
|
obj.put("calcStatus",-4);
|
|
obj.put("calcStatus",-4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Long userId = numUserIdMap.get(num);
|
|
|
|
+ if(userId != null){
|
|
|
|
+ User user = userMap.get(userId);
|
|
|
|
+ obj.put("userName",user==null?null :user.getUserName());
|
|
|
|
+ }
|
|
|
|
+ if(coldStorageMap != null){
|
|
|
|
+ SceneColdStorage sceneColdStorage = coldStorageMap.get(num);
|
|
|
|
+ if(sceneColdStorage != null){
|
|
|
|
+ obj.put("isColdStorage",true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
List<Object> list = new ArrayList<>(array);
|
|
List<Object> list = new ArrayList<>(array);
|
|
long total = dataObj.getLongValue("total");
|
|
long total = dataObj.getLongValue("total");
|