1
zj
2025-08-12 f8c80b2848a6b2e3ef16db317147576f4a4e0714
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
package project.wallet.internal;
 
import java.io.Serializable;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import kernel.exception.BusinessException;
import kernel.util.Arith;
import kernel.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import project.contract.ContractApplyOrder;
import project.contract.ContractApplyOrderService;
import project.contract.ContractOrder;
import project.contract.ContractOrderService;
import project.contract.ContractRedisKeys;
import project.contract.job.ContractOrderCalculationServiceImpl;
import project.data.DataService;
import project.data.model.Realtime;
import project.exchange.ExchangeApplyOrder;
import project.exchange.ExchangeApplyOrderService;
import project.finance.FinanceOrder;
import project.finance.FinanceOrderService;
import project.futures.FuturesOrder;
import project.futures.FuturesOrderService;
import project.futures.FuturesRedisKeys;
import project.item.ItemService;
import project.item.model.Item;
import project.miner.MinerOrderService;
import project.miner.MinerRedisKeys;
import project.miner.model.MinerOrder;
import project.redis.RedisHandler;
import project.syspara.SysparaService;
import project.wallet.AssetService;
import project.wallet.Wallet;
import project.wallet.WalletExtend;
import project.wallet.WalletService;
 
public class AssetServiceImpl implements AssetService {
    
    private DataService dataService;
    
    private ItemService itemService;
    
    private RedisHandler redisHandler;
    
    private WalletService walletService;
    
    private SysparaService sysparaService;
    
    private MinerOrderService minerOrderService;
    
    private FinanceOrderService financeOrderService;
    
    private FuturesOrderService futuresOrderService;
    
    private ContractOrderService contractOrderService;
    
    private ContractApplyOrderService contractApplyOrderService;
    
    private ExchangeApplyOrderService exchangeApplyOrderService;
    private static final Logger logger = LoggerFactory.getLogger(AssetServiceImpl.class);
 
    public Map<String, Object> getMoneyAll(Serializable partyId) {
        Map<String, Object> data = new HashMap<String, Object>();
        DecimalFormat df2 = new DecimalFormat("#.##");
 
        double money = 0;
        double money_wallet = 0;
        double money_coin = 0;
        double money_all_coin = 0;
        double money_finance = 0;
        double money_miner = 0;
        double money_contractApply = 0;
        double money_contract = 0;
        double money_contract_deposit = 0;
        double money_contract_profit = 0;
        double money_futures = 0;
        double money_futures_profit = 0;
 
        // 先获取一次所有币种的数据来计算
        String data_symbol = "";
        List<String> list_symbol = new ArrayList<String>();
 
        List<Item> list_items = this.itemService.cacheGetByMarket("");
        for (int i = 0; i < list_items.size(); i++) {
            Item items = list_items.get(i);
            list_symbol.add(items.getSymbol());
            if (i != 0) {
                data_symbol = data_symbol + "," + items.getSymbol();
            } else {
                data_symbol = items.getSymbol();
            }
        }
 
        List<Realtime> realtime_all = this.dataService.realtime(data_symbol);
        if (realtime_all.size() <= 0) {
            throw new BusinessException("系统错误,请稍后重试");
        }
 
        // usdt余额
        Wallet wallet = new Wallet();
        if (!"".equals(partyId) && partyId != null) {
            wallet = this.walletService.saveWalletByPartyId(partyId);
        }
 
        money = wallet.getMoney();
        // 钱包USDT
        money_wallet = wallet.getMoney();
        // 币余额
        money_coin = this.getMoneyCoin(partyId, realtime_all, list_symbol);
        money = money + money_coin;
        // 钱包USDT+币余额
        money_all_coin = money;
        // 理财
        money_finance = this.getMoneyFinance(partyId, realtime_all);
        money = money + money_finance;
        // 矿机
        money_miner = this.getMoneyMiner(partyId, realtime_all);
//        money_miner = this.getMoneyMinerRedis(partyId, realtime_all);
        money = money + money_miner;
        // 永续委托
        money_contractApply = this.getMoneyContractApply(partyId);
        money = money + money_contractApply;
                
//        Map<String, Object> moneys_contract = this.getMoneyContract(partyId);
//        // 永续
//        money_contract = (Double) moneys_contract.get("money_contract");
//        // 永续总保证金
//        money_contract_deposit = (Double) moneys_contract.get("money_contract_deposit");
//        // 永续总未实现盈亏
//        money_contract_profit = (Double) moneys_contract.get("money_contract_profit");
        
        Map<String, Object> moneys_contract = this.getMoneyContractRedis(partyId);
        if (null != moneys_contract && 0 != moneys_contract.size()) {
            // 永续
            money_contract = (Double) moneys_contract.get("money_contract");
            // 永续总保证金
            money_contract_deposit = (Double) moneys_contract.get("money_contract_deposit");
            // 永续总未实现盈亏
            money_contract_profit = (Double) moneys_contract.get("money_contract_profit");            
        }
        
        money = money + money_contract;
        
//        Map<String, Object> moneys_futures = this.getMoneyFutures(partyId);
//        // 交割
//        money_futures = (Double) moneys_futures.get("money_futures");
//        // 交割未实现盈亏
//        money_futures_profit = (Double) moneys_futures.get("money_futures_profit");
 
        Map<String, Object> moneys_futures = this.getMoneyFuturesRedis(partyId);
        if (null != moneys_futures && 0 != moneys_futures.size()) {
            // 交割
            money_futures = (Double) moneys_futures.get("money_futures");
            // 交割未实现盈亏
            money_futures_profit = (Double) moneys_futures.get("money_futures_profit");
        }
        
        money = money + money_futures;
 
        // 币币交易
        money = money + this.getMoneyexchangeApplyOrders(partyId, realtime_all);
        if(df2.format(money).equals("-0")){
            data.put("total", df2.format(0));
        }else{
            data.put("total", df2.format(money));
        }
        //锁定金额
        data.put("lock_money", df2.format(wallet.getLock_money()));
        //冻结金额
        data.put("freeze_money", df2.format(wallet.getFreeze_money()));
        data.put("money_wallet", df2.format(money_wallet));
        data.put("money_coin", df2.format(money_coin));
        data.put("money_all_coin", df2.format(money_all_coin));
        data.put("money_miner", df2.format(money_miner));
        data.put("money_finance", df2.format(money_finance));
        // 计算合约金额
        double result = Arith.add(money_contract, money_contractApply);
        logger.info("-----------合约余额"+result);
        double epsilon = 1.0E-10; // 定义一个很小的误差范围
        if (Math.abs(result) < epsilon) {
            data.put("money_contract", df2.format(0.0));
        }else{
            data.put("money_contract", df2.format(Arith.add(money_contract, money_contractApply)));
        }
        data.put("money_contract_deposit", df2.format(money_contract_deposit));
        data.put("money_contract_profit", df2.format(money_contract_profit));
        data.put("money_futures", df2.format(money_futures));
        data.put("money_futures_profit", df2.format(money_futures_profit));
 
 
        return data;
    }
    public double getMoneyCoin(Serializable partyId, List<Realtime> realtime_all, List<String> list_symbol) {
        double money_coin = 0;
 
        List<WalletExtend> walletExtends = this.walletService.findExtend(partyId, list_symbol);
        WalletExtend walletExtend = new WalletExtend();
        if (realtime_all.size() <= 0) {
 
            String data_symbol = "";
 
            for (int i = 0; i < walletExtends.size(); i++) {
                walletExtend = walletExtends.get(i);
                if (walletExtend.getAmount() > 0) {
                    if (i != 0) {
                        data_symbol = data_symbol + "," + walletExtend.getWallettype();
                    } else {
                        data_symbol = walletExtend.getWallettype();
                    }
                }
            }
 
            walletExtend = new WalletExtend();
 
            realtime_all = this.dataService.realtime(data_symbol);
            if (realtime_all.size() <= 0) {
                throw new BusinessException("系统错误,请稍后重试");
            }
        }
 
        Realtime realtime = null;
        
        // 如果2个相同,则说明用户所有币账户已经生成 .toUpperCase()/
        if (walletExtends != null && walletExtends.size() != 0) {
 
            for (int i = 0; i < walletExtends.size(); i++) {
                if (null == walletExtends.get(i)) {
                    continue;
                }
 
                walletExtend = walletExtends.get(i);
                if (walletExtend.getAmount() > 0) {
                    realtime = null;
 
                    for (Realtime real : realtime_all) {
                        if (real.getSymbol().equals(walletExtend.getWallettype().toLowerCase())) {
                            realtime = real;
                            break;
                        }
                    }
 
                    if (realtime != null) {
                        money_coin = Arith.add(money_coin, Arith.mul(realtime.getClose(), walletExtend.getAmount()));
                    }
                }
            }
        }
 
        return money_coin;
    }
    
