| | |
| | | import org.springblade.modules.jurisdiction.entity.Jurisdiction; |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.mapper.DeptMapper; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springblade.modules.system.node.TreeNodes; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.vo.DeptVO; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springblade.modules.system.wrapper.DeptWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * @author Chill |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService { |
| | | private static final String TENANT_ID = "tenantId"; |
| | | private static final String PARENT_ID = "parentId"; |
| | | |
| | | private final IInformationService iInformationService; |
| | | @Autowired |
| | | private IInformationService iInformationService; |
| | | |
| | | private final JurisdictionService jurisdictionService; |
| | | @Autowired |
| | | private JurisdictionService jurisdictionService; |
| | | |
| | | @Override |
| | | public List<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVO> lazyTree(String tenantId, Long parentId) { |
| | | if (AuthUtil.isAdministrator()) { |
| | | tenantId = StringPool.EMPTY; |
| | | public List<DeptVO> lazyTree(String tenantId, Long parentId,String userId) { |
| | | // if (AuthUtil.isAdministrator()) { |
| | | // tenantId = StringPool.EMPTY; |
| | | // } |
| | | //获取用户信息,保安,民警 |
| | | if (null!=userId && !userId.equals("")) { |
| | | UserVO user = baseMapper.getUserInfoById(userId); |
| | | if (user.getRoleAlias().equals("公安管理员")){ |
| | | //公安管理员又分,如果是派出所,只返回当前值 |
| | | if (user.getDeptName().contains("派出所")){ |
| | | return ForestNodeMerger.merge(baseMapper.lazyTreeCityOne(tenantId, parentId)); |
| | | }else { |
| | | //市局,区级 |
| | | Dept dept = this.getById(parentId); |
| | | if (null != dept) { |
| | | if (dept.getParentId().equals(1123598813738675201L)) { |
| | | return ForestNodeMerger.merge(baseMapper.lazyTreeCity(tenantId, parentId)); |
| | | } |
| | | if (dept.getParentId().equals(0L)){ |
| | | //南昌市公安局 |
| | | return ForestNodeMerger.merge(baseMapper.lazyTreeByJurisdiction()); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | //保安公司 |
| | | return ForestNodeMerger.merge(baseMapper.securityLazyTree(null, parentId)); |
| | | } |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentId)); |
| | | //admin |
| | | return ForestNodeMerger.merge(baseMapper.lazyTree(tenantId, parentId,null)); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVO> lazyTrees() { |
| | | return ForestNodeMerger.merge(baseMapper.lazyTrees()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVO> selectInfos() { |
| | | return baseMapper.selectInfos(); |
| | | } |
| | | |
| | | @Override |
| | | public List<DeptVo> selDeptList() { |
| | | return baseMapper.selDeptList(); |
| | | } |