Commit 79df6a1d by 杨伟程
parents 501ac08a cd1d2342
...@@ -7,7 +7,10 @@ import com.makeit.common.response.ApiResponseEntity; ...@@ -7,7 +7,10 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO; import com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO;
import com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO; import com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.alarm.PlatAlarmConfigService; import com.makeit.service.platform.alarm.PlatAlarmConfigService;
import com.makeit.utils.AlarmConfigCacheUtil;
import com.makeit.vo.platform.alarm.PlatAlarmConfigListVO; import com.makeit.vo.platform.alarm.PlatAlarmConfigListVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -81,6 +84,16 @@ public class PlatAlarmConfigController { ...@@ -81,6 +84,16 @@ public class PlatAlarmConfigController {
platAlarmConfigService.changeStatus(dto); platAlarmConfigService.changeStatus(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
@Autowired
private AlarmConfigCacheUtil alarmConfigCacheUtil;
@ApiOperation("测试")
@PostMapping("test")
@TenantIdIgnore
@AuthIgnore
public ApiResponseEntity<?> test(@Validated @RequestBody PlatAlarmConfigDTOVO dto) {
alarmConfigCacheUtil.get(dto.getOrgId(),dto.getAlarmType());
return ApiResponseUtils.success();
}
} }
......
...@@ -8,6 +8,7 @@ import com.makeit.common.response.ApiResponseEntity; ...@@ -8,6 +8,7 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.device.PlatDeviceEditDTO; import com.makeit.dto.platform.device.PlatDeviceEditDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO; import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.global.annotation.AuthIgnore; import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore; import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.device.PlatDeviceService; import com.makeit.service.platform.device.PlatDeviceService;
...@@ -23,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -23,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* <p> * <p>
* 设备 前端控制器 * 设备 前端控制器
...@@ -71,5 +74,11 @@ public class PlatDeviceController { ...@@ -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 { ...@@ -24,6 +24,6 @@ public class PlatBedPanoramaDTO {
private String type; private String type;
@DictEnum(em = PlatBedStatusEnum.BedStatusEnum.class, message = "状态可选值为{m}") @DictEnum(em = PlatBedStatusEnum.BedStatusEnum.class, message = "状态可选值为{m}")
@ApiModelProperty("状态 1-空闲 2-已入住") @ApiModelProperty("状态 1-空闲 0-已入住")
private String status; private String status;
} }
...@@ -22,6 +22,9 @@ public class PlatSpaceDeviceQueryDTO { ...@@ -22,6 +22,9 @@ public class PlatSpaceDeviceQueryDTO {
@ApiModelProperty(value = "产品名称") @ApiModelProperty(value = "产品名称")
private String productName; private String productName;
@ApiModelProperty(value = "产品id")
private String productId;
@ApiModelProperty(value = "状态 数据字典 1 在线 0离线") @ApiModelProperty(value = "状态 数据字典 1 在线 0离线")
private String status; private String status;
......
...@@ -60,4 +60,6 @@ public interface PlatDeviceService extends IService<PlatDevice> { ...@@ -60,4 +60,6 @@ public interface PlatDeviceService extends IService<PlatDevice> {
void editDeviceProperties(PlatDeviceAttrWechatDTO dto); void editDeviceProperties(PlatDeviceAttrWechatDTO dto);
List<DeviceProperties> readDeviceProperties(PlatDeviceAttrWechatDTO dto); List<DeviceProperties> readDeviceProperties(PlatDeviceAttrWechatDTO dto);
List<PlatDevice> productList(PlatDeviceQueryDTO dto);
} }
...@@ -304,4 +304,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -304,4 +304,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
return devicePropertiesList; 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;
}
} }
...@@ -110,6 +110,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM ...@@ -110,6 +110,7 @@ public class PlatRoomBedDeviceServiceImpl extends ServiceImpl<PlatRoomBedDeviceM
queryWrapper.like(StringUtil.isNotEmpty(dto.getOriDeviceId()), PlatDevice::getOriDeviceId, dto.getOriDeviceId()); 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.getName()), PlatDevice::getName, dto.getName());
queryWrapper.like(StringUtil.isNotEmpty(dto.getProductName()), PlatDevice::getProductName, dto.getProductName()); 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(StringUtil.isNotEmpty(dto.getStatus()), PlatDevice::getStatus, dto.getStatus());
queryWrapper.eq(PlatDevice::getOrgId, orgId); queryWrapper.eq(PlatDevice::getOrgId, orgId);
Page<PlatDevice> pages = platDeviceService.page(p, queryWrapper); Page<PlatDevice> pages = platDeviceService.page(p, queryWrapper);
......
...@@ -151,21 +151,22 @@ public class WorkStationServiceImpl implements WorkStationService { ...@@ -151,21 +151,22 @@ public class WorkStationServiceImpl implements WorkStationService {
if (orgs.isEmpty()) { if (orgs.isEmpty()) {
return new PageVO<>(); return new PageVO<>();
} }
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
dto.setOrgIds(orgIds);
if (dto.getSpaceIds().isEmpty()) { if (dto.getSpaceIds().isEmpty()) {
List<String> orgIds = orgs.stream().map(PlatOrg::getId).collect(Collectors.toList());
spaces = platSpaceService.list(new QueryWrapper<PlatSpace>().lambda() spaces = platSpaceService.list(new QueryWrapper<PlatSpace>().lambda()
.in(PlatSpace::getOrgId, orgIds)); .in(PlatSpace::getOrgId, orgIds));
if (spaces.isEmpty()) { if (spaces.isEmpty()) {
return new PageVO<>(); return new PageVO<>();
} }
List<String> spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList()); List<String> spaceIds = spaces.stream().map(PlatSpace::getId).collect(Collectors.toList());
dto.setOrgIds(orgIds);
dto.setSpaceIds(spaceIds); dto.setSpaceIds(spaceIds);
} else { } else {
//获取父级的所有子级空间 //获取父级的所有子级空间
spaces = platSpaceService.listChild(dto.getSpaceIds()); spaces = platSpaceService.listChild(dto.getSpaceIds());
} }
List<String> elderIdList = new ArrayList<>(); List<String> elderIdList = new ArrayList<>();
......
...@@ -37,7 +37,8 @@ public class AlarmConfigCacheUtil implements ApplicationRunner { ...@@ -37,7 +37,8 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
return list; return list;
} }
public void put(PlatAlarmConfig alarmConfig) { public void put(PlatAlarmConfig alarmConfigVO) {
PlatAlarmConfig alarmConfig = platAlarmConfigService.getById(alarmConfigVO.getId());
if (StringUtils.equals(CommonEnum.YES.getValue(),alarmConfig.getStatus())) { if (StringUtils.equals(CommonEnum.YES.getValue(),alarmConfig.getStatus())) {
RedisUtil.set(RedisConst.ALARM_CONFIG_ORG_ID+alarmConfig.getOrgId() + ":" + alarmConfig.getAlarmType(),alarmConfig); RedisUtil.set(RedisConst.ALARM_CONFIG_ORG_ID+alarmConfig.getOrgId() + ":" + alarmConfig.getAlarmType(),alarmConfig);
} else { } else {
......
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