Browse Source

[合同][修改][修改预账单生成逻辑]

release_toaliyun_real
luozukai 6 years ago
parent
commit
60fda0a5e4
2 changed files with 20 additions and 8 deletions
  1. +10
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  2. +10
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 10
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -652,8 +652,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}else{
//如果是计算账单金额&cross 拆分日期进行计算
if(!saveDb && billTimeVo.getEndDate().after(endDate)) {
long needpayFront = getNeedPayMoney(wxPropertyContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size());
long needpayAfter = getNeedPayMoney(wxPropertyContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size());
long needpayFront = getNeedPayMoney(wxPropertyContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size(),saveDb);
long needpayAfter = getNeedPayMoney(wxPropertyContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size(),saveDb);
System.out.println();
needpay = needpayFront+needpayAfter;
flag = true;
@@ -669,7 +669,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

//计算金额
if(!flag){
needpay = getNeedPayMoney(wxPropertyContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size());
needpay = getNeedPayMoney(wxPropertyContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(),saveDb);
}

WxBillProperty wxBillProperty = new WxBillProperty();
@@ -713,7 +713,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return resultMap;
}

public long getNeedPayMoney(WxPropertyContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize){
public long getNeedPayMoney(WxPropertyContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize,boolean saveDb){
long needpay;
//按日
if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
@@ -727,6 +727,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
priceD = new Double(price)/12;
}

//生成金额直接计算
if(!saveDb){
needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, startDate, endDate)).longValue();
return needpay;
}

SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd");
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
if(i == billTimeVoListSize - 1){//最后


+ 10
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -1044,8 +1044,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}else{
//如果是计算账单金额&cross 拆分日期进行计算
if(!saveDb && billTimeVo.getEndDate().after(endDate)) {
long needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size());
long needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size());
long needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),DateUtils.getDaySet(endDate,Calendar.DATE,-1),i,billTimeVoList.size(),saveDb);
long needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size(),saveDb);
System.out.println();
needpay = needpayFront+needpayAfter;
flag = true;
@@ -1061,7 +1061,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {

//计算金额
if(!flag){
needpay = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size());
needpay = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(),saveDb);
}

WxBillRent wxBillRent = new WxBillRent();
@@ -1105,7 +1105,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return resultMap;
}

public long getNeedPayMoney(WxRentContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize){
public long getNeedPayMoney(WxRentContract wxRentContract,long price,Date startDate,Date endDate,int i,int billTimeVoListSize,boolean saveDb){
long needpay;
//按日
if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){
@@ -1119,6 +1119,12 @@ public class WxRentContractServiceImpl implements WxRentContractService {
priceD = new Double(price)/12;
}

//生成金额直接计算
if(!saveDb){
needpay = new Double(getMonthNeedPay(priceD, startDate, endDate)).longValue();
return needpay;
}

SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd");
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM");
if(i == billTimeVoListSize - 1){//最后


Loading…
Cancel
Save