1.灿能云接口移植,实时数据接口代码调整
This commit is contained in:
@@ -3,6 +3,7 @@ package com.njcn.cloud.pojo.dto;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -39,6 +40,11 @@ public class AppEventMsg {
|
|||||||
@TableField("EventDetail_Index")
|
@TableField("EventDetail_Index")
|
||||||
private String eventdetailIndex;
|
private String eventdetailIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty("触发时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@TableField("Time_Id")
|
||||||
|
private LocalDateTime timeID;
|
||||||
|
|
||||||
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
@ApiModelProperty("读取状态(0:未读,1:已读,2:删除)")
|
||||||
@TableField("state")
|
@TableField("state")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@TableName("app_info_set")
|
@TableName("app_info_set")
|
||||||
@ApiModel(value = "AppInfoSet对象", description = "推送消息设置")
|
@ApiModel(value = "AppInfoSet对象", description = "推送消息设置")
|
||||||
public class AppInfoSet extends BaseEntity {
|
public class AppInfoSet {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.cloud.pojo.vo;
|
package com.njcn.cloud.pojo.vo;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -9,7 +10,6 @@ import java.io.Serializable;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -20,6 +20,15 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class DevMsgDetailInfo implements Serializable {
|
public class DevMsgDetailInfo implements Serializable {
|
||||||
|
@ApiModelProperty("未读条数")
|
||||||
|
Integer unstate;
|
||||||
|
@ApiModelProperty("终端信息")
|
||||||
|
Page<DevMsgDetailInfo.Unstate> page;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Unstate implements Serializable {
|
||||||
|
@ApiModelProperty("终端消息列表Guid")
|
||||||
|
private String devmsgIndex;
|
||||||
|
|
||||||
@ApiModelProperty("终端消息id")
|
@ApiModelProperty("终端消息id")
|
||||||
private String topId;
|
private String topId;
|
||||||
@@ -63,6 +72,7 @@ public class DevMsgDetailInfo implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("读取状态")
|
@ApiModelProperty("读取状态")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
public void setComoutDesc(String comoutDesc) {
|
public void setComoutDesc(String comoutDesc) {
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if (StrUtil.isNotBlank(comoutDesc)) {
|
if (StrUtil.isNotBlank(comoutDesc)) {
|
||||||
@@ -81,3 +91,4 @@ public class DevMsgDetailInfo implements Serializable {
|
|||||||
this.alarmDesc = collect;
|
this.alarmDesc = collect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.cloud.pojo.vo;
|
package com.njcn.cloud.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -16,7 +17,14 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class EventMsgDetailVO implements Serializable {
|
public class EventMsgDetailVO implements Serializable {
|
||||||
|
@ApiModelProperty("未读条数")
|
||||||
|
private Integer udState;
|
||||||
|
|
||||||
|
@ApiModelProperty("消息返回体")
|
||||||
|
private Page<udState> page;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class udState implements Serializable {
|
||||||
@ApiModelProperty("监测点Id")
|
@ApiModelProperty("监测点Id")
|
||||||
private String lineIndex;
|
private String lineIndex;
|
||||||
|
|
||||||
@@ -39,14 +47,14 @@ public class EventMsgDetailVO implements Serializable {
|
|||||||
@ApiModelProperty("特征幅值")
|
@ApiModelProperty("特征幅值")
|
||||||
private Double eventValue;
|
private Double eventValue;
|
||||||
|
|
||||||
@ApiModelProperty("终端信息")
|
@ApiModelProperty("监测点信息")
|
||||||
private String lineInfo;
|
private String lineInfo;
|
||||||
|
|
||||||
@ApiModelProperty("暂态消息")
|
@ApiModelProperty("暂态消息Guid")
|
||||||
private String eventMsgIndex;
|
private String eventMsgIndex;
|
||||||
|
|
||||||
@ApiModelProperty("读取状态")
|
@ApiModelProperty("读取状态")
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@ import org.springframework.boot.SpringApplication;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.DependsOn;
|
import org.springframework.context.annotation.DependsOn;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -13,6 +15,7 @@ import org.springframework.context.annotation.DependsOn;
|
|||||||
@EnableFeignClients(basePackages = "com.njcn")
|
@EnableFeignClients(basePackages = "com.njcn")
|
||||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||||
@DependsOn("proxyMapperRegister")
|
@DependsOn("proxyMapperRegister")
|
||||||
|
@EnableScheduling
|
||||||
public class AppCloudBootApplication {
|
public class AppCloudBootApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.cloud.controller.RealTimeInfo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.cloud.enums.app.UserCodeEnum;
|
||||||
|
import com.njcn.cloud.service.user.RealTimeInfoService;
|
||||||
|
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.vo.LineDetailVO;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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: 实时数据列表
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/22 15:38
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/realtimeinfo")
|
||||||
|
@Api(tags = "实时数据接口")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RealTimeInfoController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
private final RealTimeInfoService realTimeInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/getLineBaseInfo")
|
||||||
|
@ApiOperation(value = "监测点信息接口", notes = "监测点信息")
|
||||||
|
public HttpResult<List<LineDetailVO.Detail>> getLineBaseInfo(@RequestBody List<String> lineId) {
|
||||||
|
String methodDescribe = getMethodDescribe("getLineBaseInfo");
|
||||||
|
List<LineDetailVO.Detail> lineBaseInfo1 = realTimeInfoService.getLineBaseInfo(lineId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineBaseInfo1, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -57,13 +57,13 @@ public class DevMsgController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/deviceList")
|
@PostMapping("/deviceList")
|
||||||
@ApiOperation(value = "终端列表入口", notes = "终端列表")
|
@ApiOperation(value = "终端列表入口", notes = "终端列表")
|
||||||
public HttpResult<Page<DevMsgDetailInfo>> deviceList(@RequestBody BaseParam param) {
|
public HttpResult<DevMsgDetailInfo> deviceList(@RequestBody BaseParam param) {
|
||||||
String methodDescribe = getMethodDescribe("deviceList");
|
String methodDescribe = getMethodDescribe("deviceList");
|
||||||
if (StrUtil.isBlank(param.getSearchValue())) {
|
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||||
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||||
}
|
}
|
||||||
Page<DevMsgDetailInfo> page = devMsgService.deviceList(param);
|
DevMsgDetailInfo devMsgDetailInfo = devMsgService.deviceList(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, devMsgDetailInfo, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +80,7 @@ public class DevMsgController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 终端通讯状态统计
|
* 终端通讯状态统计
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getDevComTJ")
|
@PostMapping("/devComTJ")
|
||||||
@ApiOperation(value = "终端通讯状态统计", notes = "终端通讯状态统计")
|
@ApiOperation(value = "终端通讯状态统计", notes = "终端通讯状态统计")
|
||||||
public HttpResult<DevComTJ> getDevComTJ(String deptId) {
|
public HttpResult<DevComTJ> getDevComTJ(String deptId) {
|
||||||
String methodDescribe = getMethodDescribe("getDevComTJ");
|
String methodDescribe = getMethodDescribe("getDevComTJ");
|
||||||
@@ -91,7 +91,7 @@ public class DevMsgController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 终端通讯信息
|
* 终端通讯信息
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getDevComInfo")
|
@PostMapping("/devComInfo")
|
||||||
@ApiOperation(value = "终端通讯信息", notes = "终端通讯信息")
|
@ApiOperation(value = "终端通讯信息", notes = "终端通讯信息")
|
||||||
public HttpResult<List<DevDetail>> getDevComInfo(String deptId) {
|
public HttpResult<List<DevDetail>> getDevComInfo(String deptId) {
|
||||||
String methodDescribe = getMethodDescribe("getDevComInfo");
|
String methodDescribe = getMethodDescribe("getDevComInfo");
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ public class EventMsgController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/eventDetailList")
|
@PostMapping("/eventDetailList")
|
||||||
@ApiOperation(value = "暂态消息获取入口", notes = "暂态消息")
|
@ApiOperation(value = "暂态消息获取入口", notes = "暂态消息")
|
||||||
public HttpResult<Page<EventMsgDetailVO>> eventDetailList(@RequestBody BaseParam param) {
|
public HttpResult<EventMsgDetailVO> eventDetailList(@RequestBody BaseParam param) {
|
||||||
String methodDescribe = getMethodDescribe("eventDetailList");
|
String methodDescribe = getMethodDescribe("eventDetailList");
|
||||||
if (StrUtil.isBlank(param.getSearchValue())) {
|
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||||
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||||
}
|
}
|
||||||
Page<EventMsgDetailVO> page = eventMsgService.eventMsgPage(param);
|
EventMsgDetailVO detailVO = eventMsgService.eventMsgPage(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, detailVO, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class SteadyMsgController extends BaseController {
|
|||||||
@PostMapping("steadyState")
|
@PostMapping("steadyState")
|
||||||
@ApiOperation(value = "稳态越限列表", notes = "稳态越限列表")
|
@ApiOperation(value = "稳态越限列表", notes = "稳态越限列表")
|
||||||
public HttpResult<AppSteadyMsgVO> steadyState(@RequestBody BaseParam param) {
|
public HttpResult<AppSteadyMsgVO> steadyState(@RequestBody BaseParam param) {
|
||||||
String methodDescribe = getMethodDescribe("eventDetailList");
|
String methodDescribe = getMethodDescribe("steadyState");
|
||||||
if (StrUtil.isBlank(param.getSearchValue())) {
|
if (StrUtil.isBlank(param.getSearchValue())) {
|
||||||
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
throw new BusinessException(EventMsgCodeEnum.USERID_WRONG.getMsg());
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ public class SteadyMsgController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 生成稳态越限指标图形
|
* @description: 生成稳态越限指标图形
|
||||||
* @author gbl
|
* @author wr
|
||||||
* @param lineIndex 监测点ID
|
* @param lineIndex 监测点ID
|
||||||
* @param timeID 统计时间
|
* @param timeID 统计时间
|
||||||
* @param typeCode
|
* @param typeCode
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class EventMsgPushController extends BaseController {
|
|||||||
@ApiOperation(value = "暂态消息推送", notes = "暂态消息推送")
|
@ApiOperation(value = "暂态消息推送", notes = "暂态消息推送")
|
||||||
public HttpResult<Boolean> sendEventMsg(String eventDetailIndex, String lineId) throws Exception {
|
public HttpResult<Boolean> sendEventMsg(String eventDetailIndex, String lineId) throws Exception {
|
||||||
String methodDescribe = getMethodDescribe("sendEventMsg");
|
String methodDescribe = getMethodDescribe("sendEventMsg");
|
||||||
if (StrUtil.isNotBlank(eventDetailIndex) || StrUtil.isNotBlank(lineId)) {
|
if (StrUtil.isBlank(eventDetailIndex) || StrUtil.isBlank(lineId)) {
|
||||||
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
||||||
}
|
}
|
||||||
msgService.sendEventMsg(eventDetailIndex, lineId);
|
msgService.sendEventMsg(eventDetailIndex, lineId);
|
||||||
@@ -61,7 +61,7 @@ public class EventMsgPushController extends BaseController {
|
|||||||
@ApiOperation(value = "稳态消息推送", notes = "稳态消息推送")
|
@ApiOperation(value = "稳态消息推送", notes = "稳态消息推送")
|
||||||
public HttpResult<Boolean> sendSteadyMsg(String userIndex, String timeID, Integer lineNum) {
|
public HttpResult<Boolean> sendSteadyMsg(String userIndex, String timeID, Integer lineNum) {
|
||||||
String methodDescribe = getMethodDescribe("sendSteadyMsg");
|
String methodDescribe = getMethodDescribe("sendSteadyMsg");
|
||||||
if (StrUtil.isNotBlank(userIndex) || StrUtil.isNotBlank(userIndex)) {
|
if (StrUtil.isBlank(userIndex) || StrUtil.isBlank(userIndex)) {
|
||||||
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
||||||
}
|
}
|
||||||
msgService.sendSteadyMsg(userIndex, timeID, lineNum);
|
msgService.sendSteadyMsg(userIndex, timeID, lineNum);
|
||||||
@@ -76,13 +76,13 @@ public class EventMsgPushController extends BaseController {
|
|||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "userIndex", value = "用户索引", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "userIndex", value = "用户索引", required = true, paramType = "query"),
|
||||||
@ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "timeID", value = "统计时间", required = true, paramType = "query"),
|
||||||
@ApiImplicitParam(name = "topID", value = "终点消息id", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "topID", value = "终端消息id", required = true, paramType = "query"),
|
||||||
@ApiImplicitParam(name = "flag", value = "强制推送标志", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "flag", value = "强制推送标志", required = true, paramType = "query"),
|
||||||
})
|
})
|
||||||
@ApiOperation(value = "终端消息推送", notes = "终端消息推送")
|
@ApiOperation(value = "终端消息推送", notes = "终端消息推送")
|
||||||
public HttpResult<Boolean> sendTargetMsg(String userIndex, String timeID, String topID, int flag) {
|
public HttpResult<Boolean> sendTargetMsg(String userIndex, String timeID, String topID, int flag) {
|
||||||
String methodDescribe = getMethodDescribe("sendTargetMsg");
|
String methodDescribe = getMethodDescribe("sendTargetMsg");
|
||||||
if (StrUtil.isNotBlank(userIndex) || StrUtil.isNotBlank(userIndex)) {
|
if (StrUtil.isBlank(userIndex) || StrUtil.isBlank(userIndex)) {
|
||||||
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
throw new BusinessException(UserCodeEnum.INVALID_PARAMETER.getMsg());
|
||||||
}
|
}
|
||||||
msgService.sendTargetMsg(userIndex, timeID, topID, flag);
|
msgService.sendTargetMsg(userIndex, timeID, topID, flag);
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public class SteadyMsgTask {
|
|||||||
private final IAppSteadyAssService appSteadyAssService;
|
private final IAppSteadyAssService appSteadyAssService;
|
||||||
private final IAppDevMsgService appDevMsgService;
|
private final IAppDevMsgService appDevMsgService;
|
||||||
|
|
||||||
@Scheduled(cron = "* * 10 * * ?")
|
@Scheduled(cron = "0 0 10 * * ?")
|
||||||
public void timer() throws Exception {
|
public void timer() {
|
||||||
System.out.println("开始执行++++++++++++++++++++++++"+new Date());
|
System.out.println("开始执行++++++++++++++++++++++++"+new Date());
|
||||||
Date date = DateUtil.offsetDay(new Date(), -1);
|
Date date = DateUtil.offsetDay(new Date(), -1);
|
||||||
String time = DateUtil.format(date, DatePattern.NORM_DATE_PATTERN);
|
String time = DateUtil.format(date, DatePattern.NORM_DATE_PATTERN);
|
||||||
@@ -58,7 +58,8 @@ public class SteadyMsgTask {
|
|||||||
* @Date: 2023/11/17 15:07
|
* @Date: 2023/11/17 15:07
|
||||||
*/
|
*/
|
||||||
public void steadyMsg(String time,String startTime,String endTime) {
|
public void steadyMsg(String time,String startTime,String endTime) {
|
||||||
List<User> users = userFeignClient.getUserByIdList(null).getData();
|
List<User> users = userFeignClient.getUserByIdList(new ArrayList<>()).getData();
|
||||||
|
// List<User> users = userFeignClient.getUserByIdList(Arrays.asList("5434cc08dc9d4b7cba5e856de52f0dda")).getData();
|
||||||
if(CollUtil.isNotEmpty(users)){
|
if(CollUtil.isNotEmpty(users)){
|
||||||
StatSubstationBizBaseParam param;
|
StatSubstationBizBaseParam param;
|
||||||
for (User user : users) {
|
for (User user : users) {
|
||||||
@@ -96,7 +97,7 @@ public class SteadyMsgTask {
|
|||||||
*/
|
*/
|
||||||
public void devDegree(String time,String startTime,String endTime){
|
public void devDegree(String time,String startTime,String endTime){
|
||||||
LocalDateTime date = LocalDateTimeUtil.parse(time,DatePattern.NORM_DATE_PATTERN);
|
LocalDateTime date = LocalDateTimeUtil.parse(time,DatePattern.NORM_DATE_PATTERN);
|
||||||
List<User> users = userFeignClient.getUserByIdList(null).getData();
|
List<User> users = userFeignClient.getUserByIdList(new ArrayList<>()).getData();
|
||||||
if(CollUtil.isNotEmpty(users)){
|
if(CollUtil.isNotEmpty(users)){
|
||||||
for (User user : users) {
|
for (User user : users) {
|
||||||
List<String> devIds = generalDeviceInfoClient.deptGetRunDev(user.getDeptId()).getData();
|
List<String> devIds = generalDeviceInfoClient.deptGetRunDev(user.getDeptId()).getData();
|
||||||
|
|||||||
@@ -51,14 +51,22 @@ public class AppDevMsgServiceImpl extends ServiceImpl<AppDevMsgMapper, AppDevMsg
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DevMsgDetailInfo> deviceList(BaseParam param) {
|
public DevMsgDetailInfo deviceList(BaseParam param) {
|
||||||
|
DevMsgDetailInfo dev = new DevMsgDetailInfo();
|
||||||
|
int count = this.count(
|
||||||
|
new LambdaQueryWrapper<AppDevMsg>()
|
||||||
|
.eq(AppDevMsg::getUserIndex, param.getSearchValue())
|
||||||
|
.eq(AppDevMsg::getState, 0)
|
||||||
|
|
||||||
|
);
|
||||||
|
dev.setUnstate(count);
|
||||||
Page<AppDevMsg> page = this.page(new Page(param.getPageNum(), param.getPageSize()),
|
Page<AppDevMsg> page = this.page(new Page(param.getPageNum(), param.getPageSize()),
|
||||||
new LambdaQueryWrapper<AppDevMsg>()
|
new LambdaQueryWrapper<AppDevMsg>()
|
||||||
.eq(AppDevMsg::getUserIndex, param.getSearchValue())
|
.eq(AppDevMsg::getUserIndex, param.getSearchValue())
|
||||||
.orderByDesc(AppDevMsg::getTimeId)
|
.orderByDesc(AppDevMsg::getTimeId)
|
||||||
);
|
);
|
||||||
List<AppDevMsg> records = page.getRecords();
|
List<AppDevMsg> records = page.getRecords();
|
||||||
List<DevMsgDetailInfo> info=new ArrayList<>();
|
List<DevMsgDetailInfo.Unstate> info = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(records)) {
|
if (CollUtil.isNotEmpty(records)) {
|
||||||
List<String> topIds = records.stream().map(AppDevMsg::getTopId).collect(Collectors.toList());
|
List<String> topIds = records.stream().map(AppDevMsg::getTopId).collect(Collectors.toList());
|
||||||
OnlineRateParam top = new OnlineRateParam();
|
OnlineRateParam top = new OnlineRateParam();
|
||||||
@@ -66,11 +74,12 @@ public class AppDevMsgServiceImpl extends ServiceImpl<AppDevMsgMapper, AppDevMsg
|
|||||||
top.setType(0);
|
top.setType(0);
|
||||||
List<TopMsgPO> data = generalDeviceInfoClient.getTopMsgInfoByIds(top).getData();
|
List<TopMsgPO> data = generalDeviceInfoClient.getTopMsgInfoByIds(top).getData();
|
||||||
Map<String, TopMsgPO> topMap = data.stream().collect(Collectors.toMap(TopMsgPO::getTopId, Function.identity()));
|
Map<String, TopMsgPO> topMap = data.stream().collect(Collectors.toMap(TopMsgPO::getTopId, Function.identity()));
|
||||||
DevMsgDetailInfo msg;
|
DevMsgDetailInfo.Unstate msg;
|
||||||
for (AppDevMsg record : records) {
|
for (AppDevMsg record : records) {
|
||||||
if (topMap.containsKey(record.getTopId())) {
|
if (topMap.containsKey(record.getTopId())) {
|
||||||
TopMsgPO topMsgPO = topMap.get(record.getTopId());
|
TopMsgPO topMsgPO = topMap.get(record.getTopId());
|
||||||
msg=new DevMsgDetailInfo();
|
msg = new DevMsgDetailInfo.Unstate();
|
||||||
|
msg.setDevmsgIndex(record.getDevmsgIndex());
|
||||||
msg.setComoutDesc(topMsgPO.getComOutDesc());
|
msg.setComoutDesc(topMsgPO.getComOutDesc());
|
||||||
msg.setAlarmDesc(topMsgPO.getAlarmDesc());
|
msg.setAlarmDesc(topMsgPO.getAlarmDesc());
|
||||||
msg.setTopId(topMsgPO.getTopId());
|
msg.setTopId(topMsgPO.getTopId());
|
||||||
@@ -90,16 +99,17 @@ public class AppDevMsgServiceImpl extends ServiceImpl<AppDevMsgMapper, AppDevMsg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Page<DevMsgDetailInfo> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
Page<DevMsgDetailInfo.Unstate> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
||||||
pageEvent.setRecords(info);
|
pageEvent.setRecords(info);
|
||||||
return pageEvent;
|
dev.setPage(pageEvent);
|
||||||
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateDevMsgState(List<String> ids) {
|
public Boolean updateDevMsgState(List<String> ids) {
|
||||||
return this.update(new LambdaUpdateWrapper<AppDevMsg>()
|
return this.update(new LambdaUpdateWrapper<AppDevMsg>()
|
||||||
.set(AppDevMsg::getState, 1)
|
.set(AppDevMsg::getState, 1)
|
||||||
.in(AppDevMsg::getTopId,ids)
|
.in(AppDevMsg::getDevmsgIndex, ids)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,15 +46,22 @@ public class AppEventMsgServiceImpl extends ServiceImpl<AppEventMsgMapper, AppEv
|
|||||||
private final EventDetailFeignClient eventDetailFeignClient;
|
private final EventDetailFeignClient eventDetailFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EventMsgDetailVO> eventMsgPage(BaseParam param) {
|
public EventMsgDetailVO eventMsgPage(BaseParam param) {
|
||||||
|
EventMsgDetailVO detailVO=new EventMsgDetailVO();
|
||||||
String searchValue = param.getSearchValue();
|
String searchValue = param.getSearchValue();
|
||||||
//获取暂态消息信息
|
//获取暂态消息信息
|
||||||
Page<AppEventMsg> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<AppEventMsg>()
|
Page<AppEventMsg> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<AppEventMsg>()
|
||||||
.eq(AppEventMsg::getUserIndex, searchValue)
|
.eq(AppEventMsg::getUserIndex, searchValue)
|
||||||
.eq(AppEventMsg::getUserIndex, searchValue)
|
.orderByDesc(AppEventMsg::getTimeID)
|
||||||
);
|
);
|
||||||
|
int count = this.count(new LambdaQueryWrapper<AppEventMsg>()
|
||||||
|
.eq(AppEventMsg::getUserIndex, searchValue)
|
||||||
|
.eq(AppEventMsg::getUserIndex, searchValue)
|
||||||
|
.eq(AppEventMsg::getState, 0)
|
||||||
|
);
|
||||||
|
detailVO.setUdState(count);
|
||||||
List<AppEventMsg> records = page.getRecords();
|
List<AppEventMsg> records = page.getRecords();
|
||||||
List<EventMsgDetailVO> info=new ArrayList<>();
|
List<EventMsgDetailVO.udState> info=new ArrayList<>();
|
||||||
if(CollUtil.isNotEmpty(records)){
|
if(CollUtil.isNotEmpty(records)){
|
||||||
Map<String, AppEventMsg> eventMsg = records.stream().collect(Collectors.toMap(AppEventMsg::getEventdetailIndex, Function.identity()));
|
Map<String, AppEventMsg> eventMsg = records.stream().collect(Collectors.toMap(AppEventMsg::getEventdetailIndex, Function.identity()));
|
||||||
//获取暂态事件id
|
//获取暂态事件id
|
||||||
@@ -64,16 +71,16 @@ public class AppEventMsgServiceImpl extends ServiceImpl<AppEventMsgMapper, AppEv
|
|||||||
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
List<LineDetailVO.Detail> lineDetail = lineFeignClient.getLineDetailByIds(linedIds).getData();
|
||||||
//监测点map
|
//监测点map
|
||||||
Map<String, LineDetailVO.Detail> lineDetailMap = lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getLineId, Function.identity()));
|
Map<String, LineDetailVO.Detail> lineDetailMap = lineDetail.stream().collect(Collectors.toMap(LineDetailVO.Detail::getLineId, Function.identity()));
|
||||||
EventMsgDetailVO vo;
|
EventMsgDetailVO.udState vo;
|
||||||
AppEventMsg appEventMsg ;
|
AppEventMsg appEventMsg ;
|
||||||
for (RmpEventDetailPO detail : eventDetail) {
|
for (RmpEventDetailPO detail : eventDetail) {
|
||||||
if(lineDetailMap.containsKey(detail.getLineId())){
|
if(lineDetailMap.containsKey(detail.getLineId())){
|
||||||
LineDetailVO.Detail line = lineDetailMap.get(detail.getLineId());
|
LineDetailVO.Detail line = lineDetailMap.get(detail.getLineId());
|
||||||
vo=new EventMsgDetailVO();
|
vo=new EventMsgDetailVO.udState();
|
||||||
vo.setLineIndex(line.getLineId());
|
vo.setLineIndex(line.getLineId());
|
||||||
vo.setLineName(PubUtil.lineName(detail.getSagsource(),line.getLineName()));
|
vo.setLineName(PubUtil.lineName(detail.getSagsource(),line.getLineName()));
|
||||||
vo.setEventDetailIndex(detail.getEventId());
|
vo.setEventDetailIndex(detail.getEventId());
|
||||||
vo.setTimeID(line.getTimeID());
|
vo.setTimeID(detail.getStartTime());
|
||||||
vo.setPersistTime(detail.getDuration());
|
vo.setPersistTime(detail.getDuration());
|
||||||
vo.setMs(detail.getFirstMs());
|
vo.setMs(detail.getFirstMs());
|
||||||
vo.setEventValue(detail.getFeatureAmplitude());
|
vo.setEventValue(detail.getFeatureAmplitude());
|
||||||
@@ -87,12 +94,12 @@ public class AppEventMsgServiceImpl extends ServiceImpl<AppEventMsgMapper, AppEv
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Page<EventMsgDetailVO> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
Page<EventMsgDetailVO.udState> pageEvent = BeanUtil.copyProperties(page, Page.class);
|
||||||
pageEvent.setRecords(info);
|
pageEvent.setRecords(info);
|
||||||
return pageEvent;
|
detailVO.setPage(pageEvent);
|
||||||
|
return detailVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.cloud.service.impl.user;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
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.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -38,6 +39,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@@ -69,6 +71,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
private final IAppSteadyMsgService appSteadyMsgService;
|
private final IAppSteadyMsgService appSteadyMsgService;
|
||||||
private final IAppDevMsgService appDevMsgService;
|
private final IAppDevMsgService appDevMsgService;
|
||||||
private final RedisUtil redisUtil;
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
private final SmsUtil smsUtil;
|
private final SmsUtil smsUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,6 +85,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
* 4:执行推送保存功能
|
* 4:执行推送保存功能
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void sendEventMsg(String eventDetailIndex, String lineId) throws Exception {
|
public void sendEventMsg(String eventDetailIndex, String lineId) throws Exception {
|
||||||
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventDetailIndex)).getData();
|
List<RmpEventDetailPO> eventDetails = eventDetailFeignClient.getEventDetailByIdsList(Arrays.asList(eventDetailIndex)).getData();
|
||||||
if (CollUtil.isEmpty(eventDetails)) {
|
if (CollUtil.isEmpty(eventDetails)) {
|
||||||
@@ -93,7 +97,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
}
|
}
|
||||||
DeptLine deptLines = deptLineFeignClient.getLineByLineIds(lineId).getData();
|
DeptLine deptLines = deptLineFeignClient.getLineByLineIds(lineId).getData();
|
||||||
//查询为空,则无人关注,不做推送处理,但是需要进行日志记录
|
//查询为空,则无人关注,不做推送处理,但是需要进行日志记录
|
||||||
if (ObjectUtil.isNotNull(deptLines)) {
|
if (ObjectUtil.isNull(deptLines)) {
|
||||||
noUserFocus(eventDetailIndex, lineId);
|
noUserFocus(eventDetailIndex, lineId);
|
||||||
}
|
}
|
||||||
//存在则进行筛选用户操作
|
//存在则进行筛选用户操作
|
||||||
@@ -115,6 +119,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveDataDTO);
|
List<WaveDataDetail> waveDataDetails = WaveUtil.filterWaveData(waveDataDTO);
|
||||||
String instantPath = wavePicComponent.generateImageShun(waveDataDTO, waveDataDetails);
|
String instantPath = wavePicComponent.generateImageShun(waveDataDTO, waveDataDetails);
|
||||||
String rmsPath = wavePicComponent.generateImageRms(waveDataDTO, waveDataDetails);
|
String rmsPath = wavePicComponent.generateImageRms(waveDataDTO, waveDataDetails);
|
||||||
|
one=new AppEventInfo();
|
||||||
one.setEventdetailIndex(eventDetailIndex);
|
one.setEventdetailIndex(eventDetailIndex);
|
||||||
one.setInstantwavePath(instantPath);
|
one.setInstantwavePath(instantPath);
|
||||||
one.setRmswavePath(rmsPath);
|
one.setRmswavePath(rmsPath);
|
||||||
@@ -142,10 +147,11 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
* @param lineNum 监测点数
|
* @param lineNum 监测点数
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public String sendSteadyMsg(String userIndex, String timeID, Integer lineNum) {
|
public String sendSteadyMsg(String userIndex, String timeID, Integer lineNum) {
|
||||||
List<User> users = userFeignClient.getUserByIdList(Arrays.asList(userIndex)).getData();
|
List<User> users = userFeignClient.getUserByIdList(Arrays.asList(userIndex)).getData();
|
||||||
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
||||||
if (CollUtil.isEmpty(users) || ObjectUtil.isNotNull(appInfoSet)) {
|
if (CollUtil.isEmpty(users) || ObjectUtil.isNull(appInfoSet)) {
|
||||||
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
||||||
}
|
}
|
||||||
LocalDateTime time = LocalDateTimeUtil.parse(timeID,DatePattern.NORM_DATE_PATTERN);
|
LocalDateTime time = LocalDateTimeUtil.parse(timeID,DatePattern.NORM_DATE_PATTERN);
|
||||||
@@ -185,10 +191,11 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
* @param flag 是否强制推送
|
* @param flag 是否强制推送
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public String sendTargetMsg(String userIndex, String timeID, String topID, Integer flag) {
|
public String sendTargetMsg(String userIndex, String timeID, String topID, Integer flag) {
|
||||||
List<User> users = userFeignClient.getUserByIdList(Arrays.asList(userIndex)).getData();
|
List<User> users = userFeignClient.getUserByIdList(Arrays.asList(userIndex)).getData();
|
||||||
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
||||||
if (CollUtil.isEmpty(users) || ObjectUtil.isNotNull(appInfoSet)) {
|
if (CollUtil.isEmpty(users) || ObjectUtil.isNull(appInfoSet)) {
|
||||||
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
throw new BusinessException(UserCodeEnum.NO_USER.getMsg());
|
||||||
}
|
}
|
||||||
LocalDateTime time = LocalDateTimeUtil.parse(timeID,DatePattern.NORM_DATE_PATTERN);
|
LocalDateTime time = LocalDateTimeUtil.parse(timeID,DatePattern.NORM_DATE_PATTERN);
|
||||||
@@ -223,6 +230,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public void sendTerminalMsg(String userIndex,String devCode, String timeID,Integer devNum,Integer alarmNum,Integer comOutNum) {
|
public void sendTerminalMsg(String userIndex,String devCode, String timeID,Integer devNum,Integer alarmNum,Integer comOutNum) {
|
||||||
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
AppInfoSet appInfoSet = appInfoSetService.getById(userIndex);
|
||||||
if (ObjectUtil.isNotNull(appInfoSet)) {
|
if (ObjectUtil.isNotNull(appInfoSet)) {
|
||||||
@@ -250,7 +258,14 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
float flowNum = topMsgPO.getFlowValue();
|
float flowNum = topMsgPO.getFlowValue();
|
||||||
if (alarmNum > 0 || comOutNum > 0 || flowNum > 94) {
|
if (alarmNum > 0 || comOutNum > 0 || flowNum > 94) {
|
||||||
//推送
|
//推送
|
||||||
String title = time + "终端异常共" + topMsgPO.getDeviceAbnormalNum() + "台";
|
List<String> devIds = generalDeviceInfoClient.deptGetRunDev(user.getDeptId()).getData();
|
||||||
|
OnlineRateParam top=new OnlineRateParam();
|
||||||
|
top.setIds(devIds);
|
||||||
|
top.setType(1);
|
||||||
|
top.setStartTime(DateUtil.beginOfDay(DateUtil.parse(topMsgPO.getTime())).toString());
|
||||||
|
top.setEndTime(DateUtil.endOfDay(DateUtil.parse(topMsgPO.getTime())).toString());
|
||||||
|
List<TopMsgPO> data = generalDeviceInfoClient.getTopMsgInfoByIds(top).getData();
|
||||||
|
String title = time + "终端异常共" + data.size()+ "台";
|
||||||
String content = "异常情况:" + (StringUtils.isEmpty(alarmNum) ? "" : "终端告警:" + alarmNum + "次 ") + (StringUtils.isEmpty(comOutNum) ? "" : "通讯中断:" + Integer.valueOf(comOutNum) + "次 ") + (StringUtils.isEmpty(flowNum) ? "" : "终端流量:" + Float.valueOf(flowNum) + "%");
|
String content = "异常情况:" + (StringUtils.isEmpty(alarmNum) ? "" : "终端告警:" + alarmNum + "次 ") + (StringUtils.isEmpty(comOutNum) ? "" : "通讯中断:" + Integer.valueOf(comOutNum) + "次 ") + (StringUtils.isEmpty(flowNum) ? "" : "终端流量:" + Float.valueOf(flowNum) + "%");
|
||||||
sendMsg(user.getDevCode(), title, content, "3");
|
sendMsg(user.getDevCode(), title, content, "3");
|
||||||
}
|
}
|
||||||
@@ -264,12 +279,13 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
* @param appUser 用户信息
|
* @param appUser 用户信息
|
||||||
* @param devCode 手机唯一标识
|
* @param devCode 手机唯一标识
|
||||||
*/
|
*/
|
||||||
private void pushEventInfo(RmpEventDetailPO eventDetail, User appUser, String devCode, int phonePushFlag) throws Exception {
|
private void pushEventInfo(RmpEventDetailPO eventDetail, User appUser, String devCode, int phonePushFlag) {
|
||||||
//先根据用户获取推送策略
|
//先根据用户获取推送策略
|
||||||
AppInfoSet appInfoSet = appInfoSetService.getById(appUser.getId());
|
AppInfoSet appInfoSet = appInfoSetService.getById(appUser.getId());
|
||||||
if (ObjectUtil.isNotNull(appInfoSet)) {
|
if (ObjectUtil.isNotNull(appInfoSet)) {
|
||||||
AppEventMsg eventMsg = new AppEventMsg();
|
AppEventMsg eventMsg = new AppEventMsg();
|
||||||
eventMsg.setEventdetailIndex(eventDetail.getEventId());
|
eventMsg.setEventdetailIndex(eventDetail.getEventId());
|
||||||
|
eventMsg.setTimeID(eventDetail.getStartTime());
|
||||||
eventMsg.setUserIndex(appUser.getId());
|
eventMsg.setUserIndex(appUser.getId());
|
||||||
eventMsg.setState(0);
|
eventMsg.setState(0);
|
||||||
//执行保存消息记录操作
|
//执行保存消息记录操作
|
||||||
@@ -295,7 +311,7 @@ public class MsgServiceImpl implements MsgService {
|
|||||||
boolean isPush = judgeEventNeedPush(eventDetail, line);
|
boolean isPush = judgeEventNeedPush(eventDetail, line);
|
||||||
if (isPush) {
|
if (isPush) {
|
||||||
String message = "{\"line\":\"" + line.getLineName() + "\",\"time\":\"" + time + "\",\"ms\":\"" + eventDetail.getFirstMs() + "\",\"eventvalue\":\"" + amplitude + "\",\"persisttime\":\"" + duration + "\"}";
|
String message = "{\"line\":\"" + line.getLineName() + "\",\"time\":\"" + time + "\",\"ms\":\"" + eventDetail.getFirstMs() + "\",\"eventvalue\":\"" + amplitude + "\",\"persisttime\":\"" + duration + "\"}";
|
||||||
smsUtil.sendSms(appUser.getPhone(), smsUtil.getMessageTemplate("8"), message);
|
// smsUtil.sendSms(appUser.getPhone(), smsUtil.getMessageTemplate("8"), message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.cloud.service.impl.user;
|
||||||
|
|
||||||
|
import com.njcn.cloud.service.user.RealTimeInfoService;
|
||||||
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2023/11/22 15:40
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RealTimeInfoServiceImpl implements RealTimeInfoService {
|
||||||
|
|
||||||
|
|
||||||
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LineDetailVO.Detail> getLineBaseInfo(List<String> lineId) {
|
||||||
|
return lineFeignClient.getLineDetailByIds(lineId).getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ public interface IAppDevMsgService extends IService<AppDevMsg> {
|
|||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2023/11/7 11:13
|
* @Date: 2023/11/7 11:13
|
||||||
*/
|
*/
|
||||||
Page<DevMsgDetailInfo> deviceList(BaseParam param);
|
DevMsgDetailInfo deviceList(BaseParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 修改消息状态
|
* @Description: 修改消息状态
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public interface IAppEventMsgService extends IService<AppEventMsg> {
|
|||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2023/11/1 13:36
|
* @Date: 2023/11/1 13:36
|
||||||
*/
|
*/
|
||||||
Page<EventMsgDetailVO> eventMsgPage(BaseParam param);
|
EventMsgDetailVO eventMsgPage(BaseParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 暂态事件基本信息
|
* @Description: 暂态事件基本信息
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.cloud.service.user;
|
||||||
|
|
||||||
|
|
||||||
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface RealTimeInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 获取监测点信息
|
||||||
|
* @param lineId
|
||||||
|
* @return: java.util.List<com.njcn.device.pq.pojo.vo.LineDetailVO.Detail>
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2023/11/22 15:44
|
||||||
|
*/
|
||||||
|
List<LineDetailVO.Detail> getLineBaseInfo(List<String> lineId);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user