    public double getMoneyFinance(Serializable partyId, List<Realtime> realtimeall) {
        double money_finance = 0;
        List<FinanceOrder> financeOrders = financeOrderService.findByState(partyId.toString(), "1");
        String finance_profit_symbol = sysparaService.find("finance_profit_symbol").getValue();
        if (financeOrders != null) {
            Realtime realtime = null;
            if (!"".equals(finance_profit_symbol) && finance_profit_symbol != null && finance_profit_symbol != "usdt") {
                realtime = new Realtime();
 
                if (realtimeall.size() <= 0) {
                    List<Realtime> realtime_list = this.dataService.realtime(finance_profit_symbol);
 
                    if (realtime_list.size() > 0) {
                        realtime = realtime_list.get(0);
                    } else {
                        throw new BusinessException("系统错误,请稍后重试");
                    }
                } else {
                    for (Realtime real : realtimeall) {
                        if (real.getSymbol().equals(finance_profit_symbol)) {
                            realtime = real;
                            break;
                        }
                    }
                }
            }
            for (FinanceOrder order : financeOrders) {
                double amount = 0;
                if (!"".equals(finance_profit_symbol) && finance_profit_symbol != null
                        && finance_profit_symbol != "usdt") {
                    amount = Arith.mul(order.getAmount(), realtime.getClose());
                } else {
                    amount = order.getAmount();
                }
                money_finance = Arith.add(amount, money_finance);
            }
        }
        return money_finance;
    }
    
    /*
     * 获取 所有订单 矿机总资产 redis
     */
    public double getMoneyMinerRedis(Serializable partyId, List<Realtime> realtimeall) {
        Double minerAssets = (Double) this.redisHandler.get(MinerRedisKeys.MINER_ASSETS_PARTY_ID + partyId.toString());        
        double money_miner = null == minerAssets ? 0.000D : minerAssets;
        
        String minerBuySymbol = this.sysparaService.find("miner_buy_symbol").getValue();
        if (!StringUtils.isEmptyString(minerBuySymbol)) {
            Realtime realtime = new Realtime();
 
            if (realtimeall.size() <= 0) {
                List<Realtime> realtime_list = this.dataService.realtime(minerBuySymbol);
 
                if (realtime_list.size() > 0) {
                    realtime = realtime_list.get(0);
                } else {
                    throw new BusinessException("系统错误,请稍后重试");
                }
            } else {                
                for (Realtime real : realtimeall) {
                    if (real.getSymbol().equals(minerBuySymbol)) {
                        realtime = real;
                        break;
                    }
                }
            }
            
            double minerBuyClose = realtime.getClose();
            money_miner = Arith.mul(money_miner, minerBuyClose);
        }
        
        return money_miner;
    }
    
    /*
     * 获取 所有订单 矿机总资产
     */
    public double getMoneyMiner(Serializable partyId, List<Realtime> realtimeall) {
        double money_miner = 0;
        List<MinerOrder> minerOrders = minerOrderService.findByState(partyId.toString(), "1");
        if (minerOrders != null) {
            for (MinerOrder order : minerOrders) {
                double amount = Arith.add(order.getAmount(), 0);
                money_miner = Arith.add(amount, money_miner);
            }
            String minerBuySymbol = sysparaService.find("miner_buy_symbol").getValue();
            if (!StringUtils.isEmptyString(minerBuySymbol)) {
                Realtime realtime = new Realtime();
 
                if (realtimeall.size() <= 0) {
                    List<Realtime> realtime_list = this.dataService.realtime(minerBuySymbol);
 
                    if (realtime_list.size() > 0) {
                        realtime = realtime_list.get(0);
                    } else {
                        throw new BusinessException("系统错误,请稍后重试");
                    }
                } else {
                    for (Realtime real : realtimeall) {
                        if (real.getSymbol().equals(minerBuySymbol)) {
                            realtime = real;
                            break;
                        }
                    }
                }
                double minerBuyClose = realtime.getClose();
                money_miner = Arith.mul(money_miner, minerBuyClose);
            }
        }
 
        return money_miner;
    }
    
    public double getMoneyContractApply(Serializable partyId) {
        double money_contractApply = 0;
 
        List<ContractApplyOrder> contractApplyOrders = this.contractApplyOrderService.findSubmitted(partyId.toString(), "", "", "");
        if (contractApplyOrders != null) {
            
            for (ContractApplyOrder order : contractApplyOrders) {
                double amount = Arith.mul(order.getVolume_open(), order.getUnit_amount());
                money_contractApply = Arith.add(amount, money_contractApply);
            }
        }
 
        return money_contractApply;
    }
    
