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

add delete origin data ---Ken

parent fc03f870
......@@ -250,19 +250,15 @@ 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());
populateFieldsTB(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
result.setCreateTime(new Date());
trialBalanceMapper.insertSelective(result);
}
logger.debug("insert TrialBalance EntityCode:{},Period:{}", item.getSegment1(), item.getPeriod());
populateFieldsTB(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
result.setCreateTime(new Date());
trialBalanceMapper.insertSelective(result);
}
private void processCF(CashFlowQueryDto item) {
......@@ -276,18 +272,14 @@ 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());
populateFieldsCF(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
cashFlowMapper.insertSelective(result);
}
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) {
......@@ -301,18 +293,14 @@ 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());
populateFieldsBS(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
balanceSheetMapper.insertSelective(result);
}
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);
}
......@@ -327,18 +315,14 @@ 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());
populateFieldsBSprc(item, result);
result.setId(distributedIdService.nextId());
result.setCreateBy("");
result.setCreateTime(new Date());
balanceSheetMapper.insertSelective(result);
}
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) {
......@@ -352,18 +336,14 @@ 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());
populateFieldsPLS(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
profitLossStatementMapper.insertSelective(result);
}
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) {
......@@ -377,18 +357,14 @@ 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());
populateFieldsPLSprc(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
profitLossStatementMapper.insertSelective(result);
}
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) {
......@@ -403,18 +379,14 @@ 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());
populateFieldsOAR(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
organizationAccountingRateMapper.insertSelective(result);
}
logger.debug("insert OrganizationAccountingRate Period:{}", item.getPeriod());
populateFieldsOAR(item, result);
result.setId(distributedIdService.nextId());
result.setCreateTime(new Date());
result.setCreateBy("");
organizationAccountingRateMapper.insertSelective(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