需求:两个list内object数据进项相加,获得新的数据,以下是我的代码部分:
List<MoneyCountBean> counttradeamt = commonService.getList("counttradeamt", bean);
List<MoneyCountBean> countrefundamt = commonService.getList("countrefundamt", bean);
List<JSONObject> jsonList = new ArrayList<JSONObject>();
for (MoneyCountBean tradeamt : counttradeamt) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", tradeamt.getId());
jsonObject.put("count", tradeamt.getCounttradeamt());
jsonList.add(jsonObject);
}
for (MoneyCountBean fundamt : countrefundamt) {
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("id", fundamt.getId());
jsonObject1.put("count", fundamt.getCountrefundamt(