辽宁前置接口开发
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 15:07【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class DevComFlagDTO {
|
||||
|
||||
private String id;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime date;
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/4 21:01【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class DeviceInfo {
|
||||
//终端索引
|
||||
private String id;
|
||||
//终端ip
|
||||
private String ip;
|
||||
//终端型号
|
||||
private String devType;
|
||||
//挂载单位
|
||||
private String org_name;
|
||||
//组织名称
|
||||
private String port;
|
||||
//终端端口
|
||||
private String stationName;
|
||||
//变电站名
|
||||
private String name;
|
||||
//终端序列号
|
||||
private String updateTime;
|
||||
//数据更新时间
|
||||
private String manufacturer;
|
||||
//终端厂商
|
||||
private String status;
|
||||
//终端状态
|
||||
private String series;
|
||||
//终端识别码
|
||||
private String devKey;
|
||||
//
|
||||
private List<MonitorInfo> monitorData;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 10:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class MonitorInfo {
|
||||
//监测点索引
|
||||
private String id;
|
||||
//名称
|
||||
private String name;
|
||||
//监测点逻辑号
|
||||
private String lineNo;
|
||||
//监测点电压等级
|
||||
private String voltageLevel;
|
||||
//监测点接线方式
|
||||
private String ptType;
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/4/17
|
||||
*/
|
||||
@Data
|
||||
public class MonitorIntegrityDTO {
|
||||
|
||||
@ApiModelProperty("监测点号")
|
||||
private String id;
|
||||
@ApiModelProperty("统计日期")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
@ApiModelProperty("时间点数据")
|
||||
private Integer times;
|
||||
@ApiModelProperty("统计间隔")
|
||||
private Integer interval;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:34【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class PqIcdPathDTO {
|
||||
//模型索引
|
||||
private String id;
|
||||
//更新时间
|
||||
private String updateTime;
|
||||
//icd文件名
|
||||
private String fileName;
|
||||
//icd文件存储的地址
|
||||
private String filePath;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class NodeDeviceParam {
|
||||
|
||||
|
||||
/**
|
||||
* 服务器IP
|
||||
*/
|
||||
|
||||
private String ip;
|
||||
|
||||
private List<Integer> runFlag;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.device.pq.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.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "pq_icd_path")
|
||||
public class PqIcdPath {
|
||||
/**
|
||||
* 装置类型GUID
|
||||
*/
|
||||
@TableId(value = "ID", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 装置类型名称
|
||||
*/
|
||||
@TableField(value = "`Name`")
|
||||
private String name;
|
||||
|
||||
@TableField(value = "`Path`")
|
||||
private String path;
|
||||
|
||||
|
||||
|
||||
@TableField(value = "Update_Time")
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@ApiModel
|
||||
public class LineDetailDataVO {
|
||||
private String lineId;
|
||||
@ApiModelProperty(name = "id",value = "监测点序号")
|
||||
private Integer id;
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
import com.njcn.device.pq.pojo.param.ConstantValueParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -176,4 +178,13 @@ public class DeviceController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/updateDevComFlag")
|
||||
@ApiOperation("修改装置通讯状态")
|
||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorIntegrityDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
@@ -128,4 +129,18 @@ public class LineIntegrityDataController extends BaseController {
|
||||
List<LineDataQualityDTO> result = irStatIntegrityDService.getLineDataQuality(lineDataQualityParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,result,methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前置推送完整性记录数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/saveOrUpdateData")
|
||||
@ApiOperation("完整性数据录入")
|
||||
@ApiImplicitParam(name = "monitorIntegrityDTOList", value = "参数实体", required = true)
|
||||
public HttpResult<Boolean> saveOrUpdateData(@RequestBody List<MonitorIntegrityDTO> monitorIntegrityDTOList) {
|
||||
String methodDescribe = getMethodDescribe("saveOrUpdateData");
|
||||
Boolean flag = irStatIntegrityDService.saveOrUpdateData(monitorIntegrityDTOList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,flag,methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
|
||||
import com.njcn.device.pq.service.NodeDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "前置机终端管理")
|
||||
@RestController
|
||||
@RequestMapping("nodeDevice")
|
||||
@RequiredArgsConstructor
|
||||
public class NodeDeviceController extends BaseController {
|
||||
|
||||
private final NodeDeviceService nodeDeviceService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据前置ip获取对应的终端台账信息
|
||||
* @author cdf
|
||||
* @date 2021/6/23
|
||||
*/
|
||||
@ApiOperation("根据前置ip获取对应的终端台账信息")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("nodeDeviceList")
|
||||
public HttpResult<List<DeviceInfo>> nodeDeviceList(@RequestBody NodeDeviceParam nodeDeviceParam){
|
||||
String methodDescribe = getMethodDescribe("nodeDeviceList");
|
||||
List<DeviceInfo> list = nodeDeviceService.nodeDeviceList(nodeDeviceParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.PqIcdPathDTO;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.pojo.po.PqIcdPath;
|
||||
import com.njcn.device.pq.service.NodeDeviceService;
|
||||
import com.njcn.device.pq.service.PqIcdPathService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 前置程序控制器
|
||||
* @author cdf
|
||||
* @since 2022-01-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "icd模型管理")
|
||||
@RestController
|
||||
@RequestMapping("icd")
|
||||
@RequiredArgsConstructor
|
||||
public class PqIcdPathController extends BaseController {
|
||||
|
||||
private final PqIcdPathService pqIcdPathService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据终端模型获取icd模型,如果模型为空则获取全部icd模型
|
||||
3
|
||||
*/
|
||||
@ApiOperation("获取icd模型")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("icdPathList")
|
||||
public HttpResult<List<PqIcdPathDTO>> icdPathList(@RequestBody List<String> devType){
|
||||
String methodDescribe = getMethodDescribe("icdPathList");
|
||||
List<PqIcdPath> list = pqIcdPathService.lambdaQuery().in(!CollectionUtils.isEmpty(devType), PqIcdPath::getName, devType).list();
|
||||
|
||||
List<PqIcdPathDTO> result = list.stream().map(temp -> {
|
||||
PqIcdPathDTO pqIcdPathDTO = new PqIcdPathDTO();
|
||||
pqIcdPathDTO.setId(temp.getId());
|
||||
pqIcdPathDTO.setUpdateTime(LocalDateTimeUtil.format(temp.getUpdateTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
pqIcdPathDTO.setFileName(temp.getPath().substring(temp.getPath().lastIndexOf('/') + 1));
|
||||
pqIcdPathDTO.setFilePath(temp.getPath());
|
||||
|
||||
return pqIcdPathDTO;
|
||||
}).collect(Collectors.toList());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.njcn.device.pq.pojo.advanced.UpDevVO;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.dto.OverLimitLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.WarningSubstationDTO;
|
||||
@@ -20,7 +21,6 @@ import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.web.pojo.vo.LineDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -568,4 +568,5 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
List<LineDetail> selectByName(@Param("param") LineBaseQueryParam param);
|
||||
|
||||
List<MonitorInfo> getLineByDeviceId(@Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,12 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -14,4 +19,5 @@ import com.njcn.device.pq.pojo.po.Node;
|
||||
*/
|
||||
public interface NodeMapper extends BaseMapper<Node> {
|
||||
|
||||
List<DeviceInfo> nodeDeviceList(@Param("nodeDeviceParam") NodeDeviceParam nodeDeviceParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.PqIcdPath;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqIcdPathMapper extends BaseMapper<PqIcdPath> {
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.LineDataIntegrity;
|
||||
@@ -19,7 +20,7 @@ import java.util.List;
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface RStatIntegrityDMapper extends BaseMapper<RStatIntegrityD> {
|
||||
public interface RStatIntegrityDMapper extends MppBaseMapper<RStatIntegrityD> {
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
<select id="getLineDetailInfo" resultType="com.njcn.device.pq.pojo.vo.LineDetailDataVO">
|
||||
select
|
||||
c.id lineId,
|
||||
a.name lineName,
|
||||
c.Time_Interval,
|
||||
e.name scale,
|
||||
|
||||
@@ -1795,4 +1795,21 @@
|
||||
AND
|
||||
t2.scale = #{scale}
|
||||
</select>
|
||||
|
||||
<select id="getLineByDeviceId" resultType="com.njcn.device.pq.pojo.dto.MonitorInfo">
|
||||
SELECT
|
||||
pq_line_detail.id id,
|
||||
line.`Name` name,
|
||||
pq_line_detail.Num lineNo,
|
||||
s1.`Name` voltageLevel,
|
||||
pq_line_detail.PT_Phase_Type ptType,
|
||||
pq_line_detail.Run_Flag status
|
||||
FROM
|
||||
pq_line_detail
|
||||
LEFT JOIN pq_line line ON pq_line_detail.Id = line.Id
|
||||
INNER JOIN pq_line voltage on voltage.id = line.Pid
|
||||
LEFT JOIN pq_voltage ON pq_voltage.id =voltage.id
|
||||
LEFT JOIN sys_dict_data s1 ON pq_voltage.Scale = s1.id
|
||||
WHERE voltage.Pid = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,4 +2,35 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.NodeMapper">
|
||||
|
||||
|
||||
<select id="nodeDeviceList" resultType="com.njcn.device.pq.pojo.dto.DeviceInfo">
|
||||
SELECT
|
||||
pq_device.Id id,
|
||||
pq_device.IP ip,
|
||||
s1.`Name` devType,
|
||||
pq_device.`Port` port,
|
||||
pq_line.`Name` name,
|
||||
pq_device.Update_Time updateTime,
|
||||
s2.`Name` manufacturer,
|
||||
pq_device.Com_Flag status,
|
||||
pq_device.Series series,
|
||||
pq_device.Dev_Key devKey
|
||||
FROM
|
||||
pq_node
|
||||
LEFT JOIN pq_device ON pq_node.Id = pq_device.Node_Id
|
||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||
LEFT JOIN sys_dict_data s1 ON pq_device.Dev_Type = s1.id
|
||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||
<where>
|
||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||
pq_node.ip=#{nodeDeviceParam.ip}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||
AND pq_device.Run_Flag in
|
||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.device.pq.mapper.PqIcdPathMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.PqIcdPath">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pq_icd_path-->
|
||||
<id column="ID" jdbcType="CHAR" property="id" />
|
||||
<result column="Name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="Path" jdbcType="VARCHAR" property="path" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
ID, `Name`, `Path`, Update_Time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -2,7 +2,9 @@ package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorIntegrityDTO;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
@@ -17,7 +19,7 @@ import java.util.List;
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface IRStatIntegrityDService extends IService<RStatIntegrityD> {
|
||||
public interface IRStatIntegrityDService extends IMppService<RStatIntegrityD> {
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
@@ -29,4 +31,6 @@ public interface IRStatIntegrityDService extends IService<RStatIntegrityD> {
|
||||
|
||||
|
||||
List<LineDataQualityDTO> getLineDataQuality(LineDataQualityParam lineDataQualityParam);
|
||||
|
||||
Boolean saveOrUpdateData(List<MonitorIntegrityDTO> monitorIntegrityDTOList);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 8:51【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
public interface NodeDeviceService {
|
||||
List<DeviceInfo> nodeDeviceList(NodeDeviceParam nodeDeviceParam);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.PqIcdPath;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqIcdPathService extends IService<PqIcdPath>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.service.NodeDeviceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/11/5 8:52【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class NodeDeviceServiceImpl implements NodeDeviceService {
|
||||
private final NodeMapper nodeMapper;
|
||||
private final LineMapper lineMapper;
|
||||
@Override
|
||||
public List<DeviceInfo> nodeDeviceList(NodeDeviceParam nodeDeviceParam) {
|
||||
|
||||
List<DeviceInfo> list = nodeMapper.nodeDeviceList(nodeDeviceParam);
|
||||
list.forEach(temp->{
|
||||
List<MonitorInfo> monitorInfoList= lineMapper.getLineByDeviceId(temp.getId());
|
||||
temp.setMonitorData(monitorInfoList);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.device.pq.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.device.pq.pojo.po.PqIcdPath;
|
||||
import com.njcn.device.pq.mapper.PqIcdPathMapper;
|
||||
import com.njcn.device.pq.service.PqIcdPathService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2024/11/5 11:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath> implements PqIcdPathService{
|
||||
|
||||
}
|
||||
@@ -7,18 +7,23 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorIntegrityDTO;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -36,13 +41,14 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class RStatIntegrityDServiceImpl extends ServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||
public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||
|
||||
private final RStatOnlinerateDMapper onlineRateMapper;
|
||||
|
||||
private final RStatIntegrityDMapper rStatIntegrityDMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
@Override
|
||||
public Float getTotalIntegrityByLineIds(LineBaseQueryParam param) {
|
||||
@@ -100,4 +106,23 @@ public class RStatIntegrityDServiceImpl extends ServiceImpl<RStatIntegrityDMappe
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean saveOrUpdateData(List<MonitorIntegrityDTO> monitorIntegrityDTOList) {
|
||||
List<String> lineIds = monitorIntegrityDTOList.stream().map(MonitorIntegrityDTO::getId).distinct().collect(Collectors.toList());
|
||||
List<LineDetailDataVO> lineDetailInfo = lineDetailMapper.getLineDetailInfo(lineIds);
|
||||
Map<String, Integer> collect = lineDetailInfo.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, LineDetailDataVO::getTimeInterval));
|
||||
List<RStatIntegrityD> collect1 = monitorIntegrityDTOList.stream().map(temp -> {
|
||||
RStatIntegrityD rStatIntegrityD = new RStatIntegrityD();
|
||||
rStatIntegrityD.setTimeId(temp.getDate());
|
||||
rStatIntegrityD.setLineIndex(temp.getId());
|
||||
rStatIntegrityD.setDueTime(24 * 60 / collect.get(temp.getId()));
|
||||
rStatIntegrityD.setRealTime(temp.getTimes());
|
||||
|
||||
return rStatIntegrityD;
|
||||
}).collect(Collectors.toList());
|
||||
this.saveOrUpdateBatchByMultiId(collect1,200);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user