提交 082f6351 编写于 作者: zhouweidong's avatar zhouweidong

Long型数据转String,解决前端精度丢失问题

上级 13b9e248
...@@ -23,6 +23,8 @@ import java.math.BigDecimal; ...@@ -23,6 +23,8 @@ import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -66,6 +68,10 @@ public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable ...@@ -66,6 +68,10 @@ public class ${item.getCodeName()}DTO extends ${dtoBase} implements Serializable
@JSONField(name = "${jsonfield}") @JSONField(name = "${jsonfield}")
</#if> </#if>
@JsonProperty("${jsonfield}") @JsonProperty("${jsonfield}")
<#comment>Long型数据转String,解决前端精度丢失问题</#comment>
<#if srfr7javatype(apifield.getStdDataType())=='Long'>
@JsonSerialize(using = ToStringSerializer.class)
</#if>
<@valueRule defield /> <@valueRule defield />
private ${srfr7javatype(apifield.getStdDataType())} ${prvateCodeName}; private ${srfr7javatype(apifield.getStdDataType())} ${prvateCodeName};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册