|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
|
import com.fdkankan.common.constant.SceneStatus;
|
|
|
+import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.service.*;
|
|
@@ -23,7 +24,9 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
@@ -49,6 +52,8 @@ public class UploadShootingListener {
|
|
|
private IScenePlusExtService scenePlusExtService;
|
|
|
@Autowired
|
|
|
private ISceneEditControlsService sceneEditControlsService;
|
|
|
+ @Autowired
|
|
|
+ private UploadShootingService uploadShootingService;
|
|
|
|
|
|
|
|
|
@RabbitListener(
|
|
@@ -74,46 +79,40 @@ public class UploadShootingListener {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ Set<Integer> indexs = new HashSet<>();
|
|
|
String basePath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + uuid + "/";
|
|
|
//遍历检查点位相关文件是否齐全,如果齐全改为进入计算
|
|
|
for (OrigFileUploadBatch batch : batches) {
|
|
|
List<OrigFileUpload> fileUploadList = origFileUploadService.getByBatchId(batch.getBatchId());
|
|
|
String workPath = basePath;
|
|
|
- if(index){
|
|
|
-
|
|
|
+ if(index != -1){
|
|
|
+ workPath = workPath + index + "/";
|
|
|
}
|
|
|
//下载文件
|
|
|
- fileUploadList.stream().forEach(v->{
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- if(batch.getPtIndex() != -1){//如果是点位上传批次,需要校验文件上传是否齐全
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ for (OrigFileUpload origFileUpload : fileUploadList) {
|
|
|
+ HttpUtilExt.downloadFileAndCheck(origFileUpload.getFileUrl(), workPath + origFileUpload.getFileName(), 60000);
|
|
|
}
|
|
|
|
|
|
+ if(batch.getPtIndex() != -1){
|
|
|
+ //如果是点位上传批次,需要校验文件上传是否齐全
|
|
|
+ boolean lackFille = uploadShootingService.checkLackFille(batch.getPtIndex(), fileUploadList);
|
|
|
+ if(!lackFille){
|
|
|
+ indexs.add(batch.getPtIndex());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //下载文件
|
|
|
-
|
|
|
- //调用算法
|
|
|
-
|
|
|
- //上传文件
|
|
|
-
|
|
|
- //写表
|
|
|
-
|
|
|
- //处理删除点位
|
|
|
-
|
|
|
-
|
|
|
- List<OrigFileUpload> fileUploadList = origFileUploadService.getByBatchId(batchId);
|
|
|
- String path = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + uuid + "/" + index + "/";
|
|
|
- for (OrigFileUpload origFileUpload : fileUploadList) {
|
|
|
- String localPath = path + origFileUpload.getFileName();
|
|
|
- HttpUtilExt.downloadFileAndCheck(origFileUpload.getFileUrl(), localPath, 300000);
|
|
|
+ JSONObject playLoad = new JSONObject();
|
|
|
+ playLoad.put("uuid", uuid);
|
|
|
+ playLoad.put("path", basePath);
|
|
|
+ if(indexs.size() > 0){
|
|
|
+ playLoad.put("indexs", indexs);
|
|
|
+ }else if(index == -1){
|
|
|
+ playLoad.put("delIndex", true);
|
|
|
+ }else{
|
|
|
+ return;
|
|
|
}
|
|
|
- params.put("path", path);
|
|
|
- mqProducer.sendByWorkQueue("laser-preview-scene-handler", params);
|
|
|
+ mqProducer.sendByWorkQueue("laser-preview-scene-handler", playLoad);
|
|
|
|
|
|
String batchKey = RedisConstants.BATCH_ID_UPLOAD_SHOOTING.replace("@uuid@", uuid).replace("@index@", String.valueOf(index));
|
|
|
redisUtil.del(batchKey);
|