|
@@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -111,6 +112,7 @@ public class GeoHazardMonitorTokenController {
|
|
* @return // 生成令牌
|
|
* @return // 生成令牌
|
|
*/
|
|
*/
|
|
@PostMapping("/alarm")
|
|
@PostMapping("/alarm")
|
|
|
|
+ @Transactional
|
|
public String alarm(@RequestParam("parameter") String parameter, HttpServletRequest request) {
|
|
public String alarm(@RequestParam("parameter") String parameter, HttpServletRequest request) {
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
String token = apiTokenUtils.getGeoHazardMonitorToken(request);
|
|
log.info("token:{}", token);
|
|
log.info("token:{}", token);
|
|
@@ -141,6 +143,7 @@ public class GeoHazardMonitorTokenController {
|
|
if (ObjectUtils.isEmpty(alarm)) {
|
|
if (ObjectUtils.isEmpty(alarm)) {
|
|
MsgAlarm msgAlarm = new MsgAlarm();
|
|
MsgAlarm msgAlarm = new MsgAlarm();
|
|
BeanUtils.copyProperties(reqMsgAlarmVo, msgAlarm);
|
|
BeanUtils.copyProperties(reqMsgAlarmVo, msgAlarm);
|
|
|
|
+ BeanUtils.copyProperties(reqMsgAlarmVo, msgAlarmVice);
|
|
msgAlarm.setCameraCode(String.valueOf(reqMsgAlarmVo.getAlarmCamera()));
|
|
msgAlarm.setCameraCode(String.valueOf(reqMsgAlarmVo.getAlarmCamera()));
|
|
String[] imageUrl = reqMsgAlarmVo.getImageUrls();
|
|
String[] imageUrl = reqMsgAlarmVo.getImageUrls();
|
|
StringBuffer buffer = new StringBuffer();
|
|
StringBuffer buffer = new StringBuffer();
|
|
@@ -187,6 +190,10 @@ public class GeoHazardMonitorTokenController {
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.info(e.getMessage());
|
|
log.info(e.getMessage());
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ jsonObject.put("resultCode", 2);
|
|
|
|
+ jsonObject.put("message", "失败");
|
|
|
|
+ jsonObject.put("data", "消息推送失败");
|
|
|
|
+ return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
|
|
}
|
|
}
|
|
jsonObject.put("resultCode", 1);
|
|
jsonObject.put("resultCode", 1);
|
|
jsonObject.put("message", "成功");
|
|
jsonObject.put("message", "成功");
|