Commit d8b76c16 by kangxiaoshan

作废合同调整金

parent 2a73b1e5
......@@ -100,7 +100,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
this.shareIncome4Contract(contract, start, end);
contract.setMyBodyName(bodiesNameMap.get(contract.getMyBodyCode()));
}
logger.info("计算分摊收入耗时", (System.currentTimeMillis() - start_) / 1000);
logger.info("计算分摊收入耗时:{}", (System.currentTimeMillis() - start_));
return contracts;
}
......@@ -263,10 +263,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
if (checkTwoTime(suspendDate, cancelDate)) {
adjustmentFund = 0L;
} else {
/* adjustmentFund = new BigDecimal((getDayRange(cancelDate, suspendDate) + 1)
* contract.getIncomeExcludingTax() * 1.0 / contractAllDay)
.setScale(0, BigDecimal.ROUND_HALF_UP).longValue() * -1;*/
/*adjustmentFund = (getDayRange(cancelDate, suspendDate) + 1) * dayShareIncome * (-1);*/
adjustmentFund = shareMultiply(new BigDecimal((getDayRange(cancelDate, suspendDate) + 1) * -1), dayShareIncome, 0);
}
......@@ -275,7 +272,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
daysIncom = daysIncom < 0 ? 0 : daysIncom;
//区间分摊总收入
/*contract.setIntervaIncomeShare(dayShareIncome * daysIncom);*/
contract.setIntervaIncomeShare(shareMultiply(dayShareIncome, new BigDecimal(daysIncom), 0));
if (checkTwoTime(selected[0], cancelDate) && checkTwoTime(cancelDate, selected[1])) {
......@@ -309,22 +305,24 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
DateTime cancelDate = new DateTime(contractChange.getDs());
/*Long adjustmentFund = (getDayRange(contractPart[0], cancelDate) + 1) * dayShareIncome * (-1);*/
Long adjustmentFund = shareMultiply(new BigDecimal((getDayRange(contractPart[0], cancelDate) + 1)), dayShareIncome, 0);
Long adjustmentFund = shareMultiply(new BigDecimal((getDayRange(contractPart[0], cancelDate) + 1) * -1), dayShareIncome, 0);
DateTime usedEnd = usePart[1].compareTo(cancelDate) <= 0 ? usePart[1] : cancelDate;
int daysIncom = Days.daysBetween(usePart[0], usedEnd).getDays() + 1;
daysIncom = daysIncom < 0 ? 0 : daysIncom;
contract.setIntervalUseDays(getDayRange(contractPart[0], usedEnd) + 1);
//区间分摊总收入
/*contract.setIntervaIncomeShare(dayShareIncome * daysIncom);*/
contract.setIntervaIncomeShare(shareMultiply(dayShareIncome, new BigDecimal(daysIncom), 0));
boolean fullRange = getDayRange(selected[0], selected[1])
/*boolean fullRange = getDayRange(selected[0], selected[1])
>= Days.daysBetween(contractPart[0], cancelDate).getDays() ? true : false;
if (fullRange) {
contract.setAdjustmentFund(-1 * contract.getIntervaIncomeShare());
} else if (checkTwoTime(selected[0], cancelDate) && checkTwoTime(cancelDate, selected[1])) {
} else */
if (checkTwoTime(selected[0], cancelDate) && checkTwoTime(cancelDate, selected[1])) {
contract.setAdjustmentFund(adjustmentFund);
} else {
contract.setAdjustmentFund(0L);
......@@ -338,7 +336,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return one.multiply(two).setScale(scale, BigDecimal.ROUND_HALF_UP).longValue();
}
@Override
public boolean checkLateContract(DateTime dateTime, DateTime creatTime) {
int aferDays = dateTime.monthOfYear().get() == 12 ? 29 : 9;
......@@ -354,8 +351,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return dateTime1.isBefore(dateTime2) || dateTime1.isEqual(dateTime2);
}
public static void main(String[] args) {
/* Long aa = new BigDecimal(1000 * 100 / 1.06).setScale(2, BigDecimal.ROUND_HALF_UP).longValue();
......
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