feat(service): 实现分页功能并优化设备权限管理

- 在控制器层添加分页支持,将返回类型从 List 修改为 Page
- 实现服务层分页逻辑,集成 MyBatis Plus 分页插件
- 重构设备权限管理逻辑,区分超级管理员、普通用户和游客权限
- 添加营销用户和工程用户的特殊权限处理机制
- 迁移事件查询逻辑到统一的事件用户服务中
- 移除过时的设备用户映射器接口和 XML 查询方法
- 为暂降事件报告添加动态文件名生成功能
- 修复时间范围计算中的日期边界问题
- 优化台账树结构以支持多层级权限过滤
- 统计未读事件数量的查询逻辑优化
This commit is contained in:
xy
2026-04-14 19:09:23 +08:00
parent 460a10f3b5
commit e77108ebf5
33 changed files with 778 additions and 231 deletions

View File

@@ -6,6 +6,7 @@ import com.njcn.csharmonic.api.fallback.EventUserFeignClientFallbackFactory;
import com.njcn.csharmonic.param.CsEventUserQueryParam;
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -27,4 +28,20 @@ public interface EventUserFeignClient {
@PostMapping("/deleteByIds")
HttpResult<Boolean> deleteByIds(@RequestBody List<String> eventList);
@PostMapping("/queryTempEvent")
@ApiOperation("查询暂态事件(未读)")
HttpResult<List<String>> queryTempEvent(@RequestBody CsEventUserQueryParam param);
@PostMapping("/queryTempHarmonic")
@ApiOperation("查询稳态事件(未读)")
HttpResult<List<String>> queryTempHarmonic(@RequestBody CsEventUserQueryParam param);
@PostMapping("/queryAlarmEvent")
@ApiOperation("查询告警事件(未读)")
HttpResult<List<String>> queryAlarmEvent(@RequestBody CsEventUserQueryParam param);
@PostMapping("/queryRunEvent")
@ApiOperation("查询运行事件(未读)")
HttpResult<List<String>> queryRunEvent(@RequestBody CsEventUserQueryParam param);
}

View File

@@ -45,6 +45,30 @@ public class EventUserFeignClientFallbackFactory implements FallbackFactory<Even
log.error("{}异常,降级处理,异常为:{}","根据id删除数据异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> queryTempEvent(CsEventUserQueryParam param) {
log.error("{}异常,降级处理,异常为:{}","查询暂态事件(未读)异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> queryTempHarmonic(CsEventUserQueryParam param) {
log.error("{}异常,降级处理,异常为:{}","查询稳态事件(未读)异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> queryAlarmEvent(CsEventUserQueryParam param) {
log.error("{}异常,降级处理,异常为:{}","查询告警事件(未读)异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> queryRunEvent(CsEventUserQueryParam param) {
log.error("{}异常,降级处理,异常为:{}","查询运行事件(未读)异常",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -24,7 +24,10 @@ public class HarmonicVO implements Serializable {
@ApiModelProperty(value = "越限监测点数")
private Integer overLineNums = 0;
@ApiModelProperty(value = "越限监测点数")
@ApiModelProperty(value = "越限日期")
private List<String> overDaysList;
@ApiModelProperty(value = "越限监测点详情")
private List<LineHarmonicDetail> list = new ArrayList<>();
@Data
@@ -59,5 +62,31 @@ public class HarmonicVO implements Serializable {
}
@Data
public static class LineHarmonicOverDays implements Serializable {
@ApiModelProperty(value = "工程名称")
private String engineeringName;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "设备名称")
private String devName;
@ApiModelProperty(value = "监测点id")
private String lineId;
@ApiModelProperty(value = "监测点名称")
private String lineName;
@ApiModelProperty(value = "越限日期字符串")
private String timeString;
@ApiModelProperty(value = "越限日期集合")
private List<String> timeList;
}
}