|
|
@ -33,7 +33,7 @@ import com.epmet.dao.GovMenuDao; |
|
|
|
import com.epmet.dto.GovMenuDTO; |
|
|
|
import com.epmet.entity.GovMenuEntity; |
|
|
|
import com.epmet.enums.MenuTypeEnum; |
|
|
|
import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.redis.GovCustomerMenuRedis; |
|
|
|
import com.epmet.redis.GovMenuRedis; |
|
|
|
import com.epmet.service.*; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -42,6 +42,7 @@ import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
@ -57,7 +58,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
@Autowired |
|
|
|
private GovMenuRedis govMenuRedis; |
|
|
|
@Autowired |
|
|
|
private EpmetUserFeignClient epmetUserFeignClient; |
|
|
|
private GovCustomerMenuRedis govCustomerMenuRedis; |
|
|
|
@Autowired |
|
|
|
private GovRoleMenuService govRoleMenuService; |
|
|
|
@Autowired |
|
|
@ -208,9 +209,15 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit |
|
|
|
* @Date 15:51 2021-03-16 |
|
|
|
**/ |
|
|
|
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type) { |
|
|
|
List<GovMenuDTO> govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type); |
|
|
|
if (!CollectionUtils.isEmpty(govMenuDTOS)){ |
|
|
|
return govMenuDTOS; |
|
|
|
} |
|
|
|
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); |
|
|
|
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); |
|
|
|
return TreeUtils.buildTree(dtoList); |
|
|
|
govMenuDTOS = TreeUtils.buildTree(dtoList); |
|
|
|
govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS); |
|
|
|
return govMenuDTOS; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|