Browse Source

[预览账单][修改][修改最后一期金额问题]

release_toaliyun_real
luozukai 7 years ago
parent
commit
33fdcf14ff
2 changed files with 14 additions and 5 deletions
  1. +0
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  2. +14
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 0
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -16,7 +16,6 @@ import com.iformall.mapper.*;
import com.iformall.service.WxFlowRecordService;
import com.iformall.service.WxFlowService;
import com.iformall.service.WxPropertyContractService;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@@ -33,7 +32,6 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;



+ 14
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -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){


Loading…
Cancel
Save