瀏覽代碼

Merge branch 'master' of http://124.70.43.205:3000/GYEE_R.D/Gyee_Frame_NX

Administrator 3 年之前
父節點
當前提交
11f799e8fb
共有 24 個文件被更改,包括 2480 次插入82 次删除
  1. 19 0
      pom.xml
  2. 2 0
      src/main/java/com/gyee/SpringbootStart.java
  3. 15 0
      src/main/java/com/gyee/frame/common/conf/ExportConfig.java
  4. 45 0
      src/main/java/com/gyee/frame/common/conf/WebSocketStompConfig.java
  5. 55 0
      src/main/java/com/gyee/frame/controller/comm/WebSocketController.java
  6. 10 0
      src/main/java/com/gyee/frame/controller/curve/PowerCurveController.java
  7. 53 18
      src/main/java/com/gyee/frame/controller/export/GoldenController.java
  8. 96 0
      src/main/java/com/gyee/frame/mapper/auto/PushMessageMapper.java
  9. 212 0
      src/main/java/com/gyee/frame/model/auto/PushMessage.java
  10. 703 0
      src/main/java/com/gyee/frame/model/auto/PushMessageExample.java
  11. 28 0
      src/main/java/com/gyee/frame/model/custom/ServerMessage.java
  12. 69 0
      src/main/java/com/gyee/frame/model/excel/ExcelVo.java
  13. 57 0
      src/main/java/com/gyee/frame/service/PushMessageService.java
  14. 65 0
      src/main/java/com/gyee/frame/service/comm/FullPushMsgService.java
  15. 110 50
      src/main/java/com/gyee/frame/service/export/GoldenService.java
  16. 131 4
      src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  17. 195 0
      src/main/java/com/gyee/frame/util/excel/ExcelExportUtils.java
  18. 129 0
      src/main/java/com/gyee/frame/util/excel/FileUtils.java
  19. 174 0
      src/main/java/com/gyee/frame/util/excel/ZipUtils.java
  20. 15 9
      src/main/java/com/gyee/frame/util/task/TaskTemplateCallable.java
  21. 8 0
      src/main/resources/application.yml
  22. 1 1
      src/main/resources/mybatis/auto/AnalysissubtablebottomMapper.xml
  23. 288 0
      src/main/resources/mybatis/auto/PushMessageMapper.xml
  24. 0 0
      src/main/resources/static/ehcache/ehcache-shiro.xml

+ 19 - 0
pom.xml

@@ -366,6 +366,25 @@
 			<version>8.18.0</version>
 		</dependency>
 		<!--http请求-->
+
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi</artifactId>
+			<version>5.0.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>net.sourceforge.jexcelapi</groupId>
+			<artifactId>jxl</artifactId>
+			<version>2.6.12</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-collections4</artifactId>
+			<version>4.4</version>
+		</dependency>
+
 	</dependencies>
 
 

+ 2 - 0
src/main/java/com/gyee/SpringbootStart.java

@@ -5,6 +5,7 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 
 /**
@@ -12,6 +13,7 @@ import org.springframework.cache.annotation.EnableCaching;
  * @author gyee
  *
  */
+@EnableScheduling
 @EnableCaching
 @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
 public class SpringbootStart {

+ 15 - 0
src/main/java/com/gyee/frame/common/conf/ExportConfig.java

@@ -22,4 +22,19 @@ public class ExportConfig {
     private Map<String, String> template2swgl;
 
     private Map<String, String> template2cft;
+
+    //导出数据模板标题
+    private List<String> template1title;
+
+    private List<String> template2swdltitle;
+
+    private List<String> template2swgltitle;
+
+    private List<String> template2cfttitle;
+
+    //文件导出地址
+    private String exportpath;
+
+    //数据导出间隔
+    private List<Integer> exportval;
 }

+ 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");
+    }
+
+}

+ 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);
+    }
+}
+

+ 10 - 0
src/main/java/com/gyee/frame/controller/curve/PowerCurveController.java

@@ -0,0 +1,10 @@
+package com.gyee.frame.controller.curve;
+
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("/contrast")
+public class PowerCurveController {
+}

+ 53 - 18
src/main/java/com/gyee/frame/controller/export/GoldenController.java

@@ -5,25 +5,32 @@ import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.service.WindpowerstationService;
 import com.gyee.frame.service.export.GoldenService;
+import com.gyee.frame.util.excel.FileUtils;
+import com.gyee.frame.util.excel.ZipUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.util.*;
 
 @RestController
 @RequestMapping("/export")
