Search in sources :

Example 1 with QueryFilter

use of hry.core.util.QueryFilter in project benchmark by seelunzi.

the class ExDmColdAccountRecordServiceImpl method findColdAccountRecordBytransactionNum.

/*    */
/*    */
/*    */
public List<ExDmColdAccountRecord> findColdAccountRecordBytransactionNum(String transactionNum) /*    */
{
    /* 44 */
    QueryFilter filter = new QueryFilter(ExDmHotAccountRecord.class);
    /* 45 */
    filter.addFilter("transactionNum=", transactionNum);
    /* 46 */
    List<ExDmColdAccountRecord> list = super.find(filter);
    /* 47 */
    return list;
/*    */
}
Also used : QueryFilter(hry.core.util.QueryFilter) ExDmColdAccountRecord(hry.exchange.account.model.ExDmColdAccountRecord)

Example 2 with QueryFilter

use of hry.core.util.QueryFilter in project benchmark by seelunzi.

the class ExDmHotAccountRecordServiceImpl method findHotAccountRecordBytransactionNum.

/*    */
/*    */
/*    */
public List<ExDmHotAccountRecord> findHotAccountRecordBytransactionNum(String transactionNum) /*    */
{
    /* 57 */
    QueryFilter filter = new QueryFilter(ExDmHotAccountRecord.class);
    /* 58 */
    filter.addFilter("transactionNum=", transactionNum);
    /* 59 */
    List<ExDmHotAccountRecord> list = super.find(filter);
    /* 61 */
    return list;
/*    */
}
Also used : QueryFilter(hry.core.util.QueryFilter) ExDmHotAccountRecord(hry.exchange.account.model.ExDmHotAccountRecord)

Example 3 with QueryFilter

use of hry.core.util.QueryFilter in project benchmark by seelunzi.

the class ExEntrustServiceImpl method getExEntrustByentrustNum.

/*     */
/*     */
public ExEntrust getExEntrustByentrustNum(String entrustNum) /*     */
{
    /* 550 */
    QueryFilter filter = new QueryFilter(ExEntrust.class);
    /* 551 */
    filter.addFilter("entrustNum=", entrustNum);
    /* 552 */
    filter.setSaasId("hurong_system");
    /* 553 */
    return (ExEntrust) get(filter);
/*     */
}
Also used : QueryFilter(hry.core.util.QueryFilter) ExEntrust(hry.trade.entrust.model.ExEntrust)

Example 4 with QueryFilter

use of hry.core.util.QueryFilter in project benchmark by seelunzi.

the class ExEntrustServiceImpl method tradeInit.

