Commit e9ed0d15 by 朱淼

修改

parent f6319aed
......@@ -3,16 +3,10 @@ package com.makeit.module.controller.wechat.space;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.auth.PlatOrgDTO;
import com.makeit.dto.platform.space.PlatSpaceAddDTO;
import com.makeit.dto.platform.space.PlatSpaceQueryDTO;
import com.makeit.dto.platform.space.PlatSpaceVO;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.utils.user.plat.PlatUserVO;
import com.makeit.utils.user.wechat.WechatUserInfo;
import com.makeit.utils.user.wechat.WechatUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -74,9 +68,9 @@ public class PlatSpaceWechatController {
}
@ApiOperation("一级空间列表(该账号权限下)")
@ApiOperation("一级空间列表")
@PostMapping("oneLevelList")
public ApiResponseEntity<List<PlatSpaceAddDTO>> oneLevelList(@RequestBody PlatOrgDTO dto) {
public ApiResponseEntity<List<PlatSpaceAddDTO>> oneLevelList(@RequestBody BaseIdDTO dto) {
List<PlatSpaceAddDTO> data = spaceService.oneLevelList(dto);
return ApiResponseUtils.success(data);
}
......
......@@ -386,6 +386,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
//如果是租户账号 则有所有权限
if (StringUtils.equals(isTenant, CommonEnum.YES.getValue())) {
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.eq(PlatOrg::getStatus, CommonEnum.YES.getValue())
);
return getOrgTree(orgList, Collections.singletonList(TenantIdUtil.getTenantId()));
......@@ -393,7 +394,9 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
//平台账号
Set<String> orgIdList = getOrgIdListByUserId(userVO.getId());
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>().in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
if (CollectionUtils.isEmpty(orgList)) {
return new ArrayList<>();
}
......@@ -464,6 +467,7 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
//如果是租户账号 则有所有权限
if (StringUtils.equals(isTenant, CommonEnum.YES.getValue())) {
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.eq(PlatOrg::getStatus, CommonEnum.YES.getValue())
);
return orgList;
......@@ -471,7 +475,9 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
//平台账号
Set<String> orgIdList = getOrgIdListByUserId(userVO.getId());
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>().in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
List<PlatOrg> orgList = this.list(new LambdaQueryWrapper<PlatOrg>()
.eq(StringUtils.isNotEmpty(param.getType()), PlatOrg::getType, param.getType())
.in(BaseEntity::getId, orgIdList).eq(PlatOrg::getStatus, CommonEnum.YES.getValue()));
if (CollectionUtils.isEmpty(orgList)) {
return new ArrayList<>();
}
......
package com.makeit.service.platform.space;
import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.dto.platform.auth.PlatOrgDTO;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.dto.platform.space.PlatSpaceAddDTO;
import com.makeit.dto.platform.space.PlatSpaceQueryDTO;
import com.makeit.dto.platform.space.PlatSpaceVO;
import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.utils.user.wechat.WechatUserInfo;
import com.makeit.vo.platform.space.PlatSpaceAndRoomVO;
import java.util.List;
......@@ -62,7 +61,7 @@ public interface PlatSpaceService extends IService<PlatSpace> {
List<PlatSpace> listChild(List<String> spaceIds);
List<PlatSpaceAddDTO> oneLevelList(PlatOrgDTO dtom);
List<PlatSpaceAddDTO> oneLevelList(BaseIdDTO dto);
PlatSpaceVO child(PlatSpaceVO vo, Map<String,List<PlatSpace>> map);
......
......@@ -3,7 +3,7 @@ package com.makeit.service.platform.space.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.platform.auth.PlatOrgDTO;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.dto.platform.space.PlatSpaceAddDTO;
import com.makeit.dto.platform.space.PlatSpaceQueryDTO;
import com.makeit.dto.platform.space.PlatSpaceVO;
......@@ -21,8 +21,6 @@ import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.user.plat.PlatUserUtil;
import com.makeit.utils.user.plat.PlatUserVO;
import com.makeit.utils.user.wechat.WechatUserInfo;
import com.makeit.utils.user.wechat.WechatUserUtil;
import com.makeit.vo.platform.space.PlatSpaceAndRoomVO;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -208,19 +206,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
}
@Override
public List<PlatSpaceAddDTO> oneLevelList(PlatOrgDTO dto) {
//获取该账号的权限组织
PlatOrg param = new PlatOrg();
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){
return new ArrayList<>();
}
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
public List<PlatSpaceAddDTO> oneLevelList(BaseIdDTO dto) {
List<PlatSpace> spaces = list(new QueryWrapper<PlatSpace>().lambda()
.isNull(PlatSpace::getParentId)
.in(PlatSpace::getOrgId, orgIds));
.eq(PlatSpace::getOrgId, dto.getId()));
return BeanDtoVoUtils.listVo(spaces, PlatSpaceAddDTO.class);
}
......
......@@ -25,7 +25,6 @@ import com.makeit.service.platform.workstation.WorkStationService;
import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.vo.platform.elder.realtime.PlatElderRealTimeNowVO;
import com.makeit.vo.platform.space.PlatBedPanoramaVO;
import com.makeit.vo.platform.workstation.*;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -254,7 +253,7 @@ public class WorkStationServiceImpl implements WorkStationService {
WorkStationHomeStatisticsVO vo = new WorkStationHomeStatisticsVO();
if (dto.getOrgIds().isEmpty()) {
//获取该账号的权限组织
List<PlatOrg> orgs = belongToScopeList(PlatOrgEnum.OrgTypeEnum.INSTITUTION.getValue());
List<PlatOrg> orgs = belongToScopeList(PlatOrgEnum.OrgTypeEnum.HOME.getValue());
if (orgs.isEmpty()) {
return vo;
}
......@@ -293,7 +292,7 @@ public class WorkStationServiceImpl implements WorkStationService {
public List<WorkStationHomeBedVO> homeList(WorkStationQueryDTO dto) {
List<PlatSpace> spaces = new ArrayList<>();
//获取该账号的权限组织
List<PlatOrg> orgs = belongToScopeList(PlatOrgEnum.OrgTypeEnum.INSTITUTION.getValue());
List<PlatOrg> orgs = belongToScopeList(PlatOrgEnum.OrgTypeEnum.HOME.getValue());
if (orgs.isEmpty()) {
return new ArrayList<>();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment