|
@@ -16,8 +16,6 @@ import com.fdkankan.scene.util.CreateObjUtil;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.PrintWriter;
|
|
@@ -29,30 +27,26 @@ import java.util.Map;
|
|
|
@Log4j2
|
|
|
public class ReBuildVideoSceneReceiver {
|
|
|
|
|
|
-
|
|
|
- @Autowired
|
|
|
+ private String receiverInstance;
|
|
|
private ISceneProService sceneProService;
|
|
|
- @Autowired
|
|
|
private ISceneProEditService sceneProEditService;
|
|
|
- @Autowired
|
|
|
private IRebuildVideoProgressService rebuildVideoProgressService;
|
|
|
- @Autowired
|
|
|
private UploadToOssUtil uploadToOssUtil;
|
|
|
|
|
|
- @Value("${rabbitmq.queue.video}")
|
|
|
- private String queue;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ public ReBuildVideoSceneReceiver(String receiverInstance, ISceneProService sceneProService,
|
|
|
+ UploadToOssUtil uploadToOssUtil, IRebuildVideoProgressService rebuildVideoProgressService,
|
|
|
+ ISceneProEditService sceneProEditService){
|
|
|
+ this.receiverInstance = receiverInstance;
|
|
|
+ this.sceneProService = sceneProService;
|
|
|
+ this.sceneProEditService = sceneProEditService;
|
|
|
+ this.uploadToOssUtil = uploadToOssUtil;
|
|
|
+ this.rebuildVideoProgressService = rebuildVideoProgressService;
|
|
|
+ }
|
|
|
|
|
|
@RabbitListener(queues = "${rabbitmq.queue.video}", containerFactory = "rabbitListenerContainerFactory")
|
|
|
public void processvideo(String content) {
|
|
|
- log.info("接收处理队列当中" + queue + "的消息: " + content);
|
|
|
-
|
|
|
+ log.info(receiverInstance + "接收处理队列当中 QUEUE_VIDEO_A 的消息: " + content);
|
|
|
rebuildVideo(content);
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void rebuildVideo(String content){
|
|
@@ -158,7 +152,7 @@ public class ReBuildVideoSceneReceiver {
|
|
|
dataArray = (JSONArray) videosjson.get("data");
|
|
|
JSONObject uploadJson = null;
|
|
|
if(uploadData!=null) {
|
|
|
- uploadJson = JSONObject.parseObject(uploadData);
|
|
|
+ uploadJson = com.alibaba.fastjson.JSONObject.parseObject(uploadData);
|
|
|
uploadarray = uploadJson.getJSONArray("upload");
|
|
|
log.info("uploadarray =====" + uploadarray);
|
|
|
}
|
|
@@ -254,7 +248,7 @@ public class ReBuildVideoSceneReceiver {
|
|
|
try{
|
|
|
scene = sceneProService.findBySceneNum(projectNum);
|
|
|
if(scene != null){
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
+ com.alibaba.fastjson.JSONObject statusJson = new com.alibaba.fastjson.JSONObject();
|
|
|
//临时将-2改成1,app还没完全更新
|
|
|
statusJson.put("status", scene.getStatus() == -2? 1 : scene.getStatus());
|
|
|
statusJson.put("webSite", scene.getWebSite());
|