-@Api(value = "golden数据导出功能",tags =  "golden数据导出功能")
+@Api(value = "golden数据导出功能", tags = "golden数据导出功能")
 public class GoldenController {
 
-    @Resource
+    @Autowired
     private GoldenService goldenService;
-    @Resource
+    @Autowired
     private WindpowerstationService stationService;
 
+
+    @Autowired
+    FileUtils fileUtils;
+
+
     /**
      * 查询所有的场站
      *
@@ -37,7 +44,6 @@ public class GoldenController {
     }
 
 
-
     /**
      * 通过模板导出单个风机数据
      *
@@ -67,23 +73,52 @@ public class GoldenController {
     /**
      * 通过模板导出所有风机数据
      *
-     * @param id       模板ID
-     * @param startTs  开始时间
-     * @param endTs    结束时间
-     * @param interval 时间间隔
+     * @param startTs 开始时间
+     * @param endTs   结束时间
      * @return
      */
     @GetMapping("/history/all")
     public AjaxResult getHistoryAll(
             @RequestParam(value = "station") String station,
-            @RequestParam(value = "templateId") Integer id,
             @RequestParam(value = "startTs") Long startTs,
-            @RequestParam(value = "endTs") Long endTs,
-            @RequestParam(value = "interval", required = false) Optional<Integer> interval) {
+            @RequestParam(value = "endTs") Long endTs) {
 
-        int val = interval.isPresent() ? interval.get() : 1800;
+        boolean tag = goldenService.getHistoryDataAll(station, startTs, endTs);
+        return AjaxResult.successData(AjaxStatus.success.code, tag);
+    }
 
-        Map<String, List<Object>> map = goldenService.getHistoryDataAll(station, id, startTs, endTs, val);
-        return AjaxResult.successData(AjaxStatus.success.code, map);
+
+    /**
+     * @param request
+     * @return
+     */
+    @GetMapping("/downloadFile")
+    public AjaxResult downloadFile(HttpServletRequest request,
+                                   @RequestParam(value = "station") String[] stations,
+                                   @RequestParam(value = "templateId") String templateId,
+                                   @RequestParam(value = "month") String[] month,
+                                   @RequestParam(value = "interval") int[] interval) throws Exception {
+
+        String zipName = "";
+        List<File> srcFiles = new ArrayList<>();
+        for (int i = 0; i < stations.length; i++) {
+            String path = fileUtils.getFilePath(stations[i], templateId, month[i], interval[i]);
+            if ("1".equals(templateId)) {
+                ZipUtils.toZip(fileUtils.getFilePathNoEx(path), path, true);
+                zipName = month[0] + "_单机数据.zip";
+            } else {
+                zipName = month[0] + "_测风塔数据.zip";
+            }
+            srcFiles.add(new File(path));
+        }
+        ZipUtils.toZip(srcFiles, fileUtils.getFilePath2("path", month[0], interval[0]), zipName);
+        Map map = new HashMap();
+        map.put("path", fileUtils.getFilePath2("url", month[0], interval[0]));
+        map.put("name", zipName);
+
+        AjaxResult result = AjaxResult.successData(200, map);
+        return 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;
+    }
+}

+ 69 - 0
src/main/java/com/gyee/frame/model/excel/ExcelVo.java

@@ -0,0 +1,69 @@
+package com.gyee.frame.model.excel;
+
+/**
+ * excel vo
+ */
+public class ExcelVo {
+
+
+    private String F1;
+
+    private double F2;
+
+    private double F3;
+
+    private double F4;
+
+    private double F5;
+
+    private double F6;
+
+
+    public String getF1() {
+        return F1;
+    }
+
+    public void setF1(String f1) {
+        F1 = f1;
+    }
+
+    public double getF2() {
+        return F2;
+    }
+
+    public void setF2(double f2) {
+        F2 = f2;
+    }
+
+    public double getF3() {
+        return F3;
+    }
+
+    public void setF3(double f3) {
+        F3 = f3;
+    }
+
+    public double getF4() {
+        return F4;
+    }
+
+    public void setF4(double f4) {
+        F4 = f4;
+    }
+
+    public double getF5() {
+        return F5;
+    }
+
+    public void setF5(double f5) {
+        F5 = f5;
+    }
+
+    public double getF6() {
+        return F6;
+    }
+
+    public void setF6(double f6) {
+        F6 = f6;
+    }
+}

+ 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;
+    }
+}

+ 65 - 0
src/main/java/com/gyee/frame/service/comm/FullPushMsgService.java

@@ -0,0 +1,65 @@
+package com.gyee.frame.service.comm;
+
+
+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 javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 推送全场重要消息
+ */
+@Service
+public class FullPushMsgService {
+
+    @Autowired
+    private PushMessageService pushMessageService;
+
+    @Resource
+    private WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service;
+
+    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;
+        }
+
+
+    }
+}

+ 110 - 50
src/main/java/com/gyee/frame/service/export/GoldenService.java

@@ -5,16 +5,22 @@ import com.gyee.frame.common.conf.ThreadPoolTaskConfig;
 import com.gyee.frame.common.exception.QiNiuException;
 import com.gyee.frame.common.exception.enums.QiNiuErrorEnum;
 import com.gyee.frame.common.feign.RemoteServiceBuilder;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.auto.WindpowerstationExample;
 import com.gyee.frame.model.custom.export.TsPointData;
 import com.gyee.frame.service.AnalysissubtablebottomService;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
+import com.gyee.frame.service.WindpowerstationService;
 import com.gyee.frame.service.WindturbineService;
 import com.gyee.frame.util.DateUtils;
