|
|
|
@@ -1799,6 +1799,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
public static double getMonthNeedPay(Double price,Date start,Date end){ |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); |
|
|
|
SimpleDateFormat sdD = new SimpleDateFormat("d"); |
|
|
|
Double total = new Double(0); |
|
|
|
int[] diff; |
|
|
|
|
|
|
|
@@ -1816,6 +1817,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return total; |
|
|
|
} |
|
|
|
|
|
|
|
//判断是否满足整月 |
|
|
|
int startInt = Integer.parseInt(sdD.format(start)); |
|
|
|
int endInt = Integer.parseInt(sdD.format(end)); |
|
|
|
if(startInt == (endInt+1)){ |
|
|
|
int months = getMonths(sdM.format(start)+"-01",sdM.format(end)+"-01"); |
|
|
|
return months * price; |
|
|
|
} |
|
|
|
|
|
|
|
//第一个月 |
|
|
|
Date lastMonthDay = DateUtils.getLastDayForMonth(start); |
|
|
|
diff = DateUtils.getDiff(start,lastMonthDay); |
|
|
|
@@ -1900,12 +1909,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception{ |
|
|
|
long tprice = 100; |
|
|
|
// long tprice = 100; |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
Date start = sd.parse("2020-05-29"); |
|
|
|
Date end = sd.parse("2020-07-28"); |
|
|
|
Date start = sd.parse("2020-05-02"); |
|
|
|
// Date end = sd.parse("2020-07-28"); |
|
|
|
|
|
|
|
// System.out.println("===="+new WxRentContractServiceImpl().getNeedPay(tprice,0,start,end));; |
|
|
|
SimpleDateFormat sdD = new SimpleDateFormat("d"); |
|
|
|
System.out.println(sdD.format(start)); |
|
|
|
} |
|
|
|
|
|
|
|
public static List<BillTimeVo> initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ |
|
|
|
|