|
@@ -3,6 +3,8 @@ package com.aidex.web.controller.app;
|
|
|
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
import com.aidex.common.app.domain.vo.LocationVO;
|
|
import com.aidex.common.app.domain.vo.LocationVO;
|
|
import com.aidex.common.app.domain.vo.SysWharfVO;
|
|
import com.aidex.common.app.domain.vo.SysWharfVO;
|
|
import com.aidex.common.app.server.IAppService;
|
|
import com.aidex.common.app.server.IAppService;
|
|
@@ -15,6 +17,7 @@ import com.aidex.common.plush.domain.vo.SysShipExtendListVO;
|
|
import com.aidex.common.plush.domain.vo.SysShipExtendVO;
|
|
import com.aidex.common.plush.domain.vo.SysShipExtendVO;
|
|
import com.aidex.common.plush.domain.vo.SysShipResVO;
|
|
import com.aidex.common.plush.domain.vo.SysShipResVO;
|
|
import com.aidex.common.utils.json.JSONObject;
|
|
import com.aidex.common.utils.json.JSONObject;
|
|
|
|
+import com.aidex.common.utils.uuid.IdUtils;
|
|
import com.aidex.quartz.task.RefreshAccessTokenTask;
|
|
import com.aidex.quartz.task.RefreshAccessTokenTask;
|
|
import com.aidex.system.domain.*;
|
|
import com.aidex.system.domain.*;
|
|
import com.aidex.system.domain.vo.SysReservationDataHistoryVO;
|
|
import com.aidex.system.domain.vo.SysReservationDataHistoryVO;
|
|
@@ -37,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -63,7 +67,9 @@ public class AppController {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private WxMaService wxMaService;
|
|
private WxMaService wxMaService;
|
|
- private String code;
|
|
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysShipService sysShipService;
|
|
|
|
|
|
@GetMapping("/carousel")
|
|
@GetMapping("/carousel")
|
|
@ApiOperation(value = "获取轮播信息", notes = "获取轮播信息", produces = "application/json")
|
|
@ApiOperation(value = "获取轮播信息", notes = "获取轮播信息", produces = "application/json")
|
|
@@ -233,7 +239,7 @@ public class AppController {
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/message")
|
|
@PostMapping("/message")
|
|
- public R<PageInfo> getMessage(@RequestBody Message message, HttpServletRequest request, HttpServletResponse response)
|
|
|
|
|
|
+ public R getMessage(@RequestBody Message message, HttpServletRequest request, HttpServletResponse response)
|
|
{
|
|
{
|
|
// 验证签名时使用
|
|
// 验证签名时使用
|
|
// String timestamp = request.getHeader("timestamp");
|
|
// String timestamp = request.getHeader("timestamp");
|
|
@@ -241,20 +247,35 @@ public class AppController {
|
|
// String type = request.getHeader("type");
|
|
// String type = request.getHeader("type");
|
|
// String device_sn = request.getHeader("device_sn");
|
|
// String device_sn = request.getHeader("device_sn");
|
|
// String message_id = request.getHeader("message_id");
|
|
// String message_id = request.getHeader("message_id");
|
|
|
|
+ // logger.info("webhook消息推送,消息-------{}", message);
|
|
Map<String, Object> extend = message.getExtend();
|
|
Map<String, Object> extend = message.getExtend();
|
|
|
|
+ logger.info("webhook消息推送,消息----extend---{}", extend);
|
|
if (null != extend) {
|
|
if (null != extend) {
|
|
|
|
+ logger.info("webhook消息推送,消息----extend-count--{}", extend.containsKey("count"));
|
|
if (extend.containsKey("count")) {
|
|
if (extend.containsKey("count")) {
|
|
- int[] alarm_count = (int[]) extend.get("count");
|
|
|
|
- if (alarm_count.length > 0){
|
|
|
|
- logger.info("webhook消息推送,告警人数----人数---{}", alarm_count[0]);
|
|
|
|
|
|
+ ArrayList<Integer> alarm_count = (ArrayList<Integer>) extend.get("count");
|
|
|
|
+ logger.info("webhook消息推送,消息----extend-alarm_count--{}", alarm_count);
|
|
|
|
+ if (alarm_count.size() > 0){
|
|
|
|
+ logger.info("webhook消息推送,告警人数----人数---{}", alarm_count.get(0));
|
|
logger.info("webhook消息推送,请求头----时间戳---{}", message.getTimestamp());
|
|
logger.info("webhook消息推送,请求头----时间戳---{}", message.getTimestamp());
|
|
logger.info("webhook消息推送,请求头----设备号---{}", message.getDevice_sn());
|
|
logger.info("webhook消息推送,请求头----设备号---{}", message.getDevice_sn());
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ String dateTime = DateUtil.s(DateUtil.timeToSecond(message.getTimestamp()));
|
|
|
|
+ logger.info("webhook消息推送,请求头----时间戳转换---{}", dateTime);
|
|
|
|
+ int row = iAppService.insertCameraAlarm(new SysCameraAlarm(IdUtils.fastSimpleUUID(), DateUtil.date(), message.getDevice_sn(), Integer.valueOf(alarm_count.get(0))));
|
|
|
|
+ return R.status(row);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return R.data(null);
|
|
|
|
|
|
+ return R.status(false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /*@GetMapping("/test")
|
|
|
|
+ @ApiOperation(value = "获取信息类型", notes = "获取信息类型", produces = "application/json")
|
|
|
|
+ public R test()
|
|
|
|
+ {
|
|
|
|
+ sysShipService.getShipSurplusSeat("261836442bbb48659d40f716feaa470d", 300);
|
|
|
|
+ return R.status(true);
|
|
|
|
+ }*/
|
|
|
|
+
|
|
}
|
|
}
|