/*     */
/*     */
/*     */
/*     */
public void tradeInit() /*     */
{
    /* 104 */
    RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
    /*     */
    /* 106 */
    redisTradeService.delkeys(":buy:");
    /* 107 */
    redisTradeService.delkeys(":sell:");
    /*     */
    /*     */
    /* 110 */
    List<ExCointoCoin> listExCointoCoin = this.commonDao.getExointocoinValid();
    /* 111 */
    for (ExCointoCoin exCointoCoin : listExCointoCoin) {
        /* 112 */
        String header = getHeader(exCointoCoin.getCoinCode(), exCointoCoin.getFixPriceCoinCode());
        /*     */
        /* 114 */
        QueryFilter filterbuy = new QueryFilter(ExEntrust.class);
        /* 115 */
        filterbuy.addFilter("status<", Integer.valueOf(2));
        /* 116 */
        filterbuy.addFilter("type=", Integer.valueOf(1));
        /* 117 */
        filterbuy.addFilter("coinCode=", exCointoCoin.getCoinCode());
        /* 118 */
        filterbuy.addFilter("fixPriceCoinCode=", exCointoCoin.getFixPriceCoinCode());
        /* 119 */
        filterbuy.setOrderby("entrustPrice desc");
        /* 120 */
        List<ExEntrust> listbuy = find(filterbuy);
        /* 121 */
        List<EntrustTrade> listbuypricesame = new ArrayList();
        /* 122 */
        String buyonePricekey = header + ":" + "buyonePrice";
        /* 123 */
        if ((null != listbuy) && (listbuy.size() > 0)) {
            /* 124 */
            BigDecimal sameprice = ((ExEntrust) listbuy.get(0)).getEntrustPrice();
            /* 125 */
            EntrustTrade entrustTrade = null;
            /* 126 */
            for (ExEntrust l : listbuy) {
                /* 127 */
                String exentrust = JSON.toJSONString(l);
                /* 128 */
                entrustTrade = (EntrustTrade) JSON.parseObject(exentrust, EntrustTrade.class);
                /* 129 */
                if (l.getEntrustPrice().compareTo(sameprice) == 0) {
                    /* 130 */
                    listbuypricesame.add(entrustTrade);
                /*     */
                } else {
                    /* 132 */
                    String key = getHeader(entrustTrade) + ":buy:" + sameprice.setScale(10, 6).toString();
                    /* 133 */
                    redisTradeService.save(key, JSON.toJSONString(listbuypricesame));
                    /* 134 */
                    listbuypricesame = new ArrayList();
                    /* 135 */
                    listbuypricesame.add(entrustTrade);
                    /* 136 */
                    sameprice = l.getEntrustPrice();
                /*     */
                }
            /*     */
            }
            /* 139 */
            String key = header + ":buy:" + sameprice.setScale(10, 6).toString();
            /* 140 */
            redisTradeService.save(key, JSON.toJSONString(listbuypricesame));
            /*     */
            /*     */
            /* 143 */
            this.redisService.save(buyonePricekey, JSON.toJSONString(((ExEntrust) listbuy.get(0)).getEntrustPrice()));
        /*     */
        } else {
            /* 145 */
            this.redisService.delete(buyonePricekey);
        /*     */
        }
        /*     */
        /*     */
        /*     */
        /* 150 */
        QueryFilter filtersell = new QueryFilter(ExEntrust.class);
        /* 151 */
        filtersell.addFilter("status<", Integer.valueOf(2));
        /* 152 */
        filtersell.addFilter("type=", Integer.valueOf(2));
        /* 153 */
        filtersell.addFilter("coinCode=", exCointoCoin.getCoinCode());
        /* 154 */
        filtersell.addFilter("fixPriceCoinCode=", exCointoCoin.getFixPriceCoinCode());
        /* 155 */
        filtersell.setOrderby("entrustPrice asc");
        /* 156 */
        List<ExEntrust> listsell = find(filtersell);
        /* 157 */
        List<EntrustTrade> listsellpricesame = new ArrayList();
        /* 158 */
        String sellonePricekey = header + ":" + "sellonePrice";
        /* 159 */
        if ((null != listsell) && (listsell.size() > 0)) {
            /* 160 */
            BigDecimal sameprice = ((ExEntrust) listsell.get(0)).getEntrustPrice();
            /* 161 */
            EntrustTrade entrustTrade = null;
            /* 162 */
            for (ExEntrust l : listsell) {
                /* 163 */
                String exentrust = JSON.toJSONString(l);
                /* 164 */
                entrustTrade = (EntrustTrade) JSON.parseObject(exentrust, EntrustTrade.class);
                /* 165 */
                if (l.getEntrustPrice().compareTo(sameprice) == 0) {
                    /* 166 */
                    listsellpricesame.add(entrustTrade);
                /*     */
                } else {
                    /* 168 */
                    String key = getHeader(entrustTrade) + ":sell:" + sameprice.setScale(10, 6).toString();
                    /* 169 */
                    redisTradeService.save(key, JSON.toJSONString(listsellpricesame));
                    /* 170 */
                    listsellpricesame = new ArrayList();
                    /* 171 */
                    listsellpricesame.add(entrustTrade);
                    /* 172 */
                    sameprice = l.getEntrustPrice();
                /*     */
                }
            /*     */
            }
            /*     */
            /*     */
            /* 177 */
            String key = header + ":sell:" + sameprice.setScale(10, 6).toString();
            /* 178 */
            redisTradeService.save(key, JSON.toJSONString(listsellpricesame));
            /*     */
            /* 180 */
            this.redisService.save(sellonePricekey, JSON.toJSONString(((ExEntrust) listsell.get(0)).getEntrustPrice()));
        /*     */
        } else {
            /* 182 */
            this.redisService.delete(sellonePricekey);
        /*     */
        }
    /*     */
    }
/*     */
}
Also used : ExCointoCoin(hry.exchange.product.model.ExCointoCoin) EntrustTrade(hry.trade.redis.model.EntrustTrade) QueryFilter(hry.core.util.QueryFilter) ExEntrust(hry.trade.entrust.model.ExEntrust) RedisTradeService(hry.redis.common.utils.RedisTradeService) BigDecimal(java.math.BigDecimal)

Aggregations

QueryFilter (hry.core.util.QueryFilter)4 ExEntrust (hry.trade.entrust.model.ExEntrust)2 ExDmColdAccountRecord (hry.exchange.account.model.ExDmColdAccountRecord)1 ExDmHotAccountRecord (hry.exchange.account.model.ExDmHotAccountRecord)1 ExCointoCoin (hry.exchange.product.model.ExCointoCoin)1 RedisTradeService (hry.redis.common.utils.RedisTradeService)1 EntrustTrade (hry.trade.redis.model.EntrustTrade)1 BigDecimal (java.math.BigDecimal)1