接口调整
This commit is contained in:
@@ -20,4 +20,8 @@ public interface PqDeviceMapper extends BaseMapper<PqDevice> {
|
|||||||
List<DeviceDTO> queryListByIds(@Param("ids") List<Integer> ids);
|
List<DeviceDTO> queryListByIds(@Param("ids") List<Integer> ids);
|
||||||
|
|
||||||
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, @Param("searchValue") String searchValue,@Param("devIndexs") List<Integer> devIndexs, @Param("state") String state);
|
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, @Param("searchValue") String searchValue,@Param("devIndexs") List<Integer> devIndexs, @Param("state") String state);
|
||||||
|
|
||||||
|
Page<DeviceDTO> queryListByLineIds(Page<DeviceDTO> pqsEventdetailPage, @Param("searchValue") String searchValue,@Param("lineIds") List<Integer> lineIds);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,4 +101,37 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
order by pq_device.updatetime
|
order by pq_device.updatetime
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryListByLineIds" resultType="com.njcn.gather.event.devcie.pojo.dto.DeviceDTO">
|
||||||
|
select distinct
|
||||||
|
pq_device.dev_index devId,
|
||||||
|
pq_device.name devName,
|
||||||
|
pq_device.UpdateTime updateTime,
|
||||||
|
pq_device.DevFlag devFlag,
|
||||||
|
pq_device.IP ip,
|
||||||
|
pq_device.status status,
|
||||||
|
PQ_SUBSTATION.sub_index stationId,
|
||||||
|
PQ_SUBSTATION.name stationName,
|
||||||
|
PQ_GDINFORMATION.Name gdName,
|
||||||
|
PQS_DICDATA.DIC_Name MANUFACTURER_Name
|
||||||
|
from
|
||||||
|
pq_line,
|
||||||
|
pq_device,
|
||||||
|
PQ_DEVICEDETAIL,
|
||||||
|
PQ_SUBSTATION,
|
||||||
|
PQ_GDINFORMATION,
|
||||||
|
PQS_DICDATA
|
||||||
|
where
|
||||||
|
pq_line.DEV_INDEX = pq_device.DEV_INDEX
|
||||||
|
and PQ_DEVICEDETAIL.dev_index =pq_device.dev_index
|
||||||
|
and pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
|
||||||
|
and pq_device.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
|
||||||
|
and PQ_DEVICEDETAIL.MANUFACTURER = PQS_DICDATA.DIC_INDEX
|
||||||
|
and pq_line.LINE_INDEX in
|
||||||
|
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
@@ -16,6 +17,8 @@ import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
|||||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||||
|
import com.njcn.gather.event.transientes.mapper.PqUserLedgerMapper;
|
||||||
|
import com.njcn.gather.event.transientes.mapper.PqUserLineAssMapper;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.SimulationMsgParam;
|
import com.njcn.gather.event.transientes.pojo.param.SimulationMsgParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.*;
|
import com.njcn.gather.event.transientes.pojo.po.*;
|
||||||
@@ -55,6 +58,8 @@ import java.util.stream.Stream;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class EventGateController extends BaseController {
|
public class EventGateController extends BaseController {
|
||||||
private final MsgEventInfoServiceImpl msgEventInfoServiceImpl;
|
private final MsgEventInfoServiceImpl msgEventInfoServiceImpl;
|
||||||
|
private final PqUserLineAssMapper pqUserLineAssMapper;
|
||||||
|
private final PqUserLedgerMapper pqUserLedgerMapper;
|
||||||
@Value("${SYS_TYPE_ZT}")
|
@Value("${SYS_TYPE_ZT}")
|
||||||
private String sysTypeZt;
|
private String sysTypeZt;
|
||||||
|
|
||||||
@@ -95,14 +100,25 @@ public class EventGateController extends BaseController {
|
|||||||
//jsonObject = test();
|
//jsonObject = test();
|
||||||
|
|
||||||
if (msgEventConfigService.getEventType().contains(jsonObject.get("wavetype").toString())) {
|
if (msgEventConfigService.getEventType().contains(jsonObject.get("wavetype").toString())) {
|
||||||
|
//过滤重要暂降事件
|
||||||
|
Integer lineId = Integer.valueOf(jsonObject.get("lineid").toString());
|
||||||
|
List<PqUserLineAssPO> assList = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().eq(PqUserLineAssPO::getLineIndex,lineId));
|
||||||
|
|
||||||
|
String str ="/";
|
||||||
|
if(CollUtil.isNotEmpty(assList)){
|
||||||
|
List<String> userIds = assList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||||
|
List<PqUserLedgerPO> poList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().select(PqUserLedgerPO::getId,PqUserLedgerPO::getCustomerName).in(PqUserLedgerPO::getId,userIds));
|
||||||
|
str = poList.stream().map(PqUserLedgerPO::getCustomerName).collect(Collectors.joining(StrUtil.COMMA));
|
||||||
|
}
|
||||||
|
jsonObject.put("objName",str);
|
||||||
webSocketServer.sendMessageToAll(jsonObject.toString());
|
webSocketServer.sendMessageToAll(jsonObject.toString());
|
||||||
|
|
||||||
//开始发送短信
|
//开始发送短信
|
||||||
try {
|
/* try {
|
||||||
sendMessage(jsonObject);
|
sendMessage(jsonObject);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("短信组装发送失败!失败原因{}",e.getMessage());
|
log.error("短信组装发送失败!失败原因{}",e.getMessage());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ 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.event.file.pojo.dto.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
import com.njcn.gather.event.devcie.mapper.PqLineMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||||
@@ -91,4 +92,15 @@ public class EventRightController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@PostMapping("/rightEventDevOpen")
|
||||||
|
@ApiOperation("右侧表头终端点击事件")
|
||||||
|
@ApiImplicitParam(name = "largeScreenCountParam", value = "", required = true)
|
||||||
|
public HttpResult<Object> rightEventDevOpen(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("rightEventDevOpen");
|
||||||
|
Page<DeviceDTO> page = eventRightService.rightEventDevOpen(largeScreenCountParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.njcn.gather.event.transientes.controller;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsDicTreePO;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.vo.PqsDicTreeVO;
|
||||||
|
import com.njcn.gather.event.transientes.service.PqsDicTreeService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-08-01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Api(tags = "字典树")
|
||||||
|
@RequestMapping("dicTree")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class PqsDicTreeController extends BaseController {
|
||||||
|
|
||||||
|
private final PqsDicTreeService pqsDicTreeService;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo
|
||||||
|
@GetMapping("/getDicTree")
|
||||||
|
@ApiOperation("获取树结构")
|
||||||
|
public HttpResult<List<PqsDicTreePO>> getDicTree(@RequestParam("code") String code){
|
||||||
|
String methodDescribe = getMethodDescribe("getDicTree");
|
||||||
|
|
||||||
|
List<PqsDicTreePO> pqsDicTreePOList = pqsDicTreeService.getDicTree(code);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDicTreePOList, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,15 @@ package com.njcn.gather.event.transientes.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.gather.event.transientes.pojo.po.PqsDicTreePO;
|
import com.njcn.gather.event.transientes.pojo.po.PqsDicTreePO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface PqsDicTreeMapper extends BaseMapper<PqsDicTreePO> {
|
public interface PqsDicTreeMapper extends BaseMapper<PqsDicTreePO> {
|
||||||
|
|
||||||
|
@Select("SELECT ID,NAME,CODE,PARENT_ID as parentId,level FROM PQS_DICTREE " +
|
||||||
|
"START WITH CODE = #{code} " +
|
||||||
|
"CONNECT BY PRIOR ID = PARENT_ID")
|
||||||
|
List<PqsDicTreePO> selectChildrenByCode(@Param("code") String code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,4 +42,7 @@ public class PqsDicTreePO {
|
|||||||
|
|
||||||
@TableField(value ="UPDATE_TIME")
|
@TableField(value ="UPDATE_TIME")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer level;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-08-01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqsDicTreeVO {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
private String dicValue;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private List<PqsDicTreeVO> children;
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.njcn.gather.event.transientes.pojo.vo;
|
package com.njcn.gather.event.transientes.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.models.auth.In;
|
import io.swagger.models.auth.In;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,25 +15,38 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class UserLedgerStatisticVO {
|
public class UserLedgerStatisticVO {
|
||||||
|
|
||||||
private Integer importNum;
|
@ApiModelProperty(value = "半导体及精密加工大类id")
|
||||||
|
private String importId;
|
||||||
|
|
||||||
private Integer importDevNum;
|
private Integer importNum = 0;
|
||||||
|
|
||||||
private Integer otherImportNum;
|
private Integer importDevNum = 0;
|
||||||
|
|
||||||
private Integer otherImportDevNum;
|
@ApiModelProperty(value = "其他敏感用户大类id")
|
||||||
|
private String otherImportId;
|
||||||
|
|
||||||
private Integer otherNum;
|
private Integer otherImportNum = 0;
|
||||||
|
|
||||||
private Integer otherDevNum;
|
private Integer otherImportDevNum = 0;
|
||||||
|
|
||||||
private List<Inner> innerList;
|
@ApiModelProperty(value = "其他干扰源大类id")
|
||||||
|
private String otherId;
|
||||||
|
|
||||||
|
private Integer otherNum = 0;
|
||||||
|
|
||||||
|
private Integer otherDevNum = 0;
|
||||||
|
|
||||||
|
private List<Inner> innerList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Inner{
|
public static class Inner{
|
||||||
|
|
||||||
|
private String treeId;
|
||||||
|
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
private String customId;
|
private String customId;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
@@ -39,6 +54,7 @@ public class UserLedgerStatisticVO {
|
|||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private Integer count;
|
private Integer count;
|
||||||
|
|
||||||
private List<String> eventList;
|
private List<String> eventList;
|
||||||
|
|
||||||
private List<Inner> children;
|
private List<Inner> children;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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.event.file.pojo.dto.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
|
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.MonitorTerminalParam;
|
import com.njcn.gather.event.transientes.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.gather.event.transientes.pojo.param.PqUserLedgerParam;
|
import com.njcn.gather.event.transientes.pojo.param.PqUserLedgerParam;
|
||||||
@@ -20,5 +21,8 @@ public interface EventRightService {
|
|||||||
Page<EventDetailVO> rightEventOpen(LargeScreenCountParam param);
|
Page<EventDetailVO> rightEventOpen(LargeScreenCountParam param);
|
||||||
|
|
||||||
|
|
||||||
|
Page<DeviceDTO> rightEventDevOpen(LargeScreenCountParam param);
|
||||||
|
|
||||||
|
|
||||||
List<UserLedgerStatisticVO.Inner> rightImportUser(LargeScreenCountParam param);
|
List<UserLedgerStatisticVO.Inner> rightImportUser(LargeScreenCountParam param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.gather.event.transientes.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsDicTreePO;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.vo.PqsDicTreeVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PqsDicTreeService extends IService<PqsDicTreePO> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<PqsDicTreePO> getDicTree(String code);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,8 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.gather.event.devcie.mapper.PqDeviceMapper;
|
||||||
|
import com.njcn.gather.event.devcie.pojo.dto.DeviceDTO;
|
||||||
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
import com.njcn.gather.event.devcie.pojo.dto.LedgerBaseInfoDTO;
|
||||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||||
import com.njcn.gather.event.devcie.service.PqLineService;
|
import com.njcn.gather.event.devcie.service.PqLineService;
|
||||||
@@ -59,32 +61,45 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
private final RedisUtil redisUtil;
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
private final static String NAME_KEY = "LineCache:";
|
private final static String NAME_KEY = "LineCache:";
|
||||||
|
private final PqDeviceMapper pqDeviceMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserLedgerStatisticVO userLedgerStatistic(LargeScreenCountParam param) {
|
public UserLedgerStatisticVO userLedgerStatistic(LargeScreenCountParam param) {
|
||||||
UserLedgerStatisticVO result = new UserLedgerStatisticVO();
|
UserLedgerStatisticVO result = new UserLedgerStatisticVO();
|
||||||
|
|
||||||
List<Integer> lineIds = commGeneralService.getLineIdsByDept(param);
|
|
||||||
|
|
||||||
//获取当前用户权限能获取到的用户台账信息
|
|
||||||
LambdaQueryWrapper<PqUserLineAssPO> assQuery = new LambdaQueryWrapper<>();
|
|
||||||
assQuery.in(PqUserLineAssPO::getLineIndex, lineIds);
|
|
||||||
List<PqUserLineAssPO> assList = pqUserLineAssMapper.selectList(assQuery);
|
|
||||||
List<String> assUserIds = assList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
|
||||||
|
|
||||||
//获取字典树
|
//获取字典树
|
||||||
List<PqsDicTreePO> dicTreeList = pqsDicTreeMapper.selectList(new LambdaQueryWrapper<>());
|
List<PqsDicTreePO> dicTreeList = pqsDicTreeMapper.selectList(new LambdaQueryWrapper<>());
|
||||||
List<PqsDicTreePO> touList = dicTreeList.stream().filter(it -> Objects.equals(it.getCode(), DicTreeEnum.BJ_USER.getCode())||Objects.equals(it.getCode(), DicTreeEnum.OI_USER.getCode())||Objects.equals(it.getCode(), DicTreeEnum.OT_USER.getCode())).collect(Collectors.toList());
|
List<PqsDicTreePO> touList = dicTreeList.stream().filter(it -> Objects.equals(it.getCode(), DicTreeEnum.BJ_USER.getCode())||Objects.equals(it.getCode(), DicTreeEnum.OI_USER.getCode())||Objects.equals(it.getCode(), DicTreeEnum.OT_USER.getCode())).collect(Collectors.toList());
|
||||||
Map<String, PqsDicTreePO> treeMap = touList.stream().collect(Collectors.toMap(PqsDicTreePO::getCode, Function.identity()));
|
Map<String, PqsDicTreePO> treeMap = touList.stream().collect(Collectors.toMap(PqsDicTreePO::getCode, Function.identity()));
|
||||||
|
treeMap.forEach((tree, obj) -> {
|
||||||
|
if (tree.equals(DicTreeEnum.BJ_USER.getCode())) {
|
||||||
|
result.setImportId(obj.getId());
|
||||||
|
} else if (tree.equals(DicTreeEnum.OI_USER.getCode())) {
|
||||||
|
result.setOtherImportId(obj.getId());
|
||||||
|
} else if (tree.equals(DicTreeEnum.OT_USER.getCode())) {
|
||||||
|
result.setOtherId(obj.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Integer> lineIds = commGeneralService.getLineIdsByDept(param);
|
||||||
|
//获取当前用户权限能获取到的用户台账信息
|
||||||
|
LambdaQueryWrapper<PqUserLineAssPO> assQuery = new LambdaQueryWrapper<>();
|
||||||
|
assQuery.in(PqUserLineAssPO::getLineIndex, lineIds);
|
||||||
|
List<PqUserLineAssPO> assList = pqUserLineAssMapper.selectList(assQuery);
|
||||||
|
if(CollUtil.isEmpty(assList)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
List<String> assUserIds = assList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, PqsDicTreePO> dicTreeMap = dicTreeList.stream().collect(Collectors.toMap(PqsDicTreePO::getId, Function.identity()));
|
Map<String, PqsDicTreePO> dicTreeMap = dicTreeList.stream().collect(Collectors.toMap(PqsDicTreePO::getId, Function.identity()));
|
||||||
|
|
||||||
|
|
||||||
//查询时间段的暂降事件
|
//查询时间段的暂降事件
|
||||||
LambdaQueryWrapper<PqsEventdetail> eventQuery = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqsEventdetail> eventQuery = new LambdaQueryWrapper<>();
|
||||||
eventQuery.between(PqsEventdetail::getTimeid, DateUtil.parse(param.getSearchBeginTime()), DateUtil.endOfDay(DateUtil.parse(param.getSearchBeginTime())))
|
eventQuery.between(PqsEventdetail::getTimeid, DateUtil.parse(param.getSearchBeginTime()), DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
|
||||||
.in(PqsEventdetail::getWavetype, msgEventConfigService.getEventType());
|
.in(PqsEventdetail::getWavetype, msgEventConfigService.getEventType());
|
||||||
|
|
||||||
LambdaQueryWrapper<PqLine> lineQuery = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqLine> lineQuery = new LambdaQueryWrapper<>();
|
||||||
@@ -108,6 +123,9 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
List<PqLine> lineList = pqLineService.list(lineQuery);
|
List<PqLine> lineList = pqLineService.list(lineQuery);
|
||||||
|
|
||||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().in(PqUserLedgerPO::getId, assUserIds));
|
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().in(PqUserLedgerPO::getId, assUserIds));
|
||||||
|
if(CollUtil.isEmpty(pqUserLedgerPOList)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
Map<String, List<PqUserLedgerPO>> userMap = pqUserLedgerPOList.stream().collect(Collectors.groupingBy(PqUserLedgerPO::getBigObjType));
|
Map<String, List<PqUserLedgerPO>> userMap = pqUserLedgerPOList.stream().collect(Collectors.groupingBy(PqUserLedgerPO::getBigObjType));
|
||||||
|
|
||||||
List<UserLedgerStatisticVO.Inner> innerList = new ArrayList<>();
|
List<UserLedgerStatisticVO.Inner> innerList = new ArrayList<>();
|
||||||
@@ -131,6 +149,7 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
|
|
||||||
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
||||||
inner.setName(obj.getName());
|
inner.setName(obj.getName());
|
||||||
|
|
||||||
inner.setCount(0);
|
inner.setCount(0);
|
||||||
|
|
||||||
List<UserLedgerStatisticVO.Inner> childrenList = new ArrayList<>();
|
List<UserLedgerStatisticVO.Inner> childrenList = new ArrayList<>();
|
||||||
@@ -140,6 +159,8 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
UserLedgerStatisticVO.Inner item = new UserLedgerStatisticVO.Inner();
|
UserLedgerStatisticVO.Inner item = new UserLedgerStatisticVO.Inner();
|
||||||
Integer[] count = getEventCount(userList, assList, eventdetailList, lineList, false);
|
Integer[] count = getEventCount(userList, assList, eventdetailList, lineList, false);
|
||||||
item.setCount(count[0]);
|
item.setCount(count[0]);
|
||||||
|
item.setTreeId(key);
|
||||||
|
item.setParentId(obj.getId());
|
||||||
item.setName(dicTreeMap.containsKey(key) ? dicTreeMap.get(key).getName() : "/");
|
item.setName(dicTreeMap.containsKey(key) ? dicTreeMap.get(key).getName() : "/");
|
||||||
childrenList.add(item);
|
childrenList.add(item);
|
||||||
});
|
});
|
||||||
@@ -156,10 +177,15 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
public Page<EventDetailVO> rightEventOpen(LargeScreenCountParam param) {
|
public Page<EventDetailVO> rightEventOpen(LargeScreenCountParam param) {
|
||||||
Page<EventDetailVO> result = new Page<>(PageFactory.getPageNum(param),PageFactory.getPageSize(param));
|
Page<EventDetailVO> result = new Page<>(PageFactory.getPageNum(param),PageFactory.getPageSize(param));
|
||||||
List<Integer> deptLineIds = commGeneralService.getLineIdsByRedis(param.getDeptId());
|
List<Integer> deptLineIds = commGeneralService.getLineIdsByRedis(param.getDeptId());
|
||||||
|
if(CollUtil.isEmpty(deptLineIds)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
//获取用户监测点关系符合部门监测点的
|
//获取用户监测点关系符合部门监测点的
|
||||||
List<PqUserLineAssPO> assList = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getLineIndex,deptLineIds));
|
List<PqUserLineAssPO> assList = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getLineIndex,deptLineIds));
|
||||||
List<String> userIds = assList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
List<String> userIds = assList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||||
|
if(CollUtil.isEmpty(userIds)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
LambdaQueryWrapper<PqUserLedgerPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqUserLedgerPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in(PqUserLedgerPO::getId,userIds);
|
lambdaQueryWrapper.in(PqUserLedgerPO::getId,userIds);
|
||||||
@@ -173,6 +199,9 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
}
|
}
|
||||||
//获取符合条件的用户
|
//获取符合条件的用户
|
||||||
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(lambdaQueryWrapper);
|
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if(CollUtil.isEmpty(pqUserLedgerPOList)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
Map<String,PqUserLedgerPO> pqMap = pqUserLedgerPOList.stream().collect(Collectors.toMap(PqUserLedgerPO::getId,Function.identity()));
|
Map<String,PqUserLedgerPO> pqMap = pqUserLedgerPOList.stream().collect(Collectors.toMap(PqUserLedgerPO::getId,Function.identity()));
|
||||||
List<String> pUserIds = pqUserLedgerPOList.stream().map(PqUserLedgerPO::getId).collect(Collectors.toList());
|
List<String> pUserIds = pqUserLedgerPOList.stream().map(PqUserLedgerPO::getId).collect(Collectors.toList());
|
||||||
List<PqUserLineAssPO> assListLast = assList.stream().filter(it->pUserIds.contains(it.getUserIndex())).collect(Collectors.toList());
|
List<PqUserLineAssPO> assListLast = assList.stream().filter(it->pUserIds.contains(it.getUserIndex())).collect(Collectors.toList());
|
||||||
@@ -180,7 +209,7 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
|
|
||||||
//查询时间段的暂降事件
|
//查询时间段的暂降事件
|
||||||
LambdaQueryWrapper<PqsEventdetail> eventQuery = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqsEventdetail> eventQuery = new LambdaQueryWrapper<>();
|
||||||
eventQuery.between(PqsEventdetail::getTimeid, DateUtil.parse(param.getSearchBeginTime()), DateUtil.endOfDay(DateUtil.parse(param.getSearchBeginTime())))
|
eventQuery.between(PqsEventdetail::getTimeid, DateUtil.parse(param.getSearchBeginTime()), DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())))
|
||||||
.in(PqsEventdetail::getWavetype, msgEventConfigService.getEventType());
|
.in(PqsEventdetail::getWavetype, msgEventConfigService.getEventType());
|
||||||
|
|
||||||
if (lineUseList.size() > 1000) {
|
if (lineUseList.size() > 1000) {
|
||||||
@@ -226,28 +255,79 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserLedgerStatisticVO.Inner> rightImportUser(LargeScreenCountParam param) {
|
public Page<DeviceDTO> rightEventDevOpen(LargeScreenCountParam param) {
|
||||||
List<UserLedgerStatisticVO.Inner> result = new ArrayList<>();
|
Page<DeviceDTO> result = new Page<>(PageFactory.getPageNum(param),PageFactory.getPageSize(param));
|
||||||
|
List<Integer> lineIds = commGeneralService.getLineIdsByRedis(param.getDeptId());
|
||||||
|
|
||||||
List<Integer> deptLineIds = commGeneralService.getLineIdsByRedis(param.getDeptId());
|
LambdaQueryWrapper<PqUserLineAssPO> assQuery = new LambdaQueryWrapper<>();
|
||||||
|
assQuery.in(PqUserLineAssPO::getLineIndex,lineIds);
|
||||||
List<PqUserLedgerPO> poList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().eq(PqUserLedgerPO::getIsShow,1));
|
List<PqUserLineAssPO> assPOList = pqUserLineAssMapper.selectList(assQuery);
|
||||||
if(CollUtil.isEmpty(poList)){
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
List<String> ids = poList.stream().map(PqUserLedgerPO::getId).collect(Collectors.toList());
|
|
||||||
List<PqUserLineAssPO> assPOList = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getUserIndex,ids));
|
|
||||||
if(CollUtil.isEmpty(assPOList)){
|
if(CollUtil.isEmpty(assPOList)){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> userIds = assPOList.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
List<String> userIds = assPOList.stream().map(PqUserLineAssPO::getUserIndex).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<PqUserLedgerPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(PqUserLedgerPO::getId,userIds);
|
||||||
|
if(StrUtil.isNotBlank(param.getBigObjType())){
|
||||||
|
//对象大类不为空
|
||||||
|
lambdaQueryWrapper.eq(PqUserLedgerPO::getBigObjType,param.getBigObjType());
|
||||||
|
}
|
||||||
|
if(StrUtil.isNotBlank(param.getSmallObjType())){
|
||||||
|
//对象大类不为空
|
||||||
|
lambdaQueryWrapper.eq(PqUserLedgerPO::getSmallObjType,param.getSmallObjType());
|
||||||
|
}
|
||||||
|
|
||||||
poList = poList.stream().filter(it->userIds.contains(it.getId())).collect(Collectors.toList());
|
if(StrUtil.isNotBlank(param.getBigObjType()) || StrUtil.isNotBlank(param.getSmallObjType())){
|
||||||
|
List<PqUserLedgerPO> pqUserLedgerPOList = pqUserLedgerMapper.selectList(lambdaQueryWrapper);
|
||||||
|
List<String> lastIds = pqUserLedgerPOList.stream().map(PqUserLedgerPO::getId).collect(Collectors.toList());
|
||||||
|
List<Integer> ids = assPOList.stream().filter(it->lastIds.contains(it.getUserIndex())).map(PqUserLineAssPO::getLineIndex).collect(Collectors.toList());
|
||||||
|
if(CollUtil.isEmpty(ids)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = pqDeviceMapper.queryListByLineIds(new Page<DeviceDTO>(PageFactory.getPageNum(param),PageFactory.getPageSize(param)),param.getSearchValue(),ids);
|
||||||
|
|
||||||
List<Integer> lineIds = assPOList.stream().map(PqUserLineAssPO::getLineIndex).distinct().collect(Collectors.toList());
|
}else {
|
||||||
List<PqsEventdetail> eventList = pqsEventdetailService.lambdaQuery().in(PqsEventdetail::getLineid,lineIds).between(PqsEventdetail::getTimeid,DateUtil.parse(param.getSearchBeginTime()),DateUtil.parse(param.getSearchEndTime())).list();
|
//查询条件都为空直接拿取所有测点匹配装置
|
||||||
|
List<Integer> lineAssIds = assPOList.stream().map(PqUserLineAssPO::getLineIndex).collect(Collectors.toList());
|
||||||
|
result = pqDeviceMapper.queryListByLineIds(new Page<DeviceDTO>(PageFactory.getPageNum(param),PageFactory.getPageSize(param)),param.getSearchValue(),lineAssIds);
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserLedgerStatisticVO.Inner> rightImportUser(LargeScreenCountParam param) {
|
||||||
|
List<UserLedgerStatisticVO.Inner> result = new ArrayList<>();
|
||||||
|
List<Integer> deptLineIds = commGeneralService.getLineIdsByRedis(param.getDeptId());
|
||||||
|
if(CollUtil.isEmpty(deptLineIds)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
List<PqUserLineAssPO> list = pqUserLineAssMapper.selectList(new LambdaQueryWrapper<PqUserLineAssPO>().in(PqUserLineAssPO::getLineIndex,deptLineIds));
|
||||||
|
if(CollUtil.isEmpty(list)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
List<String> userIds = list.stream().map(PqUserLineAssPO::getUserIndex).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<PqUserLedgerPO> poList = pqUserLedgerMapper.selectList(new LambdaQueryWrapper<PqUserLedgerPO>().in(PqUserLedgerPO::getId,userIds).eq(PqUserLedgerPO::getIsShow,1));
|
||||||
|
if(CollUtil.isEmpty(poList)){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> ids = poList.stream().map(PqUserLedgerPO::getId).collect(Collectors.toList());
|
||||||
|
List<PqUserLineAssPO> assTemList = list.stream().filter(it->ids.contains(it.getUserIndex())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//获取监测id,用于查询暂降表
|
||||||
|
List<Integer> lineIds = assTemList.stream().map(PqUserLineAssPO::getLineIndex).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<PqsEventdetail> eventList = pqsEventdetailService.lambdaQuery().
|
||||||
|
in(PqsEventdetail::getLineid,lineIds)
|
||||||
|
.in(PqsEventdetail::getWavetype,msgEventConfigService.getEventType())
|
||||||
|
.between(PqsEventdetail::getTimeid,DateUtil.parse(param.getSearchBeginTime()),DateUtil.parse(param.getSearchEndTime())).list();
|
||||||
if(CollUtil.isEmpty(eventList)){
|
if(CollUtil.isEmpty(eventList)){
|
||||||
poList.forEach(item->{
|
poList.forEach(item->{
|
||||||
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
||||||
@@ -259,7 +339,7 @@ public class EventRightServiceImpl implements EventRightService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String,List<Integer>> assMap = assPOList.stream().collect(Collectors.groupingBy(PqUserLineAssPO::getUserIndex,Collectors.mapping(PqUserLineAssPO::getLineIndex,Collectors.toList())));
|
Map<String,List<Integer>> assMap = assTemList.stream().collect(Collectors.groupingBy(PqUserLineAssPO::getUserIndex,Collectors.mapping(PqUserLineAssPO::getLineIndex,Collectors.toList())));
|
||||||
poList.forEach(item->{
|
poList.forEach(item->{
|
||||||
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
UserLedgerStatisticVO.Inner inner = new UserLedgerStatisticVO.Inner();
|
||||||
inner.setCustomId(item.getId());
|
inner.setCustomId(item.getId());
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.gather.event.transientes.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.gather.event.transientes.mapper.PqsDicTreeMapper;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.po.PqsDicTreePO;
|
||||||
|
import com.njcn.gather.event.transientes.pojo.vo.PqsDicTreeVO;
|
||||||
|
import com.njcn.gather.event.transientes.service.PqsDicTreeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-08-01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqsDicTreeServiceImpl extends ServiceImpl<PqsDicTreeMapper, PqsDicTreePO> implements PqsDicTreeService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典树
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PqsDicTreePO> getDicTree(String code){
|
||||||
|
List<PqsDicTreePO> pqsDicTreePOList = this.getBaseMapper().selectChildrenByCode(code);
|
||||||
|
return pqsDicTreePOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user