PDA收货查询修改1111
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.mhd.wms.interfaces.dto.receiptMaterialDetail;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Long 反序列化器:支持从字符串或数字解析,避免 JavaScript 大整数精度丢失。
|
||||||
|
* 前端应始终以字符串形式传递 uniqueId、parentUniqueId、inUniqueId 等大 Long 字段。
|
||||||
|
*/
|
||||||
|
public class LongFromStringDeserializer extends JsonDeserializer<Long> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||||
|
JsonNode node = p.readValueAsTree();
|
||||||
|
if (node == null || node.isNull()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (node.isTextual()) {
|
||||||
|
String s = node.asText();
|
||||||
|
return s == null || s.isEmpty() ? null : Long.parseLong(s.trim());
|
||||||
|
}
|
||||||
|
if (node.isNumber()) {
|
||||||
|
return node.asLong();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user