+import com.gyee.frame.util.excel.ExcelExportUtils;
+import com.gyee.frame.util.excel.FileUtils;
 import com.gyee.frame.util.task.TaskTemplateCallable;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -27,25 +33,32 @@ import java.util.stream.Collectors;
 public class GoldenService {
 
 
-    @Resource
+    @Autowired
     private ExportConfig exportConfig;
-    @Resource
+    @Autowired
     private ThreadPoolTaskConfig taskConfig;
-    @Resource
+    @Autowired
     private RemoteServiceBuilder remoteService;
-    @Resource
+    @Autowired
     private WindturbineService windturbineService;
-    @Resource
+    @Autowired
     private WindTurbineTestingPointAiService windService;
+    @Autowired
+    private WindpowerstationService windpowerstationService;
 
-    @Resource
+    @Autowired
     private AnalysissubtablebottomService analysissubtablebottomService;
 
+    @Autowired
+    private FileUtils fileService;
+
+
     /**
      * 一天的时间戳
      */
     public static final Integer TIMES_TAMP_DAY = 86400;
 
+
     /**
      * 根据场站和风机ID查询
      *
@@ -71,24 +84,58 @@ public class GoldenService {
      * 查询所有风机
      *
      * @param station
-     * @param templateId
      * @param startTs
      * @param endTs
-     * @param interval
      * @return
      */
-    public Map<String, List<Object>> getHistoryDataAll(String station, int templateId, long startTs, long endTs, int interval) {
-        switch (templateId) {
-            case 1:
-                return getTemplateHistory1(station, startTs, endTs, interval);
-            case 2:
-                return getTemplateHistory2(station, startTs, endTs, interval);
-            default:
-                throw new QiNiuException(QiNiuErrorEnum.TEMPLATE_NO_SUPPORT);
+    public boolean getHistoryDataAll(String station,long startTs, long endTs) {
+
+        List<Integer>  val  =  exportConfig.getExportval();
+        WindpowerstationExample example = new WindpowerstationExample();
+        example.createCriteria().andIdLike("%"+station+"%");
+        List<Windpowerstation> lists = windpowerstationService.selectByExample(example);
+        for(int i :val){
+            for (Windpowerstation st: lists) {
+                getTemplateHistory1(st.getCode(),st.getAddress(),startTs,endTs,i*60);
+                getTemplateHistory2(st.getCode(),st.getAddress(),startTs,endTs,i*60);
+            }
         }
+        return true;
+
+
+
     }
 
 
+
+    @Scheduled(cron = "0 0 1 * * ?")
+//    @Scheduled(cron = "0/1 * * * * *")
+    public void getHistoryData() {
+
+        Calendar c = Calendar.getInstance();
+        c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH)-1,0, 0, 0);
+        long beginOfDate = c.getTime().getTime();
+        c = Calendar.getInstance();
+        c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH),0, 0, 0);
+        long endOfDate = c.getTime().getTime();
+
+        List<Integer>  val  =  exportConfig.getExportval();
+        WindpowerstationExample example = new WindpowerstationExample();
+        example.createCriteria().andIdLike("%_FDC%");
+        List<Windpowerstation> lists = windpowerstationService.selectByExample(example);
+//        beginOfDate = 1635696000000L;
+//        endOfDate = 1637596800000L;
+        for(int i :val){
+            for (Windpowerstation station: lists) {
+                getTemplateHistory1(station.getCode(),station.getAddress(),beginOfDate,endOfDate,i*60);
+                getTemplateHistory2(station.getCode(),station.getAddress(),beginOfDate,endOfDate,i*60);
+            }
+        }
+    }
+
+
+
+
     /**
      * 模板1  场站所有风机数据
      *
@@ -98,37 +145,38 @@ public class GoldenService {
      * @param interval
      * @return
      */
