Commit 2cdd47e9 by kangxiaoshan

计算确认收入

parent d1b8f5ba
...@@ -623,6 +623,11 @@ public class DmpIncomeServiceImpl implements DmpIncomeService { ...@@ -623,6 +623,11 @@ public class DmpIncomeServiceImpl implements DmpIncomeService {
income.setCreateTime(new Date()); income.setCreateTime(new Date());
income.setInputDate(DateTime.now().toString("yyyy-MM-dd")); income.setInputDate(DateTime.now().toString("yyyy-MM-dd"));
income.setInputUser(user.getName()); income.setInputUser(user.getName());
income = cacluConfirmIncome(income);
return pdIncomeRepository.save(income);
}
private PdIncome cacluConfirmIncome(PdIncome income) {
if (StringUtils.isEmpty(income.getAcceptanceAmount())) { if (StringUtils.isEmpty(income.getAcceptanceAmount())) {
Long rax = Long.parseLong(income.getTaxRate().replace("%", "")) / 100 + 1; Long rax = Long.parseLong(income.getTaxRate().replace("%", "")) / 100 + 1;
Long confirmIncome = rax * Long.parseLong(income.getAcceptanceAmount()); Long confirmIncome = rax * Long.parseLong(income.getAcceptanceAmount());
...@@ -630,8 +635,7 @@ public class DmpIncomeServiceImpl implements DmpIncomeService { ...@@ -630,8 +635,7 @@ public class DmpIncomeServiceImpl implements DmpIncomeService {
} else { } else {
income.setConfirmIncome("0"); income.setConfirmIncome("0");
} }
return income;
return pdIncomeRepository.save(income);
} }
@Override @Override
...@@ -639,10 +643,11 @@ public class DmpIncomeServiceImpl implements DmpIncomeService { ...@@ -639,10 +643,11 @@ public class DmpIncomeServiceImpl implements DmpIncomeService {
PdIncome item = pdIncomeRepository.findOne(income.getId()); PdIncome item = pdIncomeRepository.findOne(income.getId());
item.setModifyTime(new Date()); item.setModifyTime(new Date());
item.setAcceptanceAmount(income.getAcceptanceAmount()); item.setAcceptanceAmount(income.getAcceptanceAmount());
item.setConfirmIncome(income.getConfirmIncome()); item.setConfirmIncome(cacluConfirmIncome(income).getConfirmIncome());
item.setInputDate(income.getInputDate()); item.setInputDate(income.getInputDate());
item.setIncomeType(income.getIncomeType()); item.setIncomeType(income.getIncomeType());
item.setTaxRate(income.getTaxRate()); item.setTaxRate(income.getTaxRate());
//item = cacluConfirmIncome(income);
pdIncomeRepository.save(item); pdIncomeRepository.save(item);
return item; return item;
} }
......
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