|
@@ -19,6 +19,7 @@ import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
|
+import com.fdkankan.scene.bean.EvidenceBean;
|
|
|
import com.fdkankan.scene.bean.IconBean;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.httpclient.ManageHttpClient;
|
|
@@ -30,6 +31,7 @@ import com.fdkankan.scene.service.ISceneIconService;
|
|
|
import com.fdkankan.scene.service.IScenePlusService;
|
|
|
import com.fdkankan.scene.vo.*;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
+import com.fdkankan.web.user.SSOUser;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -65,7 +67,7 @@ public class SceneEvidenceServiceImpl extends ServiceImpl<ISceneEvidenceMapper,
|
|
|
private FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
|
|
|
@Override
|
|
|
- public void saveEvidence(SaveEvidenceParamVO param) throws Exception {
|
|
|
+ public void saveEvidence(SaveEvidenceParamVO param, SSOUser ssoUser) throws Exception {
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
if (scenePlus == null)
|
|
@@ -79,6 +81,71 @@ public class SceneEvidenceServiceImpl extends ServiceImpl<ISceneEvidenceMapper,
|
|
|
SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
|
|
|
this.saveEvidenceToSceneEditInfo(param.getNum(), sceneEditInfo);
|
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
|
+
|
|
|
+ //推送媒体库
|
|
|
+ this.batchPushMedia(param, ssoUser, scenePlus);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void batchPushMedia(SaveEvidenceParamVO param, SSOUser ssoUser, ScenePlus scenePlus){
|
|
|
+ List<JSONObject> params = new ArrayList<>();
|
|
|
+ for (EvidenceParamVO evidenceParamVO : param.getDataList()) {
|
|
|
+ //media
|
|
|
+ JSONArray medias = evidenceParamVO.getData().getJSONArray("media");
|
|
|
+ if(CollUtil.isNotEmpty(medias)){
|
|
|
+ for (Object o : medias) {
|
|
|
+ JSONObject media = (JSONObject) o;
|
|
|
+ if(media.getIntValue("isAddMedia") != 1){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + media.getString("src");
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ params.add(item);
|
|
|
+ item.put("kno", scenePlus.getKNo());
|
|
|
+ item.put("filePath", ossPath);
|
|
|
+ item.put("fileName", media.getString("name"));
|
|
|
+ item.put("fileSize", fYunFileServiceInterface.getSpace("4dkankan", ossPath));
|
|
|
+ item.put("delSource", 0);
|
|
|
+ item.put("toHaixin", 1);
|
|
|
+ item.put("content", EvidenceBean.builder().
|
|
|
+ title(evidenceParamVO.getData().getString("title"))
|
|
|
+ .collectedTime(evidenceParamVO.getData().getString("collectedTime"))
|
|
|
+ .collectionModeName(evidenceParamVO.getData().getString("collectionModeName"))
|
|
|
+ .createAccount(ssoUser.getUserName())
|
|
|
+ .feature(evidenceParamVO.getData().getString("feature"))
|
|
|
+ .leftPosition(evidenceParamVO.getData().getString("leftPosition"))
|
|
|
+ .status(evidenceParamVO.getData().getInteger("status")).build());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //bgm
|
|
|
+ JSONObject bgm = evidenceParamVO.getData().getJSONObject("bgm");
|
|
|
+ if(bgm.getIntValue("isAddMedia") == 1){
|
|
|
+ String ossPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + bgm.getString("src");
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ params.add(item);
|
|
|
+ item.put("kno", scenePlus.getKNo());
|
|
|
+ item.put("filePath", ossPath);
|
|
|
+ item.put("fileName", bgm.getString("name"));
|
|
|
+ item.put("fileSize", fYunFileServiceInterface.getSpace("4dkankan", ossPath));
|
|
|
+ item.put("delSource", 0);
|
|
|
+ item.put("toHaixin", 1);
|
|
|
+ item.put("content", EvidenceBean.builder().
|
|
|
+ title(evidenceParamVO.getData().getString("title"))
|
|
|
+ .collectedTime(evidenceParamVO.getData().getString("collectedTime"))
|
|
|
+ .collectionModeName(evidenceParamVO.getData().getString("collectionModeName"))
|
|
|
+ .createAccount(ssoUser.getUserName())
|
|
|
+ .feature(evidenceParamVO.getData().getString("feature"))
|
|
|
+ .leftPosition(evidenceParamVO.getData().getString("leftPosition"))
|
|
|
+ .status(evidenceParamVO.getData().getInteger("status")).build());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //调用案件系统接口,进行推送
|
|
|
+ if(CollUtil.isEmpty(params)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ manageHttpClient.addMediaLibrarys(params);
|
|
|
}
|
|
|
|
|
|
private void addOrUpdateData(String num, List<EvidenceParamVO> dataList) throws Exception{
|
|
@@ -249,7 +316,7 @@ public class SceneEvidenceServiceImpl extends ServiceImpl<ISceneEvidenceMapper,
|
|
|
return data;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- this.saveEvidence(param);
|
|
|
+ this.saveEvidence(param, null);
|
|
|
|
|
|
return ResultData.ok(collect);
|
|
|
}
|