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

Commit 22cdb9b2 authored by 胡佳晨's avatar 胡佳晨

脚本

parent 5c2aa54c
......@@ -1022,7 +1022,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
@Override
public boolean checkOrderTime(String userId) {
String lock = "order_lock:checkOrderTime:" + userId;
if (redisLockUtil.tryLock(lock, 1, 3600)) {
// if (redisLockUtil.tryLock(lock, 1, 3600)) {
try {
List<OrderScriptDto> dtoData = orderTicketsMapper.orderScriptDto(userId);
LocalDateTime now = LocalDateTime.now();
......@@ -1086,10 +1086,12 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
//mysql
LinkedList<String> sqls = new LinkedList<>();
String orderStr = "";
log.debug("orderIdList -> size() :" + orderIdList.size());
for (int i = 0; i < orderIdList.size(); i++) {
String orderTicketId = orderIdList.get(i).split(",")[0];
orderStr = orderStr+"'"+orderTicketId + "',";
orderStr += "'"+orderTicketId + "',";
}
log.debug("orderStr -> STR :" + orderStr.toString());
orderStr = orderStr.substring(0, orderStr.length() - 1);
sqls.add("UPDATE kylin_order_tickets SET updated_at = '" + now + "' WHERE order_tickets_id in (" + orderStr + ") ");
sqls.add("UPDATE kylin_order_ticket_status SET `status` = 2,updated_at = '" + now + "' WHERE order_id in (" + orderStr + ") ");
......@@ -1127,10 +1129,10 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
e.printStackTrace();
} finally {
}
redisLockUtil.unlock(lock);
} else {
log.debug("WARNING LOCKING");
}
// redisLockUtil.unlock(lock);
// } else {
// log.debug("WARNING LOCKING");
// }
return true;
}
......
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