3 changed files with 108 additions and 2 deletions
@ -0,0 +1,105 @@ |
|||
package com.yxt.supervise.report.api.riskmessageslog; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import com.yxt.supervise.report.api.imgmessageslog.Linkers; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/22 8:46 |
|||
*/ |
|||
@Data |
|||
public class RiskMessagesLogVos implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String messageTime; |
|||
private String pagepath; |
|||
private String content; |
|||
//消息状态
|
|||
private String oState; |
|||
private Map<String,String> map; |
|||
private String riskSid; |
|||
private String shName; |
|||
private List<String> devices; |
|||
private String text; |
|||
List<Linkers> linkers; |
|||
private String shSid; |
|||
private Integer count; |
|||
private List<String> message; |
|||
private String type; |
|||
private TemplateMessageVo templateMessageVo; |
|||
private String isImg; |
|||
private String riskLevel="二级风险"; |
|||
//{time4=2023-09-14 17:17:35, thing8=中通樊家屯仓, thing2=东北角的摄像头,111,22,33}
|
|||
//{thing3=中通樊家屯仓, thing2=东北角的摄像头,111,22,33, time5=2023-09-14 17:18:00}
|
|||
public TemplateMessageVo getTemplateMessageVo() { |
|||
TemplateMessageVo vo=new TemplateMessageVo(); |
|||
//{time4=2023-09-14 17:17:35, thing8=中通樊家屯仓, thing2=东北角的摄像头,111,22,33}
|
|||
//{thing3=中通樊家屯仓, thing2=东北角的摄像头,111,22,33, time5=2023-09-14 17:18:00}
|
|||
if(StrUtil.isNotEmpty(type)){ |
|||
if(type.equals("设备离线")){ |
|||
vo.setTime(map.get("time4")); |
|||
vo.setShName(map.get("thing8")+"设备离线"); |
|||
}else if(type.equals("设备离线解除")){ |
|||
vo.setTime(map.get("time5")); |
|||
vo.setShName(map.get("thing3")+"设备离线解除"); |
|||
}else if(type.equals("系统异常")){ |
|||
vo.setTime(map.get("time4")); |
|||
vo.setShName("环境监控未向平台推送数据"); |
|||
}else if(type.equals("系统异常解除")){ |
|||
vo.setTime(map.get("time5")); |
|||
vo.setShName("环境监控已正常推送数据"); |
|||
}else if(type.equals("图片对比异常")){ |
|||
//{thing3=瀚川商贸仓库, thing4=图片对比异常, time5=2023-11-06 05:04:08}
|
|||
vo.setTime(map.get("time5")); |
|||
vo.setShName(map.get("thing3")+"图片对比异常"); |
|||
}else if(type.equals("每日数据上报")){ |
|||
//{time1=2023-08-15 09:57, thing3=赵丽晓, thing2=监管数据总览(喜相随生产加工动产质押项…}
|
|||
vo.setTime(map.get("time1")); |
|||
vo.setShName(map.get("thing2")+")每日数据上报"); |
|||
} |
|||
} |
|||
this.templateMessageVo=vo; |
|||
return templateMessageVo; |
|||
} |
|||
|
|||
public List<String> getMessage() { |
|||
List<String> l=new ArrayList<>(); |
|||
String[] keyValuePairs = content.split("[{;,}]"); |
|||
for (String pair : keyValuePairs) { |
|||
// 按照等号拆分键和值
|
|||
String[] keyValue = pair.split("="); |
|||
if (keyValue.length == 2) { |
|||
String key = keyValue[0].trim(); |
|||
String value = keyValue[1].trim(); |
|||
l.add(value); |
|||
} |
|||
} |
|||
this.message=l; |
|||
return message; |
|||
} |
|||
|
|||
public Map<String, String> getMap() { |
|||
Map<String, String> strMap = new HashMap<>(); |
|||
|
|||
String[] keyValuePairs = content.split("[{;,}]"); |
|||
|
|||
for (String pair : keyValuePairs) { |
|||
// 按照等号拆分键和值
|
|||
String[] keyValue = pair.split("="); |
|||
if (keyValue.length == 2) { |
|||
String key = keyValue[0].trim(); |
|||
String value = keyValue[1].trim(); |
|||
strMap.put(key, value); |
|||
} |
|||
} |
|||
this.map = strMap; |
|||
return map; |
|||
} |
|||
} |
Loading…
Reference in new issue