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

Commit bf948816 authored by 胡佳晨's avatar 胡佳晨

定时任务

parent 8aaafc1b
...@@ -65,8 +65,8 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp ...@@ -65,8 +65,8 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
List<String> orderIds = goblinRedisUtils.getUnPayGoblinOrderList(i + ""); List<String> orderIds = goblinRedisUtils.getUnPayGoblinOrderList(i + "");
for (String orderId : orderIds) { for (String orderId : orderIds) {
GoblinStoreOrderVo orderVo = goblinRedisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = goblinRedisUtils.getGoblinOrder(orderId);
log.debug("orderVo = " + orderVo);
if (orderVo == null || orderVo.getCreatedAt() == null) { if (orderVo == null || orderVo.getCreatedAt() == null) {
goblinRedisUtils.removeGoblinOrder(i + "", orderId);
continue; continue;
} }
LocalDateTime expireTime = LocalDateTime.parse(orderVo.getCreatedAt(), DTF_YMD_HMS).plusMinutes(orderVo.getPayCountdownMinute() + 1); LocalDateTime expireTime = LocalDateTime.parse(orderVo.getCreatedAt(), DTF_YMD_HMS).plusMinutes(orderVo.getPayCountdownMinute() + 1);
...@@ -85,16 +85,16 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp ...@@ -85,16 +85,16 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
//库存&限购&&待支付订单 //库存&限购&&待支付订单
goblinRedisUtils.incrSkuStock("pre", skuVo.getSkuId(), skuVo.getNum()); goblinRedisUtils.incrSkuStock("pre", skuVo.getSkuId(), skuVo.getNum());
goblinRedisUtils.decrSkuCountByUid(orderVo.getUserId(), skuVo.getSkuId(), skuVo.getNum()); goblinRedisUtils.decrSkuCountByUid(orderVo.getUserId(), skuVo.getSkuId(), skuVo.getNum());
goblinRedisUtils.removeGoblinOrder(i + "", orderVo.getOrderId());
//mysql //mysql
sqlDataSku.add(new Object[]{ sqlDataSku.add(new Object[]{
orderVo.getStatus(), now, orderVo.getOrderId(), now, now skuVo.getStatus(), now, orderVo.getOrderId(), now, now
}); });
} }
//订单 //订单
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_5.getValue()); orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_5.getValue());
updateGoblinStoreOrderVo(orderVo.getOrderId(), orderVo); updateGoblinStoreOrderVo(orderVo.getOrderId(), orderVo);
goblinRedisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo); goblinRedisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo);
goblinRedisUtils.removeGoblinOrder(i + "", orderVo.getOrderId());
//mysql //mysql
sqlDataOrder.add(new Object[]{ sqlDataOrder.add(new Object[]{
orderVo.getStatus(), now, now, "超时关闭", orderVo.getOrderId(), now, now orderVo.getStatus(), now, now, "超时关闭", orderVo.getOrderId(), now, now
...@@ -102,6 +102,8 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp ...@@ -102,6 +102,8 @@ public class DMCheckGoblinOrderTimeImpl extends ServiceImpl<GoblinStoreOrderMapp
//执行sql //执行sql
queueUtils.sendMsgByGoblinRedis(MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey(), queueUtils.sendMsgByGoblinRedis(MQConst.KylinQueue.SQL_ORDER_CLOSE.getKey(),
SqlMapping.gets(sqls, sqlDataOrder, sqlDataSku)); SqlMapping.gets(sqls, sqlDataOrder, sqlDataSku));
}else if(orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_5.getValue()||orderVo.getStatus() == GoblinStatusConst.Status.ORDER_STATUS_2.getValue()){
goblinRedisUtils.removeGoblinOrder(i + "", orderVo.getOrderId());
} }
} }
} }
......
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