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 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_POSTCUS_API_KEY,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_CRM_POSTCUS_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_ZHONGTAI_SYS_API_URL,systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_ZHONGTAI_SYS_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)); } }