    /*
     * 获取 所有订单 永续合约总资产、总保证金、总未实现盈利 redis
     */
    public Map<String, Object> getMoneyContractRedis(Serializable partyId) {
        
        Double contractAssets = (Double) this.redisHandler.get(ContractRedisKeys.CONTRACT_ASSETS_PARTY_ID + partyId.toString());
        Double contractAssetsDeposit = (Double) this.redisHandler.get(ContractRedisKeys.CONTRACT_ASSETS_DEPOSIT_PARTY_ID + partyId.toString());
        Double contractAssetsProfit = (Double) this.redisHandler.get(ContractRedisKeys.CONTRACT_ASSETS_PROFIT_PARTY_ID + partyId.toString());
 
        Map<String, Object> moneys_contract = new HashMap<String, Object>();
        moneys_contract.put("money_contract", null == contractAssets ? 0.000D : contractAssets);
        moneys_contract.put("money_contract_deposit", null == contractAssetsDeposit ? 0.000D : contractAssetsDeposit);
        moneys_contract.put("money_contract_profit", null == contractAssetsProfit ? 0.000D : contractAssetsProfit);
 
        return moneys_contract;
    }
    
    /*
     * 获取 所有订单 永续合约总资产、总保证金、总未实现盈利
     */
    public Map<String, Object> getMoneyContract(Serializable partyId) {
        double money_contract = 0;
        double money_contract_deposit = 0;
        double money_contract_profit = 0;
        
        List<ContractOrder> contractOrders = this.contractOrderService.findSubmitted(partyId.toString(), "", "");
        if (contractOrders != null) {
            
            for (ContractOrder order : contractOrders) {
                double order_volume = 1;
                
                if (order.getLever_rate() != null && order.getLever_rate() != 0) {
                    order_volume = Arith.div(order.getVolume_open(), order.getLever_rate());
                } else {
                    order_volume = order.getVolume_open();
                }
                
                double amount = Arith.add(Arith.mul(order_volume, order.getUnit_amount()), order.getProfit());
                money_contract = Arith.add(amount, money_contract);
                money_contract_deposit = Arith.add(order.getDeposit(), money_contract_deposit);
                money_contract_profit = Arith.add(order.getProfit(), money_contract_profit);
            }
        }
        
        Map<String, Object> moneys_contract = new HashMap<String, Object>();
        moneys_contract.put("money_contract", money_contract);
        moneys_contract.put("money_contract_deposit", money_contract_deposit);
        moneys_contract.put("money_contract_profit", money_contract_profit);
 
        return moneys_contract;
    }
    
    /*
     * 获取 单个订单 永续合约总资产、总保证金、总未实现盈利
     */
    public Map<String, Double> getMoneyContractByOrder(ContractOrder order) {
        Map<String, Double> moneys_contract = new HashMap<String, Double>();
        
        if (null == order) {
            moneys_contract.put("money_contract", 0.000D);
            moneys_contract.put("money_contract_deposit", 0.000D);
            moneys_contract.put("money_contract_profit", 0.000D);
            return moneys_contract;
        }
        
        double order_volume = 1;
 
        if (order.getLever_rate() != null && order.getLever_rate() != 0) {
            order_volume = Arith.div(order.getVolume_open(), order.getLever_rate());
        } else {
            order_volume = order.getVolume_open();
        }
 
 
        
        double money_contract = Arith.add(Arith.mul(order_volume, order.getUnit_amount()), order.getProfit());
        double money_contract_deposit = order.getDeposit();
        double money_contract_profit = order.getProfit();
        
        moneys_contract.put("money_contract", money_contract);
        moneys_contract.put("money_contract_deposit", money_contract_deposit);
        moneys_contract.put("money_contract_profit", money_contract_profit);
        return moneys_contract;
    }
    
    /*
     * 获取 所有订单 交割合约总资产、总未实现盈利 redis
     */
    public Map<String, Object> getMoneyFuturesRedis(Serializable partyId) {
 
        Double futuresAssets = (Double) this.redisHandler.get(FuturesRedisKeys.FUTURES_ASSETS_PARTY_ID + partyId.toString());
        Double futuresAssetsProfit = (Double) this.redisHandler.get(FuturesRedisKeys.FUTURES_ASSETS_PROFIT_PARTY_ID + partyId.toString());
 
        Map<String, Object> moneys_futures = new HashMap<String, Object>();
        moneys_futures.put("money_futures", null == futuresAssets ? 0.000D : futuresAssets);
        moneys_futures.put("money_futures_profit", null == futuresAssetsProfit ? 0.000D : futuresAssetsProfit);
 
        return moneys_futures;
    }
    
