|
|
@@ -17,11 +17,10 @@ import com.fdkankan.manage.constant.SceneTypeLabelEnum;
|
|
|
import com.fdkankan.manage.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.*;
|
|
|
import com.fdkankan.manage.httpClient.client.FdKKClient;
|
|
|
-import com.fdkankan.manage.httpClient.client.OverallClient;
|
|
|
import com.fdkankan.manage.httpClient.service.LaserService;
|
|
|
import com.fdkankan.manage.entity.*;
|
|
|
import com.fdkankan.manage.httpClient.service.OverallService;
|
|
|
-import com.fdkankan.manage.httpClient.vo.OverallVo;
|
|
|
+import com.fdkankan.manage.mapper.IScenePlusMapper;
|
|
|
import com.fdkankan.manage.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.manage.mq.common.MqQueueUtil;
|
|
|
import com.fdkankan.manage.mq.param.ScenePayStatusVo;
|
|
|
@@ -29,9 +28,9 @@ import com.fdkankan.manage.mq.param.SceneRestStoreVo;
|
|
|
import com.fdkankan.manage.service.*;
|
|
|
import com.fdkankan.manage.util.CameraUtils;
|
|
|
import com.fdkankan.manage.util.DateUtils;
|
|
|
-import com.fdkankan.manage.util.NumTypeUtils;
|
|
|
import com.fdkankan.manage.util.SceneStatusUtil;
|
|
|
import com.fdkankan.manage.vo.request.SceneParam;
|
|
|
+import com.fdkankan.manage.vo.request.SetFeedOptionParam;
|
|
|
import com.fdkankan.manage.vo.response.*;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
@@ -107,6 +106,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
IMqSendLogService mqSendLogService;
|
|
|
@Autowired
|
|
|
OverallService overallService;
|
|
|
+ @Autowired
|
|
|
+ ICameraTypeService cameraTypeService;
|
|
|
+ @Autowired
|
|
|
+ IFeedbackOptionService feedbackOptionService;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -162,7 +165,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(cameraDetail == null ){
|
|
|
return;
|
|
|
}
|
|
|
- if(!"aws".equals(CacheUtil.uploadType) && ( cameraDetail.getType() ==10 || cameraDetail.getType() == 11)){
|
|
|
+ if(!"aws".equals(CacheUtil.uploadType) && cameraTypeService.isLaser(cameraDetail.getType())){
|
|
|
return;
|
|
|
}
|
|
|
ScenePayStatusVo scenePayStatusVo = new ScenePayStatusVo(cameraDetail.getCameraId());
|
|
|
@@ -206,13 +209,15 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
@Override
|
|
|
public PageInfo pageList(SceneParam param) {
|
|
|
-
|
|
|
- SceneTypeLabelEnum sceneTypeLabelEnum = SceneTypeLabelEnum.getByLabelType(param.getType());
|
|
|
- if(sceneTypeLabelEnum == null){
|
|
|
- throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ SceneTypeLabelEnum sceneTypeLabelEnum = null;
|
|
|
+ if(param.getType() != null){
|
|
|
+ sceneTypeLabelEnum = SceneTypeLabelEnum.getByLabelType(param.getType());
|
|
|
+ if(sceneTypeLabelEnum == null){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if(param.getType() == 3){ //双目lite
|
|
|
+ if(param.getType() != null && param.getType() == 3){ //双目lite
|
|
|
return sceneService.pageList(param);
|
|
|
}
|
|
|
//优化查询,去掉left join
|
|
|
@@ -242,7 +247,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
return PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize());
|
|
|
}
|
|
|
HashMap<String, JSONObject> laserMap = new HashMap<>();
|
|
|
- param.setIsLaser(sceneTypeLabelEnum.getLaser());
|
|
|
+ param.setIsLaser(sceneTypeLabelEnum != null && sceneTypeLabelEnum.getLaser());
|
|
|
|
|
|
Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
List<SceneVo> records = page.getRecords();
|
|
|
@@ -253,6 +258,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
HashMap<String,MqSendLog> mqSendLogMap = null;
|
|
|
|
|
|
List<String> sceneNumList = page.getRecords().stream().map(SceneVo::getNum).collect(Collectors.toList());
|
|
|
+ List<Integer> feedbackOptionIds = page.getRecords().stream().map(SceneVo::getFeedbackOptionId).collect(Collectors.toList());
|
|
|
+ HashMap<Integer, FeedbackOption> mapByIds = feedbackOptionService.getMapByIds(new HashSet<>(feedbackOptionIds));
|
|
|
+
|
|
|
if(!records.isEmpty()){
|
|
|
map = copyLogService.getByNewNumList(sceneNumList);
|
|
|
coldStorageMap = sceneColdStorageService.getByNumList(sceneNumList);
|
|
|
@@ -263,7 +271,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
if(param.getIsLaser()){
|
|
|
laserMap = laserService.list(sceneNumList,sceneTypeLabelEnum.getSceneSource().get(0));
|
|
|
-
|
|
|
}
|
|
|
|
|
|
List<String> modelingNumList = page.getRecords().stream().filter(e -> e.getStatus() == 0).map(SceneVo::getNum).collect(Collectors.toList());
|
|
|
@@ -290,6 +297,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(record.getSceneSource() != null && (SceneTypeLabelEnum.isLaserBySceneSource(record.getSceneSource()))){
|
|
|
record.setComputeTime(record.getMeshComputeTime());
|
|
|
}
|
|
|
+ if(CameraUtils.isLaser(record.getSceneSource(),record.getIsObj())){
|
|
|
+ record.setSceneName(record.getLaserTitle());
|
|
|
+ }
|
|
|
}
|
|
|
if(record.getStatus() != -2){
|
|
|
record.setComputeTime(null);
|
|
|
@@ -329,7 +339,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
record.setBuildErrorReason(SceneBuildProcessLogEnum.getReason(process));
|
|
|
}
|
|
|
- //{"latitude":22.3672085,"longitude":113.595673,"altitude":9.275519,"horizontalAccuracy":65.0,"verticalAccuracy":10.0,"timestamp":1564381147.2775609}
|
|
|
record.setAddressComponent(commonService.getAddressComponent(record.getGps()));
|
|
|
|
|
|
if(mqSendLogMap!=null){
|
|
|
@@ -339,13 +348,13 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
record.setStatus(-4);
|
|
|
}
|
|
|
}
|
|
|
+ FeedbackOption feedbackOption = mapByIds.get(record.getFeedbackOptionId());
|
|
|
+ if(feedbackOption != null){
|
|
|
+ record.setFeedbackOptionName(feedbackOption.getNameCn());
|
|
|
+ }else {
|
|
|
+ record.setFeedbackOptionId(null);
|
|
|
+ }
|
|
|
|
|
|
-// if(record.getLocation() != null && (record.getLocation() == 5 || record.getLocation() == 6)){
|
|
|
-// if(record.getMixture() != 1){
|
|
|
-// record.setSlamCount(record.getShootCount());
|
|
|
-// record.setShootCount(null);
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
return PageInfo.PageInfo(page);
|
|
|
}
|
|
|
@@ -467,19 +476,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
sceneResourceCameraService.setCooperationUser(cameraDetail,num);
|
|
|
|
|
|
//String newDataSource = updateFdageNewDataSource(scenePro, scenePlus, oldCamera.getSnCode(), param.getSnCode(), dataSource);
|
|
|
-
|
|
|
- if(cameraDetail.getType() == 10 || cameraDetail.getType() == 11){ //深时场景
|
|
|
+ Boolean newIsLaser = cameraTypeService.isLaser(cameraDetail.getType());
|
|
|
+ Boolean oldIsLaser = cameraTypeService.isLaser(oldCameraDetail.getType());
|
|
|
+ if(newIsLaser){ //深时场景
|
|
|
//迁移深时 dataSource
|
|
|
//FileUtil.move(new File(dataSource +"_laserData"),new File(newDataSource+"_laserData"),true);
|
|
|
laserService.move(num,oldCamera.getSnCode(),camera.getSnCode(),cameraDetail.getUserId(),dataSource);
|
|
|
}
|
|
|
- cameraDetailService.updateUseSpace(oldCameraDetail.getCameraId(),oldCameraDetail.getUnit().equals("SP")?-1L: -space);
|
|
|
- cameraDetailService.updateUseSpace(cameraDetail.getCameraId(),cameraDetail.getUnit().equals("SP")?+1L: +space);
|
|
|
|
|
|
- if(!"aws".equals(CacheUtil.uploadType) && oldCameraDetail.getType() != 11 && oldCameraDetail.getType() != 10 && subSpace >0){ //有剩余容量解封容量内场景
|
|
|
+ if(!"aws".equals(CacheUtil.uploadType) && !oldIsLaser && subSpace >0){ //有剩余容量解封容量内场景
|
|
|
cameraIds.add(oldCameraDetail.getCameraId());
|
|
|
}
|
|
|
- if(!"aws".equals(CacheUtil.uploadType) && cameraDetail.getType() != 11 && cameraDetail.getType() != 10){ //有剩余容量解封容量内场景
|
|
|
+ if(!"aws".equals(CacheUtil.uploadType) && !oldIsLaser){ //有剩余容量解封容量内场景
|
|
|
cameraIds.add(cameraDetail.getCameraId());
|
|
|
}
|
|
|
if("aws".equals(CacheUtil.uploadType) && subSpace >0){ //有剩余容量解封容量内场景
|
|
|
@@ -686,7 +694,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
scenePlusService.removeById(scenePlus.getId());
|
|
|
}
|
|
|
- if(sceneSource != null && (sceneSource == 4 || sceneSource == 5 || sceneSource ==57)){
|
|
|
+ if(CameraUtils.isLaser(sceneSource)){
|
|
|
laserService.delete(num);
|
|
|
}
|
|
|
//overallService.delete(num);
|
|
|
@@ -913,7 +921,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
}
|
|
|
//深时场景通知修改计算完成时间
|
|
|
- if(sceneResource != null && (sceneResource == 4 || sceneResource == 5)){
|
|
|
+ if(CameraUtils.isLaser(sceneResource)){
|
|
|
HashMap<String,String> map = new HashMap<>();
|
|
|
map.put("sceneCode",num);
|
|
|
map.put("algorithmTime",date);
|
|
|
@@ -965,4 +973,76 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
public Object labelList() {
|
|
|
return SceneTypeLabelEnum.getAllProperties();
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void setFeedbackOption(SetFeedOptionParam param) {
|
|
|
+ LambdaUpdateWrapper<ScenePro> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(ScenePro::getNum,param.getNum());
|
|
|
+ updateWrapper.set(ScenePro::getFeedbackOptionId,param.getFeedbackOptionId());
|
|
|
+ this.update(updateWrapper);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<ScenePlus> updateWrapper2 = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper2.eq(ScenePlus::getNum,param.getNum());
|
|
|
+ updateWrapper2.set(ScenePlus::getFeedbackOptionId,param.getFeedbackOptionId());
|
|
|
+ scenePlusService.update(updateWrapper2);
|
|
|
+
|
|
|
+ LambdaUpdateWrapper<Scene> updateWrapper3 = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper3.eq(Scene::getNum,param.getNum());
|
|
|
+ updateWrapper3.set(Scene::getFeedbackOptionId,param.getFeedbackOptionId());
|
|
|
+ sceneService.update(updateWrapper3);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ IScenePlusMapper scenePlusMapper;
|
|
|
+ @Override
|
|
|
+ public void reDelScene(List<String> numList) {
|
|
|
+
|
|
|
+ List<String> laserNumList = new ArrayList<>();
|
|
|
+ List<String> qjkkNumList = new ArrayList<>();
|
|
|
+ List<ScenePro> sceneProList = this.getBaseMapper().selectDelPro(numList);
|
|
|
+ if(!sceneProList.isEmpty()){
|
|
|
+ List<Long> proIds = sceneProList.stream().map(ScenePro::getId).collect(Collectors.toList());
|
|
|
+ this.getBaseMapper().reDelScenePro(numList);
|
|
|
+ this.getBaseMapper().reDelSceneProEdit(proIds);
|
|
|
+
|
|
|
+ List<String> lNumList = sceneProList.stream().filter(e -> CameraUtils.isLaser(e.getSceneSource())).map(ScenePro::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList.isEmpty()){
|
|
|
+ laserNumList.addAll(lNumList);
|
|
|
+ }
|
|
|
+ List<String> lNumList2 = sceneProList.stream().filter(e -> CameraUtils.isQjkk(e.getSceneSource())).map(ScenePro::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList2.isEmpty()){
|
|
|
+ qjkkNumList.addAll(lNumList2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ScenePlus> scenePlusList = scenePlusMapper.selectDelPro(numList);
|
|
|
+ if(!scenePlusList.isEmpty()){
|
|
|
+ List<Long> plusIds = scenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
+ scenePlusMapper.reDelScenePro(numList);
|
|
|
+ scenePlusMapper.reDelSceneProEdit(plusIds);
|
|
|
+
|
|
|
+ List<String> lNumList = scenePlusList.stream().filter(e -> CameraUtils.isLaser(e.getSceneSource())).map(ScenePlus::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList.isEmpty()){
|
|
|
+ laserNumList.addAll(lNumList);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> lNumList2 = scenePlusList.stream().filter(e -> CameraUtils.isQjkk(e.getSceneSource())).map(ScenePlus::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList2.isEmpty()){
|
|
|
+ qjkkNumList.addAll(lNumList2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!laserNumList.isEmpty()){
|
|
|
+ HashMap<String,Object> map = new HashMap<>();
|
|
|
+ map.put("numList",laserNumList);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(MqQueueUtil.RECOVER_SCENE,map);
|
|
|
+ }
|
|
|
+ if(!qjkkNumList.isEmpty()){
|
|
|
+ HashMap<String,Object> map = new HashMap<>();
|
|
|
+ map.put("numList",qjkkNumList);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(MqQueueUtil.PANO_RECOVER_SCENE,map);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|