-    private Map<String, List<Object>> getTemplateHistory1(String station, long startTs, long endTs, int interval) {
-        // 风机ID、数据
-        Map<String, List<Object>> map = new LinkedHashMap<>();
+    private Map<String, Map<String, List<Object>>> getTemplateHistory1(String station, String address,long startTs, long endTs, int interval) {
 
+        String val = Integer.valueOf(interval / 60) + "";
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String startTss = dateFormat.format(startTs);
+        // 风机ID、数据
+        Map<String, Map<String, List<Object>>> map = new LinkedHashMap<>();
         try {
             List<String> winds = windturbineService.findWindTurbineAll(station);
             if (winds == null)
-                return map;
-
+                return null;
             // 异步返回结果
-            List<Future<Map<String, List<Object>>>> list = new LinkedList<>();
+            List<Future<Map<String, Map<String, List<Object>>>>> list = new LinkedList<>();
             for (String wind : winds) {
                 TaskTemplateCallable task = new TaskTemplateCallable(windService, remoteService.ShardingService(),
                         exportConfig.getTemplate1(), station, wind, startTs, endTs, interval);
                 Future submit = taskConfig.getExecutor().submit(task);
                 list.add(submit);
             }
-
             // 返回结果处理
-            for (Future<Map<String, List<Object>>> future : list) {
-                Map<String, List<Object>> wtMap = future.get();
-                for (Map.Entry<String, List<Object>> entry : wtMap.entrySet()) {
+            for (Future<Map<String, Map<String, List<Object>>>> future : list) {
+                Map<String, Map<String, List<Object>>> wtMap = future.get();
+                for (Map.Entry<String, Map<String, List<Object>>> entry : wtMap.entrySet()) {
                     map.put(entry.getKey(), entry.getValue());
+                    List<String> title = exportConfig.getTemplate1title();
+                    ExcelExportUtils.exelcExportTem(entry.getValue(), entry.getKey(), title, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\" + address + "单机\\", entry.getKey());
                 }
             }
-
         } catch (Exception e) {
-            log.error(e.getMessage());
+            log.error("error", e);
             throw new QiNiuException(QiNiuErrorEnum.ERROR_DATA);
         }
-
         return map;
     }
 
@@ -197,27 +245,28 @@ public class GoldenService {
      * @param endTs
      * @return
      */
-    private Map<String, List<Object>> getTemplateHistory2(String station, long startTs, long endTs, int interval) {
+    private Map<String, List<Object>> getTemplateHistory2(String station,String address, long startTs, long endTs, int interval) {
+
+        String val = Integer.valueOf(interval / 60) + "";
         // 风机ID、数据
         Map<String, List<Object>> map = new LinkedHashMap<>();
-
         try {
+
             // 上网电量
             String point = exportConfig.getTemplate2swdl().get(station);
             String[] points = point.split(",");
             DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
             String startTss = dateFormat.format(startTs);
             String endTss = dateFormat.format(endTs);
-            List<Map> data = analysissubtablebottomService.selectByRecorddateGrop(startTss,endTss,station,points);
-
-
-            //List<TsPointData> data = remoteService.ShardingService().getHistorySnap(point, startTs, endTs, TIMES_TAMP_DAY);
+            List<Map> data = analysissubtablebottomService.selectByRecorddateGrop(startTss, endTss, station, points);
             List<Object> list = new ArrayList<>();
-            //list.add(data.stream().map(p -> DateUtils.format(p.getTs(), DateUtils.DATE_PATTERN)).collect(Collectors.toList()));
-            //list.add(data.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList()));
-
             list.add(data.stream().map(p -> dateFormat.format(p.get("RECORDDATE"))).collect(Collectors.toList()));
             list.add(data.stream().map(p -> Double.valueOf(p.get("SWDL").toString())).collect(Collectors.toList()));
+            List<String> swdltitle = exportConfig.getTemplate2swdltitle();
+            Map<String, List<Object>> swdlVos = new HashMap<>();
+            swdlVos.put("F1", data.stream().map(p -> dateFormat.format(p.get("RECORDDATE"))).collect(Collectors.toList()));
+            swdlVos.put("F2", data.stream().map(p -> Double.valueOf(p.get("SWDL").toString())).collect(Collectors.toList()));
+            ExcelExportUtils.exelcExportTem(swdlVos, "日上网电量", swdltitle, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\", address+"测风塔");
             map.put("swdl", list);
 
             // 上网功率
@@ -226,18 +275,22 @@ public class GoldenService {
             List<Object> list2 = new ArrayList<>();
             list2.add(data2.stream().map(p -> DateUtils.format(p.getTs(), DateUtils.DATE_TIME_PATTERN)).collect(Collectors.toList()));
             list2.add(data2.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList()));
+            Map<String, List<Object>> swglVos = new HashMap<>();
+            swglVos.put("F1", data2.stream().map(p -> DateUtils.format(p.getTs(), DateUtils.DATE_TIME_PATTERN)).collect(Collectors.toList()));
+            swglVos.put("F2", data2.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList()));
+            List<String> swgltitle = exportConfig.getTemplate2swgltitle();
+            ExcelExportUtils.exelcExportTem(swglVos, "上网功率", swgltitle, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\", address+"测风塔");
             map.put("swgl", list2);
 
             // 测风塔数据
             String point3 = exportConfig.getTemplate2cft().get(station);
-            List<Object> maps = getTemplateHistory2(startTs, endTs, interval, point3);
-            map.put("cft", maps);
-
-        } catch (QiNiuException e) {
-            log.error(e.getMessage());
+            Map<String, List<Object>> cftlVos = getTemplateHistory2(startTs, endTs, interval, point3);
+            List<String> cftltitle = exportConfig.getTemplate2cfttitle();
+            ExcelExportUtils.exelcExportTem(cftlVos, "测风塔数据", cftltitle, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\", address+"测风塔");
+        } catch (Exception e) {
+            log.error("error", e);
             throw new QiNiuException(QiNiuErrorEnum.ERROR_DATA);
         }
-
         return map;
     }
 
@@ -251,15 +304,20 @@ public class GoldenService {
      * @param points
      * @return
      */
-    private List<Object> getTemplateHistory2(long startTs, long endTs, int interval, String points) {
+    private Map<String, List<Object>> getTemplateHistory2(long startTs, long endTs, int interval, String points) {
         List<Object> list = new ArrayList<>();
 
+        Map<String, List<Object>> map = new HashMap<>();
+
+
         // 第一列添加时间
-        List<String> intervals = dateInterval(startTs, endTs, interval);
+        List<Object> intervals = dateInterval(startTs, endTs, interval);
         list.add(intervals);
+        map.put("F1", intervals);
 
         try {
             String[] splits = points.split(",");
+            int num = 2;
             for (String point : splits) {
                 List<TsPointData> data = remoteService.ShardingService().getHistorySnap(point, startTs, endTs, interval);
 
@@ -271,6 +329,8 @@ public class GoldenService {
                     collect = data.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList());
                 }
                 list.add(collect);
+                map.put("F" + num, collect);
+                num++;
             }
 
         } catch (QiNiuException e) {
@@ -278,7 +338,7 @@ public class GoldenService {
             throw new QiNiuException(QiNiuErrorEnum.ERROR_DATA);
         }
 
-        return list;
+        return map;
     }
 
 
@@ -290,8 +350,8 @@ public class GoldenService {
      * @param interval
      * @return
      */
-    private List<String> dateInterval(long st, long et, int interval) {
-        List<String> list = new ArrayList<>();
+    private List<Object> dateInterval(long st, long et, int interval) {
+        List<Object> list = new ArrayList<>();
         int val = interval * 1000;
         while (st < et) {
             list.add(DateUtils.format(st, DateUtils.DATE_TIME_PATTERN));

+ 131 - 4
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -468,10 +468,11 @@ public class GenreSetPushService {
                 }
             }
 
-            if(rycfdl==0.0)
-            {
-                rycfdl = rfdl * YCFDLXS;
-            }
+//            if(rycfdl==0.0)
+//            {
+//                rycfdl = rfdl * YCFDLXS;
+//            }
+            rycfdl = StringUtils.round(rfdl * YCFDLXS, 2);
             //预测电量临时算法=(月发电量+日预测发电量*(日历天数-当前日数))*预测发电量系数
             c = Calendar.getInstance();
             double yycfdl = (yfdl + rycfdl*(daynum-c.get(Calendar.DAY_OF_MONTH)))*YCFDLXS;
@@ -859,6 +860,132 @@ public class GenreSetPushService {
                     mxztmap.put("hjslts", 0.0);
 
                     mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
+                }else if (id.endsWith("_GC")){
+                    List<String> gfzbls = new ArrayList<>();
+
+                    List<Windturbine> wtls = InitialRunner.pj_wtmap.get(id);
+                    for(Windturbine wt:wtls) {
+                        //状态
+                        gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+                    }
+                    List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
+                    if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {
+                        for (int i = 0; i < wtls.size(); i++) {
+                            double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
+                            switch (Double.valueOf(gfzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    zcfdnum++;
+                                    break;
+                                case 2:
+                                    gztjnum++;
+                                    break;
+                                case 3:
+                                    lxnum++;
+                                    break;
+                                case 4:
+                                    jxtjnum++;
+                                    break;
+                                case 5:
+                                    xdjclnum++;
+                                    break;
+                                case 6:
+                                    xdjclnum++;
+                                    break;
+                                default:
+                                    break;
+                            }
+
+                        }
+                    }
+
+                    //待机台数
+                    mxztmap.put("djts", djnum);
+                    //正常发电台数
+                    mxztmap.put("yxts", zcfdnum);
+                    // 限电降出力台数
+                    mxztmap.put("xdjclts", xdjclnum);
+                    // 故障停机台数
+                    mxztmap.put("gzts", gztjnum);
+                    // 检修停机台数
+                    mxztmap.put("jxts", jxtjnum);
+                    // 电网受累台数
+                    mxztmap.put("dwslts", dwslnum);
+                    // 风机离线台数
+                    mxztmap.put("lxts", lxnum);
+                    mxztmap.put("sdtjts", 0.0);
+                    mxztmap.put("fdjclts", 0.0);
+                    mxztmap.put("xdtjts", 0.0);
+                    mxztmap.put("cnslgzts", 0.0);
+                    mxztmap.put("cnsljxts", 0.0);
+                    mxztmap.put("hjslts", 0.0);
+
+                    mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
+                }else if (id.endsWith("_XL")){
+                    List<String> gfzbls = new ArrayList<>();
+
+                    List<Windturbine> wtls = InitialRunner.ln_wtmap.get(id);
+                    for(Windturbine wt:wtls) {
+                        //状态
+                        gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+                    }
+                    List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
+                    if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {
+                        for (int i = 0; i < wtls.size(); i++) {
+                            double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
+                            switch (Double.valueOf(gfzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    zcfdnum++;
+                                    break;
+                                case 2:
+                                    gztjnum++;
+                                    break;
+                                case 3:
+                                    lxnum++;
+                                    break;
+                                case 4:
+                                    jxtjnum++;
+                                    break;
+                                case 5:
+                                    xdjclnum++;
+                                    break;
+                                case 6:
+                                    xdjclnum++;
+                                    break;
+                                default:
+                                    break;
+                            }
+
+                        }
+                    }
+
+                    //待机台数
+                    mxztmap.put("djts", djnum);
+                    //正常发电台数
+                    mxztmap.put("yxts", zcfdnum);
+                    // 限电降出力台数
+                    mxztmap.put("xdjclts", xdjclnum);
+                    // 故障停机台数
+                    mxztmap.put("gzts", gztjnum);
+                    // 检修停机台数
+                    mxztmap.put("jxts", jxtjnum);
+                    // 电网受累台数
+                    mxztmap.put("dwslts", dwslnum);
+                    // 风机离线台数
+                    mxztmap.put("lxts", lxnum);
+                    mxztmap.put("sdtjts", 0.0);
+                    mxztmap.put("fdjclts", 0.0);
+                    mxztmap.put("xdtjts", 0.0);
+                    mxztmap.put("cnslgzts", 0.0);
+                    mxztmap.put("cnsljxts", 0.0);
+                    mxztmap.put("hjslts", 0.0);
+
+                    mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
                 }else {
                     mxztmap.put("djts", 0.0);
                     mxztmap.put("sdtjts", 0.0);

+ 195 - 0
src/main/java/com/gyee/frame/util/excel/ExcelExportUtils.java

@@ -0,0 +1,195 @@
+package com.gyee.frame.util.excel;
+
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * EXCEL导出工具
+ */
+public class ExcelExportUtils {
+
+    private static Logger logger = LoggerFactory.getLogger(ExcelExportUtils.class);
+
+    /**
+     *
+     * @param voList 数据
+     * @param sheetName sheet名称
+     * @param titles 单元格表头
+     * @param path 导出路径
+     * @param fileName 导出文件名
+     * @return
+     * @throws Exception
+     */
+    public static boolean exelcExportTem(Map<String, List<Object>> voList, String sheetName, List<String> titles, String path, String fileName) throws Exception {
+
+        boolean check = checkExist(path, fileName + ".xls");
+        if (check) {
+            //获取d://test.xls,建立数据的输入通道
+            FileInputStream in = new FileInputStream(path + fileName + ".xls");
+            //使用POI提供的方法得到excel的信息
+            POIFSFileSystem poifsFileSystem = new POIFSFileSystem(in);
+            //得到文档对象
+            HSSFWorkbook workbook = new HSSFWorkbook(poifsFileSystem);
+            //根据name获取sheet表
+            HSSFSheet sheet = workbook.getSheet(sheetName);
+            if (null == sheet) {
+                sheet = workbook.createSheet(sheetName);
+                HSSFRow row = sheet.createRow(0);
+                //创建单元格,设置表头
+                HSSFCell cell = row.createCell(0);
+                for (int i = 1; i <= titles.size(); i++) {
+                    cell.setCellValue(titles.get(i - 1));
+                    cell = row.createCell(i);
+                }
+            }
+            FileOutputStream out = new FileOutputStream(path + fileName + ".xls");  //向d://test.xls中写数据
+            for (int i = 0; i < voList.get("F1").size(); i++) {
+                HSSFRow row = sheet.createRow((short) (sheet.getLastRowNum() + 1)); //对总行数减4,就是倒数行数加数据
+                //创建单元格设值
+                switch (titles.size()) {
+                    case 2:
+                        row.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        break;
+                    case 5:
+                        row.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        row.createCell(2).setCellValue(Double.valueOf(voList.get("F3").get(i).toString()));
+                        row.createCell(3).setCellValue(Double.valueOf(voList.get("F4").get(i).toString()));
+                        row.createCell(4).setCellValue(Double.valueOf(voList.get("F5").get(i).toString()));
+                        break;
+                    case 6:
+                        row.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        row.createCell(2).setCellValue(Double.valueOf(voList.get("F3").get(i).toString()));
+                        row.createCell(3).setCellValue(Double.valueOf(voList.get("F4").get(i).toString()));
+                        row.createCell(4).setCellValue(Double.valueOf(voList.get("F5").get(i).toString()));
+                        row.createCell(5).setCellValue(Double.valueOf(voList.get("F6").get(i).toString()));
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+            try {
+                workbook.write(out);
+                out.flush();
+                logger.info(fileName + "-文件写入成功");
+                return true;
+            } catch (Exception e) {
+                logger.error("文件写入失败", e);
+                return false;
+            } finally {
+                if (null != out) {
+                    out.close();
+                }
+                if (null != workbook) {
+                    workbook.close();
+                }
+            }
+
+        } else {
+
+            //创建一个workbook对应一个excel文件
+            HSSFWorkbook workbook = new HSSFWorkbook();
+            //在workbook中创建一个sheet对应excel中的sheet
+            HSSFSheet sheet = workbook.createSheet(sheetName);
+            //在sheet表中添加表头第0行,老版本的poi对sheet的行列有限制
+            HSSFRow row0 = sheet.createRow(0);
+            //创建单元格,设置表头
+            HSSFCell cell = row0.createCell(0);
+            for (int i = 1; i <= titles.size(); i++) {
+                cell.setCellValue(titles.get(i - 1));
+                cell = row0.createCell(i);
+            }
+            //写入数据
+            for (int i = 0; i < voList.get("F1").size(); i++) {
+                HSSFRow row1 = sheet.createRow(i + 1);
+                //创建单元格设值
+                switch (titles.size()) {
+                    case 2:
+                        row1.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row1.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        break;
+                    case 5:
+                        row1.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row1.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        row1.createCell(2).setCellValue(Double.valueOf(voList.get("F3").get(i).toString()));
+                        row1.createCell(3).setCellValue(Double.valueOf(voList.get("F4").get(i).toString()));
+                        row1.createCell(4).setCellValue(Double.valueOf(voList.get("F5").get(i).toString()));
+                        break;
+                    case 6:
+                        row1.createCell(0).setCellValue(voList.get("F1").get(i).toString());
+                        row1.createCell(1).setCellValue(Double.valueOf(voList.get("F2").get(i).toString()));
+                        row1.createCell(2).setCellValue(Double.valueOf(voList.get("F3").get(i).toString()));
+                        row1.createCell(3).setCellValue(Double.valueOf(voList.get("F4").get(i).toString()));
+                        row1.createCell(4).setCellValue(Double.valueOf(voList.get("F5").get(i).toString()));
+                        row1.createCell(5).setCellValue(Double.valueOf(voList.get("F6").get(i).toString()));
+                        break;
+                    default:
+                        break;
+                }
+            }
+            //将文件保存到指定的位置
+
+            FileOutputStream out = null;
+            try {
+                out = new FileOutputStream(path + fileName + ".xls");
+                workbook.write(out);
+                out.flush();
+                logger.info(fileName + "-文件写入成功");
+                return true;
+            } catch (Exception e) {
+                logger.error("文件写入失败", e);
+                return false;
+            } finally {
+                if (null != out) {
+                    out.close();
+                }
+            }
+        }
+
+    }
+
+
+    /**
+     * 判断文件及目录是否存在,若目录不存在则创建目录,文件不存 在返回false
+     *
+     * @param filepath
+     * @param fileName
+     * @return tag
+     * @throws Exception
+     */
+    public static boolean checkExist(String filepath, String fileName) throws Exception {
+
+        boolean tag = false;
+        File path = new File(filepath);
+        File name = new File(filepath + fileName);
+        //判断目录是否存在
+        if (path.exists()) {
+            //判断文件是否存在
+            if (name.exists()) {
+                tag = true;
+            }
+        } else {
+            //创建目录
+            path.mkdirs();
+            //检查目录是否存在
+            if (name.exists()) {
+                tag = true;
+            }
+        }
+        return tag;
+    }
+
+}

+ 129 - 0
src/main/java/com/gyee/frame/util/excel/FileUtils.java

@@ -0,0 +1,129 @@
+package com.gyee.frame.util.excel;
+
+import com.gyee.frame.common.conf.ExportConfig;
+import com.gyee.frame.common.exception.QiNiuException;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.auto.WindpowerstationExample;
+import com.gyee.frame.service.WindpowerstationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+import org.springframework.stereotype.Service;
+
+import java.net.MalformedURLException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.List;
+
+@Service
+public class FileUtils {
+
+
+
+
+    @Autowired
+    private ExportConfig exportConfig;
+
+
+    @Autowired
+    private WindpowerstationService windpowerstationService;
+
+
+    private final Path fileStorageLocation; // 文件在本地存储的地址
+
+
+    @Autowired
+    public FileUtils() {
+        this.fileStorageLocation = Paths.get(System.getProperty("user.dir")).toAbsolutePath().normalize();
+    }
+
+
+    /**
+     * 加载文件
+     * @param fileName 文件名
+     * @return 文件
+     */
+    public Resource loadFileAsResource(String fileName) {
+        try {
+            Path filePath = this.fileStorageLocation.resolve(fileName).normalize();
+            Resource resource = new UrlResource(filePath.toUri());
+            if(resource.exists()) {
+                return resource;
+            } else {
+                throw new QiNiuException("File not found " + fileName);
+            }
+        } catch (MalformedURLException ex) {
+            throw new QiNiuException("File not found " + fileName);
+        }
+    }
+
+
+    /**
+     * 获取文件路径
+     * @param station
+     * @param templateId
+     * @param month
+     * @param interval
+     * @return
+     */
+    public String getFilePath(String station,String templateId,String month,int interval) {
+
+        StringBuilder sb = new StringBuilder();
+        try {
+            String val = Integer.valueOf(interval / 60) + "";
+            WindpowerstationExample example = new WindpowerstationExample();
+            example.createCriteria().andIdLike("%"+station+"%");
+            List<Windpowerstation> lists = windpowerstationService.selectByExample(example);
+            String uploadDir =  exportConfig.getExportpath();
+            sb.append(uploadDir).append("\\");
+            sb.append(month).append("\\");
+            sb.append(val).append("分钟\\");
+            if ("1".equals(templateId)){
+                sb.append(lists.get(0).getAddress()).append("单机").append(".zip");
+            }else if ("2".equals(templateId)){
+                sb.append(lists.get(0).getAddress()).append("测风塔").append(".xls");
+            } else {
+                throw new QiNiuException("请求错误");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return sb.toString();
+    }
+
+
+    /**
+     * 获取文件路径
+     * @param tag
+     * @param month
+     * @param interval
+     * @return
+     */
+    public String getFilePath2(String tag,String month,int interval) {
+        String val = Integer.valueOf(interval / 60) + "";
+        StringBuilder sb = new StringBuilder();
+        if ("path".equals(tag)){
+            sb.append(exportConfig.getExportpath()).append("\\");
+        }else {
+            sb.append("http:\\10.155.32.4:8070").append("\\zhfx\\excel\\");
+        }
+
+        sb.append(month).append("\\");
+        sb.append(val).append("分钟");
+        return sb.toString();
+    }
+
+
+    public  String getFilePathNoEx(String filePath) {
+        if ((filePath != null) && (filePath.length() > 0)) {
+            int dot = filePath.lastIndexOf('.');
+            if ((dot >-1) && (dot < (filePath.length()))) {
+                return filePath.substring(0, dot);
+            }
+        }
+        return filePath;
+    }
+
+
+
+}

+ 174 - 0
src/main/java/com/gyee/frame/util/excel/ZipUtils.java

@@ -0,0 +1,174 @@
+package com.gyee.frame.util.excel;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * 文件压缩工具类
+ */
+public class ZipUtils {
+
+
+    private static Logger logger = LoggerFactory.getLogger(ZipUtils.class);
+    private static final int BUFFER_SIZE = 2 * 1024;
+
+
+    /**
+     * 压缩成ZIP 方法1
+     *
+     * @param srcDir           压缩文件夹路径
+     * @param path             压缩文件输出流
+     * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+     * @throws RuntimeException 压缩失败会抛出运行时异常
+     */
+    public static void toZip(String srcDir, String path, boolean KeepDirStructure) {
+        long start = System.currentTimeMillis();
+        ZipOutputStream zos = null;
+        OutputStream fos = null;
+        try {
+            File file = new File(path);
+            if (file.exists()) {
+                file.delete();
+            }
+            fos = new FileOutputStream(file);
+            zos = new ZipOutputStream(fos);
+            File sourceFile = new File(srcDir);
+            compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
+            long end = System.currentTimeMillis();
+            logger.info("压缩完成,耗时:" + (end - start) + " ms");
+        } catch (Exception e) {
+            logger.error("zip error from ZipUtils", e);
+        } finally {
+            if (zos != null) {
+                try {
+                    zos.close();
+                } catch (Exception e) {
+                    logger.error("zos 流关闭异常", e);
+                }
+            }
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (Exception e) {
+                    logger.error("fos 流关闭异常", e);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 压缩成ZIP 方法2
+     *
+     * @param srcFiles 需要压缩的文件列表
+     * @param path     压缩文件地址
+     * @param zipName  压缩文件名
+     * @throws RuntimeException 压缩失败会抛出运行时异常
+     */
+    public static void toZip(List<File> srcFiles, String path, String zipName) throws RuntimeException {
+        long start = System.currentTimeMillis();
+
+        FileOutputStream out = null;
+        ZipOutputStream zos = null;
+        try {
+            File file = new File(path+"\\"+zipName);
+            if (file.exists()) {
+                file.delete();
+            }
+            out = new FileOutputStream(file);
+            zos = new ZipOutputStream(out);
+            for (File srcFile : srcFiles) {
+                byte[] buf = new byte[BUFFER_SIZE];
+                zos.putNextEntry(new ZipEntry(srcFile.getName()));
+                int len;
+                FileInputStream in = new FileInputStream(srcFile);
+                while ((len = in.read(buf)) != -1) {
+                    zos.write(buf, 0, len);
+                }
+                zos.closeEntry();
+                in.close();
+            }
+            long end = System.currentTimeMillis();
+            logger.info("压缩完成,耗时:" + (end - start) + " ms");
+        } catch (Exception e) {
+            logger.error("zip error from ZipUtils", e);
+            throw new RuntimeException("zip error from ZipUtils", e);
+        } finally {
+            if (zos != null) {
+                try {
+                    zos.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+
+        }
+    }
+
+
+
+
+    /**
+     * 递归压缩方法
+     *
+     * @param sourceFile       源文件
+     * @param zos              zip输出流
+     * @param name             压缩后的名称
+     * @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
+     * @throws Exception
+     */
+    private static void compress(File sourceFile, ZipOutputStream zos, String name,
+                                 boolean KeepDirStructure) throws Exception {
+        byte[] buf = new byte[BUFFER_SIZE];
+        if (sourceFile.isFile()) {
+            // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
+            zos.putNextEntry(new ZipEntry(name));
+            // copy文件到zip输出流中
+            int len;
+            FileInputStream in = new FileInputStream(sourceFile);
+            while ((len = in.read(buf)) != -1) {
+                zos.write(buf, 0, len);
+            }
+            // Complete the entry
+            zos.closeEntry();
+            in.close();
+        } else {
+            File[] listFiles = sourceFile.listFiles();
+            if (listFiles == null || listFiles.length == 0) {
+                // 需要保留原来的文件结构时,需要对空文件夹进行处理
+                if (KeepDirStructure) {
+                    // 空文件夹的处理
+                    zos.putNextEntry(new ZipEntry(name + "/"));
+                    // 没有文件,不需要文件的copy
+
+                    zos.closeEntry();
+                }
+            } else {
+                for (File file : listFiles) {
+                    // 判断是否需要保留原来的文件结构
+                    if (KeepDirStructure) {
+                        // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
+                        // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
+                        compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
+                    } else {
+                        compress(file, zos, file.getName(), KeepDirStructure);
+                    }
+                }
+            }
+        }
+
+    }
+}

+ 15 - 9
src/main/java/com/gyee/frame/util/task/TaskTemplateCallable.java

@@ -41,16 +41,19 @@ public class TaskTemplateCallable implements Callable {
 
 
     @Override
-    public Map<String, List<Object>> call()  {
+    public Map<String, Map<String, List<Object>>> call()  {
 
-        Map<String, List<Object>> map = new HashMap<>();
-        List<Object> list = new ArrayList<>();
+        Map<String, Map<String, List<Object>>> map = new HashMap<>();
+//        List<Object> list = new ArrayList<>();
+        Map<String, List<Object>> list = new HashMap<>();
 
         // 第一列添加时间
-        List<String> intervals = dateInterval(startTs, endTs, interval);
-        list.add(intervals);
+        List<Object> intervals = dateInterval(startTs, endTs, interval);
+        //list.add(intervals);
+        list.put("F1",intervals);
 
         try {
+            int num = 2;
             for (String code : this.codes) {
                 List<WindTurbineTestingPointAi2> windPoints = this.windService.findPointsByUniformCodeAndStation(station, wtId, code);
                 if (windPoints == null || windPoints.size() == 0)
@@ -68,7 +71,8 @@ public class TaskTemplateCallable implements Callable {
                     } else {
                         collect = data.stream().map(point -> (int) point.getDoubleValue()).collect(Collectors.toList());
                     }
-                    list.add(collect);
+                    //list.add(collect);
+                    list.put("F"+num,collect);
                 } else {
                     if (data.size() == 0) {
                         for (int i = 0; i < intervals.size(); i++)
@@ -76,8 +80,10 @@ public class TaskTemplateCallable implements Callable {
                     } else {
                         collect = data.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList());
                     }
-                    list.add(collect);
+                    //list.add(collect);
+                    list.put("F"+num,collect);
                 }
+                num++;
             }
 
             map.put(this.wtId, list);
@@ -99,8 +105,8 @@ public class TaskTemplateCallable implements Callable {
      * @param interval
      * @return
      */
-    private List<String> dateInterval(long st, long et, int interval) {
-        List<String> list = new ArrayList<>();
+    private List<Object> dateInterval(long st, long et, int interval) {
+        List<Object> list = new ArrayList<>();
         int val = interval * 1000;
         while (st < et) {
             list.add(DateUtils.format(st, DateUtils.DATE_TIME_PATTERN));

+ 8 - 0
src/main/resources/application.yml

@@ -173,6 +173,7 @@ zmconfig:
 #golden数据导出模板测点
 exportcode:
   template1: AI022,AI130,GZZT,XDZT
+  template1title: 数据时间, scada风速(m/s), scada功率(kW), 是否故障(故障=1,不故障=0), 是否限电(限电=1,不限电=0)
   #日上网电量
 #  template2swdl:
 #    MHS_FDC: MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0136
@@ -187,6 +188,7 @@ exportcode:
     QS_FDC: QSDJL.NX_GD_QSF_DD_P1_L1_001_ZXYG001, SLDJL.NX_GD_QSF_DD_P1_L1_001_ZXYG001
     SBQ_FDC: SBQDJL.NX_GD_SBQF_DD_P1_L1_001_ZXYG009, SBQDJL.NX_GD_SBQF_DD_P1_L1_001_ZXYG061, SBQDJL.NX_GD_SBQF_DD_P1_L1_001_ZXYG109
     XS_FDC: XSDJL.NX_GD_XSF_DD_P1_L1_001_ZXYG017
+  template2swdltitle: 数据时间(格式:2021/10/1), 日报上网电量(mWh)
   #上网功率
   template2swgl:
     MHS_FDC: MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0135
@@ -194,6 +196,7 @@ exportcode:
     QS_FDC: QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0135
     SBQ_FDC: SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0135
     XS_FDC: XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0135
+  template2swgltitle: 数据时间(格式:2019-05-01 13:10:00), 上网功率(kW)
   #测风塔数据
   template2cft:
     MHS_FDC: MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLS30,MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLD70,MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLTEM,MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLPRE,MHSFGL.NX_GD_MHSF_YC_P1_L1_001_FGLHUM
@@ -201,3 +204,8 @@ exportcode:
     QS_FDC: QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT003,QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT018,QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT019,QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT020,QSFGL.NX_GD_QSF_YC_P1_L1_001_CFT021
     SBQ_FDC: SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0106,SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLD70,SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLTEM,SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLPRE,SBQFGL.NX_GD_SBQF_YC_P1_L1_001_FGLHUM
     XS_FDC: XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLS30,XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLD70,XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLTEM,XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLPRE,XSFGL.NX_GD_XSF_YC_P1_L1_001_FGLHUM
+  template2cfttitle: 数据时间(格式:2019-05-01 13:10:00), 轮毂高度平均风速(m/s), 轮毂高度平均风向(°), 温度(℃), 压强(hPa), 湿度(%)
+  exportpath: D:\\gis\apache-tomcat-8.0.36\\webapps\\zhfx\\excel
+  #exportpath: D:\\java\\apache-tomcat-9.0.50\\webapps\\excel
+  exportval: 5, 10, 15
+

+ 1 - 1
src/main/resources/mybatis/auto/AnalysissubtablebottomMapper.xml

@@ -360,7 +360,7 @@
         <where>
             AND wpid = #{wpid}
             AND RECORDDATE >= to_date(#{startTs}, 'yyyy-mm-dd')
-            AND RECORDDATE  &lt;=  to_date(#{endTs}, 'yyyy-mm-dd')
+            AND RECORDDATE  &lt;  to_date(#{endTs}, 'yyyy-mm-dd')
             AND meterid in
             <foreach collection="point" item="item" index="index" open= "(" separator="," close=")">
                 #{item}

+ 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>

src/main/resources/ehcache/ehcache-shiro.xml → src/main/resources/static/ehcache/ehcache-shiro.xml