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

Commit 2405452d authored by 胡佳晨's avatar 胡佳晨

temp

parent b2f7ed15
......@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import java.math.BigDecimal;
......@@ -952,13 +953,28 @@ public class DataImpl {
}
@Autowired
public boolean SurplusRedis(){
List<KylinTicketStatus> ticketStatus = ticketStatusMapper.selectList(Wrappers.lambdaQuery(KylinTicketStatus.class));
for (KylinTicketStatus item : ticketStatus){
String ticketId = item.getTicketId();
dataUtils.setSurplusGeneral(ticketId, (Integer) redisUtil.getDB15RedisGet(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_GENERAL));
dataUtils.setSurplusExchange(ticketId, (Integer) redisUtil.getDB15RedisGet(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_EXCHANGE));
public boolean SurplusRedis() {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
jedis.auth("NBs$%6hW");
jedis.select(15);
List<KylinTicketStatus> ticketStatus = ticketStatusMapper.selectList(Wrappers.lambdaQuery(KylinTicketStatus.class));
for (KylinTicketStatus item : ticketStatus) {
String ticketId = item.getTicketId();
dataUtils.setSurplusGeneral(ticketId, toObjMapper.readValue(jedis.get(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_GENERAL), Integer.class));
dataUtils.setSurplusExchange(ticketId, toObjMapper.readValue(jedis.get(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_EXCHANGE), Integer.class));
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
if (jedis != null) {
jedis.close();
}
}
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