| 1234567891011121314151617181920212223242526272829303132333435 |
- package com.kym.service.impl;
- import com.kym.entity.MerchantStation;
- import com.kym.mapper.MerchantStationMapper;
- import com.kym.service.MerchantStationService;
- import com.kym.service.cache.KymCache;
- import com.kym.service.mybatisplus.MyBaseServiceImpl;
- import jakarta.annotation.PostConstruct;
- import org.springframework.stereotype.Service;
- import java.util.Map;
- /**
- * <p>
- * 商户站点表 服务实现类
- * </p>
- *
- * @author skyline
- * @since 2025-02-25
- */
- @Service
- public class MerchantStationServiceImpl extends MyBaseServiceImpl<MerchantStationMapper, MerchantStation> implements MerchantStationService {
- /**
- * 初始化缓存站点-商户对应关系
- */
- @PostConstruct
- private void init() {
- var merchantStationList = list();
- for (MerchantStation ms : merchantStationList) {
- KymCache.INSTANCE.putStationId2MerchantId(Map.of(ms.getStationId(), String.valueOf(ms.getId())));
- }
- }
- }
|