Browse Source

项目名称和kpi对应名称的返回

wangchenghong 3 years ago
parent
commit
0560ca4080

+ 9 - 0
src/main/java/com/persagy/apm/energy/report/common/service/impl/CommonServiceImpl.java

@@ -28,6 +28,8 @@ import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.Hotel
 import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.HotelProjectMaintenanceInfo;
 import com.persagy.apm.energy.report.saasweb.model.dto.QueryProjectDTO;
 import com.persagy.apm.energy.report.saasweb.model.vo.PoemsProjectVO;
+import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
+import com.persagy.apm.energy.report.saasweb.service.ISaasWebService;
 import com.persagy.apm.energy.report.saasweb.service.impl.SaasWebClientWrapper;
 import com.persagy.apm.energy.report.workorder.service.IWorkOrderWebService;
 import io.swagger.annotations.Api;
@@ -66,6 +68,9 @@ public class CommonServiceImpl implements CommonService {
     @Autowired
     IStatisticItemsService iStatisticItemsService;
 
+    @Autowired
+    ISaasWebService saasWebService;
+
     @Override
     public List<String> getPjNameByPjId(List<String> pjIdList) {
         if (CollectionUtils.isEmpty(pjIdList)) {
@@ -130,6 +135,9 @@ public class CommonServiceImpl implements CommonService {
         hotelProjectAlarmDealInfo.setHandledCount(dealCount);
         hotelProjectAlarmDealInfo.setHandledPercent(completeRate);
         hotelProjectAlarmDealInfo.setTotalCount(workCount);
+        // 获取项目信息
+        ReportProjectVO reportProjectInfo = saasWebService.getReportProjectInfo(projectId);
+        hotelProjectAlarmDealInfo.setProjectName(null == reportProjectInfo ? "" : reportProjectInfo.getProjectName());
         return hotelProjectAlarmDealInfo;
     }
 
@@ -161,6 +169,7 @@ public class CommonServiceImpl implements CommonService {
                     continue;
                 }
                 hotelProjectKpiItem.setRankWithinClimateZone(i + 1);
+                hotelProjectKpiItem.setName(function.getName());
                 return hotelProjectKpiItem;
             }
         } catch (Exception e) {

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/vo/HotelProjectKpiItem.java

@@ -20,7 +20,7 @@ import java.util.List;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class HotelProjectKpiItem extends HotelRankVO {
     @ApiModelProperty(value = "名称")
-    private Double name;
+    private String name;
 
     @ApiModelProperty(value = "达标率")
     private Double controlRates;