|
|
@@ -378,12 +378,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
if(record.getRevenue() == null || record.getRevenue().longValue() <= 0){ |
|
|
if(record.getRevenue() == null || record.getRevenue().longValue() <= 0){ |
|
|
record.setPrice(0l); |
|
|
record.setPrice(0l); |
|
|
}else{ |
|
|
}else{ |
|
|
if(record.getPayRatio()!=null){ |
|
|
|
|
|
|
|
|
if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ |
|
|
record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); |
|
|
record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); |
|
|
}else{ |
|
|
}else{ |
|
|
int dayCount = record.getReceivePeriod() * 30; |
|
|
int dayCount = record.getReceivePeriod() * 30; |
|
|
RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); |
|
|
RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); |
|
|
record.setPayRatio(ratioVo.getRatio()); |
|
|
|
|
|
|
|
|
//record.setPayRatio(ratioVo.getRatio()); |
|
|
if(ratioVo.getBalance() != null){ |
|
|
if(ratioVo.getBalance() != null){ |
|
|
//有超出部分,在getPayRatio里计算 |
|
|
//有超出部分,在getPayRatio里计算 |
|
|
record.setPrice(ratioVo.getBalance().longValue()); |
|
|
record.setPrice(ratioVo.getBalance().longValue()); |
|
|
@@ -597,8 +597,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
wxBillRentMapper.insertBills(record.getPreviewBillRentList()); |
|
|
wxBillRentMapper.insertBills(record.getPreviewBillRentList()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ResultData getResultDataForUpdate(WxRentContract record, Long userId,int from,Date oldRentStartDate) { |
|
|
public ResultData getResultDataForUpdate(WxRentContract record, Long userId,int from,Date oldRentStartDate) { |
|
|
//更新租赁合同信息 |
|
|
//更新租赁合同信息 |
|
|
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(record.getId()); |
|
|
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(record.getId()); |
|
|
@@ -607,6 +605,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
} |
|
|
} |
|
|
wxRentContract.setBusDiscountTime(record.getBusDiscountTime()); |
|
|
wxRentContract.setBusDiscountTime(record.getBusDiscountTime()); |
|
|
wxRentContract.setBusDiscountRatio(record.getBusDiscountRatio()); |
|
|
wxRentContract.setBusDiscountRatio(record.getBusDiscountRatio()); |
|
|
|
|
|
wxRentContract.setPayRatio(record.getPayRatio()); |
|
|
|
|
|
|
|
|
int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; |
|
|
int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; |
|
|
|
|
|
|
|
|
@@ -617,12 +616,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
|
if(!EnumFromType.SWITCH.getCode().equals(from)){ |
|
|
if(!EnumFromType.SWITCH.getCode().equals(from)){ |
|
|
if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { |
|
|
if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { |
|
|
if(record.getPayRatio()!=null){ |
|
|
|
|
|
|
|
|
if(record.getPayRatio()!=null && record.getPayRatio().intValue() > 0){ |
|
|
record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); |
|
|
record.setPrice(countPrice(record.getPayRatio(),record.getRevenue())); |
|
|
}else{ |
|
|
}else{ |
|
|
int dayCount = record.getReceivePeriod() * 30; |
|
|
int dayCount = record.getReceivePeriod() * 30; |
|
|
RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); |
|
|
RatioVo ratioVo = getPayRatio(EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod()); |
|
|
record.setPayRatio(ratioVo.getRatio()); |
|
|
|
|
|
|
|
|
//record.setPayRatio(ratioVo.getRatio()); |
|
|
if(ratioVo.getBalance() != null){ |
|
|
if(ratioVo.getBalance() != null){ |
|
|
//有超出部分,在getPayRatio里计算 |
|
|
//有超出部分,在getPayRatio里计算 |
|
|
record.setPrice(ratioVo.getBalance().longValue()); |
|
|
record.setPrice(ratioVo.getBalance().longValue()); |
|
|
|