use of hry.redis.common.utils.RedisTradeService in project benchmark by seelunzi.
the class TradeRedis method putSelfEntrustTradelist.
/* */
/* */
public static void putSelfEntrustTradelist(EntrustTrade exEntrust) {
/* 446 */
String key = getHeader(exEntrust) + ":" + exEntrust.getEntrustPrice().setScale(10, 6).toString();
/* 447 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 448 */
String v = redisTradeService.get(key);
/* 449 */
List<EntrustTrade> list = JSON.parseArray(v, EntrustTrade.class);
/* 450 */
if (null == list) {
/* 451 */
list = new ArrayList();
/* */
}
/* 453 */
list.add(exEntrust);
/* 454 */
redisTradeService.save(key, JSON.toJSONString(list));
/* */
}
use of hry.redis.common.utils.RedisTradeService in project benchmark by seelunzi.
the class TradeRedis method getSelfkeys.
/* */
/* */
public static List<BigDecimal> getSelfkeys(EntrustTrade exEntrust) {
/* 562 */
String key = getHeader(exEntrust);
/* 563 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 564 */
Set<String> keys = redisTradeService.noPerkeys(key + ":");
/* 565 */
if (null == keys) {
/* 566 */
return null;
/* */
}
/* 568 */
List<BigDecimal> list2 = new ArrayList();
/* 569 */
Iterator<String> iterator = keys.iterator();
/* 570 */
while (iterator.hasNext()) {
/* 571 */
String keystr = (String) iterator.next();
/* 572 */
BigDecimal ks = new BigDecimal(keystr.split(":")[2]);
/* 573 */
list2.add(ks);
/* */
}
/* 575 */
if (exEntrust.getType().equals(Integer.valueOf(2))) {
/* 576 */
Collections.sort(list2, new AscBigDecimalComparator());
/* */
} else {
/* 578 */
Collections.sort(list2, new DescBigDecimalComparator());
/* */
}
/* 580 */
return list2;
/* */
}
use of hry.redis.common.utils.RedisTradeService in project benchmark by seelunzi.
the class TradeRedis method getTradeStringData.
/* */
/* */
public static String getTradeStringData(String key) {
/* 550 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* */
/* 552 */
String v = redisTradeService.get(key);
/* 553 */
return v;
/* */
}
use of hry.redis.common.utils.RedisTradeService in project benchmark by seelunzi.
the class TradeRedis method cancelEntrust.
/* */
/* */
public static void cancelEntrust(EntrustTrade exEntrust, List<EntrustTrade> entrustlist, String key, List<Accountadd> aadds) /* */
{
/* 245 */
putIngExEntrust(entrustlist, key);
/* */
/* 247 */
MQEnter.pushDealFundMQ(aadds);
/* */
/* 249 */
putEntrustByUser(exEntrust);
/* 250 */
setcancelSelfOnePrice(exEntrust);
/* */
/* */
/* 253 */
RedisService redisService = (RedisService) ContextUtil.getBean("redisService");
/* 254 */
List<EntrustTrade> listchange = new ArrayList();
/* 255 */
listchange.add(exEntrust);
/* 256 */
redisService.save(getTradeDealEntrustChangeNum(), JSON.toJSONString(listchange));
/* */
/* 258 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 259 */
redisTradeService.save(getEntrustTimeFlag(exEntrust.getCoinCode(), exEntrust.getFixPriceCoinCode()), "1");
/* */
}
use of hry.redis.common.utils.RedisTradeService in project benchmark by seelunzi.
the class TradeRedis method getMatchEntrustTradeBykey.
/* */
/* */
public static List<EntrustTrade> getMatchEntrustTradeBykey(String keys) /* */
{
/* 607 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 608 */
String v = redisTradeService.get(keys);
/* 609 */
List<EntrustTrade> list = JSON.parseArray(v, EntrustTrade.class);
/* 610 */
return list;
/* */
}
Aggregations