Commit 5c015b55 by 朱淼

fix bug

parent 02e960da
......@@ -8,6 +8,7 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.device.PlatDeviceEditDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.device.PlatDeviceService;
......@@ -23,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 设备 前端控制器
......@@ -71,5 +74,11 @@ public class PlatDeviceController {
}
@ApiOperation("产品下拉")
@PostMapping("productList")
public ApiResponseEntity<List<PlatDevice>> productList(@RequestBody PlatDeviceQueryDTO dto) {
return ApiResponseUtils.success(platDeviceService.productList(dto));
}
}
......@@ -24,6 +24,6 @@ public class PlatBedPanoramaDTO {
private String type;
@DictEnum(em = PlatBedStatusEnum.BedStatusEnum.class, message = "状态可选值为{m}")
@ApiModelProperty("状态 1-空闲 2-已入住")
@ApiModelProperty("状态 1-空闲 0-已入住")
private String status;
}
......@@ -22,6 +22,9 @@ public class PlatSpaceDeviceQueryDTO {
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品id")
private String productId;
@ApiModelProperty(value = "状态 数据字典 1 在线 0离线")
private String status;
......
......@@ -60,4 +60,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
void editDeviceProperties(PlatDeviceAttrWechatDTO dto);
List<DeviceProperties> readDeviceProperties(PlatDeviceAttrWechatDTO dto);
List<PlatDevice> productList(PlatDeviceQueryDTO dto);
}
......@@ -304,4 +304,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
return devicePropertiesList;
}
@Override
public List<PlatDevice> productList(PlatDeviceQueryDTO dto) {
List<PlatDevice> platDevices = list(new QueryWrapper<PlatDevice>().lambda()
.like(StringUtils.isNotBlank(dto.getProductName()), PlatDevice::getProductName, dto.getProductName())
.groupBy(PlatDevice::getProductId));
return platDevices;
}
}
......@@ -109,6 +109,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
queryWrapper.like(StringUtil.isNotEmpty(dto.getOriDeviceId()), PlatDevice::getOriDeviceId, dto.getOriDeviceId());
queryWrapper.like(StringUtil.isNotEmpty(dto.getName()), PlatDevice::getName, dto.getName());
queryWrapper.like(StringUtil.isNotEmpty(dto.getProductName()), PlatDevice::getProductName, dto.getProductName());
queryWrapper.eq(StringUtil.isNotEmpty(dto.getProductId()), PlatDevice::getProductId, dto.getProductId());
queryWrapper.eq(StringUtil.isNotEmpty(dto.getStatus()), PlatDevice::getStatus, dto.getStatus());
queryWrapper.eq(PlatDevice::getOrgId,orgId);
Page<PlatDevice> pages = platDeviceService.page(p, queryWrapper);
......
......@@ -151,21 +151,22 @@ public class WorkStationServiceImpl implements WorkStationService {
if (orgs.isEmpty()) {
return new PageVO<>();
}
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
dto.setOrgIds(orgIds);
if (dto.getSpaceIds().isEmpty()) {
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
spaces = platSpaceService.list(new QueryWrapper<PlatSpace>().lambda()
.in(PlatSpace::getOrgId, orgIds));
if (spaces.isEmpty()) {
return new PageVO<>();
}
List<String> spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList());
dto.setOrgIds(orgIds);
dto.setSpaceIds(spaceIds);
} else {
//获取父级的所有子级空间
spaces = platSpaceService.listChild(dto.getSpaceIds());
}
List<String> elderIdList = 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