jiangping
2024-07-15 520219f63a2ced43bfb3a02028d0a7896f0e4d2f
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
package com.doumee.service.business;
 
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.utils.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
 
import javax.annotation.PostConstruct;
 
/**
 * 志邦组织信息表Service实现
 * @author 江蹄蹄
 * @date 2024/07/04 14:40
 */
@Service
public class InitService {
 
    @Autowired
    @Lazy
    private RedisTemplate<String, Object> redisTemplate;
    @Autowired
    @Lazy
    private ShopService shopService;
    @Autowired
    @Lazy
    private SystemDictDataBiz  systemDictDataBiz;
 
    public void clearImporting(){
        redisTemplate.delete(Constants.RedisKeys.IMPORTING_SHOP);
        redisTemplate.delete(Constants.RedisKeys.IMPORTING_USERS);
    }
    public void refreshZbomDictDataCache(){
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPKEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPKEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.IAM_APPID,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_IAM_APPID).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_AUTH_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_AUTH_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_CRM_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_SMS_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_SMS_API_KEY).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_ZHONGTAI_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_ZHONGTAI_API_URL).getCode());
        redisTemplate.opsForValue().set(Constants.RedisKeys.ZBOM_ENCODE_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_ENCODE_URL).getCode());
    }
    @PostConstruct
    public void cacheShopTree(){
//        redisTemplate.opsForValue().set(Constants.RedisKeys.SHOP_TREE,shopService.shopTree(null));
    }
 
 
}