Explorar el Código

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

release_toaliyun_real
Stormeye Wu hace 7 años
padre
commit
25f5311096
Se han modificado 2 ficheros con 3 adiciones y 5 borrados
  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 Ver fichero

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


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


+ 2
- 4
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Ver fichero

@@ -379,10 +379,8 @@ public class DateUtils {
* @return * @return
*/ */
public static Date getHourTimeAfter(int hour, Date myDate) { 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; return testDate;
} }




Cargando…
Cancelar
Guardar