Bläddra i källkod

卫生间检测推送

chejianzheng 4 månader sedan
förälder
incheckning
be8a0ce604

+ 7 - 3
src/main/java/com/pub/util/MqttUtil.java

@@ -25,6 +25,7 @@ import com.wxxcx.targets.TargetVO;
 import com.wxxcx.targets.EventListVO;
 import com.wxxcx.user.MiniUserVO;
 import com.wxxcx.ws.PushMsgWebSocket;
+import org.springframework.util.StringUtils;
 
 @Slf4j
 public class MqttUtil {
@@ -61,7 +62,7 @@ public class MqttUtil {
         sub("/das/realtime_pos");
         sub("/das/dev_status");
         sub("/das/exist");
-        sub("/das/alarm_event");
+        sub("/das/alarm_event", 2);
     }
 
     public static void init() throws MqttException {
@@ -319,8 +320,11 @@ public class MqttUtil {
                             }
                             System.out.println("mqttutil--当前useropenid=" + user.getOpenid() +", fwhopenId=" + fwhOpenId);
                             System.out.println("发送微信公众号信息:devName=" + dev_name.toString() + ", phoneNo=" + user.getPhone() + "fwhOpenId=" + fwhOpenId);
-                            wxSendMessage.queryAccessToken(devId, dev_name.toString(), user.getPhone(), fwhOpenId, "检测到异常滞留,请前往小程序查看详细信息");
-                            System.out.println("发送微信公众号消息发完了");
+
+                            if (StringUtils.hasText(dev_name.toString()) && dev_name.toString().contains("卫生间")) {
+                                wxSendMessage.queryAccessToken(devId, dev_name.toString(), user.getPhone(), fwhOpenId, "检测到异常滞留,请前往小程序查看详细信息");
+                                System.out.println("发送微信公众号消息发完了");
+                            }
                         }
 
                     }

+ 4 - 4
src/main/java/com/wxxcx/index/WxxcxIndexController.java

@@ -889,11 +889,11 @@ public class WxxcxIndexController<AesException extends Throwable> {
                         subBuffer.append("'type','" + itemObj.getString("type") + "',");
                         subBuffer.append("'width'," + itemObj.getString("width") + ",");
                         subBuffer.append("'height'," + itemObj.getString("height") + ",");
-                        subBuffer.append("'heightToM'," + itemObj.getString("heightToM") + ",");
+//                        subBuffer.append("'heightToM'," + itemObj.getString("heightToM") + ",");
                         subBuffer.append("'left'," + itemObj.getString("left") + ",");
                         subBuffer.append("'rotate'," + itemObj.getString("rotate") + ",");
                         subBuffer.append("'top'," + itemObj.getString("top") + ",");
-                        subBuffer.append("'widthToM'," + itemObj.getString("widthToM") + ",");
+//                        subBuffer.append("'widthToM'," + itemObj.getString("widthToM") + ",");
                         subBuffer.append("'x'," + itemObj.getString("x") + ",");
                         subBuffer.append("'y'," + itemObj.getString("y") + ",");
                         subBuffer.append("'yuanX'," + itemObj.getString("yuanX") + ",");
@@ -906,11 +906,11 @@ public class WxxcxIndexController<AesException extends Throwable> {
                         furBuffer.append("'type','" + itemObj.getString("type") + "',");
                         furBuffer.append("'width'," + itemObj.getString("width") + ",");
                         furBuffer.append("'height'," + itemObj.getString("height") + ",");
-                        furBuffer.append("'heightToM'," + itemObj.getString("heightToM") + ",");
+//                        furBuffer.append("'heightToM'," + itemObj.getString("heightToM") + ",");
                         furBuffer.append("'left'," + itemObj.getString("left") + ",");
                         furBuffer.append("'rotate'," + itemObj.getString("rotate") + ",");
                         furBuffer.append("'top'," + itemObj.getString("top") + ",");
-                        furBuffer.append("'widthToM'," + itemObj.getString("widthToM") + ",");
+//                        furBuffer.append("'widthToM'," + itemObj.getString("widthToM") + ",");
                         furBuffer.append("'x'," + itemObj.getString("x") + ",");
                         furBuffer.append("'y'," + itemObj.getString("y") + ",");
                         furBuffer.append("'yuanX'," + itemObj.getString("yuanX") + ",");