Commit d0cda860 authored by tangwei's avatar tangwei

修改bug

parent b86478b9
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
...@@ -9,6 +10,7 @@ import java.util.Set; ...@@ -9,6 +10,7 @@ import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -422,7 +424,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -422,7 +424,22 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
par.setAlertId(alertCalled.getSequenceNbr()); par.setAlertId(alertCalled.getSequenceNbr());
List<AlertCalledZhDto> list = this.alertCalledListByAlertStatus(null, null, par); List<AlertCalledZhDto> list = this.alertCalledListByAlertStatus(null, null, par);
String json=list!=null&&list.size()>0?JSONObject.toJSONString(list.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):""; String json="";
if(list!=null&&list.size()>0){
AlertCalledZhDto ll=list.get(0);
Map<String, String> map = BeanUtils.describe((Object) list.get(0));
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
map.put("callTime",ll.getCallTime()!=null?sdf.format(ll.getCallTime()):"");
map.put("updateTime",ll.getUpdateTime()!=null?sdf.format(ll.getUpdateTime()):"");
json=list!=null&&list.size()>0?JSONObject.toJSONString(map, SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue):"";
}
emqKeeper.getMqttClient().publish(topicData, json.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topicData, json.getBytes(), RuleConfig.DEFAULT_QOS, false);
/** /**
...@@ -448,6 +465,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -448,6 +465,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
throw new RuntimeException("报送失败,系统异常!"); throw new RuntimeException("报送失败,系统异常!");
} }
} }
/** /**
* 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案 * 根据id 修改警情 type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
*/ */
......
...@@ -8,6 +8,7 @@ import java.io.IOException; ...@@ -8,6 +8,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -743,7 +744,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -743,7 +744,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
par.setAlertId(alertSubmittedDto.getAlertCalledId()); par.setAlertId(alertSubmittedDto.getAlertCalledId());
List<AlertCalledZhDto> list4 = alertCalledService.alertCalledListByAlertStatus(null, null, par); List<AlertCalledZhDto> list4 = alertCalledService.alertCalledListByAlertStatus(null, null, par);
String json=list4!=null&&list4.size()>0?JSONObject.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
String json="";
if(list!=null&&list.size()>0){
AlertCalledZhDto ll=list4.get(0);
Map<String, String> map1 = org.apache.commons.beanutils.BeanUtils.describe((Object)list4.get(0));
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
map1.put("callTime",ll.getCallTime()!=null?sdf.format(ll.getCallTime()):"");
map1.put("updateTime",ll.getUpdateTime()!=null?sdf.format(ll.getUpdateTime()):"");
json=list!=null&&list.size()>0?JSONObject.toJSONString(map1, SerializerFeature.PrettyFormat,
SerializerFeature.WriteMapNullValue):"";
}
// String json=list4!=null&&list4.size()>0?JSONObject.toJSONString(list4.get(0), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue):"";
emqKeeper.getMqttClient().publish(topicJa, json.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topicJa, json.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
......
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