Commit 2cdd47e9 by kangxiaoshan

计算确认收入

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