Przeglądaj źródła

[砍价][修改]:砍价超时判断

release_toaliyun_real
Stormeye Wu 7 lat temu
rodzic
commit
25f5311096
2 zmienionych plików z 3 dodań i 5 usunięć
  1. +1
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxPressOrderController.java
  2. +2
    -4
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

+ 1
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxPressOrderController.java Wyświetl plik

@@ -70,7 +70,7 @@ public class WxPressOrderController extends BaseController {
return new ResultData(ErrorCode.COUPON_IS_EMPTY);
}

if(order.getPressEndDate().after(curDate)) {
if(curDate.after(order.getPressEndDate())) {
logger.error("砍价已超时:" + orderId);
return new ResultData(ErrorCode.COUPON_PRESS_IS_OVERTIME);
}


+ 2
- 4
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Wyświetl plik

@@ -379,10 +379,8 @@ public class DateUtils {
* @return
*/
public static Date getHourTimeAfter(int hour, Date myDate) {
Date testDate = myDate;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long myTime = (testDate.getTime() / 1000) + 60 * 60 * hour;
testDate.setTime(myTime * 1000);
long myTime = (myDate.getTime() / 1000) + 60 * 60 * hour;
Date testDate = new Date(myTime * 1000);
return testDate;
}



Ładowanie…
Anuluj
Zapisz