|
@@ -57,6 +57,8 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
|
|
*/
|
|
*/
|
|
public List <OfficeDTO> findList(String tenantId, String parentId) {
|
|
public List <OfficeDTO> findList(String tenantId, String parentId) {
|
|
QueryWrapper queryWrapper = new QueryWrapper ( );
|
|
QueryWrapper queryWrapper = new QueryWrapper ( );
|
|
|
|
+ //查询签字注师2岗位用户信息
|
|
|
|
+
|
|
queryWrapper.like ( StringUtils.isNotBlank ( parentId ), "a.parent_ids", "," + parentId + "," );
|
|
queryWrapper.like ( StringUtils.isNotBlank ( parentId ), "a.parent_ids", "," + parentId + "," );
|
|
queryWrapper.eq ( StringUtils.isNotBlank ( tenantId ), "a.tenant_id", tenantId );
|
|
queryWrapper.eq ( StringUtils.isNotBlank ( tenantId ), "a.tenant_id", tenantId );
|
|
queryWrapper.eq ( "a.del_flag", 0 );
|
|
queryWrapper.eq ( "a.del_flag", 0 );
|
|
@@ -64,6 +66,47 @@ public class OfficeService extends TreeService <OfficeMapper, Office> {
|
|
return baseMapper.findList ( queryWrapper );
|
|
return baseMapper.findList ( queryWrapper );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public List <OfficeDTO> getAccessRootTree(List<OfficeDTO> list, String extId, String type, String showAll, String showMyOffice) {
|
|
|
|
+ List<OfficeDTO> offices = Lists.newArrayList ();
|
|
|
|
+ // 获取到所有parent_id为‘0’的部门数据
|
|
|
|
+ List<Office> children = officeMapper.getAccessChildren(OfficeDTO.getRootId());
|
|
|
|
+// List<Office> children = super.getChildren(new Office(OfficeDTO.getRootId()));
|
|
|
|
+ List<OfficeDTO> rootTrees = OfficeWrapper.INSTANCE.toDTO (children);
|
|
|
|
+ for (OfficeDTO root : rootTrees) {
|
|
|
|
+ if (this.isUseAble ( extId, type,root, showAll )){
|
|
|
|
+ // 不是被排除节点的子节点
|
|
|
|
+ List<OfficeDTO> officeList = formatListToTree (root, list, extId, type, showAll);
|
|
|
|
+ offices.addAll (officeList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(showMyOffice)) {
|
|
|
|
+ OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
|
|
|
|
+ // 排除管理员
|
|
|
|
+ if (!UserUtils.getCurrentUserDTO().isAdmin()){
|
|
|
|
+ if (org.apache.commons.lang.StringUtils.isNotBlank(officeDTO.getParentIds())) {
|
|
|
|
+ String[] split = officeDTO.getParentIds().split(",");
|
|
|
|
+ if (split.length > 2) {
|
|
|
|
+ Office office = officeMapper.selectById(split[2]);
|
|
|
|
+ if ("0".equals(office.getIsPublic())) {
|
|
|
|
+ // isPublic为“0”,当前用户的公司为私有,查询的部门包含自己所属公司全部部门和其他的公有部门
|
|
|
|
+ if(null != officeDTO && org.apache.commons.lang.StringUtils.isNotBlank(officeDTO.getParentIds())){
|
|
|
|
+ offices = this.getCompanyFromTree(offices);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if ("0".equals(officeDTO.getIsPublic())) {
|
|
|
|
+ // isPublic为“0”,当前用户的公司为私有,查询的部门包含自己所属公司全部部门和其他的公有部门
|
|
|
|
+ if(null != officeDTO && org.apache.commons.lang.StringUtils.isNotBlank(officeDTO.getParentIds())){
|
|
|
|
+ offices = this.getCompanyFromTree(offices);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return offices;
|
|
|
|
+ }
|
|
|
|
+
|
|
public List <OfficeDTO> getRootTree(List<OfficeDTO> list, String extId, String type, String showAll, String showMyOffice) {
|
|
public List <OfficeDTO> getRootTree(List<OfficeDTO> list, String extId, String type, String showAll, String showMyOffice) {
|
|
List<OfficeDTO> offices = Lists.newArrayList ();
|
|
List<OfficeDTO> offices = Lists.newArrayList ();
|
|
// 获取到所有parent_id为‘0’的部门数据
|
|
// 获取到所有parent_id为‘0’的部门数据
|