遍历HashMap

public String query() {
		agentList = bizCardAgentService.findAll();
		daiOilOrderRecordStatusMap = DaiOilOrderRecordStatus.toStringMap();
		// 统计总数
		totalRecord = 0;
		totalSuccessAmount = 0;
		List<HashMap> list = (List<HashMap>) this.getValueList().getList();
		for (int i = 0; i < list.size(); i++) {
			Map rowMap = (Map) list.get(i);
			if(rowMap.get("status").toString().equals("Success")){
				totalRecord += 1;
				try {
					totalSuccessAmount += new Double(rowMap.get("amount").toString());
				} catch (Exception e) {
					// TODO: handle exception
				}
			}
		}
		return super.query();
	}


你可能感兴趣的:(遍历HashMap)