|
@@ -1,17 +1,15 @@
|
|
package com.fdkankan.manage.httpClient.service;
|
|
package com.fdkankan.manage.httpClient.service;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
+import com.fdkankan.manage.entity.*;
|
|
import com.fdkankan.manage.mq.common.MqQueueUtil;
|
|
import com.fdkankan.manage.mq.common.MqQueueUtil;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
|
+import com.fdkankan.redis.util.RedisUtil;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fdkankan.manage.common.*;
|
|
import com.fdkankan.manage.common.*;
|
|
-import com.fdkankan.manage.entity.Camera;
|
|
|
|
-import com.fdkankan.manage.entity.CameraDetail;
|
|
|
|
-import com.fdkankan.manage.entity.SceneBuildProcessLog;
|
|
|
|
-import com.fdkankan.manage.entity.User;
|
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
import com.fdkankan.manage.httpClient.client.LaserClient;
|
|
import com.fdkankan.manage.httpClient.client.LaserClient;
|
|
import com.fdkankan.manage.httpClient.param.LaserSceneMoveParam;
|
|
import com.fdkankan.manage.httpClient.param.LaserSceneMoveParam;
|
|
@@ -54,7 +52,15 @@ public class LaserService {
|
|
@Autowired
|
|
@Autowired
|
|
IScenePlusService scenePlusService;
|
|
IScenePlusService scenePlusService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ IScenePlusExtService scenePlusExtService;
|
|
|
|
+ @Autowired
|
|
RabbitMqProducer rabbitMqProducer;
|
|
RabbitMqProducer rabbitMqProducer;
|
|
|
|
+ @Autowired
|
|
|
|
+ ICommonService commonService;
|
|
|
|
+ @Autowired
|
|
|
|
+ ISceneProService sceneProService;
|
|
|
|
+ @Autowired
|
|
|
|
+ RedisUtil redisUtil;
|
|
|
|
|
|
|
|
|
|
public PageInfo pageList(SceneParam param) {
|
|
public PageInfo pageList(SceneParam param) {
|
|
@@ -98,6 +104,9 @@ public class LaserService {
|
|
vo.setDataSource(scenePlusService.getDataSourceByNum(vo.getNum()));
|
|
vo.setDataSource(scenePlusService.getDataSourceByNum(vo.getNum()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ vo.setShootCount(this.getLaserSceneShootNum(vo.getNum()));
|
|
|
|
+ vo.setGps(this.getLaserSceneGps(vo.getNum()));
|
|
|
|
+ vo.setAddressComponent(commonService.getAddressComponent(vo.getGps()));
|
|
sceneVoList.add(vo);
|
|
sceneVoList.add(vo);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -113,6 +122,36 @@ public class LaserService {
|
|
return PageInfo.PageInfo(voPage);
|
|
return PageInfo.PageInfo(voPage);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private Integer getLaserSceneShootNum(String num) {
|
|
|
|
+ String redisKey2 = String.format(RedisKeyUtil.numShootKey, num);
|
|
|
|
+ if(redisUtil.hasKey(redisKey2)){
|
|
|
|
+ return Integer.valueOf(redisUtil.get(String.format(RedisKeyUtil.numShootKey, num)));
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private String getLaserSceneGps(String num) {
|
|
|
|
+ String redisKey = String.format(RedisKeyUtil.numGpsKey, num);
|
|
|
|
+ String redisKey2 = String.format(RedisKeyUtil.numShootKey, num);
|
|
|
|
+ if(redisUtil.hasKey(redisKey)){
|
|
|
|
+ return redisUtil.get(redisKey);
|
|
|
|
+ }
|
|
|
|
+ ScenePro pro = sceneProService.getByNum(num);
|
|
|
|
+ if(pro != null){
|
|
|
|
+ redisUtil.set(redisKey,pro.getGps());
|
|
|
|
+ redisUtil.set(redisKey2,String.valueOf(pro.getShootCount()== null ? 0 :pro.getShootCount()));
|
|
|
|
+ return pro.getGps();
|
|
|
|
+ }
|
|
|
|
+ ScenePlus plus = scenePlusService.getByNum(num);
|
|
|
|
+ if(plus != null){
|
|
|
|
+ ScenePlusExt ext = scenePlusExtService.getByPlusId(plus.getId());
|
|
|
|
+ redisUtil.set(redisKey,ext.getGps());
|
|
|
|
+ redisUtil.set(redisKey2,String.valueOf(ext.getShootCount()== null ? 0 :ext.getShootCount()));
|
|
|
|
+ return ext.getGps();
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
private LaserSceneParam getLaserSceneParam(SceneParam param) {
|
|
private LaserSceneParam getLaserSceneParam(SceneParam param) {
|
|
LaserSceneParam newParam = new LaserSceneParam();
|
|
LaserSceneParam newParam = new LaserSceneParam();
|
|
if(param.getCompanyId()!= null){ //客户场景
|
|
if(param.getCompanyId()!= null){ //客户场景
|