Commit 71cc4d88 by lzxry

tkio的作废合同调整金修复

parent 7b54c073
......@@ -1018,7 +1018,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//晚录合同 累计收入= 同下
//正常合同 累计收入= 如果合同结束日期在选择日期之内,则直接取 [合同金额/1.06]得到总金额 ,否则 【合同开始日期-选择结束日期】
//作废合同处理
Contract cancleContract = this.cancledShareFlow(contract, unitPriceAccurate, usePart);
Contract cancleContract = this.cancledShareFlow(contract, unitPriceAccurate, usePart,selected);
if (cancleContract != null) {
return;
}
......@@ -1239,7 +1239,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return contract;
}
private Contract cancledShareFlow(Contract contract, BigDecimal unitPriceAccurate, DateTime[] usePart) {
private Contract cancledShareFlow(Contract contract, BigDecimal unitPriceAccurate, DateTime[] usePart, DateTime[] selected) {
if (!ContractStatusEnum.CANCEL.getKey().equals(contract.getStatus())) {
return null;
}
......@@ -1270,7 +1270,21 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
long share = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
contract.setIntervaIncomeShare(share);
//调整金
contract.setAdjustmentFund(share*-1L);
if (checkTwoTime(selected[0], cancelDate) && checkTwoTime(cancelDate, selected[1])) {
clickNum = tkioFlowRepository.sumFlowByContractCodeAndDs(contract.getContractCode(),contract.getStartDate(),usedEnd.toString("yyyy-MM-dd"));
clickFlow = clickNum==null?0L:clickNum.longValue();
//区间点击数
clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
contract.setAdjustmentFund(unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue() * -1L);
}else{
contract.setAdjustmentFund(0L);
}
}else{
contract.setAdjustmentFund(0L);
}
//分摊总收入
contract.setIncomeShareAll(0L);
contract.setIncomeGross(0L);
......@@ -1319,7 +1333,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//正常合同 累计收入= 如果合同结束日期在选择日期之内,则直接取 [合同金额/1.06]得到总金额 ,否则 【合同开始日期-选择结束日期】
//作废合同处理
Contract cancleContract = this.cancledShareTKIO(contract, appkeyStr, unitPriceAccurate, usePart);
Contract cancleContract = this.cancledShareTKIO(contract, appkeyStr, unitPriceAccurate, usePart,selected);
if (cancleContract != null) {
return;
}
......@@ -1534,7 +1548,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
return contract;
}
private Contract cancledShareTKIO(Contract contract, String appkeys, BigDecimal unitPriceAccurate,DateTime[] usePart) {
private Contract cancledShareTKIO(Contract contract, String appkeys, BigDecimal unitPriceAccurate, DateTime[] usePart, DateTime[] selected) {
if (!ContractStatusEnum.CANCEL.getKey().equals(contract.getStatus())) {
return null;
}
......@@ -1564,7 +1578,11 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
long share = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
contract.setIntervaIncomeShare(share);
//调整金
contract.setAdjustmentFund(share*-1L);
if (checkTwoTime(selected[0], cancelDate) && checkTwoTime(cancelDate, selected[1])) {
contract.setAdjustmentFund(share*-1L);
}else{
contract.setAdjustmentFund(0L);
}
//分摊总收入
contract.setIncomeShareAll(0L);
contract.setIncomeGross(0L);
......
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