|
@@ -84,28 +84,32 @@ 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:
|
|
|
- getTemplateHistory1(station, null,startTs, endTs, interval);
|
|
|
- return null;
|
|
|
- case 2:
|
|
|
- return getTemplateHistory2(station,null, 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 * * ?")
|
|
|
-
|
|
|
+
|
|
|
public void getHistoryData() {
|
|
|
|
|
|
Calendar c = Calendar.getInstance();
|
|
@@ -119,8 +123,8 @@ public class GoldenService {
|
|
|
WindpowerstationExample example = new WindpowerstationExample();
|
|
|
example.createCriteria().andIdLike("%_FDC%");
|
|
|
List<Windpowerstation> lists = windpowerstationService.selectByExample(example);
|
|
|
- beginOfDate = 1633017600000L;
|
|
|
- endOfDate = 1635696000000L;
|
|
|
+ beginOfDate = 1635696000000L;
|
|
|
+ endOfDate = 1637596800000L;
|
|
|
for(int i :val){
|
|
|
for (Windpowerstation station: lists) {
|
|
|
getTemplateHistory1(station.getCode(),station.getAddress(),beginOfDate,endOfDate,i*60);
|
|
@@ -166,7 +170,7 @@ public class GoldenService {
|
|
|
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() + "\\excel\\" + startTss.substring(0, 7) + "\\" + val + "\\" + address + "单机\\", entry.getKey());
|
|
|
+ ExcelExportUtils.exelcExportTem(entry.getValue(), entry.getKey(), title, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\" + address + "单机\\", entry.getKey());
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -262,7 +266,7 @@ public class GoldenService {
|
|
|
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() + "\\excel\\" + startTss.substring(0, 7) + "//" + val + "//", address+"测风塔");
|
|
|
+ ExcelExportUtils.exelcExportTem(swdlVos, "日上网电量", swdltitle, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\", address+"测风塔");
|
|
|
map.put("swdl", list);
|
|
|
|
|
|
|
|
@@ -275,14 +279,14 @@ public class GoldenService {
|
|
|
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() + "\\excel\\" + startTss.substring(0, 7) + "//" + val + "//", address+"测风塔");
|
|
|
+ ExcelExportUtils.exelcExportTem(swglVos, "上网功率", swgltitle, exportConfig.getExportpath() + "\\" + startTss.substring(0, 7) + "\\" + val + "分钟\\", address+"测风塔");
|
|
|
map.put("swgl", list2);
|
|
|
|
|
|
|
|
|
String point3 = exportConfig.getTemplate2cft().get(station);
|
|
|
Map<String, List<Object>> cftlVos = getTemplateHistory2(startTs, endTs, interval, point3);
|
|
|
List<String> cftltitle = exportConfig.getTemplate2cfttitle();
|
|
|
- ExcelExportUtils.exelcExportTem(cftlVos, "测风塔数据", cftltitle, exportConfig.getExportpath() + "\\excel\\" + startTss.substring(0, 7) + "//" + val + "//", address+"测风塔");
|
|
|
+ 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);
|