初始版本提交
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
package com.njcn.gather.event.devcie.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.db.mybatisplus.bo.BaseEntity;
|
||||
import com.njcn.gather.event.devcie.pojo.vo.LedgerCountVO;
|
||||
import com.njcn.gather.event.devcie.service.LedgerCountService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:00【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "台账统计")
|
||||
@RestController
|
||||
@RequestMapping("/ledgercount")
|
||||
@RequiredArgsConstructor
|
||||
public class LedgerCountController extends BaseController {
|
||||
|
||||
private final LedgerCountService ledgerCountService;
|
||||
@OperateInfo
|
||||
@PostMapping("/scaleStatistics")
|
||||
@ApiOperation("台账规模统计")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<LedgerCountVO> scaleStatistics() {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe);
|
||||
LedgerCountVO result = ledgerCountService.scaleStatistics();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.gather.event.devcie.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "PQS_DEPTSLINE")
|
||||
public class PqsDeptsline {
|
||||
/**
|
||||
* 部门表Guid
|
||||
*/
|
||||
@TableField(value = "DEPTS_INDEX")
|
||||
private String deptsIndex;
|
||||
|
||||
@TableField(value = "LINE_INDEX")
|
||||
private Integer lineIndex;
|
||||
|
||||
@TableField(value = "SYSTYPE")
|
||||
private String systype;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.njcn.gather.event.devcie.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class LedgerCountVO {
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.vo.LedgerCountVO;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:05【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface LedgerCountService {
|
||||
LedgerCountVO scaleStatistics();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsDeptslineService extends IService<PqsDeptsline>{
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.vo.LedgerCountVO;
|
||||
import com.njcn.gather.event.devcie.service.LedgerCountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class LedgerCountServiceImpl implements LedgerCountService {
|
||||
@Override
|
||||
public LedgerCountVO scaleStatistics() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.mapper.PqsDeptslineMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class PqsDeptslineServiceImpl extends ServiceImpl<PqsDeptslineMapper, PqsDeptsline> implements PqsDeptslineService{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.HttpResultUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:00【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "大屏统计")
|
||||
@RestController
|
||||
@RequestMapping("/ledgercount")
|
||||
@RequiredArgsConstructor
|
||||
public class LargeScreenCountController extends BaseController {
|
||||
|
||||
private final LargeScreenCountService largeScreenCountService;
|
||||
@OperateInfo
|
||||
@PostMapping("/ledgercount")
|
||||
@ApiOperation("台账规模统计")
|
||||
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||
public HttpResult<LedgerCountVO> scaleStatistics(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||
String methodDescribe = getMethodDescribe("scaleStatistics");
|
||||
LedgerCountVO result = largeScreenCountService.scaleStatistics(largeScreenCountParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@PostMapping("/alarmAnalysis")
|
||||
@ApiOperation("告警统计分析")
|
||||
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||
public HttpResult<AlarmAnalysisVO> alarmAnalysis(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||
String methodDescribe = getMethodDescribe("alarmAnalysis");
|
||||
AlarmAnalysisVO result = largeScreenCountService.alarmAnalysis(largeScreenCountParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
@OperateInfo
|
||||
@PostMapping("/eventTrend")
|
||||
@ApiOperation("暂降事件趋势")
|
||||
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||
public HttpResult<List<EventTrendVO>> eventTrend(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||
String methodDescribe = getMethodDescribe("eventTrend");
|
||||
List<EventTrendVO> result = largeScreenCountService.eventTrend(largeScreenCountParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo
|
||||
@PostMapping("/eventList")
|
||||
@ApiOperation("暂降事件列表")
|
||||
@ApiImplicitParam(name = "largeScreenCountParam", value = "查询参数", required = true)
|
||||
public HttpResult<List<EventDetailVO>> eventList(@RequestBody LargeScreenCountParam largeScreenCountParam) {
|
||||
String methodDescribe = getMethodDescribe("eventTrend");
|
||||
List<EventDetailVO> result = largeScreenCountService.eventList(largeScreenCountParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.njcn.gather.event.devcie.mapper;
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevicedetail;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqDevicedetail;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsDeptsMapper extends BaseMapper<PqsDepts> {
|
||||
List<String> findDeptAndChildren(@Param("deptId") String deptId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsDeptslineMapper extends BaseMapper<PqsDeptsline> {
|
||||
}
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetailPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
|
||||
@Mapper
|
||||
public interface PqsEventdetailMapper extends MppBaseMapper<PqsEventdetailPO> {
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsEventdetailMapper extends BaseMapper<PqsEventdetail> {
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.njcn.gather.event.transientes.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.RmpEventDetailPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.event.devcie.mapper.PqDevicedetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqDevicedetail">
|
||||
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqDevicedetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqDevicedetail">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table PQ_DEVICEDETAIL-->
|
||||
<id column="DEV_INDEX" jdbcType="DECIMAL" property="devIndex" />
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsDeptsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqsDepts">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table PQS_DEPTS-->
|
||||
<id column="DEPTS_INDEX" jdbcType="VARCHAR" property="deptsIndex" />
|
||||
<result column="DEPTSNAME" jdbcType="VARCHAR" property="deptsname" />
|
||||
<result column="DEPTS_DESC" jdbcType="DECIMAL" property="deptsDesc" />
|
||||
<result column="USER_INDEX" jdbcType="VARCHAR" property="userIndex" />
|
||||
<result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
|
||||
<result column="DEPTS_DESCRIPTION" jdbcType="VARCHAR" property="deptsDescription" />
|
||||
<result column="STATE" jdbcType="DECIMAL" property="state" />
|
||||
<result column="AREA" jdbcType="VARCHAR" property="area" />
|
||||
<result column="CUSTOM_DEPT" jdbcType="DECIMAL" property="customDept" />
|
||||
<result column="PARENTNODEID" jdbcType="VARCHAR" property="parentnodeid" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
DEPTS_INDEX, DEPTSNAME, DEPTS_DESC, USER_INDEX, UPDATETIME, DEPTS_DESCRIPTION, "STATE",
|
||||
AREA, CUSTOM_DEPT, PARENTNODEID
|
||||
</sql>
|
||||
|
||||
<select id="findDeptAndChildren" resultType="java.lang.String">
|
||||
SELECT DEPTS_INDEX
|
||||
FROM PQS_DEPTS
|
||||
START WITH DEPTS_INDEX = #{deptId}
|
||||
CONNECT BY PRIOR DEPTS_INDEX = PARENTNODEID
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsDeptslineMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.event.devcie.pojo.po.PqsDeptsline">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table PQS_DEPTSLINE-->
|
||||
<result column="DEPTS_INDEX" jdbcType="VARCHAR" property="deptsIndex" />
|
||||
<result column="LINE_INDEX" jdbcType="DECIMAL" property="lineIndex" />
|
||||
<result column="SYSTYPE" jdbcType="VARCHAR" property="systype" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
DEPTS_INDEX, LINE_INDEX, SYSTYPE
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.gather.event.transientes.mapper.PqsEventdetailMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.gather.event.transientes.pojo.po.PqsEventdetail">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table PQS_EVENTDETAIL-->
|
||||
<id column="EVENTDETAIL_INDEX" jdbcType="VARCHAR" property="eventdetailIndex" />
|
||||
<result column="LINEID" jdbcType="DECIMAL" property="lineid" />
|
||||
<result column="TIMEID" jdbcType="TIMESTAMP" property="timeid" />
|
||||
<result column="MS" jdbcType="DECIMAL" property="ms" />
|
||||
<result column="DESCRIBE" jdbcType="VARCHAR" property="describe" />
|
||||
<result column="WAVETYPE" jdbcType="DECIMAL" property="wavetype" />
|
||||
<result column="PERSISTTIME" jdbcType="FLOAT" property="persisttime" />
|
||||
<result column="EVENTVALUE" jdbcType="FLOAT" property="eventvalue" />
|
||||
<result column="EVENTREASON" jdbcType="VARCHAR" property="eventreason" />
|
||||
<result column="EVENTTYPE" jdbcType="VARCHAR" property="eventtype" />
|
||||
<result column="EVENTASS_INDEX" jdbcType="VARCHAR" property="eventassIndex" />
|
||||
<result column="DQTIME" jdbcType="FLOAT" property="dqtime" />
|
||||
<result column="DEALTIME" jdbcType="TIMESTAMP" property="dealtime" />
|
||||
<result column="DEALFLAG" jdbcType="DECIMAL" property="dealflag" />
|
||||
<result column="NUM" jdbcType="DECIMAL" property="num" />
|
||||
<result column="FILEFLAG" jdbcType="DECIMAL" property="fileflag" />
|
||||
<result column="FIRSTTIME" jdbcType="TIMESTAMP" property="firsttime" />
|
||||
<result column="FIRSTTYPE" jdbcType="VARCHAR" property="firsttype" />
|
||||
<result column="FIRSTMS" jdbcType="DECIMAL" property="firstms" />
|
||||
<result column="WAVENAME" jdbcType="VARCHAR" property="wavename" />
|
||||
<result column="ENERGY" jdbcType="FLOAT" property="energy" />
|
||||
<result column="SEVERITY" jdbcType="FLOAT" property="severity" />
|
||||
<result column="LOOK_FLAG" jdbcType="DECIMAL" property="lookFlag" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
EVENTDETAIL_INDEX, LINEID, TIMEID, MS, "DESCRIBE", WAVETYPE, PERSISTTIME, EVENTVALUE,
|
||||
EVENTREASON, EVENTTYPE, EVENTASS_INDEX, DQTIME, DEALTIME, DEALFLAG, NUM, FILEFLAG,
|
||||
FIRSTTIME, FIRSTTYPE, FIRSTMS, WAVENAME, ENERGY, SEVERITY, LOOK_FLAG
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -1,44 +0,0 @@
|
||||
//package com.njcn.gather.event.mq.consumer;
|
||||
//
|
||||
//import com.njcn.message.messagedto.MessageDataDTO;
|
||||
//import com.njcn.middle.rocket.handler.EnhanceConsumerMessageHandler;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||
//import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * @Author: cdf
|
||||
// * @CreateTime: 2025-06-04
|
||||
// * @Description: 暂降消费者
|
||||
// */
|
||||
//@Component
|
||||
//@RocketMQMessageListener(
|
||||
// topic = "CC",
|
||||
// consumerGroup = "CC",
|
||||
// selectorExpression = "Test_Tag||Test_Keys",
|
||||
// consumeThreadNumber = 10,
|
||||
// enableMsgTrace = true
|
||||
//)
|
||||
//@Slf4j
|
||||
//public class EventConsumer extends EnhanceConsumerMessageHandler<MessageDataDTO> implements RocketMQListener<String> {
|
||||
// @Override
|
||||
// protected void handleMessage(MessageDataDTO message) throws Exception {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean isRetry() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected boolean throwException() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onMessage(String message) {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.gather.event.transientes.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:38【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class LargeScreenCountParam {
|
||||
@ApiModelProperty(name="deptId",value="部门id")
|
||||
private String deptId;
|
||||
@ApiModelProperty(name="type",value="类型(1年 2季度 3月份 4周 5日)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(name="eventtype",value="类型(0 暂降事件 1远程通知)")
|
||||
private Integer eventtype;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.gather.event.devcie.pojo.po;
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
/**
|
||||
* 部门表
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "PQS_DEPTS")
|
||||
public class PqsDepts {
|
||||
/**
|
||||
* 部门表Guid
|
||||
*/
|
||||
@TableId(value = "DEPTS_INDEX", type = IdType.INPUT)
|
||||
private String deptsIndex;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@TableField(value = "DEPTSNAME")
|
||||
private String deptsname;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "DEPTS_DESC")
|
||||
private Short deptsDesc;
|
||||
|
||||
/**
|
||||
* (关联表PQS_User)用户表Guid
|
||||
*/
|
||||
@TableField(value = "USER_INDEX")
|
||||
private String userIndex;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "UPDATETIME")
|
||||
private LocalDateTime updatetime;
|
||||
|
||||
/**
|
||||
* 部门描述
|
||||
*/
|
||||
@TableField(value = "DEPTS_DESCRIPTION")
|
||||
private String deptsDescription;
|
||||
|
||||
/**
|
||||
* 角色状态0:删除;1:正常;
|
||||
*/
|
||||
@TableField(value = "\"STATE\"")
|
||||
private Short state;
|
||||
|
||||
/**
|
||||
* 行政区域
|
||||
*/
|
||||
@TableField(value = "AREA")
|
||||
private String area;
|
||||
|
||||
@TableField(value = "CUSTOM_DEPT")
|
||||
private Short customDept;
|
||||
|
||||
@TableField(value = "PARENTNODEID")
|
||||
private String parentnodeid;
|
||||
}
|
||||
@@ -1,42 +1,43 @@
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2022/12/28 13:46【需求编号】
|
||||
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "PQS_EVENTDETAIL")
|
||||
public class PqsEventdetailPO {
|
||||
@MppMultiId(value = "EVENTDETAIL_INDEX")
|
||||
public class PqsEventdetail {
|
||||
@TableId(value = "EVENTDETAIL_INDEX", type = IdType.INPUT)
|
||||
private String eventdetailIndex;
|
||||
|
||||
@TableField(value = "LINEID")
|
||||
private BigDecimal lineid;
|
||||
|
||||
@TableField(value = "TIMEID")
|
||||
private Date timeid;
|
||||
private LocalDateTime timeid;
|
||||
|
||||
@TableField(value = "MS")
|
||||
private BigDecimal ms;
|
||||
|
||||
@TableField(value = "DESCRIBE")
|
||||
@TableField(value = "\"DESCRIBE\"")
|
||||
private String describe;
|
||||
|
||||
@TableField(value = "WAVETYPE")
|
||||
private Integer wavetype;
|
||||
private Short wavetype;
|
||||
|
||||
@TableField(value = "PERSISTTIME")
|
||||
private Double persisttime;
|
||||
@@ -57,19 +58,19 @@ public class PqsEventdetailPO {
|
||||
private Double dqtime;
|
||||
|
||||
@TableField(value = "DEALTIME")
|
||||
private Date dealtime;
|
||||
private LocalDateTime dealtime;
|
||||
|
||||
@TableField(value = "DEALFLAG")
|
||||
private Integer dealflag;
|
||||
private Short dealflag;
|
||||
|
||||
@TableField(value = "NUM")
|
||||
private BigDecimal num;
|
||||
|
||||
@TableField(value = "FILEFLAG")
|
||||
private Integer fileflag;
|
||||
private Short fileflag;
|
||||
|
||||
@TableField(value = "FIRSTTIME")
|
||||
private Date firsttime;
|
||||
private LocalDateTime firsttime;
|
||||
|
||||
@TableField(value = "FIRSTTYPE")
|
||||
private String firsttype;
|
||||
@@ -86,9 +87,11 @@ public class PqsEventdetailPO {
|
||||
@TableField(value = "SEVERITY")
|
||||
private Double severity;
|
||||
|
||||
/**
|
||||
* 暂降源与监测位置关系Upper:上游;Lower :下游;Unknown :未知;为空则是未计算
|
||||
*/
|
||||
@TableField(value = "SAGSOURCE")
|
||||
private String sagsource;
|
||||
@TableField(value = "LOOK_FLAG")
|
||||
private Integer lookFlag;
|
||||
|
||||
@TableField(value = "NOTICE_FLAG")
|
||||
private Integer noticeFlag;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
package com.njcn.gather.event.transientes.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 暂降明细实体类
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-10-12 18:34:55
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_mp_event_detail")
|
||||
@ApiModel(value="RmpEventDetail对象")
|
||||
public class RmpEventDetailPO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "暂时事件ID")
|
||||
@TableId(value = "event_id", type = IdType.ASSIGN_ID)
|
||||
private String eventId;
|
||||
|
||||
@ApiModelProperty(value = "监测点ID")
|
||||
private String measurementPointId;
|
||||
|
||||
@ApiModelProperty(value = "监测点ID(复制)")
|
||||
@TableField("measurement_point_id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(value = "统计类型")
|
||||
private String eventType;
|
||||
|
||||
@ApiModelProperty(value = "暂降原因(Event_Reason)")
|
||||
@TableField("advance_reason")
|
||||
private String advanceReason;
|
||||
|
||||
@ApiModelProperty(value = "暂降类型(Event_Type)")
|
||||
@TableField("advance_type")
|
||||
private String advanceType;
|
||||
|
||||
@ApiModelProperty(value = "事件关联分析表Guid")
|
||||
private String eventassIndex;
|
||||
|
||||
@ApiModelProperty(value = "dq计算持续时间 ")
|
||||
private Double dqTime;
|
||||
|
||||
@ApiModelProperty(value = "特征值计算更新时间(外键PQS_Relevance的Time字段)")
|
||||
private LocalDateTime dealTime;
|
||||
|
||||
@ApiModelProperty(value = "默认事件个数为0")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty(value = "波形文件是否从装置招到本地(0:未招,1:已招)默认值为0")
|
||||
private Integer fileFlag;
|
||||
|
||||
@ApiModelProperty(value = "特征值计算标志(0,未处理;1,已处理; 2,已处理,无结果;3,计算失败)默认值为0")
|
||||
private Integer dealFlag;
|
||||
|
||||
@ApiModelProperty(value = "处理结果第一条事件发生时间(读comtra文件获取)")
|
||||
private LocalDateTime firstTime;
|
||||
|
||||
@ApiModelProperty(value = "处理结果第一条事件暂降类型(字典表PQS_Dicdata)")
|
||||
private String firstType;
|
||||
|
||||
@ApiModelProperty(value = "处理结果第一条事件发生时间毫秒(读comtra文件获取)")
|
||||
private Double firstMs;
|
||||
|
||||
@ApiModelProperty(value = "暂降能量")
|
||||
private Double energy;
|
||||
|
||||
@ApiModelProperty(value = "暂降严重度")
|
||||
private Double severity;
|
||||
|
||||
@ApiModelProperty(value = "暂降源与监测位置关系 Upper:上游;Lower :下游;Unknown :未知;为空则是未计算")
|
||||
private String sagsource;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "格式化开始时间")
|
||||
@TableField(exist = false)
|
||||
private String formatTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "持续时间,单位秒")
|
||||
private Double duration;
|
||||
|
||||
@ApiModelProperty(value = "特征幅值")
|
||||
private Double featureAmplitude;
|
||||
|
||||
@ApiModelProperty(value = "相别")
|
||||
private String phase;
|
||||
|
||||
@ApiModelProperty(value = "事件描述")
|
||||
private String eventDescribe;
|
||||
|
||||
@ApiModelProperty(value = "波形路径")
|
||||
private String wavePath;
|
||||
|
||||
@ApiModelProperty(value = "暂降核实原因")
|
||||
@TableField("verify_reason")
|
||||
private String verifyReason;
|
||||
|
||||
@ApiModelProperty(value = "暂降核实原因详情")
|
||||
@TableField("verify_reason_detail")
|
||||
private String verifyReasonDetail;
|
||||
|
||||
private Double transientValue;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "用于计算数量")
|
||||
@TableField(exist = false)
|
||||
private Integer count;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/20 上午 9:29【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AlarmAnalysisVO {
|
||||
private Integer eventCount;
|
||||
private Integer aLarmCount;
|
||||
private Integer warnCount;
|
||||
private Integer noticeCount;
|
||||
private Integer lookALarmCount;
|
||||
private Integer lookWarnCount;
|
||||
private Integer lookNoticeCount;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/20 下午 2:50【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class EventDetailVO {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/20 上午 11:33【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class EventTrendVO {
|
||||
private LocalDate localDate;
|
||||
private Integer eventCount;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.gather.event.transientes.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class LedgerCountVO {
|
||||
|
||||
private long allSubCount;
|
||||
private long allDevCount;
|
||||
private long allLineCount;
|
||||
private long runDevCount;
|
||||
private long runSubCount;
|
||||
private long runLineCount;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:05【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface LargeScreenCountService {
|
||||
LedgerCountVO scaleStatistics(LargeScreenCountParam largeScreenCountParam);
|
||||
|
||||
AlarmAnalysisVO alarmAnalysis(LargeScreenCountParam largeScreenCountParam);
|
||||
|
||||
List<EventTrendVO> eventTrend(LargeScreenCountParam largeScreenCountParam);
|
||||
|
||||
List<EventDetailVO> eventList(LargeScreenCountParam largeScreenCountParam);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.njcn.gather.event.devcie.service;
|
||||
package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevicedetail;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqDevicedetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsDeptsService extends IService<PqsDepts>{
|
||||
|
||||
|
||||
List<String> findDeptAndChildren(@Param("deptId") String deptId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.gather.event.transientes.service;
|
||||
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqsEventdetailService extends IService<PqsEventdetail>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.gather.event.transientes.pojo.param.LargeScreenCountParam;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevice;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqLine;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqsDeptsline;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.AlarmAnalysisVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventDetailVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.EventTrendVO;
|
||||
import com.njcn.gather.event.transientes.pojo.vo.LedgerCountVO;
|
||||
import com.njcn.gather.event.devcie.service.*;
|
||||
import com.njcn.gather.event.transientes.service.LargeScreenCountService;
|
||||
import com.njcn.gather.event.transientes.service.PqsDeptsService;
|
||||
import com.njcn.gather.event.devcie.service.PqsDeptslineService;
|
||||
import com.njcn.gather.event.transientes.service.PqsEventdetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LargeScreenCountServiceImpl implements LargeScreenCountService {
|
||||
|
||||
private final PqsDeptslineService pqsDeptslineService;
|
||||
private final PqsDeptsService pqsDeptsService;
|
||||
private final PqLineService pqLineService;
|
||||
private final PqDeviceService pqDeviceService;
|
||||
private final PqsEventdetailService pqsEventdetailService;
|
||||
@Value("${SYS_TYPE_ZT}")
|
||||
private String sysTypeZt;
|
||||
@Override
|
||||
public LedgerCountVO scaleStatistics(LargeScreenCountParam largeScreenCountParam) {
|
||||
LedgerCountVO ledgerCountVO = new LedgerCountVO();
|
||||
//根据用户获取当前部门及子部门id
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren( largeScreenCountParam.getDeptId());
|
||||
//获取对应监测点id
|
||||
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());
|
||||
List<PqLine> pqLineList = pqLineService.lambdaQuery().in(PqLine::getLineIndex, deptslineIds).list();
|
||||
//统计总数
|
||||
long allSubCount = pqLineList.stream().map(PqLine::getSubIndex).distinct().count();
|
||||
List<Integer> devList = pqLineList.stream().map(PqLine::getDevIndex).distinct().collect(Collectors.toList());
|
||||
long allDevCount = devList.stream().count();
|
||||
|
||||
long allLineCount = pqLineList.stream().map(PqLine::getLineIndex).distinct().count();
|
||||
//在运总数
|
||||
List<PqDevice> list = pqDeviceService.lambdaQuery().in(PqDevice::getDevIndex, devList).eq(PqDevice::getDevflag, 0).list();
|
||||
List<Integer> runDevList = list.stream().map(PqDevice::getDevIndex).collect(Collectors.toList());
|
||||
long runDevCount = runDevList.stream().count();
|
||||
long runSubCount = list.stream().map(PqDevice::getSubIndex).distinct().count();
|
||||
List<PqLine> runLineList = pqLineService.lambdaQuery().in(PqLine::getDevIndex, runDevList).list();
|
||||
long runLineCount = runLineList.stream().count();
|
||||
|
||||
ledgerCountVO.setAllSubCount(allSubCount);
|
||||
ledgerCountVO.setAllDevCount(allDevCount);
|
||||
ledgerCountVO.setAllLineCount(allLineCount);
|
||||
ledgerCountVO.setRunDevCount(runDevCount);
|
||||
ledgerCountVO.setRunSubCount(runSubCount);
|
||||
ledgerCountVO.setRunLineCount(runLineCount);
|
||||
|
||||
|
||||
return ledgerCountVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlarmAnalysisVO alarmAnalysis(LargeScreenCountParam largeScreenCountParam) {
|
||||
AlarmAnalysisVO alarmAnalysisVO = new AlarmAnalysisVO();
|
||||
//起始时间
|
||||
String startTime = DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
//结束时间
|
||||
String endTime = DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
//根据用户获取当前部门及子部门id
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren( largeScreenCountParam.getDeptId());
|
||||
//获取对应监测点id
|
||||
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());
|
||||
List<PqsEventdetail> eventdetails = pqsEventdetailService.lambdaQuery().between(PqsEventdetail::getTimeid, startTime, endTime).in(PqsEventdetail::getLineid,deptslineIds).list();
|
||||
Integer eventCount = eventdetails.size();
|
||||
// 告警
|
||||
List<PqsEventdetail> aLarmEvent = eventdetails.stream().filter(temp -> temp.getEventvalue() < 0.5).collect(Collectors.toList());
|
||||
// 预警
|
||||
List<PqsEventdetail> warnEvent = eventdetails.stream().filter(temp -> temp.getEventvalue() >= 0.5&& temp.getEventvalue() <0.9).collect(Collectors.toList());
|
||||
List<PqsEventdetail> noticeEvent = eventdetails.stream().filter(temp -> temp.getNoticeFlag()==1).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<PqsEventdetail> lookALarmEvent = aLarmEvent.stream().filter(temp -> temp.getLookFlag() == 1).collect(Collectors.toList());
|
||||
List<PqsEventdetail> lookWarnEvent = warnEvent.stream().filter(temp -> temp.getLookFlag() == 1).collect(Collectors.toList());
|
||||
List<PqsEventdetail> lookNoticeEvent = noticeEvent.stream().filter(temp -> temp.getLookFlag() == 1).collect(Collectors.toList());
|
||||
|
||||
Integer aLarmCount =aLarmEvent.size();
|
||||
Integer warnCount =warnEvent.size();
|
||||
Integer noticeCount =noticeEvent.size();
|
||||
Integer lookALarmCount =lookALarmEvent.size();
|
||||
Integer lookWarnCount =lookWarnEvent.size();
|
||||
Integer lookNoticeCount =lookNoticeEvent.size();
|
||||
|
||||
alarmAnalysisVO.setEventCount(eventCount);
|
||||
alarmAnalysisVO.setALarmCount(aLarmCount);
|
||||
alarmAnalysisVO.setWarnCount(warnCount);
|
||||
alarmAnalysisVO.setNoticeCount(noticeCount);
|
||||
alarmAnalysisVO.setLookALarmCount(lookALarmCount);
|
||||
alarmAnalysisVO.setLookWarnCount(lookWarnCount);
|
||||
alarmAnalysisVO.setLookNoticeCount(lookNoticeCount);
|
||||
|
||||
|
||||
return alarmAnalysisVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventTrendVO> eventTrend(LargeScreenCountParam largeScreenCountParam) {
|
||||
List<EventTrendVO> eventTrendVOList = new ArrayList<>();
|
||||
//起始时间
|
||||
String startTime;
|
||||
//结束时间
|
||||
String endTime;
|
||||
if(largeScreenCountParam.getType()==3){
|
||||
//起始时间
|
||||
startTime = DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
//结束时间
|
||||
endTime = DateUtil.format(DateUtil.endOfMonth(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
}else if(largeScreenCountParam.getType()==4){
|
||||
//起始时间
|
||||
startTime = DateUtil.format(DateUtil.beginOfWeek(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
//结束时间
|
||||
endTime = DateUtil.format(DateUtil.endOfWeek(new Date()), DatePattern.NORM_DATE_PATTERN);
|
||||
}else {
|
||||
throw new BusinessException("统计类型有误类型");
|
||||
}
|
||||
List<String> deptAndChildren = pqsDeptsService.findDeptAndChildren( largeScreenCountParam.getDeptId());
|
||||
//获取对应监测点id
|
||||
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());
|
||||
List<PqsEventdetail> eventdetails = pqsEventdetailService.lambdaQuery()
|
||||
.between(PqsEventdetail::getTimeid, startTime, endTime)
|
||||
.in(PqsEventdetail::getLineid,deptslineIds)
|
||||
.eq(PqsEventdetail::getLookFlag,largeScreenCountParam.getEventtype()).list();
|
||||
LocalDate startDate = LocalDate.parse(startTime, DatePattern.NORM_DATE_FORMATTER);
|
||||
LocalDate endDate = LocalDate.parse(endTime, DatePattern.NORM_DATE_FORMATTER);
|
||||
|
||||
List<String> dateList = new ArrayList<>();
|
||||
|
||||
// 使用 for 循环处理日期范围
|
||||
for (LocalDate date = startDate; !date.isAfter(endDate); date = date.plusDays(1)) {
|
||||
EventTrendVO eventTrendVO = new EventTrendVO();
|
||||
eventTrendVO.setLocalDate(date);
|
||||
LocalDate finalDate = date;
|
||||
List<PqsEventdetail> collect = eventdetails.stream().filter(temp -> Objects.equals(DateUtil.format(temp.getTimeid(), DatePattern.NORM_DATE_PATTERN), DateUtil.format(finalDate.atStartOfDay(), DatePattern.NORM_DATE_PATTERN))).collect(Collectors.toList());
|
||||
eventTrendVO.setEventCount(collect.size());
|
||||
eventTrendVOList.add(eventTrendVO);
|
||||
}
|
||||
return eventTrendVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventDetailVO> eventList(LargeScreenCountParam largeScreenCountParam) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.njcn.gather.event.devcie.service.impl;
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.devcie.pojo.po.PqDevicedetail;
|
||||
import com.njcn.gather.event.devcie.mapper.PqDevicedetailMapper;
|
||||
import com.njcn.gather.event.devcie.service.PqDevicedetailService;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqDevicedetail;
|
||||
import com.njcn.gather.event.transientes.mapper.PqDevicedetailMapper;
|
||||
import com.njcn.gather.event.transientes.service.PqDevicedetailService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.mapper.PqsDeptsMapper;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsDepts;
|
||||
import com.njcn.gather.event.transientes.service.PqsDeptsService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/19 下午 3:57【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class PqsDeptsServiceImpl extends ServiceImpl<PqsDeptsMapper, PqsDepts> implements PqsDeptsService{
|
||||
|
||||
@Override
|
||||
public List<String> findDeptAndChildren(String deptId) {
|
||||
return this.getBaseMapper().findDeptAndChildren(deptId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.gather.event.transientes.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.gather.event.transientes.pojo.po.PqsEventdetail;
|
||||
import com.njcn.gather.event.transientes.mapper.PqsEventdetailMapper;
|
||||
import com.njcn.gather.event.transientes.service.PqsEventdetailService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/06/20 上午 10:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class PqsEventdetailServiceImpl extends ServiceImpl<PqsEventdetailMapper, PqsEventdetail> implements PqsEventdetailService{
|
||||
|
||||
}
|
||||
@@ -31,11 +31,11 @@ spring:
|
||||
username: pqsadmin_bj
|
||||
password: pqsadmin
|
||||
driver-class-name: oracle.jdbc.driver.OracleDriver
|
||||
salve:
|
||||
driver-class-name: dm.jdbc.driver.DmDriver
|
||||
url: jdbc:dm://192.168.1.21:5236/PQSADMIN?useUnicode=true&characterEncoding=utf-8
|
||||
username: PQSADMINLN
|
||||
password: Pqsadmin123
|
||||
# salve:
|
||||
# driver-class-name: dm.jdbc.driver.DmDriver
|
||||
# url: jdbc:dm://192.168.1.21:5236/PQSADMIN?useUnicode=true&characterEncoding=utf-8
|
||||
# username: PQSADMINLN
|
||||
# password: Pqsadmin123
|
||||
|
||||
#mybatis配置信息
|
||||
mybatis-plus:
|
||||
@@ -55,6 +55,8 @@ mybatis-plus:
|
||||
id-type: assign_uuid
|
||||
|
||||
|
||||
SYS_TYPE_ZT: 1cfcd6e2-c5fe-4b15-988a-32b90f1170c1
|
||||
SYS_TYPE_WT: 983f9dfe-4f9a-4c96-89d8-7d425a1f1d6c
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user