Commit 58d587e3 by 杜广伟

删除引起异常的错误代码;

1 parent 69360dfa
package com.viontech; package com.viontech;
import com.google.gson.Gson;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter; import org.springframework.web.filter.CorsFilter;
import java.util.ArrayList;
import java.util.List;
@SpringBootApplication(scanBasePackages = {"com.viontech.*"}) @SpringBootApplication(scanBasePackages = {"com.viontech.*"})
@Configuration @Configuration
...@@ -33,7 +27,7 @@ public class Application { ...@@ -33,7 +27,7 @@ public class Application {
*@Date:2019/11/26 *@Date:2019/11/26
*@Author:dugw *@Author:dugw
*/ */
@Bean /*@Bean
public GsonHttpMessageConverter gsonHttpMessageConverter(Gson gson) { public GsonHttpMessageConverter gsonHttpMessageConverter(Gson gson) {
GsonHttpMessageConverter converter = new GsonHttpMessageConverter(); GsonHttpMessageConverter converter = new GsonHttpMessageConverter();
converter.setGson(gson); converter.setGson(gson);
...@@ -44,7 +38,7 @@ public class Application { ...@@ -44,7 +38,7 @@ public class Application {
converter.setSupportedMediaTypes(supportedMediaTypes); converter.setSupportedMediaTypes(supportedMediaTypes);
} }
return converter; return converter;
} }*/
@Configuration @Configuration
public class CorsConfig { public class CorsConfig {
......
...@@ -22,7 +22,8 @@ public interface MessagePushAPIHandler { ...@@ -22,7 +22,8 @@ public interface MessagePushAPIHandler {
* @return * @return
*/ */
@Headers({"Content-Type: application/json","Accept: application/json"}) @Headers({"Content-Type: application/json","Accept: application/json"})
@PostMapping(value = "/testCode/reciveMessage") @PostMapping(value = "/external/vionvisionvideo/receiveVideoEvent")
// @PostMapping(value = "/testCode/reciveMessage")
Map auditMessagePush(@RequestBody Map params); Map auditMessagePush(@RequestBody Map params);
} }
...@@ -87,13 +87,14 @@ public class BehaviorAuditServiceImpl implements IBehaviorAuditService { ...@@ -87,13 +87,14 @@ public class BehaviorAuditServiceImpl implements IBehaviorAuditService {
if (archiveEntityList.size() == 1){ if (archiveEntityList.size() == 1){
return JsonMessageUtil.getSuccessJsonMsg("事件审核未通过操作成功"); return JsonMessageUtil.getSuccessJsonMsg("事件审核未通过操作成功");
} }
//更新归档和时间的对应关系
String archiveIds = archiveEntityList.stream().map(model -> model.getArchive_unid().toString()) String archiveIds = archiveEntityList.stream().map(model -> model.getArchive_unid().toString())
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
BehaviorArchiveEntity firstArchiveData = archiveEntityList.get(0); BehaviorArchiveEntity firstArchiveData = archiveEntityList.get(0);
Integer firstArchiveId = firstArchiveData.getArchive_unid(); Integer firstArchiveId = firstArchiveData.getArchive_unid();
String updateArchive2EventRel = "UPDATE tb_event_archive_rel SET archive_unid = "+firstArchiveId+" where archive_unid in ("+archiveIds+")"; String updateArchive2EventRel = "UPDATE tb_event_archive_rel SET archive_unid = "+firstArchiveId+" where archive_unid in ("+archiveIds+")";
jdbcTemplate.update(updateArchive2EventRel); jdbcTemplate.update(updateArchive2EventRel);
//除了第一条归档数据外,删除其他
archiveEntityList.remove(0); archiveEntityList.remove(0);
eventArchiveRepository.deleteAll(archiveEntityList); eventArchiveRepository.deleteAll(archiveEntityList);
} }
......
...@@ -44,5 +44,5 @@ spring: ...@@ -44,5 +44,5 @@ spring:
pub-sub-domain: true pub-sub-domain: true
message: message:
audit: audit:
isOpen: false isOpen: true
httpUrl: 127.0.0.1:16060 httpUrl: 127.0.0.1:16060
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!