| @@ -1546,7 +1546,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if (wxRentContract.getPriceUnit().equals(EnumPriceUnit.D.getCode())){ | |||
| Double priceD = new Double(price); | |||
| 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{ | |||
| Double priceD = new Double(price); | |||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType())) { | |||
| @@ -1568,7 +1571,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //生成金额直接计算 | |||
| 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; | |||
| } | |||
| @@ -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"); | |||
| needpay = new Double(months * priceD).longValue(); | |||
| }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){//第一期 | |||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| @@ -1594,7 +1599,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| months++; | |||
| needpay = new Double(months * priceD).longValue(); | |||
| }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(isFirstDay(startDate)){ | |||
| @@ -1604,7 +1610,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| needpay = new Double(months * priceD).longValue(); | |||
| }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{//中间 | |||
| @@ -1614,9 +1621,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| //如果当月费用需要按天计算 | |||
| if (monthCalDay) { | |||
| //取整 | |||
| //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 { | |||
| needpay = new Double(months * priceD).longValue(); | |||