Commit 2b17e796 authored by Ken you's avatar Ken you

add delete origin data ---Ken

parent fc03f870
......@@ -250,12 +250,9 @@ public class EbsApiServiceImpl implements EbsApiService {
TrialBalance result = new TrialBalance();
if (itemList.size() >0) {
logger.debug("exit and delete TrialBalance EntityCode:{},Period:{}", item.getSegment1(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsTB(item, result);
// result.setId(itemList.get(0).getId());
trialBalanceMapper.deleteByExample(example);
} else {
logger.debug("exit and update TrialBalance EntityCode:{},Period:{}", item.getSegment1(), item.getPeriod());
}
logger.debug("insert TrialBalance EntityCode:{},Period:{}", item.getSegment1(), item.getPeriod());
populateFieldsTB(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
......@@ -263,7 +260,6 @@ public class EbsApiServiceImpl implements EbsApiService {
result.setCreateTime(new Date());
trialBalanceMapper.insertSelective(result);
}
}
private void processCF(CashFlowQueryDto item) {
CashFlowExample example = new CashFlowExample();
......@@ -276,19 +272,15 @@ public class EbsApiServiceImpl implements EbsApiService {
CashFlow result = new CashFlow();
if (itemList.size() >0) {
logger.debug("exit and delete CashFlow EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsCF(item, result);
// result.setId(itemList.get(0).getId());
cashFlowMapper.deleteByExample(example);
} else {
logger.debug("exit and update CashFlow EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
}
logger.debug("insert CashFlow EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
populateFieldsCF(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
cashFlowMapper.insertSelective(result);
}
}
private void processBS(BalanceSheetQueryDto item) {
BalanceSheetExample example = new BalanceSheetExample();
......@@ -301,19 +293,15 @@ public class EbsApiServiceImpl implements EbsApiService {
BalanceSheet result = new BalanceSheet();
if (itemList.size() >0) {
logger.debug("exit and delete BalanceSheet EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsBS(item, result);
// result.setId(itemList.get(0).getId());
balanceSheetMapper.deleteByExample(example);
} else {
logger.debug("exit and update BalanceSheet EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
}
logger.debug("insert BalanceSheet EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
populateFieldsBS(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
balanceSheetMapper.insertSelective(result);
}
}
private void processBSprc(BalanceSheetPrcQueryDto item) {
......@@ -327,19 +315,15 @@ public class EbsApiServiceImpl implements EbsApiService {
BalanceSheet result = new BalanceSheet();
if (itemList.size() >0) {
logger.debug("exit and delete BalanceSheetPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsBSprc(item, result);
// result.setId(itemList.get(0).getId());
balanceSheetMapper.updateByPrimaryKey(result);
} else {
logger.debug("exit and update BalanceSheetPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
}
logger.debug("insert BalanceSheetPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
populateFieldsBSprc(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
balanceSheetMapper.insertSelective(result);
}
}
private void processPL(ProfitLossStatementQueryDto item) {
ProfitLossStatementExample example = new ProfitLossStatementExample();
......@@ -352,19 +336,15 @@ public class EbsApiServiceImpl implements EbsApiService {
ProfitLossStatement result = new ProfitLossStatement();
if (itemList.size() >0) {
logger.debug("exit and delete ProfitLossStatement EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsPLS(item, result);
// result.setId(itemList.get(0).getId());
profitLossStatementMapper.deleteByExample(example);
} else {
logger.debug("exit and update ProfitLossStatement EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
}
logger.debug("insert ProfitLossStatement EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
populateFieldsPLS(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
profitLossStatementMapper.insertSelective(result);
}
}
private void processPLprc(ProfitLossStatementPrcQueryDto item) {
ProfitLossStatementExample example = new ProfitLossStatementExample();
......@@ -377,19 +357,15 @@ public class EbsApiServiceImpl implements EbsApiService {
ProfitLossStatement result = new ProfitLossStatement();
if (itemList.size() >0) {
logger.debug("exit and delete ProfitLossStatementPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
// result = itemList.get(0);
// populateFieldsPLSprc(item, result);
// result.setId(itemList.get(0).getId());
profitLossStatementMapper.deleteByExample(example);
} else {
logger.debug("exit and update ProfitLossStatementPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
}
logger.debug("insert ProfitLossStatementPrc EntityCode:{},Period:{}", item.getEntityCode(), item.getPeriod());
populateFieldsPLSprc(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
profitLossStatementMapper.insertSelective(result);
}
}
private void processOAR(OrganizationAccountingRateQueryDto item) {
OrganizationAccountingRateExample example = new OrganizationAccountingRateExample();
......@@ -403,19 +379,15 @@ public class EbsApiServiceImpl implements EbsApiService {
OrganizationAccountingRate result = new OrganizationAccountingRate();
if (itemList.size() >0) {
logger.debug("exit and delete OrganizationAccountingRate Period:{}", item.getPeriod());
// result = itemList.get(0);
// populateFieldsOAR(item, result);
// result.setId(itemList.get(0).getId());
organizationAccountingRateMapper.deleteByExample(example);
} else {
logger.debug("exit and update OrganizationAccountingRate Period:{}", item.getPeriod());
}
logger.debug("insert OrganizationAccountingRate Period:{}", item.getPeriod());
populateFieldsOAR(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
organizationAccountingRateMapper.insertSelective(result);
}
}
private void populateFieldsJE(JournalEntryQueryDto item, JournalEntry result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment