alibaba / fastjson

FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
https://github.com/alibaba/fastjson2/wiki/fastjson_1_upgrade_cn
Apache License 2.0
25.75k stars 6.5k forks source link

json转java对象时,id属性值变了~变了~变了~ #1978

Open stonesingsong opened 6 years ago

stonesingsong commented 6 years ago

image

image

{ "payDiffSummaryList": [ { "personnelHasAll": null, "unitHasAll": null, "payGroupHasAll": null, "accountHasAll": null, "orgUnitPath": null, "userId": null, "realmString": null, "id": "4028b88164d570120164d5869b1a0008", "employeeId": "285dca7583f34c4abee1e0b40963abb5", "employeeCode": "80021938", "employeeName": "黄泽莲", "personnelGroupCode": null, "personnelGroupName": null, "orgUnitId": "3110fb59930b4f6db804709fdc80655a", "orgUnitCode": "15002357", "orgUnitName": "蔬果小店", "groupId": null, "groupCode": null, "groupName": null, "jobId": null, "jobName": null, "posTitleId": null, "posTitleName": null, "employeeStatus": null, "checkMonth": "2018-07", "submitProcessId": null, "summaryProcessId": null, "summaryStatus": null, "diffValue": 100, "processStatus": null, "createBy": null, "createDate": null, "lastUpdateBy": null, "lastUpdateDate": null, "effectiveDateStart": null, "effectiveDateEnd": null, "details": null, "_id": 0 } ], "processType": "payDiffSummary" }

image

如图所示,id由uuid变成了0~

aceshot commented 6 years ago

Feature.DisableFieldSmartMatch 亲测使用这个可行。禁用smartMatch

stonesingsong commented 6 years ago

@aceshot 我这个问题是前端回传的json中多了一个vue组件自己产生的_id,跟业务的id冲突了,fastjson把_id的值反解析到了dto的id上了。 弱弱问一句,你说的那个属性在哪里配置啊,谢谢(我这边是SpringBoot项目)~