فهرست منبع

dev代码冲突解决01

qiangxuan 7 ماه پیش
والد
کامیت
1d8de79862

+ 24 - 24
zgztBus/jeecg-module-lesm/src/main/java/org/jeecg/modules/homePageData/controller/HomePageDataController.java

@@ -60,28 +60,28 @@ public class HomePageDataController {
 
 
     /**
-     * 峰平谷时段划分
+     * 违规计量
      *
      * @return
      */
-    @AutoLog(value = "峰平谷时段划分")
-    @ApiOperation(value="峰平谷时段划分", notes="峰平谷时段划分")
-    @GetMapping(value = "/fpvTime")
-    public Result<Map<String, Long>> fpvTime() {
-        Map<String, Long> res = homePageDataService.fpvTime();
+    @AutoLog(value = " 违规计量")
+    @ApiOperation(value="违规计量", notes="违规计量")
+    @GetMapping(value = "/illegalMetering")
+    public Result<List<Map<String, String>>> illegalMetering() {
+        List<Map<String, String>> res = homePageDataService.illegalMetering();
         return Result.OK(res);
     }
 
     /**
-     * 区域用电占比
+     * 轧钢管控
      *
      * @return
      */
-    @AutoLog(value = "区域用电占比")
-    @ApiOperation(value="区域用电占比", notes="区域用电占比")
-    @GetMapping(value = "/regionElectricityPercentage")
-    public Result<List<Map<String, String>>> regionElectricityPercentage() {
-        List<Map<String, String>> res = homePageDataService.regionElectricityPercentage();
+    @AutoLog(value = "轧钢管控")
+    @ApiOperation(value="轧钢管控", notes="轧钢管控")
+    @GetMapping(value = "/rollingControl")
+    public Result<List<Map<String, String>>> rollingControl() {
+        List<Map<String, String>> res = homePageDataService.rollingControl();
         return Result.OK(res);
     }
 
@@ -115,29 +115,29 @@ public class HomePageDataController {
 
 
     /**
-     * 区域用电统计
+     * 实时设备运行
      *
      * @return
      */
-    @AutoLog(value = "区域用电统计")
-    @ApiOperation(value="区域用电统计", notes="区域用电统计")
-    @GetMapping(value = "/regionElectricityStats")
-    public Result<List<Map<String, String>>> regionElectricityStats() {
-        List<Map<String, String>> res = homePageDataService.regionElectricityStats();
+    @AutoLog(value = "实时设备运行")
+    @ApiOperation(value="实时设备运行", notes="实时设备运行")
+    @GetMapping(value = "/realDeviceRun")
+    public Result<List<Map<String, String>>> realDeviceRun() {
+        List<Map<String, String>> res = homePageDataService.realDeviceRun();
         return Result.OK(res);
     }
 
 
     /**
-     * 峰平谷时段用电总量
+     * 用电管理
      *
      * @return
      */
-    @AutoLog(value = "峰平谷时段用电总量")
-    @ApiOperation(value="峰平谷时段用电总量", notes="峰平谷时段用电总量")
-    @GetMapping(value = "/fpvElectricityStats")
-    public Result<Map<String, String>> fpvElectricityStats() {
-        Map<String, String> res = homePageDataService.fpvElectricityStats();
+    @AutoLog(value = "用电管理")
+    @ApiOperation(value="用电管理", notes="用电管理")
+    @GetMapping(value = "/electricityManage")
+    public Result<List<Map<String, String>>> electricityManage() {
+        List<Map<String, String>> res = homePageDataService.electricityManage();
         return Result.OK(res);
     }
 

+ 7 - 7
zgztBus/jeecg-module-lesm/src/main/java/org/jeecg/modules/homePageData/service/IHomePageDataService.java

@@ -20,18 +20,18 @@ public interface IHomePageDataService {
     Map<String, Object> deviceOnline();
 
     /**
-     * 峰平谷时段划分
+     * 违规计量
      *
      * @return
      */
-    Map<String, Long> fpvTime();
+    List<Map<String, String>> illegalMetering();
 
     /**
      * 区域用电占比
      *
      * @return
      */
-    List<Map<String, String>> regionElectricityPercentage();
+    List<Map<String, String>> rollingControl();
 
     /**
      * 峰平谷时间段用电量
@@ -48,18 +48,18 @@ public interface IHomePageDataService {
     List<Map<String, String>> realAlarm();
 
     /**
-     * 区域用电统计
+     * 实时设备运行
      *
      * @return
      */
-    List<Map<String, String>> regionElectricityStats();
+    List<Map<String, String>> realDeviceRun();
 
     /**
-     * 峰平谷时段用电总量
+     * 用电管理
      *
      * @return
      */
-    Map<String, String> fpvElectricityStats();
+    List<Map<String, String>> electricityManage();
 
     /**
      * 高耗能设备超过阈值情况

+ 38 - 61
zgztBus/jeecg-module-lesm/src/main/java/org/jeecg/modules/homePageData/service/impl/HomePageDataServiceImpl.java

@@ -41,6 +41,7 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
                 Map<String, String> map = new HashMap<>();
                 Double electricity = Math.random()*100+200;
                 map.put("name",deviceRegion.getRegionTitle());
+                map.put("tops", String.format("%.2f",electricity*(Math.random()*0.2+1)));
                 map.put("peaks", String.format("%.2f",electricity));
                 map.put("flat", String.format("%.2f",electricity*(Math.random()*0.2+0.7)));
                 map.put("valleys", String.format("%.2f",electricity*(Math.random()*0.2+0.5)));
@@ -79,66 +80,34 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
     }
 
     @Override
-    public Map<String, Long> fpvTime() {
-        Date current = null;
-        List<PeaksAndValleysTimeConfig> list = peaksAndValleysTimeConfigService.list();
-        Long peaks = 0l;
-        Long flat = 0l;
-        Long valleys = 0l;
-        try {
-            SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
-            String date = format.format(new Date());
-            current = format.parse(date);
-        } catch (ParseException e) {
-            e.printStackTrace();
-        }
-        for (PeaksAndValleysTimeConfig config : list) {
-            if(config.getStartTime().after(current)){
-                if(config.getType().equals("0")){
-                    peaks += config.getEndTime().getTime()-config.getStartTime().getTime();
-                }else if(config.getType().equals("1")){
-                    flat += config.getEndTime().getTime()-config.getStartTime().getTime();
-                }else{
-                    valleys += config.getEndTime().getTime()-config.getStartTime().getTime();
-                }
-            }else if(config.getStartTime().before(current)&&config.getEndTime().after(current)){
-                if(config.getType().equals("0")){
-                    peaks += config.getEndTime().getTime()-current.getTime();
-                }else if(config.getType().equals("1")){
-                    flat += config.getEndTime().getTime()-current.getTime();
-                }else{
-                    valleys += config.getEndTime().getTime()-current.getTime();
-                }
-            }
-        }
-        Map<String, Long> res = new HashMap<>();
-        res.put("peaks",peaks/60000);
-        res.put("flat",flat/60000);
-        res.put("valleys",valleys/60000);
+    public List<Map<String, String>> illegalMetering() {
+        List<DeviceRegion> list = deviceRegionService.list();
+        List<Map<String, String>> res = new ArrayList<>();
+        list.forEach(deviceRegion -> {
+            Map<String,String> map = new HashMap<>();
+            map.put("name",deviceRegion.getRegionTitle());
+            map.put("month",((int)(Math.random()*50+50))+"");
+            map.put("day",((int)(Math.random()*20))+"");
+            res.add(map);
+        });
         return res;
     }
 
     @Override
-    public List<Map<String, String>> regionElectricityPercentage() {
-        List<DeviceRegion> list = deviceRegionService.list();
-        int per = 0;
-        Map<String,Integer> map = new HashMap<>();
-        while (per<100){
-            int index = (int)(Math.random()*list.size());
-            if(oConvertUtils.isNotEmpty(map.get(list.get(index).getRegionTitle()))){
-                map.put(list.get(index).getRegionTitle(),map.get(list.get(index).getRegionTitle())+2);
-            }else{
-                map.put(list.get(index).getRegionTitle(),2);
-            }
-            per += 2;
-        }
+    public List<Map<String, String>> rollingControl() {
         List<Map<String, String>> res = new ArrayList<>();
-        list.forEach(deviceRegion -> {
-            Map<String,String> mapo = new HashMap<>();
-            mapo.put("name",deviceRegion.getRegionTitle());
-            mapo.put("value",map.get(deviceRegion.getRegionTitle())+"%");
-            res.add(mapo);
+        String[] names = {"棒一","棒二","棒三","高线","板带"};
+        Arrays.asList(names).forEach(name -> {
+            Map<String, String> map = new HashMap<>();
+            Double electricity = Math.random()*100+200;
+            map.put("name",name);
+            map.put("tops", String.format("%.2f",electricity*(Math.random()*0.2+1)));
+            map.put("peaks", String.format("%.2f",electricity));
+            map.put("flat", String.format("%.2f",electricity*(Math.random()*0.2+0.7)));
+            map.put("valleys", String.format("%.2f",electricity*(Math.random()*0.2+0.5)));
+            res.add(map);
         });
+
         return res;
     }
 
@@ -150,16 +119,19 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
         calendar.set(Calendar.HOUR_OF_DAY, 0);
         calendar.set(Calendar.MILLISECOND, 0);
         Map<String, List> res = new HashMap<>();
+        List<Map<String,String>> tops = new ArrayList<>();
         List<Map<String,String>> peaks = new ArrayList<>();
         List<Map<String,String>> flat = new ArrayList<>();
         List<Map<String,String>> valleys = new ArrayList<>();
         for (int i = 0; i < 24; i++) {
             calendar.set(Calendar.HOUR_OF_DAY, i);
             Double electricity = Math.random()*100+200;
+            tops.add(getMap(calendar.getTime(),String.format("%.2f",electricity*(Math.random()*0.2+1))));
             peaks.add(getMap(calendar.getTime(),String.format("%.2f",electricity)));
             flat.add(getMap(calendar.getTime(),String.format("%.2f",electricity*(Math.random()*0.2+0.7))));
             valleys.add(getMap(calendar.getTime(),String.format("%.2f",electricity*(Math.random()*0.2+0.5))));
         }
+        res.put("tops",tops);
         res.put("peaks",peaks);
         res.put("flat",flat);
         res.put("valleys",valleys);
@@ -200,14 +172,14 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
     }
 
     @Override
-    public List<Map<String, String>> regionElectricityStats() {
+    public List<Map<String, String>> realDeviceRun() {
         List<DeviceRegion> list = deviceRegionService.list();
         List<Map<String, String>> res = new ArrayList<>();
         if(oConvertUtils.listIsNotEmpty(list)){
             list.forEach(deviceRegion -> {
                 Map<String,String> map = new HashMap<>();
                 map.put("name",deviceRegion.getRegionTitle());
-                map.put("value",String.format("%.2f",Math.random()*150+100));
+                map.put("value",(int)(Math.random()*25+25)+"");
                 res.add(map);
             });
         }
@@ -215,11 +187,16 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
     }
 
     @Override
-    public Map<String, String> fpvElectricityStats() {
-        Map<String,String> res = new HashMap<>();
-        res.put("peaks",String.format("%.2f",Math.random()*35+15));
-        res.put("flat",String.format("%.2f",Math.random()*35+15));
-        res.put("valleys",String.format("%.2f",Math.random()*35+15));
+    public List<Map<String, String>> electricityManage() {
+        List<Map<String, String>> res = new ArrayList<>();
+        String[] names = {"尖","峰","平","谷"};
+        Arrays.asList(names).forEach(name ->{
+            Map<String,String> map = new HashMap<>();
+            map.put("name",name);
+            map.put("yesterday",String.format("%.2f",Math.random()*35+15));
+            map.put("today",String.format("%.2f",Math.random()*35+15));
+            res.add(map);
+        });
         return res;
     }