Commit 58d587e3 by 杜广伟

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

1 parent 69360dfa
package com.viontech;
import com.google.gson.Gson;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
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.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.ArrayList;
import java.util.List;
@SpringBootApplication(scanBasePackages = {"com.viontech.*"})
@Configuration
......@@ -33,7 +27,7 @@ public class Application {
*@Date:2019/11/26
*@Author:dugw
*/
@Bean
/*@Bean
public GsonHttpMessageConverter gsonHttpMessageConverter(Gson gson) {
GsonHttpMessageConverter converter = new GsonHttpMessageConverter();
converter.setGson(gson);
......@@ -44,7 +38,7 @@ public class Application {
converter.setSupportedMediaTypes(supportedMediaTypes);
}
return converter;
}
}*/
@Configuration
public class CorsConfig {
......
......@@ -22,7 +22,8 @@ public interface MessagePushAPIHandler {
* @return
*/
@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);
}
......@@ -87,13 +87,14 @@ public class BehaviorAuditServiceImpl implements IBehaviorAuditService {
if (archiveEntityList.size() == 1){
return JsonMessageUtil.getSuccessJsonMsg("事件审核未通过操作成功");
}
//更新归档和时间的对应关系
String archiveIds = archiveEntityList.stream().map(model -> model.getArchive_unid().toString())
.collect(Collectors.joining(","));
BehaviorArchiveEntity firstArchiveData = archiveEntityList.get(0);
Integer firstArchiveId = firstArchiveData.getArchive_unid();
String updateArchive2EventRel = "UPDATE tb_event_archive_rel SET archive_unid = "+firstArchiveId+" where archive_unid in ("+archiveIds+")";
jdbcTemplate.update(updateArchive2EventRel);
//除了第一条归档数据外,删除其他
archiveEntityList.remove(0);
eventArchiveRepository.deleteAll(archiveEntityList);
}
......
......@@ -44,5 +44,5 @@ spring:
pub-sub-domain: true
message:
audit:
isOpen: false
isOpen: true
httpUrl: 127.0.0.1:16060
\ 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!