记得上下班打卡 | git大法好,push需谨慎

Commit 30e38a44 authored by 张国柄's avatar 张国柄

~opt:queue.order.close;

parent 9ad67db3
......@@ -12,6 +12,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo;
import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter;
......@@ -64,10 +65,12 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
private boolean consumerOrderCloseHandler(Map<String, String> messageMap) {
try {
String orderCode = messageMap.get("id"), type = messageMap.get("type");
LocalDateTime createdAt = LocalDateTime.parse(messageMap.get("time"));
String orderCode = messageMap.get("id"), type = messageMap.get("type"), time = messageMap.get("time");
long durationToMillis = Duration.between(createdAt.plusMinutes(5), LocalDateTime.now()).toMillis();
LocalDateTime now = LocalDateTime.now();
LocalDateTime createdAt = StringUtils.isEmpty(time) ? now.minusMinutes(5) : LocalDateTime.parse(time);
long durationToMillis = Duration.between(createdAt.plusMinutes(5), now).toMillis();
if (durationToMillis > 0) {
return checkOrderTime(orderCode, type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment