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

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

修改场次

parent 2be5cc94
...@@ -651,7 +651,6 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -651,7 +651,6 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
//删除演出下所有订单缓存(订单详情,订单列表) //删除演出下所有订单缓存(订单详情,订单列表)
public void delOrderTicketsRedis(KylinPerformanceMisVo vo) { public void delOrderTicketsRedis(KylinPerformanceMisVo vo) {
//找到所有ticketId //找到所有ticketId
List<TicketTimesTicketCreatePartnerVo> timesVoList = vo.getTicketTimes(); List<TicketTimesTicketCreatePartnerVo> timesVoList = vo.getTicketTimes();
for (TicketTimesTicketCreatePartnerVo timesVo : timesVoList) { for (TicketTimesTicketCreatePartnerVo timesVo : timesVoList) {
...@@ -660,18 +659,22 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -660,18 +659,22 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
List<String> orderTicketIdList = new ArrayList<>(); List<String> orderTicketIdList = new ArrayList<>();
List<OrderIdsDao> orderIdsDaoList = kylinOrderTicketsMapper.getOrderUserIdByTimesId(timesVo.getTicketTimesId()); List<OrderIdsDao> orderIdsDaoList = kylinOrderTicketsMapper.getOrderUserIdByTimesId(timesVo.getTicketTimesId());
for (OrderIdsDao item : orderIdsDaoList) { for (OrderIdsDao item : orderIdsDaoList) {
orderTicketRedisIdList.add(KylinRedisConst.ORDER+item.getOrderTicketsId()); orderTicketRedisIdList.add(KylinRedisConst.ORDER + item.getOrderTicketsId());
userRedisIdList.add(KylinRedisConst.ORDER_LIST+item.getUserId()); userRedisIdList.add(KylinRedisConst.ORDER_LIST + item.getUserId());
orderTicketIdList.add(item.getOrderTicketsId()); orderTicketIdList.add(item.getOrderTicketsId());
} }
HashMap<String, Object> mapMongo = new HashMap<>(); HashMap<String, Object> mapMongo = new HashMap<>();
mapMongo.put("useStart",timesVo.getUseStart()); mapMongo.put("useStart", timesVo.getUseStart());
long time1 = System.currentTimeMillis();
mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateMany( mongoTemplate.getCollection(KylinOrderTicketVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("orderTicketsId").in(orderTicketIdList)).getQueryObject(), Query.query(Criteria.where("orderTicketsId").in(orderTicketIdList)).getQueryObject(),
new BasicDBObject("$set", mongoConverter.convertToMongoType(mapMongo)) new BasicDBObject("$set", mongoConverter.convertToMongoType(mapMongo))
); );
log.debug("修改 mongo time -> " + (System.currentTimeMillis() - time1) + " ms ");
dataUtils.delOrderIdUserIdRedis(orderTicketRedisIdList,userRedisIdList); time1 = System.currentTimeMillis();
dataUtils.delOrderIdUserIdRedis(orderTicketRedisIdList, userRedisIdList);
log.debug("修改 mongo time -> " + (System.currentTimeMillis() - time1) + " ms ");
} }
} }
} }
package com.liquidnet.client.admin.zhengzai.kylin.utils;
import com.liquidnet.commons.lang.util.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.StreamRecords;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class QueueUtils {
@Autowired
StringRedisTemplate stringRedisTemplate;
/**
* 发送消息 - REDIS
*
* @param streamKey Redis消费Key
* @param jsonMsg Json字符串
*/
public void sendMsgByRedis(String streamKey, String jsonMsg) {
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("message", jsonMsg);
stringRedisTemplate.opsForStream().add(StreamRecords.mapBacked(map).withStreamKey(streamKey));
}
}
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