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

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

temp

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