我有来自arraylist的JSON数据
原样:
[{"CategoryID":"2","Discontinued":"0","ProductID":"3","ProductName":"Aniseed Syrup","QuantityPerUnit":"12 - 550 ml bottles","ReorderLevel":"25","SupplierID":"1","UnitPrice":"10000","UnitsInStock":"13","UnitsOnOrder":"70"},{"CategoryID":"2","Discontinued":"1","ProductID":"5","ProductName":"Chef Anton\u0027s Gumbo Mix","QuantityPerUnit":"36 boxes","ReorderLevel":"0","SupplierID":"2","UnitPrice":"21350","UnitsInStock":"0","UnitsOnOrder":"0"},{"CategoryID":"2","Discontinued":"0","ProductID":"3","ProductName":"Aniseed Syrup","QuantityPerUnit":"12 - 550 ml bottles","ReorderLevel":"25","SupplierID":"1","UnitPrice":"10000","UnitsInStock":"13","UnitsOnOrder":"70"}]
如何在Java android中通过arraylist通过产品ID,总和单价和数量进行JSON数据合并?
成为:
[{"CategoryID":"2","Discontinued":"0","ProductID":"3","ProductName":"Aniseed Syrup","QuantityPerUnit":"2","ReorderLevel":"25","SupplierID":"1","UnitPrice":"20000","UnitsInStock":"13","UnitsOnOrder":"70"},{"CategoryID":"2","Discontinued":"1","ProductID":"5","ProductName":"Chef Anton\u0027s Gumbo Mix","QuantityPerUnit":"36 boxes","ReorderLevel":"0","SupplierID":"2","UnitPrice":"21350","UnitsInStock":"0","UnitsOnOrder":"0"}]