Commit a4f032a3 authored by tangwei's avatar tangwei

修改bug

parent e89864e9
......@@ -10,6 +10,6 @@ import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
public interface IPointSystemService {
//触发风险预警
public void sendWarning(String address, String value);
public void sendWarning(String address, String value,String valueLabe);
}
......@@ -45,7 +45,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
protected EmqKeeper emqKeeper;
@Override
public void sendWarning(String address, String value) {
public void sendWarning(String address, String value,String valueLabe) {
try {
//通过测点地址获取,和对应值 获取kks
QueryWrapper<PointSystem> pointSystemWrapper = new QueryWrapper<>();
......@@ -74,8 +74,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
eqdata = (JSONObject) list.get(0);
//组装数据,发送预警
WarningDto warningDto = setWarningDto(pointSystem, eqdata);
WarningDto warningDto = setWarningDto(pointSystem, eqdata, valueLabe);
emqKeeper.getMqttClient().publish(STATIONWARNING, JSON.toJSONString(warningDto).getBytes(), 0, false);
} catch (Exception e) {
......@@ -85,28 +84,27 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
}
public WarningDto setWarningDto(PointSystem pointSystem,JSONObject eqdata ){
public WarningDto setWarningDto(PointSystem pointSystem,JSONObject eqdata,String valueLabe ){
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time= sdf.format(new Date());
String warningObjectCode=pointSystem.getKks();
List<TabContent> tabContent=new ArrayList<>();
tabContent.add(new TabContent( "KKS编码", TEXT, warningObjectCode, "key1"));
tabContent.add(new TabContent( "设备名称", TEXT, eqdata.get("kksms"), "key2"));
tabContent.add(new TabContent( "发生时间", TEXT, time, "key3"));
tabContent.add(new TabContent( "告警原因", TEXT, valueLabe, "key3"));
tabContent.add(new TabContent( "发生时间", TEXT, time, "key4"));
DynamicDetails dynamicDetails=new DynamicDetails( TABNAME, tabContent);
List<DynamicDetails> dynamicDetailsList=new ArrayList<>();
dynamicDetailsList.add(dynamicDetails);
StringBuffer indexKey=new StringBuffer(pointSystem.getStation())
StringBuilder indexKey=new StringBuilder(pointSystem.getStation())
.append("#")
.append(pointSystem.getNumber())
.append("#")
.append(pointSystem.getFunctionNum());
StringBuffer indexValue=new StringBuffer(pointSystem.getPointType())
.append("#")
.append(pointSystem.getValue());
String indexValue=valueLabe;
WarningDto WarningDto=new WarningDto(
indexKey.toString(),
indexValue.toString(),
indexValue,
null,
(String)eqdata.get("sourceAttributionDesc"),
(String)eqdata.get("sourceAttribution"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment