用时间查询的时候遇到报这个错误的:
msg: JSON parse error: Can not deserialize value of type java.sql. Timestamp或者 LocalDateTime from String "NaN-aN-aN aN:aN:aN": not a valid representation (error: Failed to parse Date value 'NaN-aN-aN aN:aN:aN': Unparseable date: "NaN-aN-aN aN:aN:aN"); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not deserialize value of type java.sql.Timestamp from String "NaN-aN-aN aN:aN:aN": not a valid representation (error: Failed to parse Date value 'NaN-aN-aN aN:aN:aN': Unparseable date: "NaN-aN-aN aN:aN:aN")
at [Source: java.io.PushbackInputStream@61bdb1d; line: 1, column: 18] (through reference chain: com.myqm.pojo.ift.deal.query.QueryTransaction["createTimeEnd"])
解决方法:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
如
@ApiModelProperty(value = "查询建单结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
protected Timestamp createTimeEnd;