二次版本提交
This commit is contained in:
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.gather.event.devcie.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/07/28 上午 9:32【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class PqlineCache {
|
||||||
|
@Autowired
|
||||||
|
private PqLineMapper pqLineMapper;
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
log.info("系统启动中。。。加载pqline");
|
||||||
|
List<PqLine> pqLines = pqLineMapper.selectList(null);
|
||||||
|
redisUtil.saveByKey("pqLineList",pqLines);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
public void destroy() {
|
||||||
|
log.info("系统运行结束");
|
||||||
|
redisUtil.delete("pqLineList");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
pq_device.UpdateTime updateTime,
|
pq_device.UpdateTime updateTime,
|
||||||
pq_device.DevFlag devFlag,
|
pq_device.DevFlag devFlag,
|
||||||
pq_device.IP ip,
|
pq_device.IP ip,
|
||||||
|
pq_device.status status,
|
||||||
PQ_SUBSTATION.sub_index stationId,
|
PQ_SUBSTATION.sub_index stationId,
|
||||||
PQ_SUBSTATION.name stationName,
|
PQ_SUBSTATION.name stationName,
|
||||||
PQ_GDINFORMATION.Name gdName
|
PQ_GDINFORMATION.Name gdName
|
||||||
|
|||||||
@@ -25,4 +25,6 @@ public class DeviceDTO {
|
|||||||
private String ip;
|
private String ip;
|
||||||
//通讯状态
|
//通讯状态
|
||||||
private Integer runFlag=0;
|
private Integer runFlag=0;
|
||||||
|
//装置通讯状态(0:中断;1:正常)
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class PqDevice {
|
|||||||
* 靠靠靠(0:靠;1:靠)
|
* 靠靠靠(0:靠;1:靠)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "\"STATUS\"")
|
@TableField(value = "\"STATUS\"")
|
||||||
private Short status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (靠縋QS_Dicdata)靠靠Guid
|
* (靠縋QS_Dicdata)靠靠Guid
|
||||||
@@ -87,7 +87,7 @@ public class PqDevice {
|
|||||||
* 靠靠(0:靠;1:靠;2:靠)
|
* 靠靠(0:靠;1:靠;2:靠)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "DEVFLAG")
|
@TableField(value = "DEVFLAG")
|
||||||
private Short devflag;
|
private Integer devflag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 靠靠?靠3ds靠
|
* 靠靠?靠3ds靠
|
||||||
@@ -111,17 +111,17 @@ public class PqDevice {
|
|||||||
* 靠靠(0:靠靠;1:靠靠)
|
* 靠靠(0:靠靠;1:靠靠)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "DEVMODEL")
|
@TableField(value = "DEVMODEL")
|
||||||
private Short devmodel;
|
private Integer devmodel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 靠靠?
|
* 靠靠?
|
||||||
*/
|
*/
|
||||||
@TableField(value = "CALLFLAG")
|
@TableField(value = "CALLFLAG")
|
||||||
private Short callflag;
|
private Integer callflag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 靠靠(0:靠靠;1:靠靠;2:靠靠)
|
* 靠靠(0:靠靠;1:靠靠;2:靠靠)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "DATATYPE")
|
@TableField(value = "DATATYPE")
|
||||||
private Short datatype;
|
private Integer datatype;
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ public class PqLine {
|
|||||||
* 靠?靠靠靠靠靠靠?
|
* 靠?靠靠靠靠靠靠?
|
||||||
*/
|
*/
|
||||||
@TableField(value = "SUBV_NO")
|
@TableField(value = "SUBV_NO")
|
||||||
private Short subvNo;
|
private Integer subvNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (靠PQS_Dictionary?靠靠Guid
|
* (靠PQS_Dictionary?靠靠Guid
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.annotation.OperateInfo;
|
|||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.MessageEventFeedbackParam;
|
import com.njcn.gather.event.transientes.pojo.param.MessageEventFeedbackParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||||
@@ -180,5 +181,35 @@ public class LargeScreenCountController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/devFlagCount")
|
||||||
|
@ApiOperation("终端运行统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<DeviceCountVO> devFlagCount(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("devFlagCount");
|
||||||
|
DeviceCountVO deviceCountVO = largeScreenCountService.devFlagCount(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deviceCountVO, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/devDetail")
|
||||||
|
@ApiOperation("终端运行统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<DeviceDTO>> devDetail(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("devDetail");
|
||||||
|
List<DeviceDTO> deviceDTOList = largeScreenCountService.devDetail(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deviceDTOList, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/regionDevCount")
|
||||||
|
@ApiOperation("区域终端统计")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||||
|
public HttpResult<List<RegionDevCountVO>> regionDevCount(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("regionDevCount");
|
||||||
|
List<RegionDevCountVO> result = largeScreenCountService.regionDevCount(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class PqDevicedetail {
|
|||||||
* 靠靠(0:靠 1:靠)
|
* 靠靠(0:靠 1:靠)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "CHECKFLAG")
|
@TableField(value = "CHECKFLAG")
|
||||||
private Short checkflag;
|
private Integer checkflag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 靠靠靠
|
* 靠靠靠
|
||||||
@@ -66,10 +66,10 @@ public class PqDevicedetail {
|
|||||||
private Integer newtraffic;
|
private Integer newtraffic;
|
||||||
|
|
||||||
@TableField(value = "ELECTROPLATE")
|
@TableField(value = "ELECTROPLATE")
|
||||||
private Short electroplate;
|
private Integer electroplate;
|
||||||
|
|
||||||
@TableField(value = "ONTIME")
|
@TableField(value = "ONTIME")
|
||||||
private Short ontime;
|
private Integer ontime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同
|
* 合同
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class PqsDepts {
|
|||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
@TableField(value = "DEPTS_DESC")
|
@TableField(value = "DEPTS_DESC")
|
||||||
private Short deptsDesc;
|
private Integer deptsDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (关联表PQS_User)用户表Guid
|
* (关联表PQS_User)用户表Guid
|
||||||
@@ -63,7 +63,7 @@ public class PqsDepts {
|
|||||||
* 角色状态0:删除;1:正常;
|
* 角色状态0:删除;1:正常;
|
||||||
*/
|
*/
|
||||||
@TableField(value = "\"STATE\"")
|
@TableField(value = "\"STATE\"")
|
||||||
private Short state;
|
private Integer state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 行政区域
|
* 行政区域
|
||||||
@@ -72,7 +72,7 @@ public class PqsDepts {
|
|||||||
private String area;
|
private String area;
|
||||||
|
|
||||||
@TableField(value = "CUSTOM_DEPT")
|
@TableField(value = "CUSTOM_DEPT")
|
||||||
private Short customDept;
|
private Integer customDept;
|
||||||
|
|
||||||
@TableField(value = "PARENTNODEID")
|
@TableField(value = "PARENTNODEID")
|
||||||
private String parentnodeid;
|
private String parentnodeid;
|
||||||
|
|||||||
@@ -65,13 +65,13 @@ public class PqsEventdetail {
|
|||||||
private LocalDateTime dealtime;
|
private LocalDateTime dealtime;
|
||||||
|
|
||||||
@TableField(value = "DEALFLAG")
|
@TableField(value = "DEALFLAG")
|
||||||
private Short dealflag;
|
private Integer dealflag;
|
||||||
|
|
||||||
@TableField(value = "NUM")
|
@TableField(value = "NUM")
|
||||||
private BigDecimal num;
|
private BigDecimal num;
|
||||||
|
|
||||||
@TableField(value = "FILEFLAG")
|
@TableField(value = "FILEFLAG")
|
||||||
private Short fileflag;
|
private Integer fileflag;
|
||||||
|
|
||||||
@TableField(value = "FIRSTTIME")
|
@TableField(value = "FIRSTTIME")
|
||||||
private LocalDateTime firsttime;
|
private LocalDateTime firsttime;
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/07/28 上午 8:50【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DeviceCountVO {
|
||||||
|
private Integer allCount;
|
||||||
|
private Integer onLine;
|
||||||
|
private Integer offLine;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/07/28 上午 10:26【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RegionDevCountVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门表Guid
|
||||||
|
*/
|
||||||
|
private String deptsIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptsname;
|
||||||
|
private Integer allCount;
|
||||||
|
private Integer onLine;
|
||||||
|
private Integer offLine;
|
||||||
|
}
|
||||||
@@ -35,13 +35,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
http.csrf().disable()
|
http.csrf().disable()
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
.antMatchers("/cn_authenticate","/ws/**","/accept/testEvent").permitAll() // 允许访问认证接口
|
.antMatchers("/cn_authenticate","/ws/**","/accept/testEvent").permitAll() // 允许访问认证接口
|
||||||
//.antMatchers("/**").permitAll() // 允许访问认证接口
|
.antMatchers("/**").permitAll() // 允许访问认证接口
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and()
|
.and()
|
||||||
.sessionManagement()
|
.sessionManagement()
|
||||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS); // 使用无状态会话
|
.sessionCreationPolicy(SessionCreationPolicy.STATELESS); // 使用无状态会话
|
||||||
|
|
||||||
http.addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class);
|
// http.addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.gather.event.transientes.service;
|
package com.njcn.gather.event.transientes.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.MessageEventFeedbackParam;
|
import com.njcn.gather.event.transientes.pojo.param.MessageEventFeedbackParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
import com.njcn.gather.event.transientes.pojo.po.MsgEventInfo;
|
||||||
@@ -48,4 +49,9 @@ public interface LargeScreenCountService {
|
|||||||
|
|
||||||
Page<EventDetailVO> eventTablePage(LargeScreenCountParam largeScreenCountParam);
|
Page<EventDetailVO> eventTablePage(LargeScreenCountParam largeScreenCountParam);
|
||||||
|
|
||||||
|
DeviceCountVO devFlagCount(LargeScreenCountParam largeScreenCountParam);
|
||||||
|
|
||||||
|
List<DeviceDTO> devDetail(LargeScreenCountParam largeScreenCountParam);
|
||||||
|
|
||||||
|
List<RegionDevCountVO> regionDevCount(LargeScreenCountParam largeScreenCountParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ import com.njcn.gather.event.devcie.service.*;
|
|||||||
import com.njcn.gather.event.transientes.service.*;
|
import com.njcn.gather.event.transientes.service.*;
|
||||||
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||||
import com.njcn.gather.event.transientes.utils.JwtUtil;
|
import com.njcn.gather.event.transientes.utils.JwtUtil;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import io.swagger.models.auth.In;
|
import io.swagger.models.auth.In;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -82,7 +84,7 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
|||||||
private final PqsUsersetService pqsUsersetService;
|
private final PqsUsersetService pqsUsersetService;
|
||||||
private final PqsUserService pqsUserService;
|
private final PqsUserService pqsUserService;
|
||||||
private final PqLinedetailMapper pqLinedetailMapper;
|
private final PqLinedetailMapper pqLinedetailMapper;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
@Value("${SYS_TYPE_ZT}")
|
@Value("${SYS_TYPE_ZT}")
|
||||||
private String sysTypeZt;
|
private String sysTypeZt;
|
||||||
|
|
||||||
@@ -868,6 +870,75 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeviceCountVO devFlagCount(LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
DeviceCountVO deviceCountVO = new DeviceCountVO();
|
||||||
|
List<PqLine> pqLineList = (List<PqLine>) redisUtil.getObjectByKey("pqLineList");
|
||||||
|
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||||
|
List<PqsDeptsline> deptslines = pqsDeptslineService.lambdaQuery().in(PqsDeptsline::getDeptsIndex, deptAndChildren).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||||
|
List<Integer> deptslineIds = deptslines.stream().map(PqsDeptsline::getLineIndex).collect(Collectors.toList());
|
||||||
|
pqLineList = pqLineList.stream().filter(temp->deptslineIds.contains(temp.getLineIndex())).collect(Collectors.toList());
|
||||||
|
List<Integer> devIndexs = pqLineList.stream().map(PqLine::getDevIndex).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//在运总数
|
||||||
|
List<PqDevice> list = pqDeviceService.lambdaQuery().in(PqDevice::getDevIndex, devIndexs).eq(PqDevice::getDevflag, 0).list();
|
||||||
|
|
||||||
|
long onLine = list.stream().filter(temp -> Objects.equals(temp.getStatus(), 1)).count();
|
||||||
|
long Offline = list.stream().filter(temp -> Objects.equals(temp.getStatus(), 0)).count();
|
||||||
|
deviceCountVO.setAllCount(list.size());
|
||||||
|
deviceCountVO.setOnLine((int) onLine);
|
||||||
|
deviceCountVO.setOffLine((int) Offline);
|
||||||
|
|
||||||
|
return deviceCountVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceDTO> devDetail(LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
DeviceCountVO deviceCountVO = new DeviceCountVO();
|
||||||
|
List<PqLine> pqLineList = (List<PqLine>) redisUtil.getObjectByKey("pqLineList");
|
||||||
|
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||||
|
List<PqsDeptsline> deptslines = pqsDeptslineService.lambdaQuery().in(PqsDeptsline::getDeptsIndex, deptAndChildren).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||||
|
List<Integer> deptslineIds = deptslines.stream().map(PqsDeptsline::getLineIndex).collect(Collectors.toList());
|
||||||
|
pqLineList = pqLineList.stream().filter(temp->deptslineIds.contains(temp.getLineIndex())).collect(Collectors.toList());
|
||||||
|
List<Integer> devIndexs = pqLineList.stream().map(PqLine::getDevIndex).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
List<DeviceDTO> deviceDTOList = pqDeviceService.queryListByIds(devIndexs);
|
||||||
|
deviceDTOList = deviceDTOList.stream().filter(temp->Objects.equals(temp.getDevFlag(),0)).collect(Collectors.toList());
|
||||||
|
return deviceDTOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RegionDevCountVO> regionDevCount(LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
List<RegionDevCountVO> result = new ArrayList<>();
|
||||||
|
List<PqLine> pqLineList = (List<PqLine>) redisUtil.getObjectByKey("pqLineList");
|
||||||
|
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren(largeScreenCountParam.getDeptId());
|
||||||
|
if(deptAndChildren.size()>1){
|
||||||
|
deptAndChildren.remove(largeScreenCountParam.getDeptId());
|
||||||
|
}
|
||||||
|
List<PqsDeptsline> deptslines = pqsDeptslineService.lambdaQuery().in(PqsDeptsline::getDeptsIndex, deptAndChildren).eq(PqsDeptsline::getSystype, sysTypeZt).list();
|
||||||
|
List<PqsDepts> list = pqsDeptsService.lambdaQuery().in(PqsDepts::getDeptsIndex, deptAndChildren).eq(PqsDepts::getState, 1).list();
|
||||||
|
list.forEach(temp->{
|
||||||
|
RegionDevCountVO regionDevCountVO = new RegionDevCountVO();
|
||||||
|
regionDevCountVO.setDeptsIndex(temp.getDeptsIndex());
|
||||||
|
regionDevCountVO.setDeptsname(temp.getDeptsname());
|
||||||
|
List<Integer> deptslineIds = deptslines.stream().filter(deptsline->Objects.equals(deptsline.getDeptsIndex(),temp.getDeptsIndex())).map(PqsDeptsline::getLineIndex).collect(Collectors.toList());
|
||||||
|
List<PqLine> collect = pqLineList.stream().filter(pqLine -> deptslineIds.contains(pqLine.getLineIndex())).collect(Collectors.toList());
|
||||||
|
List<Integer> devIndexs = collect.stream().map(PqLine::getDevIndex).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//在运总数
|
||||||
|
List<PqDevice> pqDeviceList = pqDeviceService.lambdaQuery().in(PqDevice::getDevIndex, devIndexs).eq(PqDevice::getDevflag, 0).list();
|
||||||
|
long onLine = pqDeviceList.stream().filter(pqDevice -> Objects.equals(pqDevice.getStatus(), 1)).count();
|
||||||
|
long Offline = pqDeviceList.stream().filter(pqDevice -> Objects.equals(pqDevice.getStatus(), 0)).count();
|
||||||
|
regionDevCountVO.setAllCount(pqDeviceList.size());
|
||||||
|
|
||||||
|
regionDevCountVO.setOnLine((int) onLine);
|
||||||
|
regionDevCountVO.setOffLine((int) Offline);
|
||||||
|
result.add(regionDevCountVO);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private List<EventDetailVO> change(List<PqsEventdetail> list,List<MsgEventInfo> handleMsg){
|
private List<EventDetailVO> change(List<PqsEventdetail> list,List<MsgEventInfo> handleMsg){
|
||||||
List<EventDetailVO> result = new ArrayList<>();
|
List<EventDetailVO> result = new ArrayList<>();
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
|||||||
Reference in New Issue
Block a user