zhaoyk 3 years ago
parent
commit
286886db96

+ 2 - 0
src/main/java/com/persagy/bdtp/adm/config/AdmCommonConfig.java

@@ -1,6 +1,7 @@
 package com.persagy.bdtp.adm.config;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -15,6 +16,7 @@ public class AdmCommonConfig {
 	public ObjectMapper getObjectMapper(){
 		ObjectMapper mapper = new ObjectMapper();
 		mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+		mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 		return mapper;
 	}
 

+ 3 - 5
src/main/java/com/persagy/bdtp/adm/datatx/ObjectMapper4Tx.java

@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.persagy.bdtp.adm.entity.AdmObject;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 /**
@@ -13,11 +12,10 @@ import org.springframework.stereotype.Component;
 @Component
 public class ObjectMapper4Tx {
 
-	private final ObjectMapper mapper;
+	private ObjectMapper mapper;
 
-	@Autowired
-	public ObjectMapper4Tx(ObjectMapper mapper) {
-		this.mapper = mapper;
+	public ObjectMapper4Tx() {
+		this.mapper = new ObjectMapper();
 		configMapper();
 	}
 

+ 0 - 2
src/main/java/com/persagy/bdtp/adm/entity/AdmPipeConfig.java

@@ -1,12 +1,10 @@
 package com.persagy.bdtp.adm.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import lombok.Data;
 
 @Data
 @TableName(value = "adm_pipe_config",autoResultMap = true)
-@JsonIgnoreProperties(ignoreUnknown = true)
 public class AdmPipeConfig extends BaseAdmEntity {
 
     private String classCodeFrom;

+ 0 - 2
src/main/java/com/persagy/bdtp/adm/entity/AdmRelsConfig.java

@@ -1,12 +1,10 @@
 package com.persagy.bdtp.adm.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import lombok.Data;
 
 @Data
 @TableName(value = "adm_rels_config",autoResultMap = true)
-@JsonIgnoreProperties(ignoreUnknown = true)
 public class AdmRelsConfig extends BaseAdmEntity {
 
     private String objTypeFrom;