-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added loa support and conducted refactoring
- Loading branch information
1 parent
e1092d6
commit ba51b79
Showing
11 changed files
with
589 additions
and
18 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
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
47 changes: 46 additions & 1 deletion
47
src/main/java/com/milmove/trdmlambda/milmove/handler/LinesOfAccountingHandler.java
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 |
---|---|---|
@@ -1,5 +1,50 @@ | ||
package com.milmove.trdmlambda.milmove.handler; | ||
|
||
import com.milmove.trdmlambda.milmove.util.Trdm; | ||
|
||
import ch.qos.logback.classic.Logger; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
import java.text.ParseException; | ||
|
||
import javax.xml.datatype.DatatypeConfigurationException; | ||
import javax.xml.datatype.XMLGregorianCalendar; | ||
|
||
import org.slf4j.LoggerFactory; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.milmove.trdmlambda.milmove.exceptions.TableRequestException; | ||
import com.milmove.trdmlambda.milmove.model.lasttableupdate.LastTableUpdateResponse; | ||
|
||
@Component | ||
public class LinesOfAccountingHandler { | ||
// TODO: | ||
private Logger logger = (Logger) LoggerFactory.getLogger(LinesOfAccountingHandler.class); | ||
|
||
private Trdm trdmUtil; | ||
|
||
public LinesOfAccountingHandler(Trdm trdmUtil) { | ||
this.trdmUtil = trdmUtil; | ||
} | ||
|
||
// This cron job will handle the entirety of ensuring the RDS db | ||
// is up to date with proper TGET data. | ||
public void loaCron() | ||
throws SQLException, DatatypeConfigurationException, TableRequestException, IOException, ParseException { | ||
// Gather the last update from TRDM | ||
logger.info("getting lastTableUpdate response with physical name LN_OF_ACCT"); | ||
LastTableUpdateResponse response = trdmUtil.LastTableUpdate("LN_OF_ACCT"); | ||
logger.info("received LastTableUpdateResponse, getting our latest TGET update now"); | ||
XMLGregorianCalendar ourLastUpdate = trdmUtil.GetOurLastTGETUpdate("lines_of_accounting"); | ||
logger.info("received out latest TGET update. Comparing the 2 values to see if our TGET data is out of date"); | ||
boolean tgetOutOfDate = trdmUtil.IsTGETDataOutOfDate(ourLastUpdate, response.getLastUpdate()); | ||
if (tgetOutOfDate) { | ||
logger.info("LOA TGET data is out of date. Starting updateTGETData flow"); | ||
trdmUtil.UpdateTGETData(ourLastUpdate, "LN_OF_ACCT", "lines_of_accounting"); | ||
logger.info("finished updating LOA TGET data"); | ||
} else { | ||
// The data in RDS is up to date, no need to proceed | ||
logger.info("Lines of Accounting RDS Table TGET data already up to date"); | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
src/main/java/com/milmove/trdmlambda/milmove/model/LineOfAccounting.java
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,69 @@ | ||
package com.milmove.trdmlambda.milmove.model; | ||
|
||
import lombok.Data; | ||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
|
||
@Data | ||
public class LineOfAccounting { | ||
private UUID id; // RDS Internal | ||
private String loaSysID; | ||
private String loaDptID; | ||
private String loaTnsfrDptNm; | ||
private String loaBafID; | ||
private String loaTrsySfxTx; | ||
private String loaMajClmNm; | ||
private String loaOpAgncyID; | ||
private String loaAlltSnID; | ||
private String loaPgmElmntID; | ||
private String loaTskBdgtSblnTx; | ||
private String loaDfAgncyAlctnRcpntID; | ||
private String loaJbOrdNm; | ||
private String loaSbaltmtRcpntID; | ||
private String loaWkCntrRcpntNm; | ||
private String loaMajRmbsmtSrcID; | ||
private String loaDtlRmbsmtSrcID; | ||
private String loaCustNm; | ||
private String loaObjClsID; | ||
private String loaSrvSrcID; | ||
private String loaSpclIntrID; | ||
private String loaBdgtAcntClsNm; | ||
private String loaDocID; | ||
private String loaClsRefID; | ||
private String loaInstlAcntgActID; | ||
private String loaLclInstlID; | ||
private String loaFmsTrnsactnID; | ||
private String loaDscTx; | ||
private LocalDateTime loaBgnDt; | ||
private LocalDateTime loaEndDt; | ||
private String loaFnctPrsNm; | ||
private String loaStatCd; | ||
private String loaHistStatCd; | ||
private String loaHsGdsCd; | ||
private String orgGrpDfasCd; | ||
private String loaUic; | ||
private String loaTrnsnID; | ||
private String loaSubAcntID; | ||
private String loaBetCd; | ||
private String loaFndTyFgCd; | ||
private String loaBgtLnItmID; | ||
private String loaScrtyCoopImplAgncCd; | ||
private String loaScrtyCoopDsgntrCd; | ||
private String loaScrtyCoopLnItmID; | ||
private String loaAgncDsbrCd; | ||
private String loaAgncAcntngCd; | ||
private String loaFndCntrID; | ||
private String loaCstCntrID; | ||
private String loaPrjID; | ||
private String loaActvtyID; | ||
private String loaCstCd; | ||
private String loaWrkOrdID; | ||
private String loaFnclArID; | ||
private String loaScrtyCoopCustCd; | ||
private Integer loaEndFyTx; | ||
private Integer loaBgFyTx; | ||
private String loaBgtRstrCd; | ||
private String loaBgtSubActCd; | ||
private LocalDateTime createdAt; // RDS Internal | ||
private LocalDateTime updatedAt; // RDS Internal | ||
} |
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
Oops, something went wrong.