@Test public void testAddInvoicesAndVisits() throws Exception { }
private List<HashMap> addInvoicesAndVisits(List<HashMap> result, List<HashMap> invoices, List<HashMap> visits){ for(HashMap r: result){ String departmentName = r.get("departmentName").toString(); for(HashMap v: visits){ if(departmentName.equals(v.get("department_name").toString())){ r.put("visits", v.get("visits")); break; } } for(HashMap i: invoices){ if(departmentName.equals(i.get("department_name").toString())){ r.put("invoiceAmount", i.get("invoice_amount")); break; } } } return result; }
DepartmentStatisticsServiceImpl implements DepartmentStatisticsService { private List<HashMap> addInvoicesAndVisits(List<HashMap> result, List<HashMap> invoices, List<HashMap> visits){ for(HashMap r: result){ String departmentName = r.get("departmentName").toString(); for(HashMap v: visits){ if(departmentName.equals(v.get("department_name").toString())){ r.put("visits", v.get("visits")); break; } } for(HashMap i: invoices){ if(departmentName.equals(i.get("department_name").toString())){ r.put("invoiceAmount", i.get("invoice_amount")); break; } } } return result; } }
DepartmentStatisticsServiceImpl implements DepartmentStatisticsService { private List<HashMap> addInvoicesAndVisits(List<HashMap> result, List<HashMap> invoices, List<HashMap> visits){ for(HashMap r: result){ String departmentName = r.get("departmentName").toString(); for(HashMap v: visits){ if(departmentName.equals(v.get("department_name").toString())){ r.put("visits", v.get("visits")); break; } } for(HashMap i: invoices){ if(departmentName.equals(i.get("department_name").toString())){ r.put("invoiceAmount", i.get("invoice_amount")); break; } } } return result; }  }
DepartmentStatisticsServiceImpl implements DepartmentStatisticsService { private List<HashMap> addInvoicesAndVisits(List<HashMap> result, List<HashMap> invoices, List<HashMap> visits){ for(HashMap r: result){ String departmentName = r.get("departmentName").toString(); for(HashMap v: visits){ if(departmentName.equals(v.get("department_name").toString())){ r.put("visits", v.get("visits")); break; } } for(HashMap i: invoices){ if(departmentName.equals(i.get("department_name").toString())){ r.put("invoiceAmount", i.get("invoice_amount")); break; } } } return result; }  CommonResult clinicianDepartmentStatistics(String beginDateStr, String endDateStr); CommonResult technicianDepartmentStatistics(String beginDateStr, String endDateStr); }
DepartmentStatisticsServiceImpl implements DepartmentStatisticsService { private List<HashMap> addInvoicesAndVisits(List<HashMap> result, List<HashMap> invoices, List<HashMap> visits){ for(HashMap r: result){ String departmentName = r.get("departmentName").toString(); for(HashMap v: visits){ if(departmentName.equals(v.get("department_name").toString())){ r.put("visits", v.get("visits")); break; } } for(HashMap i: invoices){ if(departmentName.equals(i.get("department_name").toString())){ r.put("invoiceAmount", i.get("invoice_amount")); break; } } } return result; }  CommonResult clinicianDepartmentStatistics(String beginDateStr, String endDateStr); CommonResult technicianDepartmentStatistics(String beginDateStr, String endDateStr);  }