Browse Source

消息推送接口

wangchangsheng 3 years ago
parent
commit
0d9e30ea9c

+ 45 - 0
src/main/java/com/gyee/frame/common/conf/WebSocketStompConfig.java

@@ -0,0 +1,45 @@
+package com.gyee.frame.common.conf;
+
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.messaging.simp.config.MessageBrokerRegistry;
+import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
+import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
+import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
+
+@Configuration
+@EnableWebSocketMessageBroker
+public class WebSocketStompConfig  implements WebSocketMessageBrokerConfigurer {
+
+    /**
+     * 注册stomp端点,主要是起到连接作用
+     *
+     * @param stompEndpointRegistry
+     */
+    @Override
+    public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
+        stompEndpointRegistry
+                .addEndpoint("/wisdom_service")  //端点名称
+                //.setHandshakeHandler() 握手处理,主要是连接的时候认证获取其他数据验证等
+                //.addInterceptors() 拦截处理,和http拦截类似
+                .setAllowedOrigins("*");//跨域
+        // .withSockJS(); //使用sockJS1
+
+    }
+
+    /**
+     * 注册相关服务
+     *
+     * @param registry
+     */
+    @Override
+    public void configureMessageBroker(MessageBrokerRegistry registry) {
+
+        registry.enableSimpleBroker("/topic", "/queue");
+        //客户端名称前缀
+        registry.setApplicationDestinationPrefixes("/app");
+        //用户名称前
+        registry.setUserDestinationPrefix("/userDataSet");
+    }
+
+}

+ 0 - 42
src/main/java/com/gyee/frame/controller/comm/FullPushMsgController.java

@@ -1,42 +0,0 @@
-package com.gyee.frame.controller.comm;
-
-
-import com.gyee.frame.common.domain.AjaxResult;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-
-@RestController
-@RequestMapping("/fullpushmessage")
-public class FullPushMsgController {
-
-
-    /**
-     * 推送消息
-     * @return
-     */
-    @GetMapping("/pushmsg")
-    @ResponseBody
-    @ApiOperation(value = "推送全场重要信息", notes = "推送全场重要信息")
-    public AjaxResult pushmsg () {
-
-
-        return null;
-    }
-
-
-
-
-
-
-
-
-
-
-
-}

+ 55 - 0
src/main/java/com/gyee/frame/controller/comm/WebSocketController.java

@@ -0,0 +1,55 @@
+package com.gyee.frame.controller.comm;
+
+
+import com.gyee.frame.common.conf.AjaxStatus;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.model.custom.ServerMessage;
+import com.gyee.frame.service.comm.FullPushMsgService;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.messaging.simp.annotation.SubscribeMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/webSocket")
+public class WebSocketController {
+
+
+    @Autowired
+    private FullPushMsgService fullPushMsgService;
+
+
+    private Logger logger = LoggerFactory.getLogger(WebSocketController.class);
+
+    @SubscribeMapping("/submsg")
+    public ServerMessage sub() {
+        logger.info("用户订阅了消息推送。。。");
+        return new ServerMessage("订阅成功。");
+    }
+
+
+    /**
+     * 推送消息
+     *
+     * @return
+     */
+    @GetMapping("/pushmsg")
+    @ResponseBody
+    @ApiOperation(value = "推送全场重要信息", notes = "推送全场重要信息")
+    public AjaxResult pushmsg() {
+
+        Map<String, Object> result = fullPushMsgService.addPushMsg();
+
+
+        return AjaxResult.successData(AjaxStatus.success.code, result);
+    }
+}
+

+ 96 - 0
src/main/java/com/gyee/frame/mapper/auto/PushMessageMapper.java

