Browse Source

用能月报导出

jichaobo 3 years ago
parent
commit
40431d6033

+ 5 - 4
fiveep-model/src/main/java/com/bizmatics/model/vo/HtAnalogDataOneVo.java

@@ -29,14 +29,15 @@ public class HtAnalogDataOneVo implements Serializable {
     private Integer id;
 
     /**
-     * 三相正向有功电度
+     * 冻结时间
      */
-    private Double epp;
+    private String freezingTime;
 
     /**
-     * 冻结时间
+     * 三相正向有功电度
      */
-    private String freezingTime;
+    private Double epp;
+
 
 
 }

+ 4 - 3
fiveep-service/src/main/java/com/bizmatics/service/impl/HtAnalogDataServiceImpl.java

@@ -603,7 +603,8 @@ public class HtAnalogDataServiceImpl extends AbstractCrudService<HtAnalogDataMap
             ExportParams params = new ExportParams(null, "用能月报");
             workbook = ExcelExportUtil.exportBigExcel(params, HtAnalogDataTwoExportVo.class,
                     (o, i) -> {
-                        int startCurrent = (i - 1) * 30;
+//                        int startCurrent = (i - 1) * 30;
+                        int startCurrent =0;
                         List<HtAnalogDataOneVo> listOne = this.monthlyReportlist(deviceCode, startTime, endTime, cycle, startCurrent);
                         return new ArrayList<>(BeanMapperUtils.mapList(listOne, HtAnalogDataOneVo.class, HtAnalogDataTwoExportVo.class));
                     }, null);
@@ -634,8 +635,8 @@ public class HtAnalogDataServiceImpl extends AbstractCrudService<HtAnalogDataMap
     @Override
     public List<HtAnalogDataOneVo> monthlyReportlist(String deviceCode, String startTime, String endTime, int cycle, Integer startCurrent) {
         List<HtAnalogDataOneVo> listOne = new ArrayList<>();
-        List<HtAnalogDataOneVo> maxMonthlyReport = baseMapper.energyUseListOne(deviceCode, startTime, endTime, cycle, 1, 30, startCurrent);
-        List<HtAnalogDataOneVo> minMonthlyReport = baseMapper.energyUseListOne(deviceCode, startTime, endTime, cycle, 2, 30, startCurrent);
+        List<HtAnalogDataOneVo> maxMonthlyReport = baseMapper.energyUseListOne(deviceCode, startTime, endTime, cycle, 1, null, startCurrent);
+        List<HtAnalogDataOneVo> minMonthlyReport = baseMapper.energyUseListOne(deviceCode, startTime, endTime, cycle, 2, null, startCurrent);
         if (maxMonthlyReport.size() > 0) {
             Double epp=0.00;
             for (int j = 0; j < maxMonthlyReport.size()+1; j++) {

+ 4 - 3
fiveep-service/src/main/java/com/bizmatics/service/vo/HtAnalogDataTwoExportVo.java

@@ -18,12 +18,13 @@ public class HtAnalogDataTwoExportVo {
 
     private Integer id;
 
+    @Excel(name = "名称", height = 6, width = 20)
+    private String freezingTime;
 
-    @Excel(name = "电量", height = 6, width = 20)
+    @Excel(name = "电量(kWh)", height = 6, width = 20)
     private Double epp;
 
 
-    @Excel(name = "名称", height = 6, width = 20)
-    private String freezingTime;
+
 
 }