| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.netty.util.internal.StringUtil; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.activiti.entity.ActivitiDefinition; |
| | | import org.jeecg.modules.activiti.service.IActivitiDefinitionService; |
| | | import org.jeecg.modules.dnc.dto.DepartApproveUser; |
| | |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DepartmentMapper; |
| | | import org.jeecg.modules.dnc.request.DepartmentRequest; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.CommonJsonTree; |
| | | import org.jeecg.modules.dnc.response.DepartmentCode; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.support.DepartmentTreeWrapper; |
| | | import org.jeecg.modules.dnc.service.support.FindsDepartmentChildrenUtil; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.model.SysDepartTreeModel; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.util.FindsDepartsChildrenUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 查询所有部门信息,并分节点进行显示 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> queryTreeList(){ |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | query.eq(Department::getDeleteFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(Department::getPriority); |
| | | List<Department> list = this.list(query); |
| | | List<DepartmentTreeModel> listResult = FindsDepartmentChildrenUtil.wrapTreeDataToTreeList(list); |
| | | return listResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询所有部门信息,并分节点进行显示 |
| | | * @param ids 多个部门id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> queryTreeList(String ids){ |
| | | List<DepartmentTreeModel> listResult=new ArrayList<>(); |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | query.eq(Department::getDeleteFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | if(oConvertUtils.isNotEmpty(ids)){ |
| | | query.in(true,Department::getDepartId,ids.split(",")); |
| | | } |
| | | query.orderByAsc(Department::getPriority); |
| | | List<Department> list= this.list(query); |
| | | for (Department department : list) { |
| | | listResult.add(new DepartmentTreeModel(department)); |
| | | } |
| | | return listResult; |
| | | } |
| | | |
| | | /** |
| | | * <p> |
| | | * 根据关键字搜索相关的部门数据 |
| | | * </p> |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> searchByKeyWord(String keyWord,String myDeptSearch,String departIds) { |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | List<DepartmentTreeModel> newList = new ArrayList<>(); |
| | | query.like(Department::getDepartName, keyWord); |
| | | //update-begin--Author:huangzhilin Date:20140417 for:[bugfree号]组织机构搜索回显优化-------------------- |
| | | DepartmentTreeModel model = new DepartmentTreeModel(); |
| | | List<Department> departList = this.list(query); |
| | | if(departList.size() > 0) { |
| | | for(Department depart : departList) { |
| | | model = new DepartmentTreeModel(depart); |
| | | model.setChildren(null); |
| | | //update-end--Author:huangzhilin Date:20140417 for:[bugfree号]组织机构搜索功回显优化---------------------- |
| | | newList.add(model); |
| | | } |
| | | return newList; |
| | | } |
| | | return null; |
| | | } |
| | | } |