Просмотр исходного кода

[bug][修改][1001665]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
52f34e7971
2 измененных файлов: 7 добавлений и 3 удалений
  1. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  2. +5
    -1
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -1747,7 +1747,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
public static double getNeedPay(long monthPrice,long dayPrice,Date start,Date end){
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdM = new SimpleDateFormat("MM");
Double total = new Double(0);
Double total;
int[] diff;

int dayCount = DateUtils.getMonthDayCount(start);
@@ -1763,7 +1763,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
System.out.println(sd.format(start));
System.out.println(sd.format(currEnd));

if(sdM.format(start).equals(sdM.format(end))){
if(sd.format(start).equals(sd.format(end))){
total = 1 * price; //算1天
return total;
}else{


+ 5
- 1
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Просмотреть файл

@@ -1092,8 +1092,12 @@ public class DateUtils {
* @return
*/
public static int[] getDiff(Date startDate,Date endDate) {
ZoneId zone = ZoneId.systemDefault();
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
if(sd.format(startDate).equals(sd.format(endDate))){
return new int[] {0, 1};
}

ZoneId zone = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(startDate.toInstant(), zone);
LocalDate start = localDateTime.toLocalDate();



Загрузка…
Отмена
Сохранить