-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild of the billing process. Updates to the TNRunner run, qc, and
sample tracking apps.
- Loading branch information
u0028003
committed
Apr 8, 2024
1 parent
5a9aef7
commit 38e99de
Showing
32 changed files
with
2,063 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package edu.utah.billing; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class AwsAccountExpense { | ||
|
||
private String awsAccountNumber = null; | ||
private float totalExpense = 0f; | ||
|
||
public AwsAccountExpense (String number, float total) { | ||
awsAccountNumber = number; | ||
totalExpense = total; | ||
} | ||
|
||
public String getAwsAccountNumber() { | ||
return awsAccountNumber; | ||
} | ||
|
||
public float getTotalExpense() { | ||
return totalExpense; | ||
} | ||
|
||
public static float fetchTotalExpense(ArrayList<AwsAccountExpense> accounts) { | ||
float total = 0f; | ||
for (AwsAccountExpense aae: accounts) total+= aae.getTotalExpense(); | ||
return total; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package edu.utah.billing; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.TreeMap; | ||
import org.apache.poi.ss.usermodel.Cell; | ||
import org.apache.poi.ss.usermodel.Row; | ||
import org.apache.poi.ss.usermodel.Sheet; | ||
import org.apache.poi.ss.usermodel.Workbook; | ||
import org.apache.poi.ss.usermodel.WorkbookFactory; | ||
import util.gen.IO; | ||
|
||
|
||
public class AwsXlsxAccountParser2 { | ||
|
||
private TreeMap<String, String> awsAccountGroupName = new TreeMap<String, String>(); | ||
|
||
public AwsXlsxAccountParser2(File xlsx, boolean debug) { | ||
parseIt(xlsx); | ||
|
||
if (debug) { | ||
for (String s: awsAccountGroupName.keySet()) { | ||
IO.pl(s+"\t"+awsAccountGroupName.get(s)); | ||
} | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
//AwsXlsxAccountParser p = new AwsXlsxAccountParser(new File ("/Users/u0028003/HCI/CoreAdmin/Billing/AllBillingReports/2023/6_BSR_June_2023/awsAccounts.xlsx"), true); | ||
|
||
} | ||
|
||
private void parseIt(File inputFile) { | ||
try { | ||
|
||
//Open up xlsx file | ||
Workbook wb = WorkbookFactory.create(inputFile); | ||
|
||
//Find appropriate sheet | ||
Sheet sheet = wb.getSheetAt(0); | ||
if (sheet == null) throw new IOException("Could not find a sheet in "+inputFile+" ?"); | ||
|
||
//Iterate through rows | ||
int numRows = sheet.getPhysicalNumberOfRows(); | ||
for (int r = 0; r< numRows; r++) { | ||
Row row = sheet.getRow(r); | ||
if (row != null) addAccount(row); | ||
} | ||
} catch (Exception e) { | ||
System.out.println("Aws Accounts xlsx file is not in the correct format, exiting"); | ||
e.printStackTrace(); | ||
System.exit(1); | ||
} | ||
} | ||
|
||
private void addAccount(Row row) { | ||
int numCells = row.getLastCellNum()+1; | ||
if (numCells < 2) return; | ||
|
||
Cell groupNameCell = row.getCell(0); | ||
if (groupNameCell == null) return; | ||
String groupName = groupNameCell.toString().trim(); | ||
if (groupName.startsWith("INVESTIGATOR") || groupName.length()==0) return; | ||
|
||
for (int c=1;c < numCells; c++) { | ||
Cell cell = row.getCell(c); | ||
if (cell != null) { | ||
String accountNumber = cell.toString().trim(); | ||
if (accountNumber.length()!=0) awsAccountGroupName.put(accountNumber, groupName); | ||
} | ||
} | ||
} | ||
|
||
public TreeMap<String, String> getAwsAccountGroupName() { | ||
return awsAccountGroupName; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.