| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | import com.dsh.course.model.node.ZTreeNode; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.controller.util.Convert; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | public int deleteRolesById(Integer roleId) { |
| | | return this.baseMapper.deleteRolesById(roleId); |
| | | } |
| | | |
| | | @Resource |
| | | private IStoreService storeService; |
| | | @Override |
| | | public List<ZTreeNode> roleTreeList(Integer type,Integer id) { |
| | | return this.baseMapper.roleTreeList(type,id); |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | if (type==2){ |
| | | // 查询运营商下的门店ids |
| | | List<Integer> collect = storeService.lambdaQuery().eq(TStore::getOperatorId, id).list() |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | storeIds.add(-1); |
| | | } |
| | | storeIds.addAll(collect); |
| | | } |
| | | return this.baseMapper.roleTreeList(type,id,storeIds); |
| | | } |
| | | |
| | | @Override |