提交代码

dev-discount
胡锐 2 years ago
parent 94d44b5790
commit b69c817182
  1. 5
      hai-order/src/main/java/com/web/controller/OrderPayController.java
  2. 4
      hai-service/src/main/java/com/hai/common/utils/DateUtil.java

@ -42,6 +42,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
@ -122,6 +123,10 @@ public class OrderPayController {
log.error("wxPay ERROR", "订单不处于待支付状态");
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_NO_STAY_PAY, "");
}
if (DateUtil.getSecondDiff(order.getCreateTime(), DateUtil.addDate(order.getCreateTime(), 10)) < 10) {
log.error("wxPay ERROR", "订单待支付时间小于10秒,请重新下单支付");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单待支付时间小于10秒,请重新下单支付");
}
Integer openIdType = body.getInteger("openIdType");
// 是否分账

@ -413,7 +413,7 @@ public class DateUtil {
* @return: java.util.Date
* @throws
*/
public static Date addDate(Date date,int day) throws ParseException {
public static Date addDate(Date date,int day) {
long time = date.getTime(); // 得到指定日期的毫秒数
long longTime = (long)day;
long addDay = longTime*24*60*60*1000; // 要加上的天数转换成毫秒数
@ -577,7 +577,7 @@ public class DateUtil {
* @return: int
* @throws
*/
public static long getMinutesDiff(Date oldTime, Date newTime) throws Exception{
public static long getMinutesDiff(Date oldTime, Date newTime) {
long oldTimeStamp = oldTime.getTime();
long newTimeStamp = newTime.getTime();

Loading…
Cancel
Save