|
@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
import com.fdkankan.common.constant.CommonSuccessStatus;
|
|
|
|
+import com.fdkankan.common.util.DateExtUtil;
|
|
import com.fdkankan.extend.TowerSceneBean;
|
|
import com.fdkankan.extend.TowerSceneBean;
|
|
import com.fdkankan.extend.entity.Camera;
|
|
import com.fdkankan.extend.entity.Camera;
|
|
import com.fdkankan.extend.entity.CameraDetail;
|
|
import com.fdkankan.extend.entity.CameraDetail;
|
|
@@ -24,6 +25,7 @@ import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
|
+import lombok.Data;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -139,12 +141,12 @@ public class TowerServiceImpl implements ITowerService {
|
|
|
|
|
|
log.info("结束下载,开始推送:{}", num);
|
|
log.info("结束下载,开始推送:{}", num);
|
|
|
|
|
|
-// try {
|
|
|
|
|
|
+ try {
|
|
// this.dataPush(num, title, towerSceneBean.getSceneId(), towerSceneBean.getRoomId(), zipPath);
|
|
// this.dataPush(num, title, towerSceneBean.getSceneId(), towerSceneBean.getRoomId(), zipPath);
|
|
-// }finally {
|
|
|
|
|
|
+ }finally {
|
|
// FileUtil.del(scenePath);
|
|
// FileUtil.del(scenePath);
|
|
// FileUtil.del(sceneSourcePath);
|
|
// FileUtil.del(sceneSourcePath);
|
|
-// }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
// FileUtil.del(scenePath);
|
|
// FileUtil.del(scenePath);
|
|
FileUtil.copy(zipPath, parentPath, true);
|
|
FileUtil.copy(zipPath, parentPath, true);
|
|
@@ -153,11 +155,6 @@ public class TowerServiceImpl implements ITowerService {
|
|
return zipPath;
|
|
return zipPath;
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- boolean directory = FileUtil.isDirectory("/home/backend/4dkankan_v4/modeling-extend/download/KK-t-rXyBOE9LG8F/123123_456456/images/4k/");
|
|
|
|
- System.out.println(directory);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void packSceneData(Long companyId, List<String> nums) {
|
|
public void packSceneData(Long companyId, List<String> nums) {
|
|
|
|
|
|
@@ -185,6 +182,21 @@ public class TowerServiceImpl implements ITowerService {
|
|
List<TowerSceneBean> towerSceneBeans = JSON.parseArray(sceneStr, TowerSceneBean.class);
|
|
List<TowerSceneBean> towerSceneBeans = JSON.parseArray(sceneStr, TowerSceneBean.class);
|
|
List<String> titleList = towerSceneBeans.stream().map(TowerSceneBean::getName).collect(Collectors.toList());
|
|
List<String> titleList = towerSceneBeans.stream().map(TowerSceneBean::getName).collect(Collectors.toList());
|
|
scenePlusList = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>().in(ScenePlus::getCameraId, cameraIdList).in(ScenePlus::getTitle, titleList));
|
|
scenePlusList = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>().in(ScenePlus::getCameraId, cameraIdList).in(ScenePlus::getTitle, titleList));
|
|
|
|
+ List<String> dbTitleList = scenePlusList.stream().map(ScenePlus::getTitle).collect(Collectors.toList());
|
|
|
|
+ List<String> notFindList = titleList.stream().filter(title -> {
|
|
|
|
+ if (dbTitleList.contains(title)) {
|
|
|
|
+ return false;
|
|
|
|
+ }else{
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ if(CollUtil.isNotEmpty(notFindList)){
|
|
|
|
+ fYunFileService.uploadFile(JSON.toJSONString(notFindList).getBytes(),
|
|
|
|
+ ossParentPath.concat("notFind")
|
|
|
|
+ .concat("-")
|
|
|
|
+ .concat(DateExtUtil.format(new Date(), DateExtUtil.dateStyle7))
|
|
|
|
+ .concat(".txt"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(CollUtil.isEmpty(scenePlusList)){
|
|
if(CollUtil.isEmpty(scenePlusList)){
|
|
return;
|
|
return;
|
|
@@ -213,6 +225,8 @@ public class TowerServiceImpl implements ITowerService {
|
|
@Override
|
|
@Override
|
|
public void dataPush(String num, String title, String sceneId, String roomId, String zipPath) throws Exception {
|
|
public void dataPush(String num, String title, String sceneId, String roomId, String zipPath) throws Exception {
|
|
|
|
|
|
|
|
+ log.info("开始组装参数");
|
|
|
|
+
|
|
String fileMd5 = com.fdkankan.extend.util.FileUtil.getMulFileMD5(FileUtil.getInputStream(zipPath));
|
|
String fileMd5 = com.fdkankan.extend.util.FileUtil.getMulFileMD5(FileUtil.getInputStream(zipPath));
|
|
String compose = sceneId.concat("+").concat(roomId).concat("+").concat(fileMd5);
|
|
String compose = sceneId.concat("+").concat(roomId).concat("+").concat(fileMd5);
|
|
String encrypt = RsaCryptTools.encryptData(compose, privateKey);
|
|
String encrypt = RsaCryptTools.encryptData(compose, privateKey);
|
|
@@ -223,6 +237,9 @@ public class TowerServiceImpl implements ITowerService {
|
|
params.put("file", FileUtil.file(zipPath));
|
|
params.put("file", FileUtil.file(zipPath));
|
|
params.put("manufact", manufact);
|
|
params.put("manufact", manufact);
|
|
params.put("encrypt", encrypt);
|
|
params.put("encrypt", encrypt);
|
|
|
|
+ params.put("upUserAcct", "xxx");
|
|
|
|
+ log.info("encrypt:{}", encrypt);
|
|
|
|
+ log.info("开始推送");
|
|
String post = HttpUtil.post(url, params);
|
|
String post = HttpUtil.post(url, params);
|
|
JSONObject jsonObject = JSON.parseObject(post);
|
|
JSONObject jsonObject = JSON.parseObject(post);
|
|
|
|
|
|
@@ -230,12 +247,26 @@ public class TowerServiceImpl implements ITowerService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("stationCode", "410192010000001484");
|
|
|
|
+ params.put("roomEntityID", "000102050000000003085104");
|
|
|
|
+ params.put("file", FileUtil.file("D:\\test\\410192010000001484_000102050000000003085104.zip"));
|
|
|
|
+ params.put("manufact", "3");
|
|
|
|
+ params.put("upUserAcct", "111");
|
|
|
|
+ params.put("encrypt", "oNFZonGRrum3hldhU9AcMwP0JsXoxZocaTSTgj1h1Ag9pJzro9us0udinPr058y9KcwSPtkO58TKVE4csnasTZT00jghJQqsk0ATiNzX8QZh+F1iH33j6I3NHZu3vzjAV4lVHSo23WcEMo4s9G5dxymagYl8FKd7ua0/CYNysrs=");
|
|
|
|
+ String post = HttpUtil.post("http://120.52.136.13:2808/fileManager/uploadRsaFileZipView", params);
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(post);
|
|
|
|
+ System.out.println(jsonObject.toJSONString());
|
|
|
|
+ }
|
|
|
|
+
|
|
private void dataPushLog(String num, String title, String resultCode, String resultMsg){
|
|
private void dataPushLog(String num, String title, String resultCode, String resultMsg){
|
|
String content = num.concat("-").concat(title).concat(" : ").concat(resultCode);
|
|
String content = num.concat("-").concat(title).concat(" : ").concat(resultCode);
|
|
if(StrUtil.isNotEmpty(resultMsg)){
|
|
if(StrUtil.isNotEmpty(resultMsg)){
|
|
content = content.concat("-").concat(resultMsg);
|
|
content = content.concat("-").concat(resultMsg);
|
|
}
|
|
}
|
|
content = content.concat("\r\n");
|
|
content = content.concat("\r\n");
|
|
- FileUtil.writeUtf8String(content, parentPath);
|
|
|
|
|
|
+ FileUtil.writeUtf8String(content, parentPath.concat("download.log"));
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|