JSON拚接
下面是一串JSON,我需要生成这种JSON,第一级的用很多命令都能生成,但第二级的怎么处理呢,比方"FMaterialId": {"FNumber": "测试分配3"},{"FNumber": "测试分配3"}这部分怎么生成。
{
"FRowType": "Standard",
"FMaterialId": {
"FNumber": "测试分配3"
},
"FUnitID": {
"FNumber": "Pcs"
},
"FMaterialDesc": "测试分配3",
"FWWPickMtlQty": 0.0,
"FRealQty": 11.0,
"FPriceUnitID": {
"FNumber": "Pcs"
},
"FPrice": 0.0,
"FDisPriceQty": 0.0,
"FStockStatusId": {
"FNumber": "KCZT01_SYS"
},
"FGiveAway": false,
"FOWNERTYPEID": "BD_OwnerOrg",
"FExtAuxUnitQty": 0.0,
"FCheckInComing": false,
"FIsReceiveUpdateStock": false,
"FInvoicedJoinQty": 0.0,
"FPriceBaseQty": 11.0,
"FRemainInStockUnitId": {
"FNumber": "Pcs"
},
"FBILLINGCLOSE": false,
"FRemainInStockQty": 11.0,
"FAPNotJoinQty": 11.0,
"FRemainInStockBaseQty": 11.0,
"FTaxPrice": 0.0,
"FEntryTaxRate": 0.0,
"FDiscountRate": 0.0,
"FCostPrice": 0.0,
"FAuxUnitQty": 0.0,
"FOWNERID": {
"FNumber": "100.01"
},
"FSRCBILLTYPEID": "",
"FSRCBillNo": "",
"FAllAmountExceptDisCount": 0.0,
"FPriceDiscount": 0.0,
"FConsumeSumQty": 0.0,
"FBaseConsumeSumQty": 0.0,
"FRejectsDiscountAmount": 0.0,
"FSalOutStockEntryId": 0,
"FBeforeDisPriceQty": 0.0,
"FPayableEntryID": 0,
"FSUBREQBILLSEQ": 0,
"FSUBREQENTRYID": 0
},
{
"FRowType": "Standard",
"FMaterialId": {
"FNumber": "分配测试"
},
"FUnitID": {
"FNumber": "Pcs"
},
"FMaterialDesc": "分配测试",
"FWWPickMtlQty": 0.0,
"FRealQty": 22.0,
"FPriceUnitID": {
"FNumber": "Pcs"
},
"FPrice": 0.0,
"FDisPriceQty": 0.0,
"FStockStatusId": {
"FNumber": "KCZT01_SYS"
},
"FGiveAway": false,
"FOWNERTYPEID": "BD_OwnerOrg",
"FExtAuxUnitQty": 0.0,
"FCheckInComing": false,
"FIsReceiveUpdateStock": false,
"FInvoicedJoinQty": 0.0,
"FPriceBaseQty": 22.0,
"FRemainInStockUnitId": {
"FNumber": "Pcs"
},
"FBILLINGCLOSE": false,
"FRemainInStockQty": 22.0,
"FAPNotJoinQty": 22.0,
"FRemainInStockBaseQty": 22.0,
"FTaxPrice": 0.0,
"FEntryTaxRate": 0.0,
"FDiscountRate": 0.0,
"FCostPrice": 0.0,
"FAuxUnitQty": 0.0,
"FOWNERID": {
"FNumber": "100.01"
},
"FSRCBILLTYPEID": "",
"FSRCBillNo": "",
"FAllAmountExceptDisCount": 0.0,
"FPriceDiscount": 0.0,
"FConsumeSumQty": 0.0,
"FBaseConsumeSumQty": 0.0,
"FRejectsDiscountAmount": 0.0,
"FSalOutStockEntryId": 0,
"FBeforeDisPriceQty": 0.0,
"FPayableEntryID": 0,
"FSUBREQBILLSEQ": 0,
"FSUBREQENTRYID": 0
},
{
"FRowType": "Standard",
"FMaterialId": {
"FNumber": "分配测试4"
},
"FUnitID": {
"FNumber": "Pcs"
},
"FMaterialDesc": "分配测试4",
"FWWPickMtlQty": 0.0,
"FRealQty": 33.0,
"FPriceUnitID": {
"FNumber": "Pcs"
},
"FPrice": 0.0,
"FDisPriceQty": 0.0,
"FStockStatusId": {
"FNumber": "KCZT01_SYS"
},
"FGiveAway": false,
"FOWNERTYPEID": "BD_OwnerOrg",
"FExtAuxUnitQty": 0.0,
"FCheckInComing": false,
"FIsReceiveUpdateStock": false,
"FInvoicedJoinQty": 0.0,
"FPriceBaseQty": 33.0,
"FRemainInStockUnitId": {
"FNumber": "Pcs"
},
"FBILLINGCLOSE": false,
"FRemainInStockQty": 33.0,
"FAPNotJoinQty": 33.0,
"FRemainInStockBaseQty": 33.0,
"FTaxPrice": 0.0,
"FEntryTaxRate": 0.0,
"FDiscountRate": 0.0,
"FCostPrice": 0.0,
"FAuxUnitQty": 0.0,
"FOWNERID": {
"FNumber": "100.01"
},
"FSRCBILLTYPEID": "",
"FSRCBillNo": "",
"FAllAmountExceptDisCount": 0.0,
"FPriceDiscount": 0.0,
"FConsumeSumQty": 0.0,
"FBaseConsumeSumQty": 0.0,
"FRejectsDiscountAmount": 0.0,
"FSalOutStockEntryId": 0,
"FBeforeDisPriceQty": 0.0,
"FPayableEntryID": 0,
"FSUBREQBILLSEQ": 0,
"FSUBREQENTRYID": 0
}
这个其实不复杂,两步就完成了,
1.创建内层对象
2.把内层包在里面
测试效果
楼主可以使用一下这个插件,对象操作工具集合
对象操作工具集合 - 葡萄城市场 (grapecity.com.cn)
使用其中的创建对象命令就能完成了哈
Joe.xu 发表于 2023-11-22 17:43
楼主可以使用一下这个插件,对象操作工具集合
对象操作工具集合 - 葡萄城市场 (grapecity.com.cn)
有没有DEMO参考一下:) 请问,你这个拼接最后成功了吗,能分享一个DEMO上来吗?:D 这个帖子比较老了,看看楼主是否还有之前的demo,您也可以参考最佳答案的方式,
原理是类似的,从最里层开始处理
页:
[1]