| @@ -1546,7 +1546,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ | if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ | ||||
| Double priceD = new Double(price); | Double priceD = new Double(price); | ||||
| double needpayD = WxRentContractServiceImpl.getNeedPay(0,priceD,startDate,endDate); | double needpayD = WxRentContractServiceImpl.getNeedPay(0,priceD,startDate,endDate); | ||||
| needpay = new Double(needpayD).longValue(); | |||||
| //取整 | |||||
| //needpay = new Double(needpayD).longValue(); | |||||
| //四舍五入 | |||||
| needpay = new BigDecimal(needpayD).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | |||||
| }else{ | }else{ | ||||
| Double priceD = new Double(price); | Double priceD = new Double(price); | ||||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType())) { | if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType())) { | ||||
| @@ -1568,7 +1571,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //生成金额直接计算 | //生成金额直接计算 | ||||
| if(!saveDb){ | if(!saveDb){ | ||||
| needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).longValue(); | |||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).longValue(); | |||||
| needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | |||||
| return needpay; | return needpay; | ||||
| } | } | ||||
| @@ -1585,7 +1589,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| int months = getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); | int months = getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); | ||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||
| }else{ | }else{ | ||||
| needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | |||||
| } | } | ||||
| }else if(i == 0){//第一期 | }else if(i == 0){//第一期 | ||||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | ||||
| @@ -1594,7 +1599,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| months++; | months++; | ||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||
| }else{ | }else{ | ||||
| needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | |||||
| } | } | ||||
| }else{ | }else{ | ||||
| if(isFirstDay(startDate)){ | if(isFirstDay(startDate)){ | ||||
| @@ -1604,7 +1610,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||
| }else{ | }else{ | ||||
| needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | |||||
| needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | |||||
| } | } | ||||
| } | } | ||||
| }else{//中间 | }else{//中间 | ||||
| @@ -1614,9 +1621,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| //如果当月费用需要按天计算 | //如果当月费用需要按天计算 | ||||
| if (monthCalDay) { | if (monthCalDay) { | ||||
| //取整 | |||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).longValue(); | ||||
| //四舍五入 | |||||
| needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | needpay = new BigDecimal(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,false)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); | ||||
| }else { | }else { | ||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||