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

Commit 97f5738f authored by 胡佳晨's avatar 胡佳晨

回滚脚本

parent 0bc14f4f
...@@ -1022,6 +1022,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1022,6 +1022,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Long currentTime = System.currentTimeMillis(); Long currentTime = System.currentTimeMillis();
HashMap<String, Integer> mapSurplusGeneral = new HashMap<>(); HashMap<String, Integer> mapSurplusGeneral = new HashMap<>();
ArrayList<String> orderDataList = new ArrayList<>();
ArrayList<String> orderIdList = new ArrayList<>(); ArrayList<String> orderIdList = new ArrayList<>();
HashMap<String, Object> mapMongo = new HashMap<>(); HashMap<String, Object> mapMongo = new HashMap<>();
...@@ -1032,7 +1033,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1032,7 +1033,8 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
mapMongo.put("status", KylinTableStatusConst.ORDER_STATUS2); mapMongo.put("status", KylinTableStatusConst.ORDER_STATUS2);
mapMongo.put("updatedAt", DateUtil.Formatter.yyyyMMddHHmmssSSS.format(now)); mapMongo.put("updatedAt", DateUtil.Formatter.yyyyMMddHHmmssSSS.format(now));
mapMongo.put("changeDate", now); mapMongo.put("changeDate", now);
orderIdList.add(item.getOrderTicketsId() + "," + item.getUserId()); orderDataList.add(item.getOrderTicketsId() + "," + item.getUserId());
orderIdList.add(item.getUserId());
mapSurplusGeneral.put(item.getTicketId(), mapSurplusGeneral.get(item.getTicketId()) == null ? item.getNumber() : mapSurplusGeneral.get(item.getTicketId()) + item.getNumber()); mapSurplusGeneral.put(item.getTicketId(), mapSurplusGeneral.get(item.getTicketId()) == null ? item.getNumber() : mapSurplusGeneral.get(item.getTicketId()) + item.getNumber());
} catch (Exception e) { } catch (Exception e) {
log.debug("CHECK TIME SYNC = " + e.getMessage()); log.debug("CHECK TIME SYNC = " + e.getMessage());
...@@ -1044,7 +1046,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1044,7 +1046,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
} }
currentTime = System.currentTimeMillis() - currentTime; currentTime = System.currentTimeMillis() - currentTime;
log.debug("FOR 循环 -> time:" + (currentTime) + "毫秒"); log.debug("FOR 循环 -> time:" + (currentTime) + "毫秒");
if (orderIdList.size() > 0) { if (orderDataList.size() > 0) {
//库存 //库存
for (Map.Entry<String, Integer> entry : mapSurplusGeneral.entrySet()) { for (Map.Entry<String, Integer> entry : mapSurplusGeneral.entrySet()) {
dataUtils.changeSurplusGeneral(entry.getKey(), entry.getValue()); dataUtils.changeSurplusGeneral(entry.getKey(), entry.getValue());
...@@ -1055,7 +1057,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1055,7 +1057,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
//mysql //mysql
String orderStr = ""; String orderStr = "";
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);
orderStr += "'" + orderTicketId + "',"; orderStr += "'" + orderTicketId + "',";
} }
...@@ -1081,7 +1083,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1081,7 +1083,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
Thread thread = new Thread(() -> { Thread thread = new Thread(() -> {
//redis 列表 //redis 列表
orderIdList.forEach(t -> { orderDataList.forEach(t -> {
String orderTicketId = t.split(",")[0]; String orderTicketId = t.split(",")[0];
String uid = t.split(",")[1]; String uid = t.split(",")[1];
KylinOrderTicketVo vo = dataUtils.getOrderTicketVo(orderTicketId); KylinOrderTicketVo vo = dataUtils.getOrderTicketVo(orderTicketId);
......
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