Commit 3d7966e2 by huangjy

fix: 修复bug

parent 29587672
......@@ -39,6 +39,8 @@ public class PlatDeviceQueryDTO extends BaseTenantDTO {
@ApiModelProperty(value = "组织id")
private String orgId;
@ApiModelProperty(value = "设备是否激活 1 激活 0 没激活")
private Integer active;
@ApiModelProperty(value = "数据权限")
private List<String> orgIds;
......
......@@ -129,6 +129,14 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
JoinUtil.join(dtos, platAlarmConfigService, PlatAlarmRecordVO::getAlarmId, BaseEntity::getId, (t, m) -> t.setNotifyRelation(m.getNotifyRelation()));
List<PlatDevice> platDeviceList = platDeviceService.list();
Map<String, PlatDevice> deviceMap = StreamUtil.toMap(platDeviceList, BaseEntity::getId);
for (PlatAlarmRecordVO platAlarmRecordVO : dtos) {
PlatDevice platDevice = deviceMap.get(platAlarmRecordVO.getDeviceId());
if (platDevice != null) {
platAlarmRecordVO.setDevice(platDevice);
}
}
return PageUtil.toPageVO(dtos, page);
}
......@@ -165,7 +173,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
List<String> orgIdList = Lists.newArrayList();
if (com.makeit.utils.old.StringUtils.isNotEmpty(param.getType()) && com.makeit.utils.old.StringUtils.isEmpty(param.getOrgId())) {
orgIdList = choiceOrgIdList;
orgIdList = typeOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
......
......@@ -130,7 +130,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
}
List<String> orgIdList = Lists.newArrayList();
if (StringUtils.isNotEmpty(dto.getType()) && StringUtils.isEmpty(dto.getOrgId())) {
orgIdList = choiceOrgIdList;
orgIdList = typeOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
......
......@@ -172,7 +172,7 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
}
List<String> orgIdList = Lists.newArrayList();
if (com.makeit.utils.old.StringUtils.isNotEmpty(dto.getType()) && com.makeit.utils.old.StringUtils.isEmpty(dto.getOrgId())) {
orgIdList = choiceOrgIdList;
orgIdList = typeOrgIdList;
if (CollectionUtils.isEmpty(orgIdList)) {
orgIdList.add("-1");
}
......
......@@ -2,6 +2,7 @@ package com.makeit.vo.platform.alarm;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.entity.platform.device.PlatDevice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -66,5 +67,6 @@ public class PlatAlarmRecordVO extends BaseTenantDTO {
private String misinformationFlag;
private String deviceId;
private PlatDevice device;
}
......@@ -43,6 +43,14 @@
<if test="param.tenantId != null and param.tenantId != ''">
and pd.tenant_id = #{param.tenantId}
</if>
<choose>
<when test="param.active !=null and param.active !='' and param.active == 1">
and pd.device_license is not null
</when>
<when test="param.active !=null and param.active !='' and param.active == 0">
and pd.device_license is null
</when>
</choose>
<if test="param.orgIds != null and param.orgIds.size() > 0 ">
AND pd.org_id in
<foreach collection="param.orgIds" item="item" separator="," open="(" close=")" index="">
......
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