Commit 41612f94 by huangjy

fix: 修复bug

parent 5c4ab660
/*
package com.makeit.global.aspect.misc.schedule;
import com.makeit.utils.redis.ScheduleLockUtil;
......@@ -37,3 +38,4 @@ public class ScheduleLockAspect {
}
}
*/
package com.makeit.module.controller.space;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderQueryDTO;
......@@ -49,6 +51,13 @@ public class PlatRoomDynamicController {
return ApiResponseUtils.success(data);
}
@ApiOperation("床位全景分页")
@PostMapping("bedPanoramaPage")
public ApiResponseEntity<Page<PlatBedPanoramaVO>> bedPanoramaPage(@RequestBody PageReqDTO<PlatBedPanoramaDTO> dto) {
Page<PlatBedPanoramaVO> data = platRoomDynamicService.bedPanoramaPage(dto);
return ApiResponseUtils.success(data);
}
@ApiOperation("房间全景-下拉空间树")
@PostMapping("roomPanoramaTree")
public ApiResponseEntity<List<PlatSpaceAndRoomVO>> roomPanoramaTree() {
......
......@@ -8,6 +8,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
......@@ -40,6 +41,10 @@ public class PlatElderQueryDTO extends BaseTenantDTO {
@ApiModelProperty(value = "组织id")
private String orgId;
@ApiModelProperty(value = "不同类型的机构集合")
private List<String> orgIdList;
@ApiModelProperty(value = "类型 1-居家 2-机构养老")
private String type;
@ApiModelProperty(value = "房间id")
private String roomId;
......
......@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* Controller
*
......@@ -24,6 +26,8 @@ public class PlatBedPanoramaDTO {
private String type;
@ApiModelProperty("机构id")
private String orgId;
@ApiModelProperty("机构id集合")
private List<String> orgIdList;
@DictEnum(em = PlatBedStatusEnum.BedStatusEnum.class, message = "状态可选值为{m}")
@ApiModelProperty("状态 1-空闲 0-已入住")
......
......@@ -20,7 +20,7 @@ import java.util.List;
* @Describe:
*/
public interface PlatBedMapper extends BaseMapper<PlatBed> {
List<PlatBedPanoramaVO> selectBySpaceIdAndStatus(@Param("dto") PlatBedPanoramaDTO dto);
Page<PlatBedPanoramaVO> selectBySpaceIdAndStatus(Page<PlatBedQueryDTO> page,@Param("dto") PlatBedPanoramaDTO dto,@Param("orgIds")List<String> orgIdList);
List<PlatBedPanoramaVO> selectByRoomIdAndStatus(@Param("dto")PlatBedPanoramaDTO dto);
......
......@@ -8,6 +8,7 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.dto.platform.elder.add.PlatElderDTOVO;
import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatUser;
......@@ -256,11 +257,14 @@ public class DataScreenServiceImpl implements DataScreenService {
private Map<String, PlatElderListVO> mapElderBedPath(List<PlatElder> platElders) {
List<PlatElderListVO> list = BeanDtoVoUtils.listVo(platElders, PlatElderListVO.class);
JoinUtil.joinSplit(list, platSpaceService, PlatElderListVO::getSpacePath, PlatSpace::getId, (e, l) -> {
JoinUtil.joinSplit(list, platSpaceService, PlatElderListVO::getSpacePath, PlatSpace::getId, (e, l) -> {
e.setSpacePathName(StreamUtil.join(l, Objects::nonNull, PlatSpace::getName, "-"));
});
JoinUtil.join(list, platBedService, PlatElderListVO::getBedId, PlatBed::getId, (e, l) -> {
/* JoinUtil.join(list, platBedService, PlatElderListVO::getBedId, PlatBed::getId, (e, l) -> {
e.setBedName(l.getName());
});*/
JoinUtil.joinSplit(list, platBedService, PlatElderListVO::getSpacePath, PlatBed::getId, (e, l) -> {
e.setSpacePathName(e.getSpacePathName() + "-" + StreamUtil.join(l, Objects::nonNull, PlatBed::getName));
});
Map<String, PlatElderListVO> map = list.stream().collect(Collectors.toMap(PlatElderListVO::getId, Function.identity()));
return map;
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.entity.BaseEntity;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.vo.ExcelErrorVo;
......@@ -108,6 +109,10 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
private LambdaQueryWrapper<PlatElder> lambdaQueryWrapper(PlatElderQueryDTO dto) {
List<String> orgIdList = Lists.newArrayList();
if (StringUtils.isNotEmpty(dto.getType())) {
List<PlatOrg> platOrgList = platOrgService.list(new QueryWrapper<PlatOrg>().lambda().eq(PlatOrg::getType, dto.getType()));
orgIdList = StreamUtil.map(platOrgList, BaseEntity::getId);
}
if (org.apache.commons.lang3.StringUtils.isNotEmpty(dto.getOrgId())) {
orgIdList = Lists.newArrayList(dto.getOrgId().split(","));
}
......
......@@ -58,7 +58,7 @@ public interface PlatBedService extends IService<PlatBed> {
void changeStatus(StatusDTO dto);
List<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PlatBedPanoramaDTO dto);
Page<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PageReqDTO<PlatBedPanoramaDTO> pageReqDTO, PlatBedPanoramaDTO dto);
List<PlatBedPanoramaVO> selectByRoomIdAndStatus(PlatBedPanoramaDTO dto);
List<PlatBed> list(PlatBedQueryDTO dto);
......
package com.makeit.service.platform.space;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.makeit.common.page.PageReqDTO;
import com.makeit.dto.platform.elder.PlatElderQueryDTO;
import com.makeit.dto.platform.space.PlatBedPanoramaDTO;
import com.makeit.dto.platform.space.PlatRoomPanoramaDTO;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.vo.platform.space.PlatBedPanoramaVO;
import com.makeit.vo.platform.space.PlatDeviceElderVO;
import com.makeit.vo.platform.space.PlatRoomPanoramaVO;
......@@ -27,4 +28,6 @@ public interface PlatRoomDynamicService {
List<PlatSpaceAndRoomVO> bedPanoramaTree();
List<PlatDeviceElderVO> elderList(PlatElderQueryDTO dto);
Page<PlatBedPanoramaVO> bedPanoramaPage(PageReqDTO<PlatBedPanoramaDTO> dto);
}
......@@ -3,6 +3,7 @@ package com.makeit.service.platform.space.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
......@@ -150,8 +151,12 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
@Override
public List<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PlatBedPanoramaDTO dto) {
return baseMapper.selectBySpaceIdAndStatus(dto);
public Page<PlatBedPanoramaVO> selectBySpaceIdAndStatus(PageReqDTO<PlatBedPanoramaDTO> pageReqDTO, PlatBedPanoramaDTO dto) {
List<String> orgIdList = Lists.newArrayList();
if (StringUtil.isNotEmpty(dto.getOrgId())) {
orgIdList = Lists.newArrayList(dto.getOrgId().split(","));
}
return baseMapper.selectBySpaceIdAndStatus(new Page<>(pageReqDTO.getPage(),pageReqDTO.getLimit()),dto,orgIdList);
}
@Override
......
package com.makeit.service.platform.space.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.makeit.common.page.PageReqDTO;
import com.makeit.dto.platform.elder.PlatElderQueryDTO;
import com.makeit.dto.platform.space.PlatBedPanoramaDTO;
import com.makeit.dto.platform.space.PlatRoomPanoramaDTO;
......@@ -110,8 +112,11 @@ public class PlatRoomDynamicServiceImpl implements PlatRoomDynamicService {
@Override
public List<PlatBedPanoramaVO> bedPanorama(PlatBedPanoramaDTO dto) {
List<PlatBedPanoramaVO> list = new ArrayList<>();
Page<PlatBedPanoramaVO> page = new Page<>();
if(PlatBedPanoramaSpaceType.BedPanoramaSpaceType.SPACE.getValue().equals(dto.getType())){
list = platBedService.selectBySpaceIdAndStatus(dto);
page = platBedService.selectBySpaceIdAndStatus(new PageReqDTO<>(1,10,dto), dto);
list = page.getRecords();
}else if(PlatBedPanoramaSpaceType.BedPanoramaSpaceType.ROOM.getValue().equals(dto.getType())){
list = platBedService.selectByRoomIdAndStatus(dto);
}
......@@ -133,6 +138,26 @@ public class PlatRoomDynamicServiceImpl implements PlatRoomDynamicService {
}
@Override
public Page<PlatBedPanoramaVO> bedPanoramaPage(PageReqDTO<PlatBedPanoramaDTO> pageReqDTO) {
Page<PlatBedPanoramaVO> page = platBedService.selectBySpaceIdAndStatus(pageReqDTO, pageReqDTO.getData());
List<PlatBedPanoramaVO> list = page.getRecords();
JoinUtil.joinSplit(list, platSpaceService, PlatBedPanoramaVO::getSpacePath, PlatSpace::getId, (e, l) -> {
e.setSpacePathName(StreamUtil.join(l, Objects::nonNull, PlatSpace::getName, "-"));
});
list.forEach(vo->{
String spacePathName = vo.getSpacePathName();
if(StringUtil.isNotEmpty(vo.getRoomName())){
spacePathName = "".equals(spacePathName) ? vo.getRoomName() : spacePathName + "-" + vo.getRoomName();
}
if(StringUtil.isNotEmpty(vo.getBedName())){
spacePathName = "".equals(spacePathName) ? vo.getBedName() : spacePathName + "-" + vo.getBedName();
}
vo.setSpacePathName(spacePathName);
});
return page;
}
@Override
public List<PlatSpaceAndRoomVO> roomPanoramaTree() {
//查询用户权限组织id
List<PlatOrg> orgs = platOrgService.belongToScopeList(new PlatOrg());
......
......@@ -18,8 +18,11 @@
<if test="dto.status != null and dto.status != ''">
AND pb.status = #{dto.status}
</if>
<if test="dto.orgId != null and dto.orgId != ''">
AND ps.org_id = #{dto.orgId}
<if test="orgIds != null and orgIds.size() > 0 ">
AND ps.org_id IN
<foreach collection="orgIds" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
......
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