4
多个下划线 属性字段,去掉"","-" 后,数值一致,然后取hash值一致,没有处理hash冲突。 把 "","-" 加入hash运算,排除hash冲突;
复现代码示例:
String jsonStr = "{\"d_id\":\"bphyean01\",\"isOpenMergeCode\":0,\"offlineOrder\":false,\"offlineOrderType\":-1,\"og\":0,\"pushIdFromRemote\":false,\"qrisAmountPrice\":22000,\"s_req\":0,\"s_t\":1,\"skr_id\":0,\"type\":1,\"c_id\":471,\"o_$\":5500.0,\"am\":4,\"$_tp\":\"bp\",\"o_t\":1,\"a_m\":3}";
Order parseOrder = JSON.parseObject(jsonStr,Order.class);
System.out.println("parseOrder:"+parseOrder.getAmount()+"\t"+parseOrder.getAddMoney()+"\t"+JSON.toJSONString(parseOrder));
@Data
public class Order {
@JSONField(name = "d_id", ordinal = 0)
private String deviceId;
@JSONField(name = "c_id", ordinal = 1)
private Integer commodityId;
@JSONField(name = "o_$", ordinal = 2)
private Double orderPrice;
@JSONField(name = "am", ordinal = 3)
private Integer amount;
@JSONField(name = "$_tp", ordinal = 4)
private String payType;
@JSONField(name = "wx_p_id", ordinal = 5)
private Long productId;
@JSONField(name = "ext_p_id", ordinal = 6)
private Long extraProductId;
@JSONField(name = "u_id", ordinal = 7)
private String userId;
@JSONField(name = "p_id", ordinal = 8)
private Long parentId;
@JSONField(name = "o_t", ordinal = 9)
private Integer orderType;
@JSONField(name = "ts", ordinal = 10)
private Integer tradeStatus;
@JSONField(name = "pn", ordinal = 11)
private String phoneNum;
@JSONField(name = "conf_id", ordinal = 12)
private Long configId;
@JSONField(name = "sku_id", ordinal = 13)
private Long skuCommodityId;
@JSONField(name = "c_ids", ordinal = 14)
private String commodityIds;
@JSONField(name = "a_m", ordinal = 15)
private String addMoney;
@JSONField(name = "skr_id", ordinal = 15)
private Long secKillRecordId;
@JSONField(name = "c_n", ordinal = 16)
private String clientOrderNum;
@JSONField(name = "s_t", ordinal = 16)
private Integer sceneType;
@JSONField(name = "t_t", ordinal = 16)
private Integer tradingType;
}