Commit e38f91b7 authored by wanghao's avatar wanghao

1 大屏界面 全局搜索里面的 用户关联设备 查询及界面显示调整。

parent d4798453
package com.zehong.system.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -11,8 +10,6 @@ import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDetectorUserCount;
import com.zehong.system.domain.vo.TDetectorUserInspectVo;
import com.zehong.system.domain.vo.TDetectorUserVO;
import com.zehong.system.domain.vo.TMassMarksDetectorUserVO;
import com.zehong.system.mapper.TDetectorInfoMapper;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.mapper.TSiteStationInfoMapper;
import org.springframework.beans.BeanUtils;
......@@ -51,26 +48,25 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
List<TDetectorUserVO> list = new ArrayList<>();
List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser);
List<Object> initList = new ArrayList<>();
for(TDetectorUserVO user : tDetectorUserList){
TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(user, userVO);
Map<Long, List<TDetectorUserVO>> collect = tDetectorUserList.stream().collect(Collectors.groupingBy(TDetectorUserVO::getUserId));
TDetectorUserVO temp = new TDetectorUserVO();
if(user.getUserId().equals(temp.getUserId())){
initList.add(user);
for (Map.Entry<Long, List<TDetectorUserVO>> longListEntry : collect.entrySet()) {
List<Object> initList = new ArrayList<>();
List<TDetectorUserVO> value = longListEntry.getValue();
if (value.size() > 0) {
TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(value.get(0), userVO);
for (TDetectorUserVO tDetectorUserVO : value) {
// 如果设备数量为0 则不显示
if (tDetectorUserVO.getDetectorCount() == 0) {
continue;
}
initList.add(tDetectorUserVO);
}
userVO.setDetectorCountList(initList);
userVO.setIconType("6");
} else {
BeanUtils.copyProperties(user, temp);
List<Object> newList = new ArrayList<>();
newList.add(temp);
userVO.setDetectorCountList(newList);
userVO.setIconType("6");
list.add(userVO);
}
}
long end = System.currentTimeMillis();
System.out.println("detectorUserList = " + (end - startTime));
return list;
......
......@@ -20,17 +20,17 @@
<div>
<div class="top flex top-top">
<div class="group" style="width: 20%">
<div class="group" style="">
<div class="left">联系人:</div>
<div class="right zzz">{{ deviceData.linkman }}</div>
</div>
<div class="group" style="width: 30%">
<div class="group" style="">
<div class="left">联系电话:</div>
<div v-unValue class="right zzz">
{{ deviceData.phone }}
</div>
</div>
<div class="group" style="width: 30%">
<div class="group" style="">
<div class="left">联系地址:</div>
<div :title="deviceData.address" class="right last zzz">
{{ deviceData.address || "-" }}
......@@ -270,10 +270,9 @@ export default {
.group {
height: 30px;
display: flex;
justify-content: space-between;
justify-content: space-evenly;
box-sizing: border-box;
div {
flex: 1;
box-sizing: border-box;
text-align: left;
font-size: 14px;
......
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 to comment