| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import redis.clients.jedis.Jedis; |
| | | import redis.clients.jedis.JedisPool; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | @Resource |
| | | private JedisPool jedisPool; |
| | | |
| | | |
| | | /** |
| | |
| | | //获取账号当日的商品数量 |
| | | long goodsNum = redisTemplate.opsForSet().size(goodsKey); |
| | | //获取账号当日的资金消耗 |
| | | Long todayMoney = Long.parseLong(redisTemplate.opsForValue().get(accountMoneyKey) + ""); |
| | | |
| | | Long todayMoney = null; |
| | | Jedis jedis = jedisPool.getResource(); |
| | | try { |
| | | todayMoney = Long.parseLong(jedis.get(accountMoneyKey) + ""); |
| | | } finally { |
| | | jedis.close(); |
| | | } |
| | | |
| | | //同步到数据库 |
| | | LiJinProviderTaoKeAccount account = liJinProviderAccountMapper.selectByPrimaryKeyForUpdate(accountId); |