Commit ab3e1539 by kangxiaoshan

1

parent dded1b8a
......@@ -542,7 +542,10 @@ public class ContractServiceImpl implements ContractService {
//分摊收入调整金 = 合同金额 * 6% / 合同总天数 *[录入日期前一月最后一日(含) - 合同开始日期]
int day1 = Days.daysBetween(contractStart, contractEnd).getDays();
int day2 = Days.daysBetween(contractStart, new DateTime().plusMonths(-1).dayOfMonth().withMaximumValue()).getDays();
resource.setAdjustmentFund(resource.getMoney() * 6 / day1 * day2); // 此处为 *100的结果
long resultValue = new BigDecimal(resource.getMoney() * 0.06 / day1 * day2)
.setScale(2,BigDecimal.ROUND_HALF_UP)
.multiply(new BigDecimal(100)).longValue();
resource.setAdjustmentFund(resultValue); // 此处为 *100的结果
} else {
resource.setAdjustmentFund(0L);
}
......@@ -2449,17 +2452,18 @@ public class ContractServiceImpl implements ContractService {
if (containEnd) {
//时间范围合同结束时间时 分两部分计算
//第一部分
intervalIncome = v.getIncomeExcludingTax() / contracAllDays * (contractFormRange - 1);
double valuePart1 = v.getIncomeExcludingTax() * 1.0 / 100 / contracAllDays * (contractFormRange - 1);
//此处 除100 计算完成再扩大100倍
Long intervalIncomePart2 = (long) (v.getIncomeExcludingTax() * 1.0 / 100 -
((v.getIncomeExcludingTax() * 1.0 / 100 / contracAllDays * (contracAllDays - 1)))) * 100;
intervalIncome += intervalIncomePart2;
double valuePart2 = v.getIncomeExcludingTax() * 1.0 / 100 -
((v.getIncomeExcludingTax() * 1.0 / 100 / contracAllDays * (contracAllDays - 1)));
intervalIncome = new BigDecimal(valuePart1 + valuePart2).setScale(2, BigDecimal.ROUND_HALF_UP)
.multiply(new BigDecimal(100L)).longValue();
v.setIntervaIncomeShare(intervalIncome);
} else {
intervalIncome = v.getIncomeExcludingTax() / contracAllDays * contractFormRange;
intervalIncome = (new BigDecimal(v.getIncomeExcludingTax() * 1.0 / 100 / contracAllDays * contractFormRange).
setScale(2, BigDecimal.ROUND_HALF_UP)
.multiply(new BigDecimal(100L))).longValue();
v.setIntervaIncomeShare(intervalIncome);
}
......
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