|
@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
import vip.xiaonuo.coldchain.modular.monitordevice.service.MonitorDeviceService;
|
|
|
import vip.xiaonuo.coldchain.modular.monitortarget.entity.MonitorTarget;
|
|
|
import vip.xiaonuo.coldchain.modular.monitortarget.enums.MonitorStatusEnum;
|
|
@@ -119,7 +120,8 @@ public class MonitorTargetServiceImpl extends ServiceImpl<MonitorTargetMapper, M
|
|
|
public List<MonitorTarget> getListByUser(String userId) {
|
|
|
LambdaQueryWrapper<MonitorTarget> queryWrapper = new LambdaQueryWrapper<MonitorTarget>();
|
|
|
if (ObjectUtil.isNotNull(userId)) {
|
|
|
- queryWrapper.eq(MonitorTarget::getCreateBy, userId).orderByDesc(MonitorTarget::getCreateTime);
|
|
|
+ queryWrapper.eq(MonitorTarget::getCreateBy, userId).eq(MonitorTarget::getStatus,"1")
|
|
|
+ .orderByDesc(MonitorTarget::getCreateTime);
|
|
|
}
|
|
|
queryWrapper.orderByDesc(MonitorTarget::getCreateTime);
|
|
|
List<MonitorTarget> monitorTargetList = list(queryWrapper);
|
|
@@ -135,13 +137,17 @@ public class MonitorTargetServiceImpl extends ServiceImpl<MonitorTargetMapper, M
|
|
|
if (ObjectUtil.isNotEmpty(monitorTargetPageParam.getName())) {
|
|
|
queryWrapper.lambda().like(MonitorTarget::getName, monitorTargetPageParam.getName());
|
|
|
}
|
|
|
+ if (ObjectUtil.isNull(monitorTargetPageParam.getUserId())) {
|
|
|
+ queryWrapper.lambda().eq(MonitorTarget::getCreateBy, StpLoginUserUtil.getLoginUser().getId());
|
|
|
+ } else {
|
|
|
+ queryWrapper.lambda().eq(MonitorTarget::getCreateBy, monitorTargetPageParam.getUserId());
|
|
|
+ }
|
|
|
if (ObjectUtil.isAllNotEmpty(monitorTargetPageParam.getSortField(), monitorTargetPageParam.getSortOrder())) {
|
|
|
CommonSortOrderEnum.validate(monitorTargetPageParam.getSortOrder());
|
|
|
queryWrapper.orderBy(true, monitorTargetPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()), StrUtil.toUnderlineCase(monitorTargetPageParam.getSortField()));
|
|
|
} else {
|
|
|
queryWrapper.lambda().orderByAsc(MonitorTarget::getId);
|
|
|
}
|
|
|
- queryWrapper.lambda().eq(MonitorTarget::getCreateBy, monitorTargetPageParam.getUserId());
|
|
|
Page<MonitorTarget> page = this.page(CommonPageRequest.defaultPage(), queryWrapper);
|
|
|
//获取设备区域列表并赋值返回
|
|
|
page.getRecords().forEach(monitorTarget -> {
|