feat(device): 更新设备台账和事件查询功能
- 添加AppProjectService依赖以获取项目信息 - 修改项目数量获取逻辑,直接从接口获取项目信息而非设备关联数 - 在事件查询接口中添加线路ID参数支持 - 更新XML映射文件,添加线路ID过滤条件 - 修复便携式设备树结构中的固定ID分配 - 更新便携式工程和项目的固定ID为"1"和"2" - 优化事件查询服务中的设备和线路ID处理逻辑
This commit is contained in:
@@ -36,7 +36,7 @@ public interface CsEventUserPOMapper extends BaseMapper<CsEventUserPO> {
|
||||
Page<EventDetailVO> queryEventpage(Page<EventDetailVO> returnpage, @Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage, @Param("devIds") List<String> devIds);
|
||||
|
||||
|
||||
Page<EventDetailVO> queryEventPageWeb(Page<EventDetailVO> returnpage,@Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage,@Param("devIds") List<String> collect);
|
||||
Page<EventDetailVO> queryEventPageWeb(Page<EventDetailVO> returnpage,@Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage,@Param("devIds") List<String> collect,@Param("lineIds") List<String> collect2);
|
||||
|
||||
Page<EventDetailVO> queryEventPageWebDvr(Page<EventDetailVO> returnpage,@Param("csEventUserQueryPage") CsEventUserQueryPage csEventUserQueryPage,@Param("lineIds") List<String> collect);
|
||||
|
||||
|
||||
@@ -267,6 +267,12 @@
|
||||
<foreach collection="devIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="lineIds != null and lineIds.size() > 0">
|
||||
AND b.line_id IN
|
||||
<foreach collection="lineIds" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.type != null and csEventUserQueryPage.type !=''">
|
||||
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.type == 3 ">
|
||||
AND b.type in (2,3) and b.level in (1,2,3,6,7)
|
||||
|
||||
@@ -415,11 +415,17 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
||||
cldDevTree = cldDevTree.get(0).getChildren();
|
||||
}
|
||||
if (ObjectUtil.isNull(csEventUserQueryPage.getDeviceId()) || StringUtils.isEmpty(csEventUserQueryPage.getDeviceId())) {
|
||||
//便携式就1层下边就是设备
|
||||
List<String> portableDevIds = portableDevTree.stream().filter(
|
||||
temp -> StringUtils.isEmpty(csEventUserQueryPage.getDeviceId()) ||
|
||||
Objects.equals(temp.getId(), csEventUserQueryPage.getDeviceId())
|
||||
).map(CsLedgerVO::getId).collect(Collectors.toList());
|
||||
//便携式就1层下边就是设备 这边给便携式设备添加了假的工程和项目,id是写死的
|
||||
List<String> portableDevIds = new ArrayList<>();
|
||||
if (Objects.equals(csEventUserQueryPage.getEngineeringid(),"1")
|
||||
|| Objects.equals(csEventUserQueryPage.getProjectId(),"2")
|
||||
|| !ObjectUtil.isNull(csEventUserQueryPage.getLineId())
|
||||
|| !StringUtils.isEmpty(csEventUserQueryPage.getLineId())) {
|
||||
portableDevIds = portableDevTree.stream().map(CsLedgerVO::getId).filter(
|
||||
id -> StringUtils.isEmpty(csEventUserQueryPage.getDeviceId()) ||
|
||||
Objects.equals(id, csEventUserQueryPage.getDeviceId())
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
List<String> governmentDevIds = governmentDevTree.stream().filter(temp->StringUtils.isEmpty(csEventUserQueryPage.getEngineeringid())||
|
||||
Objects.equals(temp.getId(), csEventUserQueryPage.getEngineeringid()))
|
||||
.map(CsLedgerVO::getChildren).flatMap(Collection::stream).filter(
|
||||
@@ -454,6 +460,9 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
||||
if (CollectionUtils.isEmpty(devIds)){
|
||||
return returnpage;
|
||||
}
|
||||
if (!ObjectUtil.isNull(csEventUserQueryPage.getLineId()) && !StringUtils.isEmpty(csEventUserQueryPage.getLineId())) {
|
||||
lineIds.add(csEventUserQueryPage.getLineId());
|
||||
}
|
||||
}
|
||||
//获取tag
|
||||
if (Objects.equals(csEventUserQueryPage.getType(), "0")) {
|
||||
@@ -479,7 +488,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
||||
if (!Objects.isNull(csEventUserQueryPage.getIsDvr()) && csEventUserQueryPage.getIsDvr() == 1) {
|
||||
returnpage = this.getBaseMapper().queryEventPageWebDvr(returnpage,csEventUserQueryPage,lineIds);
|
||||
} else {
|
||||
returnpage = this.getBaseMapper().queryEventPageWeb(returnpage,csEventUserQueryPage,devIds);
|
||||
returnpage = this.getBaseMapper().queryEventPageWeb(returnpage,csEventUserQueryPage,devIds,lineIds);
|
||||
}
|
||||
returnpage.getRecords().forEach(temp->{
|
||||
CsLineDTO dto = map.get(temp.getLineId());
|
||||
|
||||
Reference in New Issue
Block a user