    /*
     * 获取 所有订单 交割合约总资产、总未实现盈利
     */
    public Map<String, Object> getMoneyFutures(Serializable partyId) {
        double money_futures = 0;
        double money_futures_profit = 0;
        
        List<FuturesOrder> futuresOrders = this.futuresOrderService.cacheSubmitted();
        if (futuresOrders != null) {
            
            for (FuturesOrder order : futuresOrders) {
                if (partyId.equals(order.getPartyId().toString())) {
                    money_futures = Arith.add(order.getVolume(), money_futures);
                    money_futures_profit = Arith.add(order.getProfit(), money_futures_profit);
                }
            }
        }
        
        Map<String, Object> moneys_futures = new HashMap<String, Object>();
        moneys_futures.put("money_futures", money_futures);
        moneys_futures.put("money_futures_profit", money_futures_profit);
 
        return moneys_futures;
    }
    
    /*
     * 获取 单个订单 交割合约总资产、总未实现盈利
     */
    public Map<String, Double> getMoneyFuturesByOrder(FuturesOrder order) {
        Map<String, Double> moneys_futures = new HashMap<String, Double>();
        
        if (null == order) {
            moneys_futures.put("money_futures", 0.000D);
            moneys_futures.put("money_futures_profit", 0.000D);
            return moneys_futures;
        }
        
        double money_futures = order.getVolume();
        double money_futures_profit = order.getProfit();
        
        moneys_futures.put("money_futures", money_futures);
        moneys_futures.put("money_futures_profit", money_futures_profit);
        return moneys_futures;
    }
    
    public double getMoneyexchangeApplyOrders(Serializable partyId, List<Realtime> realtimeall) {
        double moneyExchange = 0;
        
        List<ExchangeApplyOrder> exchangeApplyOrders = this.exchangeApplyOrderService.findSubmitted();
        
        if (exchangeApplyOrders != null) {
            
            for (ExchangeApplyOrder order : exchangeApplyOrders) {
                
                if (partyId.equals(order.getPartyId().toString())) {
                    
                    if ("open".equals(order.getOffset())) {
                        moneyExchange = Arith.add(moneyExchange, order.getVolume());
                    }
                    
                    if ("close".equals(order.getOffset())) {                        
                        Realtime realtime = new Realtime();
                        
                        if (realtimeall.size() <= 0) {
                            List<Realtime> realtime_list = this.dataService.realtime(order.getSymbol());
 
                            if (realtime_list.size() > 0) {
                                realtime = realtime_list.get(0);
                            } else {
                                throw new BusinessException("系统错误,请稍后重试");
                            }
                        } else {
                            for (Realtime real : realtimeall) {
                                if (real.getSymbol().equals(order.getSymbol())) {
                                    realtime = real;
                                    break;
                                }
                            }
                        }
 
                        moneyExchange = Arith.add(moneyExchange, Arith.mul(order.getVolume(), realtime.getClose()));
                    }
                }
            }
        }
 
        return moneyExchange;
    }
 
    public void setContractOrderService(ContractOrderService contractOrderService) {
        this.contractOrderService = contractOrderService;
    }
 
    public void setContractApplyOrderService(ContractApplyOrderService contractApplyOrderService) {
        this.contractApplyOrderService = contractApplyOrderService;
    }
 
    public void setWalletService(WalletService walletService) {
        this.walletService = walletService;
    }
 
    public void setDataService(DataService dataService) {
        this.dataService = dataService;
    }
 
    public void setFinanceOrderService(FinanceOrderService financeOrderService) {
        this.financeOrderService = financeOrderService;
    }
 
    public void setMinerOrderService(MinerOrderService minerOrderService) {
        this.minerOrderService = minerOrderService;
    }
 
    public void setFuturesOrderService(FuturesOrderService futuresOrderService) {
        this.futuresOrderService = futuresOrderService;
    }
 
    public void setExchangeApplyOrderService(ExchangeApplyOrderService exchangeApplyOrderService) {
        this.exchangeApplyOrderService = exchangeApplyOrderService;
    }
 
    public void setSysparaService(SysparaService sysparaService) {
        this.sysparaService = sysparaService;
    }
 
    public void setItemService(ItemService itemService) {
        this.itemService = itemService;
    }
 
    public void setRedisHandler(RedisHandler redisHandler) {
        this.redisHandler = redisHandler;
    }
 
}