|
@@ -41,8 +41,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.http.*;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -50,10 +49,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -549,8 +545,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
// 判断是否是正顺的场景,如果是正顺的场景,则发送到原来的系统进行计算
|
|
|
if (cameraDetail.getCompanyId().equals(1L)) {
|
|
|
-// callV3Service(preParams);
|
|
|
-// return ResultData.ok();
|
|
|
+ callV3Service(preParams);
|
|
|
+ return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
// 判断是否是V3的场景
|
|
@@ -566,7 +562,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
public void callV3Service(String params){
|
|
|
log.info("params:{}", params);
|
|
|
- ResponseEntity<Result> responseEntity = restTemplate.postForEntity("http://172.18.157.42:8086/api/scene/file/uploadSuccessBuild?params=".concat(params), null, Result.class);
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
|
|
+ Map<String,String> paramMap = new HashMap();
|
|
|
+ paramMap.put("params",params);
|
|
|
+ HttpEntity<Object> formEntity = new HttpEntity<>(paramMap,headers);
|
|
|
+ ResponseEntity<Result> responseEntity = restTemplate.postForEntity("http://172.18.157.42:8086/api/scene/file/uploadSuccessBuild", formEntity, Result.class);
|
|
|
if (responseEntity.getStatusCode() != HttpStatus.OK || responseEntity.getBody().getCode() != HttpStatus.OK.value()) {
|
|
|
log.error("正顺场景请求V3服务器失败!");
|
|
|
return;
|