@@ -0,0 +1,96 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.PushMessage;
+import com.gyee.frame.model.auto.PushMessageExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface PushMessageMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    long countByExample(PushMessageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int deleteByExample(PushMessageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int deleteByPrimaryKey(Short id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int insert(PushMessage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int insertSelective(PushMessage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    List<PushMessage> selectByExample(PushMessageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    PushMessage selectByPrimaryKey(Short id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int updateByExampleSelective(@Param("record") PushMessage record, @Param("example") PushMessageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int updateByExample(@Param("record") PushMessage record, @Param("example") PushMessageExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKeySelective(PushMessage record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    int updateByPrimaryKey(PushMessage record);
+}

+ 212 - 0
src/main/java/com/gyee/frame/model/auto/PushMessage.java

@@ -0,0 +1,212 @@
+package com.gyee.frame.model.auto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class PushMessage implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.ID
+     *
+     * @mbg.generated
+     */
+    private Short id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.KEY
+     *
+     * @mbg.generated
+     */
+    private String key;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.MSG
+     *
+     * @mbg.generated
+     */
+    private String msg;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.GETTIME
+     *
+     * @mbg.generated
+     */
+    private Date gettime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.TAG
+     *
+     * @mbg.generated
+     */
+    private String tag;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column PUSHMESSAGE.ALLREADER
+     *
+     * @mbg.generated
+     */
+    private String allreader;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.ID
+     *
+     * @return the value of PUSHMESSAGE.ID
+     *
+     * @mbg.generated
+     */
+    public Short getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.ID
+     *
+     * @param id the value for PUSHMESSAGE.ID
+     *
+     * @mbg.generated
+     */
+    public void setId(Short id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.KEY
+     *
+     * @return the value of PUSHMESSAGE.KEY
+     *
+     * @mbg.generated
+     */
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.KEY
+     *
+     * @param key the value for PUSHMESSAGE.KEY
+     *
+     * @mbg.generated
+     */
+    public void setKey(String key) {
+        this.key = key == null ? null : key.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.MSG
+     *
+     * @return the value of PUSHMESSAGE.MSG
+     *
+     * @mbg.generated
+     */
+    public String getMsg() {
+        return msg;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.MSG
+     *
+     * @param msg the value for PUSHMESSAGE.MSG
+     *
+     * @mbg.generated
+     */
+    public void setMsg(String msg) {
+        this.msg = msg == null ? null : msg.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.GETTIME
+     *
+     * @return the value of PUSHMESSAGE.GETTIME
+     *
+     * @mbg.generated
+     */
+    public Date getGettime() {
+        return gettime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.GETTIME
+     *
+     * @param gettime the value for PUSHMESSAGE.GETTIME
+     *
+     * @mbg.generated
+     */
+    public void setGettime(Date gettime) {
+        this.gettime = gettime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.TAG
+     *
+     * @return the value of PUSHMESSAGE.TAG
+     *
+     * @mbg.generated
+     */
+    public String getTag() {
+        return tag;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.TAG
+     *
+     * @param tag the value for PUSHMESSAGE.TAG
+     *
+     * @mbg.generated
+     */
+    public void setTag(String tag) {
+        this.tag = tag == null ? null : tag.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column PUSHMESSAGE.ALLREADER
+     *
+     * @return the value of PUSHMESSAGE.ALLREADER
+     *
+     * @mbg.generated
+     */
+    public String getAllreader() {
+        return allreader;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column PUSHMESSAGE.ALLREADER
+     *
+     * @param allreader the value for PUSHMESSAGE.ALLREADER
+     *
+     * @mbg.generated
+     */
+    public void setAllreader(String allreader) {
+        this.allreader = allreader == null ? null : allreader.trim();
+    }
+}

+ 703 - 0
src/main/java/com/gyee/frame/model/auto/PushMessageExample.java

@@ -0,0 +1,703 @@
+package com.gyee.frame.model.auto;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class PushMessageExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public PushMessageExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("ID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("ID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Short value) {
+            addCriterion("ID =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Short value) {
+            addCriterion("ID <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Short value) {
+            addCriterion("ID >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Short value) {
+            addCriterion("ID >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Short value) {
+            addCriterion("ID <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Short value) {
+            addCriterion("ID <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Short> values) {
+            addCriterion("ID in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Short> values) {
+            addCriterion("ID not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Short value1, Short value2) {
+            addCriterion("ID between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Short value1, Short value2) {
+            addCriterion("ID not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyIsNull() {
+            addCriterion("KEY is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyIsNotNull() {
+            addCriterion("KEY is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyEqualTo(String value) {
+            addCriterion("KEY =", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyNotEqualTo(String value) {
+            addCriterion("KEY <>", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyGreaterThan(String value) {
+            addCriterion("KEY >", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyGreaterThanOrEqualTo(String value) {
+            addCriterion("KEY >=", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyLessThan(String value) {
+            addCriterion("KEY <", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyLessThanOrEqualTo(String value) {
+            addCriterion("KEY <=", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyLike(String value) {
+            addCriterion("KEY like", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyNotLike(String value) {
+            addCriterion("KEY not like", value, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyIn(List<String> values) {
+            addCriterion("KEY in", values, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyNotIn(List<String> values) {
+            addCriterion("KEY not in", values, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyBetween(String value1, String value2) {
+            addCriterion("KEY between", value1, value2, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andKeyNotBetween(String value1, String value2) {
+            addCriterion("KEY not between", value1, value2, "key");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgIsNull() {
+            addCriterion("MSG is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgIsNotNull() {
+            addCriterion("MSG is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgEqualTo(String value) {
+            addCriterion("MSG =", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgNotEqualTo(String value) {
+            addCriterion("MSG <>", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgGreaterThan(String value) {
+            addCriterion("MSG >", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgGreaterThanOrEqualTo(String value) {
+            addCriterion("MSG >=", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgLessThan(String value) {
+            addCriterion("MSG <", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgLessThanOrEqualTo(String value) {
+            addCriterion("MSG <=", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgLike(String value) {
+            addCriterion("MSG like", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgNotLike(String value) {
+            addCriterion("MSG not like", value, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgIn(List<String> values) {
+            addCriterion("MSG in", values, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgNotIn(List<String> values) {
+            addCriterion("MSG not in", values, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgBetween(String value1, String value2) {
+            addCriterion("MSG between", value1, value2, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andMsgNotBetween(String value1, String value2) {
+            addCriterion("MSG not between", value1, value2, "msg");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeIsNull() {
+            addCriterion("GETTIME is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeIsNotNull() {
+            addCriterion("GETTIME is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeEqualTo(Date value) {
+            addCriterion("GETTIME =", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeNotEqualTo(Date value) {
+            addCriterion("GETTIME <>", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeGreaterThan(Date value) {
+            addCriterion("GETTIME >", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("GETTIME >=", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeLessThan(Date value) {
+            addCriterion("GETTIME <", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeLessThanOrEqualTo(Date value) {
+            addCriterion("GETTIME <=", value, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeIn(List<Date> values) {
+            addCriterion("GETTIME in", values, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeNotIn(List<Date> values) {
+            addCriterion("GETTIME not in", values, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeBetween(Date value1, Date value2) {
+            addCriterion("GETTIME between", value1, value2, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGettimeNotBetween(Date value1, Date value2) {
+            addCriterion("GETTIME not between", value1, value2, "gettime");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNull() {
+            addCriterion("TAG is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNotNull() {
+            addCriterion("TAG is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagEqualTo(String value) {
+            addCriterion("TAG =", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotEqualTo(String value) {
+            addCriterion("TAG <>", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThan(String value) {
+            addCriterion("TAG >", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThanOrEqualTo(String value) {
+            addCriterion("TAG >=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThan(String value) {
+            addCriterion("TAG <", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThanOrEqualTo(String value) {
+            addCriterion("TAG <=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLike(String value) {
+            addCriterion("TAG like", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotLike(String value) {
+            addCriterion("TAG not like", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIn(List<String> values) {
+            addCriterion("TAG in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotIn(List<String> values) {
+            addCriterion("TAG not in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagBetween(String value1, String value2) {
+            addCriterion("TAG between", value1, value2, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotBetween(String value1, String value2) {
+            addCriterion("TAG not between", value1, value2, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderIsNull() {
+            addCriterion("ALLREADER is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderIsNotNull() {
+            addCriterion("ALLREADER is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderEqualTo(String value) {
+            addCriterion("ALLREADER =", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderNotEqualTo(String value) {
+            addCriterion("ALLREADER <>", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderGreaterThan(String value) {
+            addCriterion("ALLREADER >", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderGreaterThanOrEqualTo(String value) {
+            addCriterion("ALLREADER >=", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderLessThan(String value) {
+            addCriterion("ALLREADER <", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderLessThanOrEqualTo(String value) {
+            addCriterion("ALLREADER <=", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderLike(String value) {
+            addCriterion("ALLREADER like", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderNotLike(String value) {
+            addCriterion("ALLREADER not like", value, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderIn(List<String> values) {
+            addCriterion("ALLREADER in", values, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderNotIn(List<String> values) {
+            addCriterion("ALLREADER not in", values, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderBetween(String value1, String value2) {
+            addCriterion("ALLREADER between", value1, value2, "allreader");
+            return (Criteria) this;
+        }
+
+        public Criteria andAllreaderNotBetween(String value1, String value2) {
+            addCriterion("ALLREADER not between", value1, value2, "allreader");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated do_not_delete_during_merge
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table PUSHMESSAGE
+     *
+     * @mbg.generated
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 28 - 0
src/main/java/com/gyee/frame/model/custom/ServerMessage.java

@@ -0,0 +1,28 @@
+package com.gyee.frame.model.custom;
+
+
+
+/**
+ *
+ * @ClassName: ServerMessage
+ * @Description: 服务端发送消息实体
+ * @author w
+ * @date 2021-11-25
+ */
+public class ServerMessage {
+
+    private String responseMessage;
+
+    public ServerMessage(String responseMessage) {
+        this.responseMessage = responseMessage;
+    }
+
+
+    public String getResponseMessage() {
+        return responseMessage;
+    }
+
+    public void setResponseMessage(String responseMessage) {
+        this.responseMessage = responseMessage;
+    }
+}

+ 57 - 0
src/main/java/com/gyee/frame/service/PushMessageService.java

@@ -0,0 +1,57 @@
+package com.gyee.frame.service;
+
+import com.gyee.frame.common.base.BaseService;
+import com.gyee.frame.model.auto.Project;
+import com.gyee.frame.model.auto.ProjectExample;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class PushMessageService implements BaseService<Project, ProjectExample> {
+    @Override
+    public int deleteByPrimaryKey(String id) {
+        return 0;
+    }
+
+    @Override
+    public int insertSelective(Project record) {
+        return 0;
+    }
+
+    @Override
+    public Project selectByPrimaryKey(String id) {
+        return null;
+    }
+
+    @Override
+    public int updateByPrimaryKeySelective(Project record) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExampleSelective(Project record, ProjectExample example) {
+        return 0;
+    }
+
+    @Override
+    public int updateByExample(Project record, ProjectExample example) {
+        return 0;
+    }
+
+    @Override
+    public List<Project> selectByExample(ProjectExample example) {
+        return null;
+    }
+
+    @Override
+    public long countByExample(ProjectExample example) {
+        return 0;
+    }
+
+    @Override
+    public int deleteByExample(ProjectExample example) {
+        return 0;
+    }
+}

+ 43 - 4
src/main/java/com/gyee/frame/service/comm/FullPushMsgService.java

@@ -1,10 +1,22 @@
 package com.gyee.frame.service.comm;
 
 
-import com.gyee.frame.model.benchmarking.PowerCompareDetail;
+import com.gyee.frame.common.spring.Constant;
+import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.PointData;
+import com.gyee.frame.service.PushMessageService;
+import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
+import com.gyee.frame.util.IRealTimeDataBaseUtil;
+import com.gyee.frame.util.MathUtil;
+import com.gyee.frame.util.RealTimeDataBaseFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -14,13 +26,40 @@ import java.util.Map;
 @Service
 public class FullPushMsgService {
 
+    @Autowired
+    private PushMessageService pushMessageService;
 
+    @Resource
+    private WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service;
 
-    public List<Map> pushmsg() {
+    IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
+    public Map<String, Object> addPushMsg() {
 
 
+        try {
+            Map<String, Object> jczbmap = new HashMap<>();
+            for (Windpowerstation wp : InitialRunner.wpls) {
+                List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());//场站设备数量
+                List<String> jczbls = new ArrayList<>();
+                //离线台数
+                jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WT_TXZD).getCode());
+                realApiUtil.getRealData(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WT_TXZD).getCode());
+                List<PointData> jczblist = realApiUtil.getRealData(jczbls);
+                //离线台数
+                Double lxts = MathUtil.twoBit(jczblist.get(0).getPointValueInDouble());
+                if(wtls.size() == lxts.intValue()){
+                    jczbmap.put("wp_lx", wp.getName()+"全场离线");
+                }
+
+
+            }
+
+            return jczbmap;
+        } catch (Exception e) {
+            return null;
+        }
+
 
-        return null;
     }
 }

+ 288 - 0
src/main/resources/mybatis/auto/PushMessageMapper.xml

@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gyee.frame.mapper.auto.PushMessageMapper">
+  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.PushMessage">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <id column="ID" jdbcType="DECIMAL" property="id" />
+    <result column="KEY" jdbcType="VARCHAR" property="key" />
+    <result column="MSG" jdbcType="VARCHAR" property="msg" />
+    <result column="GETTIME" jdbcType="TIMESTAMP" property="gettime" />
+    <result column="TAG" jdbcType="VARCHAR" property="tag" />
+    <result column="ALLREADER" jdbcType="VARCHAR" property="allreader" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    ID, KEY, MSG, GETTIME, TAG, ALLREADER
+  </sql>
+  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.PushMessageExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from PUSHMESSAGE
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from PUSHMESSAGE
+    where ID = #{id,jdbcType=DECIMAL}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from PUSHMESSAGE
+    where ID = #{id,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.PushMessageExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from PUSHMESSAGE
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.gyee.frame.model.auto.PushMessage">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into PUSHMESSAGE (ID, KEY, MSG, 
+      GETTIME, TAG, ALLREADER
+      )
+    values (#{id,jdbcType=DECIMAL}, #{key,jdbcType=VARCHAR}, #{msg,jdbcType=VARCHAR}, 
+      #{gettime,jdbcType=TIMESTAMP}, #{tag,jdbcType=VARCHAR}, #{allreader,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.PushMessage">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into PUSHMESSAGE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        ID,
+      </if>
+      <if test="key != null">
+        KEY,
+      </if>
+      <if test="msg != null">
+        MSG,
+      </if>
+      <if test="gettime != null">
+        GETTIME,
+      </if>
+      <if test="tag != null">
+        TAG,
+      </if>
+      <if test="allreader != null">
+        ALLREADER,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=DECIMAL},
+      </if>
+      <if test="key != null">
+        #{key,jdbcType=VARCHAR},
+      </if>
+      <if test="msg != null">
+        #{msg,jdbcType=VARCHAR},
+      </if>
+      <if test="gettime != null">
+        #{gettime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="tag != null">
+        #{tag,jdbcType=VARCHAR},
+      </if>
+      <if test="allreader != null">
+        #{allreader,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.gyee.frame.model.auto.PushMessageExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select count(*) from PUSHMESSAGE
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update PUSHMESSAGE
+    <set>
+      <if test="record.id != null">
+        ID = #{record.id,jdbcType=DECIMAL},
+      </if>
+      <if test="record.key != null">
+        KEY = #{record.key,jdbcType=VARCHAR},
+      </if>
+      <if test="record.msg != null">
+        MSG = #{record.msg,jdbcType=VARCHAR},
+      </if>
+      <if test="record.gettime != null">
+        GETTIME = #{record.gettime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.tag != null">
+        TAG = #{record.tag,jdbcType=VARCHAR},
+      </if>
+      <if test="record.allreader != null">
+        ALLREADER = #{record.allreader,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update PUSHMESSAGE
+    set ID = #{record.id,jdbcType=DECIMAL},
+      KEY = #{record.key,jdbcType=VARCHAR},
+      MSG = #{record.msg,jdbcType=VARCHAR},
+      GETTIME = #{record.gettime,jdbcType=TIMESTAMP},
+      TAG = #{record.tag,jdbcType=VARCHAR},
+      ALLREADER = #{record.allreader,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.PushMessage">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update PUSHMESSAGE
+    <set>
+      <if test="key != null">
+        KEY = #{key,jdbcType=VARCHAR},
+      </if>
+      <if test="msg != null">
+        MSG = #{msg,jdbcType=VARCHAR},
+      </if>
+      <if test="gettime != null">
+        GETTIME = #{gettime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="tag != null">
+        TAG = #{tag,jdbcType=VARCHAR},
+      </if>
+      <if test="allreader != null">
+        ALLREADER = #{allreader,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ID = #{id,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.PushMessage">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update PUSHMESSAGE
+    set KEY = #{key,jdbcType=VARCHAR},
+      MSG = #{msg,jdbcType=VARCHAR},
+      GETTIME = #{gettime,jdbcType=TIMESTAMP},
+      TAG = #{tag,jdbcType=VARCHAR},
+      ALLREADER = #{allreader,jdbcType=VARCHAR}
+    where ID = #{id,jdbcType=DECIMAL}
+  </update>
+</mapper>