|
@@ -5,14 +5,17 @@ package com.jeeplus.sys.service;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.common.constant.CommonConstants;
|
|
|
import com.jeeplus.common.constant.enums.OfficeTypeEnum;
|
|
|
import com.jeeplus.core.service.TreeService;
|
|
|
import com.jeeplus.sys.domain.Office;
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.mapper.OfficeMapper;
|
|
|
import com.jeeplus.sys.service.dto.OfficeDTO;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
@@ -61,6 +64,33 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
|
|
|
*/
|
|
|
public List <OfficeDTO> findList(String tenantId, String parentId) {
|
|
|
QueryWrapper queryWrapper = new QueryWrapper ( );
|
|
|
+ //根据当前人的所属部门去查相关数据
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
+ queryWrapper.like ( StringUtils.isNotBlank ( parentId ), "a.parent_ids", "," + parentId + "," );
|
|
|
+ queryWrapper.eq ( StringUtils.isNotBlank ( tenantId ), "a.tenant_id", tenantId );
|
|
|
+ queryWrapper.eq ( "a.del_flag", 0 );
|
|
|
+ if (StringUtils.isNotBlank(userDTO.getCompanyDTO().getName())){
|
|
|
+ if (userDTO.getCompanyDTO().getName().contains("评估")) {
|
|
|
+ queryWrapper.like ( "a.name", "%评估%" );
|
|
|
+ }else if (userDTO.getCompanyDTO().getName().contains("会计")){
|
|
|
+ //获取兴光会计师事务所的子集id
|
|
|
+ List<String> ids = baseMapper.getIds(userDTO.getCompanyDTO().getId());
|
|
|
+ ids.add(userDTO.getCompanyDTO().getId());
|
|
|
+ queryWrapper.in ( "a.id", ids );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ queryWrapper.orderByAsc ( "a.sort" );
|
|
|
+ return baseMapper.findList ( queryWrapper );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取列表
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List <OfficeDTO> findList2(String tenantId, String parentId) {
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper ( );
|
|
|
// 查询岗位用户信息
|
|
|
List<String> offId = userService.findOffId();
|
|
|
queryWrapper.like ( StringUtils.isNotBlank ( parentId ), "a.parent_ids", "," + parentId + "," );
|