Browse Source

光伏性能分析分页

xushili 1 year ago
parent
commit
6f86e520ac

+ 1 - 1
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbinegoodnessController.java

@@ -85,7 +85,7 @@ public class WindturbinegoodnessController {
                         @RequestParam(value = "target",required = true) String target,
                         @RequestParam(value = "sort",required = true) String sort
     ){
-        List<PvVo> resultList = windturbinegoodnessService.pvgoodness(pageNum,pageSize,companys,wpid,recorddate,target,sort);
+        Page<PvVo> resultList = windturbinegoodnessService.pvgoodness(pageNum,pageSize,companys,wpid,recorddate,target,sort);
 
         if (StringUtils.isNotNull(resultList)) {
             return R.data(ResultMsg.ok(resultList));

+ 9 - 3
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java

@@ -872,11 +872,10 @@ public class WindturbinegoodnessService {
         return vos;
     }
 
-    public List<PvVo> pvgoodness(Integer pageNum, Integer pageSize, String companys, String wpid, String recorddate, String target, String sort) {
+    public Page<PvVo> pvgoodness(Integer pageNum, Integer pageSize, String companys, String wpid, String recorddate, String target, String sort) {
 
         Map<String, ProEconEquipmentmodel> modelMap = CacheContext.modelMap;
         Map<String, ProBasicOrganizeTree> wtmap = CacheContext.wtmap;
-        List<PvVo> resultList = new ArrayList<>();
         LambdaQueryWrapper<ProEconEquipmentInfoDay6> qw = new LambdaQueryWrapper<>();
 
         qw.eq(ProEconEquipmentInfoDay6::getRecordDate, DateUtils.parseDate(recorddate));
@@ -903,6 +902,8 @@ public class WindturbinegoodnessService {
         Page<ProEconEquipmentInfoDay6> page = new Page<>(pageNum, pageSize);
         Page<ProEconEquipmentInfoDay6> equipmentInfoDay6s = proEconEquipmentInfoDay6Service.page(page, qw);
 
+        List<PvVo> resultList = new ArrayList<>();
+        Page<PvVo> pvVoPage = new Page<>();
         equipmentInfoDay6s.getRecords().forEach(i -> {
             PvVo vo = new PvVo();
             vo.setWtid(i.getWindturbineId());
@@ -928,7 +929,12 @@ public class WindturbinegoodnessService {
             SortUtils.sort(resultList, target, SortUtils.DESC);
         }
 
-        return resultList;
+        pvVoPage.setRecords(resultList);
+        pvVoPage.setTotal(equipmentInfoDay6s.getTotal());
+        pvVoPage.setPages(equipmentInfoDay6s.getPages());
+        pvVoPage.setCurrent(equipmentInfoDay6s.getCurrent());
+        pvVoPage.setSize(equipmentInfoDay6s.getSize());
+        return pvVoPage;
     }
 
     public List<PvVo> pvgoodnesshis(String wpid, String wtid, String beginDate, String endDate, String target, String sort) {