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

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

脚本

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