diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/utils/LogUtil.java b/pqs-common/common-core/src/main/java/com/njcn/common/utils/LogUtil.java index 69f7dc91a..150a14e61 100644 --- a/pqs-common/common-core/src/main/java/com/njcn/common/utils/LogUtil.java +++ b/pqs-common/common-core/src/main/java/com/njcn/common/utils/LogUtil.java @@ -47,7 +47,7 @@ public class LogUtil { public static void logExceptionStackInfo(String exceptionName, Exception exception) { //若开启了debug模式,则输出所有的栈堆信息 njcnPatchDebug(log, ExceptionUtil.getAllExceptionStackInfo(exception)); - log.error("{}{},目标文件:{}",exceptionName, exception.toString(), ExceptionUtil.getExceptionServerStackInfo(exception)); + log.error("{}{},目标文件:{}",exceptionName, exception, ExceptionUtil.getExceptionServerStackInfo(exception)); } } diff --git a/pqs-common/common-web/src/main/java/com/njcn/web/config/AntiSamyConfig.java b/pqs-common/common-web/src/main/java/com/njcn/web/config/AntiSamyConfig.java index 09b4995ec..6faf22b0c 100644 --- a/pqs-common/common-web/src/main/java/com/njcn/web/config/AntiSamyConfig.java +++ b/pqs-common/common-web/src/main/java/com/njcn/web/config/AntiSamyConfig.java @@ -1,13 +1,9 @@ package com.njcn.web.config; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; import com.njcn.web.filter.XssFilter; -import com.njcn.web.filter.XssRequestWrapper; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; /** * @author hongawen diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java index a34aeaccc..312147c6a 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java @@ -51,7 +51,7 @@ public class SupvPlanRel { private String isDelete; @JsonSerialize(using = TimestampAsLongSerializer.class) - private LocalDateTime deleteTime; + private Timestamp deleteTime; } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java b/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java index 2bb3a30da..ea4fb5170 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java @@ -1,15 +1,24 @@ package com.njcn.process.utils; import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.springframework.stereotype.Component; import java.io.IOException; import java.sql.Timestamp; @Component -public class TimestampAsLongSerializer extends JsonSerializer { +public class TimestampAsLongSerializer extends StdSerializer { + + protected TimestampAsLongSerializer(Class t) { + super(t); + } + public TimestampAsLongSerializer() { + this(null); + } + + @Override public void serialize(Timestamp value, JsonGenerator gen, SerializerProvider serializers) throws IOException { if (value != null) { diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index 90ffd923f..0ec776de5 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.oss.utils.FileStorageUtil; import com.njcn.process.mapper.SupvPlanMapper; @@ -186,6 +188,19 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { if(supvPlan.getSupvType().equals("05")){ //电容器组需要上送对象 List supvPlanRelList = supvPlanRelMapper.selectList(new LambdaQueryWrapper().eq(SupvPlanRel::getPlanId,supvPlan.getPlanId())); + if(CollUtil.isNotEmpty(supvPlanRelList)){ + System.out.println("njcnnjcnnjcn"); + ObjectMapper objectMapper = new ObjectMapper(); + supvPlanRelList.forEach(item -> { + String jsonString = null; + try { + jsonString = objectMapper.writeValueAsString(item); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + System.out.println(jsonString); + }); + } supvPlan.setPlanRel(supvPlanRelList); }