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");
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");