|
@@ -31,6 +31,7 @@ import com.fdkankan.ucenter.entity.*;
|
|
|
import com.fdkankan.ucenter.httpClient.service.LaserService;
|
|
|
import com.fdkankan.ucenter.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.ucenter.mapper.ISceneUpgradeMapper;
|
|
|
+import com.fdkankan.ucenter.mq.common.MqQueueUtil;
|
|
|
import com.fdkankan.ucenter.service.*;
|
|
|
import com.fdkankan.ucenter.util.DateUserUtil;
|
|
|
import com.fdkankan.ucenter.util.SceneResourcePath;
|
|
@@ -917,16 +918,19 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
@Override
|
|
|
public void deleteByList(List<ScenePro> proList,List<ScenePlus> plusList,Long userId,String platform) {
|
|
|
HashMap<Long ,Long >cameraMap = new HashMap<>();
|
|
|
+ List<String> laserNumList = new ArrayList<>();
|
|
|
+
|
|
|
if(proList.size() >0){
|
|
|
for (ScenePro scenePro : proList) {
|
|
|
cameraMap.merge(scenePro.getCameraId(), scenePro.getSpace(), Long::sum);
|
|
|
sceneDelLogService.saveLog(scenePro.getNum(),userId);
|
|
|
- if(StringUtils.isBlank(platform) && (SceneSourceUtil.isLaser(scenePro.getSceneSource()))){
|
|
|
- laserService.delete(scenePro.getNum());
|
|
|
- }
|
|
|
}
|
|
|
List<Long> proIds = proList.parallelStream().map(ScenePro::getId).collect(Collectors.toList());
|
|
|
this.removeByIds(proIds);
|
|
|
+ List<String> lNumList = proList.stream().filter(e -> SceneSourceUtil.isLaser(e.getSceneSource())).map(ScenePro::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList.isEmpty()){
|
|
|
+ laserNumList.addAll(lNumList);
|
|
|
+ }
|
|
|
folderSceneService.delBySceneId(proIds);
|
|
|
}
|
|
|
if(plusList.size() >0){
|
|
@@ -937,19 +941,26 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(scenePlus.getCameraId()!= null && plusMap.get(scenePlus.getId())!=null){
|
|
|
Long space = plusMap.get(scenePlus.getId()).getSpace() == null ? 0 :plusMap.get(scenePlus.getId()).getSpace();
|
|
|
cameraMap.merge(scenePlus.getCameraId(), space, Long::sum);
|
|
|
-
|
|
|
}
|
|
|
sceneDelLogService.saveLog(scenePlus.getNum(),userId);
|
|
|
- if(StringUtils.isBlank(platform) && ( SceneSourceUtil.isLaser(scenePlus.getSceneSource()))){
|
|
|
- laserService.delete(scenePlus.getNum());
|
|
|
- }
|
|
|
}
|
|
|
scenePlusService.removeByIds(plusIds);
|
|
|
scenePlusExtService.removeByPlusIds(plusIds);
|
|
|
folderSceneService.delBySceneId(plusIds);
|
|
|
+
|
|
|
+ List<String> lNumList = plusList.stream().filter(e -> SceneSourceUtil.isLaser(e.getSceneSource())).map(ScenePlus::getNum).collect(Collectors.toList());
|
|
|
+ if(!lNumList.isEmpty()){
|
|
|
+ laserNumList.addAll(lNumList);
|
|
|
+ }
|
|
|
}
|
|
|
+ if(!laserNumList.isEmpty()){
|
|
|
+ HashMap<String,String> map = new HashMap<>();
|
|
|
+ map.put("numList",JSONObject.toJSONString(laserNumList));
|
|
|
+ rabbitMqProducer.sendByWorkQueue(MqQueueUtil.laserDeleteScene,map);
|
|
|
+ }
|
|
|
+
|
|
|
//恢复相机使用容量
|
|
|
- if(cameraMap.size() >0){
|
|
|
+ if(!cameraMap.isEmpty()){
|
|
|
cameraDetailService.addUsedSpace(cameraMap);
|
|
|
}
|
|
|
}
|