|
@@ -0,0 +1,156 @@
|
|
|
+package com.fdkankan.fusion.down;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.fusion.common.ResultData;
|
|
|
+import com.fdkankan.fusion.controller.*;
|
|
|
+import com.fdkankan.fusion.entity.CaseFusion;
|
|
|
+import com.fdkankan.fusion.entity.CaseTag;
|
|
|
+import com.fdkankan.fusion.entity.CaseVideoFolder;
|
|
|
+import com.fdkankan.fusion.entity.FusionGuide;
|
|
|
+import com.fdkankan.fusion.request.CaseParam;
|
|
|
+import com.fdkankan.fusion.response.FusionNumVo;
|
|
|
+import com.fdkankan.fusion.service.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class CaseDownService {
|
|
|
+
|
|
|
+ @Value("${server.servlet.context-path}")
|
|
|
+ String basePath;
|
|
|
+
|
|
|
+ public static String jsonDataName = "data.json";
|
|
|
+ public static String caseInfo = "/case/getInfo?caseId=";
|
|
|
+ public static String caseSettingsInfo = "/caseSettings/info?caseId=";
|
|
|
+ public static String hostIcon = "/edit/hotIcon/list?caseId=";
|
|
|
+ public static String caseView = "/caseView/allList?caseId=";
|
|
|
+ public static String caseFiles = "/caseFiles/allList?caseId=";
|
|
|
+ public static String caseFilesType = "/caseFilesType/allList?caseId=";
|
|
|
+ public static String caseScene = "/case/sceneList?caseId=";
|
|
|
+ public static String caseFusion = "/caseFusion/list?caseId=";
|
|
|
+ public static String caseVideoFolder = "/caseVideoFolder/allList?caseId=";
|
|
|
+ public static String caseVideo = "/caseVideo/allList?folderId=";
|
|
|
+ public static String caseTag = "/caseTag/allList?caseId=";
|
|
|
+ public static String caseTagPoint = "/caseTagPoint/allList?tagId=";
|
|
|
+ public static String caseInquest = "/caseInquest/info?caseId=";
|
|
|
+ public static String caseExtractDetail = "/caseExtractDetail/info?caseId=";
|
|
|
+ public static String fusionGuide = "/fusionGuide/allList?caseId=";
|
|
|
+ public static String fusionGuidePath = "/fusionGuidePath/allList?guideId=";
|
|
|
+ public static String fusionMeter = "/fusionMeter/allList?fusionId=";
|
|
|
+
|
|
|
+ public static String model = "/model/getInfo?modelId=";
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ICaseService caseService;
|
|
|
+ @Autowired
|
|
|
+ ICaseSettingsService caseSettingsService;
|
|
|
+ @Autowired
|
|
|
+ IFusionNumService fusionNumService;
|
|
|
+ @Autowired
|
|
|
+ ICaseViewService caseViewService;
|
|
|
+ @Autowired
|
|
|
+ ICaseVideoFolderService caseVideoFolderService;
|
|
|
+ @Autowired
|
|
|
+ ICaseVideoService caseVideoService;
|
|
|
+ @Autowired
|
|
|
+ ICaseFilesService caseFilesService;
|
|
|
+ @Autowired
|
|
|
+ ICaseFilesTypeService caseFilesTypeService;
|
|
|
+ @Autowired
|
|
|
+ IHotIconService hotIconService;
|
|
|
+ @Autowired
|
|
|
+ ICaseTagService caseTagService;
|
|
|
+ @Autowired
|
|
|
+ ICaseTagPointService caseTagPointService;
|
|
|
+ @Autowired
|
|
|
+ IFusionGuideService fusionGuideService;
|
|
|
+ @Autowired
|
|
|
+ IFusionGuidePathService fusionGuidePathService;
|
|
|
+ @Autowired
|
|
|
+ ICaseInquestService caseInquestService;
|
|
|
+ @Autowired
|
|
|
+ ICaseExtractDetailService caseExtractDetailService;
|
|
|
+ @Autowired
|
|
|
+ IFusionMeterService fusionMeterService;
|
|
|
+ @Autowired
|
|
|
+ IModelService modelService;
|
|
|
+
|
|
|
+ public void createDataJson(Integer caseId){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ CaseParam param = new CaseParam();
|
|
|
+ param.setCaseId(caseId);
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseInfo+caseId,
|
|
|
+ ResultData.ok(caseService.getInfo(caseId)));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseSettingsInfo+caseId,
|
|
|
+ ResultData.ok(caseSettingsService.getByCaseId(caseId)));
|
|
|
+
|
|
|
+ List<FusionNumVo> listByCaseId = fusionNumService.getListByCaseId(caseId,null);
|
|
|
+ jsonObject.put(basePath+caseFusion+caseId,
|
|
|
+ ResultData.ok(listByCaseId));
|
|
|
+ for (FusionNumVo fusion : listByCaseId) {
|
|
|
+ jsonObject.put(basePath+fusionMeter+fusion.getFusionId(),
|
|
|
+ ResultData.ok(fusionMeterService.getListByFusionId(fusion.getFusionId(),null)));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+model+fusion.getModelId(),
|
|
|
+ ResultData.ok(modelService.getInfo(fusion.getModelId())));
|
|
|
+ }
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseScene+caseId,
|
|
|
+ ResultData.ok(caseService.sceneList(param)));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseView+caseId,
|
|
|
+ ResultData.ok(caseViewService.allList(caseId,null,null,null,null)));
|
|
|
+
|
|
|
+ List<CaseVideoFolder> videoFolders = caseVideoFolderService.getAllList(caseId);
|
|
|
+ jsonObject.put(basePath+caseVideoFolder+caseId,
|
|
|
+ ResultData.ok(videoFolders));
|
|
|
+ for (CaseVideoFolder videoFolder : videoFolders) {
|
|
|
+ jsonObject.put(basePath+caseVideo+videoFolder.getVideoFolderId(),
|
|
|
+ ResultData.ok(caseVideoService.getAllList(videoFolder.getVideoFolderId())));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseFiles+caseId,
|
|
|
+ ResultData.ok(caseFilesService.allList(caseId,null)));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseFilesType+caseId,
|
|
|
+ ResultData.ok(caseFilesTypeService.list()));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+hostIcon+caseId,
|
|
|
+ ResultData.ok(hotIconService.getListByCaseId(caseId)));
|
|
|
+
|
|
|
+ List<CaseTag> caseTagList = caseTagService.allList(caseId, null);
|
|
|
+ jsonObject.put(basePath+caseTag+caseId,
|
|
|
+ ResultData.ok(caseTagList));
|
|
|
+ for (CaseTag tag : caseTagList) {
|
|
|
+ jsonObject.put(basePath+caseTagPoint+tag.getTagId(),
|
|
|
+ ResultData.ok(caseTagPointService.allList(tag.getTagId())));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<FusionGuide> fusionGuides = fusionGuideService.getAllList(caseId);
|
|
|
+ jsonObject.put(basePath+fusionGuide+caseId,
|
|
|
+ ResultData.ok(fusionGuides));
|
|
|
+
|
|
|
+ for (FusionGuide guide : fusionGuides) {
|
|
|
+ jsonObject.put(basePath+fusionGuidePath+guide.getFusionGuideId(),
|
|
|
+ ResultData.ok(fusionGuidePathService.getListByGuideId(guide.getFusionGuideId())));
|
|
|
+ }
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseInquest+caseId,
|
|
|
+ ResultData.ok(caseInquestService.getByCaseId(caseId)));
|
|
|
+
|
|
|
+ jsonObject.put(basePath+caseExtractDetail+caseId,
|
|
|
+ ResultData.ok(caseExtractDetailService.getByCaseId(caseId)));
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|