Ver código fonte

初始化酒店月报的代码

lixing 3 anos atrás
pai
commit
19298d0592
62 arquivos alterados com 2723 adições e 146 exclusões
  1. 2 2
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/ReportBusinessDetail.java
  2. 2 2
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/dto/AddReportBusinessDetailDTO.java
  3. 2 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/ResponseReportBusinessDetailItemVO.java
  4. 8 18
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/IReportBusinessDetailService.java
  5. 41 25
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/impl/ReportBusinessDetailServiceImpl.java
  6. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/CostItemVO.java
  7. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/CostVO.java
  8. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/GroupInfo.java
  9. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/PowerItemVO.java
  10. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/PowerVO.java
  11. 44 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/IReportDetailService.java
  12. 69 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportDetailServiceImpl.java
  13. 99 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/controller/ReportHotelAreaDetailController.java
  14. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/dao/ReportHotelAreaDetailMapper.java
  15. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/ConvertReportHotelAreaDetailTool.java
  16. 66 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/ReportHotelAreaDetail.java
  17. 59 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/AddReportHotelAreaDetailDTO.java
  18. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/DeleteReportHotelAreaDetailDTO.java
  19. 53 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/PageQueryReportHotelAreaDetailDTO.java
  20. 46 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/QueryReportHotelAreaDetailDTO.java
  21. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/QueryReportHotelAreaDetailDetailDTO.java
  22. 63 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/UpdateReportHotelAreaDetailDTO.java
  23. 19 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/HotelAreaCostInfo.java
  24. 31 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/HotelProjectCostInfo.java
  25. 31 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/PowerUsageOutline.java
  26. 64 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/ResponseReportHotelAreaDetailItemVO.java
  27. 64 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/ResponseReportHotelAreaDetailListItemVO.java
  28. 88 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/IReportHotelAreaDetailService.java
  29. 282 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/impl/ReportHotelAreaDetailServiceImpl.java
  30. 93 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/controller/ReportHotelProjectDetailController.java
  31. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/dao/ReportHotelProjectDetailMapper.java
  32. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/ConvertReportHotelProjectDetailTool.java
  33. 86 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/ReportHotelProjectDetail.java
  34. 79 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/AddReportHotelProjectDetailDTO.java
  35. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/DeleteReportHotelProjectDetailDTO.java
  36. 68 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/PageQueryReportHotelProjectDetailDTO.java
  37. 61 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/QueryReportHotelProjectDetailDTO.java
  38. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/QueryReportHotelProjectDetailDetailDTO.java
  39. 83 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/UpdateReportHotelProjectDetailDTO.java
  40. 81 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/vo/ResponseReportHotelProjectDetailItemVO.java
  41. 79 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/vo/ResponseReportHotelProjectDetailListItemVO.java
  42. 88 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/IReportHotelProjectDetailService.java
  43. 328 0
      src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/ReportHotelProjectDetailServiceImpl.java
  44. 23 10
      src/main/java/com/persagy/apm/energy/report/monthly/outline/controller/ReportOutlineController.java
  45. 3 3
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IBusinessReportCostInfoService.java
  46. 3 4
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IBusinessReportPowerInfoService.java
  47. 38 5
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IReportOutlineService.java
  48. 2 7
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/IBusinessReportBuilder.java
  49. 0 5
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/IBusinessReportGenerator.java
  50. 43 11
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/impl/BusinessReportBuilder.java
  51. 2 2
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessProjectReportBuilder.java
  52. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportCostInfoServiceImpl.java
  53. 1 1
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportPlatformInfoServiceImpl.java
  54. 5 5
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportPowerInfoServiceImpl.java
  55. 43 34
      src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/ReportOutlineServiceImpl.java
  56. 2 0
      src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/BuildingInfoVO.java
  57. 2 0
      src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/PoemsProjectVO.java
  58. 2 0
      src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/ReportProjectVO.java
  59. 18 0
      src/main/java/com/persagy/apm/energy/report/saasweb/service/ISaasWebService.java
  60. 32 1
      src/main/java/com/persagy/apm/energy/report/saasweb/service/impl/SaasWebServiceImpl.java
  61. 25 0
      src/main/resources/mapper/ReportHotelAreaDetailMapper.xml
  62. 30 0
      src/main/resources/mapper/ReportHotelProjectDetailMapper.xml

+ 2 - 2
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/ReportBusinessDetail.java

@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.persagy.apm.common.model.entity.AuditableEntity;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;

+ 2 - 2
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/dto/AddReportBusinessDetailDTO.java

@@ -3,8 +3,8 @@ package com.persagy.apm.energy.report.monthly.detail.business.model.dto;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.AddReportDetailStatisticsItemRelDTO;
 import com.persagy.apm.energy.report.monthly.detail.business.model.Job;
 import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;

+ 2 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/ResponseReportBusinessDetailItemVO.java

@@ -3,12 +3,13 @@ package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.ResponseReportDetailStatisticsItemRelListItemVO;
 import com.persagy.apm.energy.report.monthly.detail.business.model.*;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.saasweb.model.vo.ReportAreaVO;
 import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.nfunk.jep.function.Power;
 
 import java.util.List;
 

+ 8 - 18
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/IReportBusinessDetailService.java

@@ -6,11 +6,13 @@ import com.persagy.apm.energy.report.monthly.detail.business.model.dto.*;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
+import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 报告详情(ReportBusinessDetail) service接口
+ * 商业报告详情(ReportBusinessDetail) service接口
  *
  * @author lixing
  * @version V1.0 2021-05-17 11:08:34
@@ -76,24 +78,12 @@ public interface IReportBusinessDetailService {
     IPage<ReportBusinessDetail> pageQueryReportBusinessDetail(PageQueryReportBusinessDetailDTO pageQueryReportBusinessDetailDTO);
 
     /**
-     * 根据段落获取报告类型关联的分组
+     * 获取商业报告详情信息(包含项目、区域信息,统计条目信息等)
      *
-     * @param reportTypeId    报告类型
-     * @param belongParagraph 报告段落
-     * @return 报告段落包含的分组id列表
+     * @param reportOutlineId 报告概要id
+     * @return 商业报告详情信息
      * @author lixing
-     * @version V1.0 2021/5/24 4:31 下
+     * @version V1.0 2021/6/7 10:02 上
      */
-    List<String> getGroupsByParagraph(String reportTypeId, String belongParagraph);
-
-    /**
-     * 根据段落获取报告类型关联的信息点
-     *
-     * @param reportTypeId    报告类型
-     * @param belongParagraph 报告段落
-     * @return 报告段落包含的信息点id列表
-     * @author lixing
-     * @version V1.0 2021/5/24 4:31 下午
-     */
-    List<String> getFunctionsByParagraph(String reportTypeId, String belongParagraph);
+    ResponseReportBusinessDetailItemVO getResponseBusinessDetail(String reportOutlineId);
 }

+ 41 - 25
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/service/impl/ReportBusinessDetailServiceImpl.java

@@ -8,9 +8,11 @@ import com.google.common.base.CaseFormat;
 import com.persagy.apm.common.constant.enums.ValidEnum;
 import com.persagy.apm.common.context.poems.PoemsContext;
 import com.persagy.apm.common.model.dto.Sort;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ConvertReportDetailStatisticsItemRelTool;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ReportDetailStatisticsItemRel;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.AddReportDetailStatisticsItemRelDTO;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.QueryReportDetailStatisticsItemRelDTO;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.ResponseReportDetailStatisticsItemRelListItemVO;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.IReportDetailStatisticsItemRelService;
 import com.persagy.apm.energy.report.monthly.config.rel.typefunction.model.ReportTypeFunctionRel;
 import com.persagy.apm.energy.report.monthly.config.rel.typefunction.model.dto.QueryReportTypeFunctionRelDTO;
@@ -18,6 +20,9 @@ import com.persagy.apm.energy.report.monthly.config.rel.typefunction.service.IRe
 import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.model.ReportTypeFunctionGroupRel;
 import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.model.dto.QueryReportTypeFunctionGroupRelDTO;
 import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.service.IReportTypeFunctionGroupRelService;
+import com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum;
+import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
+import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
 import com.persagy.apm.energy.report.monthly.detail.business.dao.ReportBusinessDetailMapper;
 import com.persagy.apm.energy.report.monthly.detail.business.model.ConvertReportBusinessDetailTool;
 import com.persagy.apm.energy.report.monthly.detail.business.model.ReportBusinessDetail;
@@ -29,6 +34,9 @@ import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseRe
 import com.persagy.apm.energy.report.monthly.detail.business.service.IReportBusinessDetailService;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
+import com.persagy.apm.energy.report.saasweb.model.vo.ReportAreaVO;
+import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
+import com.persagy.apm.energy.report.saasweb.service.ISaasWebService;
 import org.apache.commons.lang.StringUtils;
 import org.assertj.core.util.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,7 +48,7 @@ import java.util.List;
 import java.util.stream.Collectors;
 
 /**
- * 报告详情(ReportBusinessDetail) service层
+ * 商业报告详情(ReportBusinessDetail) service层
  *
  * @author lixing
  * @version V1.0 2021-05-17 11:08:34
@@ -56,6 +64,10 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
     private IReportTypeFunctionGroupRelService reportTypeFunctionGroupRelService;
     @Autowired
     private IReportOutlineService reportOutlineService;
+    @Autowired
+    private IReportTypeService reportTypeService;
+    @Autowired
+    private ISaasWebService saasWebService;
 
     /**
      * 创建报告详情
@@ -328,31 +340,35 @@ public class ReportBusinessDetailServiceImpl extends ServiceImpl<ReportBusinessD
     }
 
     @Override
-    public List<String> getGroupsByParagraph(String reportTypeId, String belongParagraph) {
-        List<String> groupIdList = Lists.newArrayList();
-        QueryReportTypeFunctionGroupRelDTO queryReportTypeFunctionGroupRelDTO = new QueryReportTypeFunctionGroupRelDTO();
-        queryReportTypeFunctionGroupRelDTO.setReportTypeId(reportTypeId);
-        queryReportTypeFunctionGroupRelDTO.setBelongParagraph(belongParagraph);
-        List<ReportTypeFunctionGroupRel> reportTypeFunctionGroupRels = reportTypeFunctionGroupRelService.
-                queryReportTypeFunctionGroupRelList(queryReportTypeFunctionGroupRelDTO);
-        if (!CollectionUtils.isEmpty(reportTypeFunctionGroupRels)) {
-            groupIdList = reportTypeFunctionGroupRels.stream().
-                    map(ReportTypeFunctionGroupRel::getFunctionGroupId).collect(Collectors.toList());
-        }
-        return groupIdList;
-    }
+    public ResponseReportBusinessDetailItemVO getResponseBusinessDetail(String reportOutlineId) {
+        ReportOutline reportOutline = reportOutlineService.queryReportOutlineDetail(reportOutlineId);
+        String reportTypeId = reportOutline.getReportTypeId();
+        ReportType reportType = reportTypeService.queryReportTypeDetail(reportTypeId);
+        String buildingType = reportType.getBuildingType();
+        ReportBusinessDetail reportBusinessDetail = getReportBusinessDetail(reportOutline.getDetailId());
+        ResponseReportBusinessDetailItemVO responseReportBusinessDetailItemVO = ConvertReportBusinessDetailTool.INSTANCE.
+                convert2ResponseItemDTO(reportBusinessDetail);
+
+        if (BelongTypeEnum.PROJECT.getType().equals(reportType.getBelongType())) {
+            ReportProjectVO reportProjectInfo = saasWebService.getReportProjectInfo(reportOutline.getBelong());
+            responseReportBusinessDetailItemVO.setProjectInfo(reportProjectInfo);
+        } else {
+            ReportAreaVO openReportAreaInfo = saasWebService.getReportAreaInfo(reportOutline.getBelong(), buildingType);
+            responseReportBusinessDetailItemVO.setOpenAreaInfo(openReportAreaInfo);
 
-    @Override
-    public List<String> getFunctionsByParagraph(String reportTypeId, String belongParagraph) {
-        List<String> functionIdList = Lists.newArrayList();
-        QueryReportTypeFunctionRelDTO queryReportTypeFunctionRelDTO = new QueryReportTypeFunctionRelDTO();
-        queryReportTypeFunctionRelDTO.setReportTypeId(reportTypeId);
-        queryReportTypeFunctionRelDTO.setBelongParagraph(belongParagraph);
-        List<ReportTypeFunctionRel> reportTypeFunctionRels = reportTypeFunctionRelService.queryReportTypeFunctionRelList(queryReportTypeFunctionRelDTO);
-        if (!CollectionUtils.isEmpty(reportTypeFunctionRels)) {
-            functionIdList = reportTypeFunctionRels.stream().
-                    map(ReportTypeFunctionRel::getFunctionId).collect(Collectors.toList());
+            ReportAreaVO compareReportAreaInfo = saasWebService.getCompareReportAreaInfo(
+                    reportOutline.getBelong(), buildingType, reportOutline.getReportMonth());
+            responseReportBusinessDetailItemVO.setCompareAreaInfo(compareReportAreaInfo);
         }
-        return functionIdList;
+
+
+        // 查询统计条目补充信息
+        QueryReportDetailStatisticsItemRelDTO queryReportDetailStatisticsItemRelDTO = new QueryReportDetailStatisticsItemRelDTO();
+        queryReportDetailStatisticsItemRelDTO.setReportDetailId(reportOutline.getDetailId());
+        queryReportDetailStatisticsItemRelDTO.setReportTypeId(reportTypeId);
+        List<ReportDetailStatisticsItemRel> reportDetailStatisticsItemRels = reportDetailStatisticsItemRelService.queryReportDetailStatisticsItemRelList(queryReportDetailStatisticsItemRelDTO);
+        List<ResponseReportDetailStatisticsItemRelListItemVO> responseReportDetailStatisticsItemRelListItemVOList = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convert2List(reportDetailStatisticsItemRels);
+        responseReportBusinessDetailItemVO.setStatisticItemsSupplements(responseReportDetailStatisticsItemRelListItemVOList);
+        return responseReportBusinessDetailItemVO;
     }
 }

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/CostItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
+package com.persagy.apm.energy.report.monthly.detail.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/CostVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
+package com.persagy.apm.energy.report.monthly.detail.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/GroupInfo.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
+package com.persagy.apm.energy.report.monthly.detail.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/PowerItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
+package com.persagy.apm.energy.report.monthly.detail.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/detail/business/model/vo/PowerVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.monthly.detail.business.model.vo;
+package com.persagy.apm.energy.report.monthly.detail.common.model.vo;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;

+ 44 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/IReportDetailService.java

@@ -0,0 +1,44 @@
+package com.persagy.apm.energy.report.monthly.detail.common.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.persagy.apm.energy.report.monthly.detail.business.model.ReportBusinessDetail;
+import com.persagy.apm.energy.report.monthly.detail.business.model.dto.AddReportBusinessDetailDTO;
+import com.persagy.apm.energy.report.monthly.detail.business.model.dto.PageQueryReportBusinessDetailDTO;
+import com.persagy.apm.energy.report.monthly.detail.business.model.dto.QueryReportBusinessDetailDTO;
+import com.persagy.apm.energy.report.monthly.detail.business.model.dto.UpdateReportBusinessDetailDTO;
+import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
+import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
+
+import java.util.List;
+
+/**
+ * 报告详情 service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-05-17 11:08:34
+ */
+public interface IReportDetailService {
+
+    /**
+     * 根据段落获取报告类型关联的分组
+     *
+     * @param reportTypeId    报告类型
+     * @param belongParagraph 报告段落
+     * @return 报告段落包含的分组id列表
+     * @author lixing
+     * @version V1.0 2021/5/24 4:31 下午
+     */
+    List<String> getGroupsByParagraph(String reportTypeId, String belongParagraph);
+
+    /**
+     * 根据段落获取报告类型关联的信息点
+     *
+     * @param reportTypeId    报告类型
+     * @param belongParagraph 报告段落
+     * @return 报告段落包含的信息点id列表
+     * @author lixing
+     * @version V1.0 2021/5/24 4:31 下午
+     */
+    List<String> getFunctionsByParagraph(String reportTypeId, String belongParagraph);
+
+}

+ 69 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/common/service/impl/ReportDetailServiceImpl.java

@@ -0,0 +1,69 @@
+package com.persagy.apm.energy.report.monthly.detail.common.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.IReportDetailStatisticsItemRelService;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunction.model.ReportTypeFunctionRel;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunction.model.dto.QueryReportTypeFunctionRelDTO;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunction.service.IReportTypeFunctionRelService;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.model.ReportTypeFunctionGroupRel;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.model.dto.QueryReportTypeFunctionGroupRelDTO;
+import com.persagy.apm.energy.report.monthly.config.rel.typefunctiongroup.service.IReportTypeFunctionGroupRelService;
+import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
+import com.persagy.apm.energy.report.monthly.detail.business.dao.ReportBusinessDetailMapper;
+import com.persagy.apm.energy.report.monthly.detail.business.model.ReportBusinessDetail;
+import com.persagy.apm.energy.report.monthly.detail.common.service.IReportDetailService;
+import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
+import com.persagy.apm.energy.report.saasweb.service.ISaasWebService;
+import org.assertj.core.util.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 报告详情(ReportBusinessDetail) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-17 11:08:34
+ */
+@Service
+public class ReportDetailServiceImpl extends ServiceImpl<ReportBusinessDetailMapper, ReportBusinessDetail>
+        implements IReportDetailService {
+    @Autowired
+    IReportDetailStatisticsItemRelService reportDetailStatisticsItemRelService;
+    @Autowired
+    private IReportTypeFunctionRelService reportTypeFunctionRelService;
+    @Autowired
+    private IReportTypeFunctionGroupRelService reportTypeFunctionGroupRelService;
+
+    @Override
+    public List<String> getGroupsByParagraph(String reportTypeId, String belongParagraph) {
+        List<String> groupIdList = Lists.newArrayList();
+        QueryReportTypeFunctionGroupRelDTO queryReportTypeFunctionGroupRelDTO = new QueryReportTypeFunctionGroupRelDTO();
+        queryReportTypeFunctionGroupRelDTO.setReportTypeId(reportTypeId);
+        queryReportTypeFunctionGroupRelDTO.setBelongParagraph(belongParagraph);
+        List<ReportTypeFunctionGroupRel> reportTypeFunctionGroupRels = reportTypeFunctionGroupRelService.
+                queryReportTypeFunctionGroupRelList(queryReportTypeFunctionGroupRelDTO);
+        if (!CollectionUtils.isEmpty(reportTypeFunctionGroupRels)) {
+            groupIdList = reportTypeFunctionGroupRels.stream().
+                    map(ReportTypeFunctionGroupRel::getFunctionGroupId).collect(Collectors.toList());
+        }
+        return groupIdList;
+    }
+
+    @Override
+    public List<String> getFunctionsByParagraph(String reportTypeId, String belongParagraph) {
+        List<String> functionIdList = Lists.newArrayList();
+        QueryReportTypeFunctionRelDTO queryReportTypeFunctionRelDTO = new QueryReportTypeFunctionRelDTO();
+        queryReportTypeFunctionRelDTO.setReportTypeId(reportTypeId);
+        queryReportTypeFunctionRelDTO.setBelongParagraph(belongParagraph);
+        List<ReportTypeFunctionRel> reportTypeFunctionRels = reportTypeFunctionRelService.queryReportTypeFunctionRelList(queryReportTypeFunctionRelDTO);
+        if (!CollectionUtils.isEmpty(reportTypeFunctionRels)) {
+            functionIdList = reportTypeFunctionRels.stream().
+                    map(ReportTypeFunctionRel::getFunctionId).collect(Collectors.toList());
+        }
+        return functionIdList;
+    }
+}

+ 99 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/controller/ReportHotelAreaDetailController.java

@@ -0,0 +1,99 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.controller;
+
+import com.persagy.apm.common.response.ApmResponseUpsertVO;
+import com.persagy.apm.common.response.CommonResult;
+import com.persagy.apm.common.response.PageList;
+import com.persagy.apm.common.utils.ResultHelper;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.ConvertReportHotelAreaDetailTool;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.ReportHotelAreaDetail;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailListItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.service.IReportHotelAreaDetailService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 商业报告详情控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:04
+ */
+@Api(tags = "商业报告详情", hidden = true)
+@Validated
+@RestController
+@RequestMapping("reportHotelAreaDetails")
+public class ReportHotelAreaDetailController {
+    @Autowired
+    private IReportHotelAreaDetailService reportHotelAreaDetailService;
+
+    @ApiOperation(value = "创建商业报告详情")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createReportHotelAreaDetail(
+            @Valid @RequestBody AddReportHotelAreaDetailDTO addReportHotelAreaDetailDTO) {
+        String id = reportHotelAreaDetailService.createReportHotelAreaDetail(addReportHotelAreaDetailDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "商业报告详情详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseReportHotelAreaDetailItemVO> queryReportHotelAreaDetailDetail(
+            @Valid @RequestBody QueryReportHotelAreaDetailDetailDTO queryReportHotelAreaDetailDetailDTO) {
+        ReportHotelAreaDetail reportHotelAreaDetail = reportHotelAreaDetailService.getReportHotelAreaDetail(queryReportHotelAreaDetailDetailDTO.getId());
+        ResponseReportHotelAreaDetailItemVO responseReportHotelAreaDetailItemVO = ConvertReportHotelAreaDetailTool.INSTANCE.convert2ResponseItemDTO(reportHotelAreaDetail);
+        return ResultHelper.single(responseReportHotelAreaDetailItemVO);
+    }
+
+
+    @ApiOperation(value = "更新商业报告详情")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateReportHotelAreaDetail(
+            @Valid @RequestBody UpdateReportHotelAreaDetailDTO updateReportHotelAreaDetailDTO) {
+        reportHotelAreaDetailService.updateReportHotelAreaDetail(updateReportHotelAreaDetailDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateReportHotelAreaDetailDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除商业报告详情")
+    @PostMapping("/delete")
+    public CommonResult deleteReportHotelAreaDetail(
+            @RequestBody @Valid DeleteReportHotelAreaDetailDTO deleteReportHotelAreaDetailDTO) {
+        reportHotelAreaDetailService.deleteReportHotelAreaDetail(deleteReportHotelAreaDetailDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "商业报告详情列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseReportHotelAreaDetailListItemVO>> queryReportHotelAreaDetail(
+            @Valid @RequestBody QueryReportHotelAreaDetailDTO queryReportHotelAreaDetailDTO) {
+        List<ReportHotelAreaDetail> reportHotelAreaDetailList = reportHotelAreaDetailService.queryReportHotelAreaDetailList(queryReportHotelAreaDetailDTO);
+        List<ResponseReportHotelAreaDetailListItemVO> resultList = ConvertReportHotelAreaDetailTool.INSTANCE.convert2List(reportHotelAreaDetailList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "商业报告详情列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseReportHotelAreaDetailListItemVO>> queryReportHotelAreaDetail(
+    //        @Valid @RequestBody PageQueryReportHotelAreaDetailDTO pageQueryReportHotelAreaDetailDTO) {
+    //    IPage<ReportHotelAreaDetail> pagedList = reportHotelAreaDetailService.pageQueryReportHotelAreaDetail(pageQueryReportHotelAreaDetailDTO);
+    //    IPage<ResponseReportHotelAreaDetailListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertReportHotelAreaDetailTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,ReportHotelAreaDetail实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/dao/ReportHotelAreaDetailMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.dao;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.ReportHotelAreaDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 商业报告详情(ReportHotelAreaDetail)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:06
+ */
+@Mapper
+public interface ReportHotelAreaDetailMapper extends BaseMapper<ReportHotelAreaDetail> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/ConvertReportHotelAreaDetailTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 商业报告详情(ReportHotelAreaDetail) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:08 2021-06-07 09:42:08
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertReportHotelAreaDetailTool {
+
+    ConvertReportHotelAreaDetailTool INSTANCE = Mappers.getMapper(ConvertReportHotelAreaDetailTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param reportHotelAreaDetail do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:08
+     */
+    ResponseReportHotelAreaDetailItemVO convert2ResponseItemDTO(ReportHotelAreaDetail reportHotelAreaDetail);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param reportHotelAreaDetail do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:08
+     */
+    ResponseReportHotelAreaDetailListItemVO convert2ResponseListItemDTO(ReportHotelAreaDetail reportHotelAreaDetail);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param reportHotelAreaDetailList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:08
+     */
+    List<ResponseReportHotelAreaDetailListItemVO> convert2List(List<ReportHotelAreaDetail> reportHotelAreaDetailList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addReportHotelAreaDetailDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:08
+     */
+    ReportHotelAreaDetail convertAddDto2Entity(AddReportHotelAreaDetailDTO addReportHotelAreaDetailDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param reportHotelAreaDetail          更新前的do对象
+     * @param updateReportHotelAreaDetailDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:08
+     */
+    ReportHotelAreaDetail convertUpdateDto2Entity(@MappingTarget ReportHotelAreaDetail reportHotelAreaDetail, UpdateReportHotelAreaDetailDTO updateReportHotelAreaDetailDTO);
+}
+

+ 66 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/ReportHotelAreaDetail.java

@@ -0,0 +1,66 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.persagy.apm.common.model.entity.AuditableEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 商业报告详情(ReportHotelAreaDetail)实体类
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:07
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "商业报告详情")
+public class ReportHotelAreaDetail extends AuditableEntity<ReportHotelAreaDetail> implements Serializable {
+    private static final long serialVersionUID = 697592670671019747L;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("费用信息")
+    private Object costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private Object powerUsageOutline;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("遗留问题处理信息")
+    private Object remainProblemsDealInfo;
+
+
+    public static String PROP_PLATFORM_RUNTIME_INFO = "platform_runtime_info";
+    public static String PROP_PLATFORM_RUNTIME_DESCRIPTION = "platform_runtime_description";
+    public static String PROP_COST_INFO = "cost_info";
+    public static String PROP_COST_DESCRIPTION = "cost_description";
+    public static String PROP_POWER_USAGE_OUTLINE = "power_usage_outline";
+    public static String PROP_POWER_USAGE_DESCRIPTION = "power_usage_description";
+    public static String PROP_ENERGY_WORK_ORDER_INFO = "energy_work_order_info";
+    public static String PROP_ENERGY_WORK_ORDER_DESCRIPTION = "energy_work_order_description";
+    public static String PROP_ALARM_DEAL_INFO = "alarm_deal_info";
+    public static String PROP_REMAIN_PROBLEMS_DEAL_INFO = "remain_problems_deal_info";
+
+}

+ 59 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/AddReportHotelAreaDetailDTO.java

@@ -0,0 +1,59 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:07
+ */
+@Data
+@ApiModel(value = "创建商业报告详情入参")
+public class AddReportHotelAreaDetailDTO {
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    @NotNull(message = "平台运行信息不能为空") // todo 更新校验规则
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    @NotNull(message = "平台运行描述不能为空") // todo 更新校验规则
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    @NotNull(message = "费用信息不能为空") // todo 更新校验规则
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    @NotNull(message = "费用说明不能为空") // todo 更新校验规则
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    @NotNull(message = "用电量概述不能为空") // todo 更新校验规则
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    @NotNull(message = "用电量说明不能为空") // todo 更新校验规则
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    @NotNull(message = "节能工单信息不能为空") // todo 更新校验规则
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    @NotNull(message = "节能工单说明不能为空") // todo 更新校验规则
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    @NotNull(message = "报警处理信息不能为空") // todo 更新校验规则
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "遗留问题处理信息", required = true)
+    @NotNull(message = "遗留问题处理信息不能为空") // todo 更新校验规则
+    private Object remainProblemsDealInfo;
+
+}

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/DeleteReportHotelAreaDetailDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:07
+ */
+@Data
+@ApiModel(value = "删除商业报告详情入参")
+public class DeleteReportHotelAreaDetailDTO {
+    @NotNull(message = "id不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 53 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/PageQueryReportHotelAreaDetailDTO.java

@@ -0,0 +1,53 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+import com.persagy.apm.common.model.dto.PageDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:08
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(value = "分页查询商业报告详情入参")
+public class PageQueryReportHotelAreaDetailDTO extends PageDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "遗留问题处理信息", required = true)
+    private Object remainProblemsDealInfo;
+
+}

+ 46 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/QueryReportHotelAreaDetailDTO.java

@@ -0,0 +1,46 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:08
+ */
+@Data
+@ApiModel(value = "查询商业报告详情入参")
+public class QueryReportHotelAreaDetailDTO {
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "遗留问题处理信息", required = true)
+    private Object remainProblemsDealInfo;
+
+}

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/QueryReportHotelAreaDetailDetailDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:07
+ */
+@Data
+@ApiModel(value = "获取商业报告详情详情入参")
+public class QueryReportHotelAreaDetailDetailDTO {
+    @NotNull(message = "主键不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 63 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/dto/UpdateReportHotelAreaDetailDTO.java

@@ -0,0 +1,63 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:07
+ */
+@Data
+@ApiModel(value = "更新商业报告详情入参")
+public class UpdateReportHotelAreaDetailDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    private String id;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    @NotNull(message = "平台运行信息不能为空") // todo 更新校验规则
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    @NotNull(message = "平台运行描述不能为空") // todo 更新校验规则
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    @NotNull(message = "费用信息不能为空") // todo 更新校验规则
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    @NotNull(message = "费用说明不能为空") // todo 更新校验规则
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    @NotNull(message = "用电量概述不能为空") // todo 更新校验规则
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    @NotNull(message = "用电量说明不能为空") // todo 更新校验规则
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    @NotNull(message = "节能工单信息不能为空") // todo 更新校验规则
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    @NotNull(message = "节能工单说明不能为空") // todo 更新校验规则
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    @NotNull(message = "报警处理信息不能为空") // todo 更新校验规则
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "遗留问题处理信息", required = true)
+    @NotNull(message = "遗留问题处理信息不能为空") // todo 更新校验规则
+    private Object remainProblemsDealInfo;
+
+}

+ 19 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/HotelAreaCostInfo.java

@@ -0,0 +1,19 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author lixing
+ * @version V1.0 2021/6/7 2:12 下午
+ **/
+@Data
+@ApiModel("酒店区域费用信息")
+public class HotelAreaCostInfo {
+    @ApiModelProperty(value = "各项目费用信息")
+    private List<HotelProjectCostInfo> projectsCostInfo;
+
+}

+ 31 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/HotelProjectCostInfo.java

@@ -0,0 +1,31 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo;
+
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostItemVO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author lixing
+ * @version V1.0 2021/6/7 2:12 下午
+ **/
+@Data
+@ApiModel("酒店项目费用信息")
+public class HotelProjectCostInfo {
+    @ApiModelProperty(value = "总费用")
+    private Double totalCost;
+    @ApiModelProperty(value = "单位建筑面积费用")
+    private Double costPerSquareMetre;
+    @ApiModelProperty(value = "费用同比涨幅")
+    private Double costYearRange;
+    @ApiModelProperty(value = "入住率")
+    private Double occupancy;
+    @ApiModelProperty(value = "入住率同比涨幅")
+    private Double occupancyYearRange;
+    @ApiModelProperty(value = "入住率环比涨幅")
+    private Double occupancyMonthRange;
+    @ApiModelProperty(value = "条目费用信息")
+    private List<CostItemVO> itemsCostInfo;
+}

+ 31 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/PowerUsageOutline.java

@@ -0,0 +1,31 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo;
+
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostItemVO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author lixing
+ * @version V1.0 2021/6/7 2:12 下午
+ **/
+@Data
+@ApiModel("酒店项目费用信息")
+public class PowerUsageOutline {
+    @ApiModelProperty(value = "总费用")
+    private Double totalCost;
+    @ApiModelProperty(value = "单位建筑面积费用")
+    private Double costPerSquareMetre;
+    @ApiModelProperty(value = "费用同比涨幅")
+    private Double costYearRange;
+    @ApiModelProperty(value = "入住率")
+    private Double occupancy;
+    @ApiModelProperty(value = "入住率同比涨幅")
+    private Double occupancyYearRange;
+    @ApiModelProperty(value = "入住率环比涨幅")
+    private Double occupancyMonthRange;
+    @ApiModelProperty(value = "条目费用信息")
+    private List<CostItemVO> itemsCostInfo;
+}

+ 64 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/ResponseReportHotelAreaDetailItemVO.java

@@ -0,0 +1,64 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:08
+ */
+@Data
+@ApiModel(value = "商业报告详情返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseReportHotelAreaDetailItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("费用信息")
+    private HotelAreaCostInfo costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private Object powerUsageOutline;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("遗留问题处理信息")
+    private Object remainProblemsDealInfo;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 64 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/model/vo/ResponseReportHotelAreaDetailListItemVO.java

@@ -0,0 +1,64 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:08
+ */
+@Data
+@ApiModel(value = "商业报告详情列表返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseReportHotelAreaDetailListItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("费用信息")
+    private Object costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private Object powerUsageOutline;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("遗留问题处理信息")
+    private Object remainProblemsDealInfo;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 88 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/IReportHotelAreaDetailService.java

@@ -0,0 +1,88 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.service;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 商业报告详情(ReportHotelAreaDetail) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:05
+ */
+public interface IReportHotelAreaDetailService {
+
+    /**
+     * 创建商业报告详情
+     *
+     * @param addReportHotelAreaDetailDTO addDTO
+     * @return 商业报告详情主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    String createReportHotelAreaDetail(AddReportHotelAreaDetailDTO addReportHotelAreaDetailDTO);
+
+    /**
+     * 商业报告详情详情
+     *
+     * @param id 主键
+     * @return 商业报告详情do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    ReportHotelAreaDetail getReportHotelAreaDetail(String id);
+
+    /**
+     * 更新商业报告详情
+     *
+     * @param updateReportHotelAreaDetailDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    void updateReportHotelAreaDetail(UpdateReportHotelAreaDetailDTO updateReportHotelAreaDetailDTO);
+
+    /**
+     * 删除商业报告详情
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    void deleteReportHotelAreaDetail(String id);
+
+    /**
+     * 查询商业报告详情
+     *
+     * @param queryReportHotelAreaDetailDTO queryDTO
+     * @return List<ReportHotelAreaDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    List<ReportHotelAreaDetail> queryReportHotelAreaDetailList(QueryReportHotelAreaDetailDTO queryReportHotelAreaDetailDTO);
+
+    /**
+     * 分页查询商业报告详情
+     *
+     * @param pageQueryReportHotelAreaDetailDTO pageQueryDTO
+     * @return IPage<ReportHotelAreaDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:05
+     */
+    IPage<ReportHotelAreaDetail> pageQueryReportHotelAreaDetail(PageQueryReportHotelAreaDetailDTO pageQueryReportHotelAreaDetailDTO);
+
+    /**
+     * 获取酒店区域报告详情
+     *
+     * @param reportOutlineId 报告概要id
+     * @return 酒店区域报告详情
+     * @author lixing
+     * @version V1.0 2021/6/7 11:45 上午
+     */
+    ResponseReportHotelAreaDetailItemVO getReportHotelAreaDetailByReportOutline(String reportOutlineId);
+}

+ 282 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/area/service/impl/ReportHotelAreaDetailServiceImpl.java

@@ -0,0 +1,282 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.area.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.dao.ReportHotelAreaDetailMapper;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.service.IReportHotelAreaDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
+import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang.StringUtils;
+import com.persagy.apm.common.constant.enums.ValidEnum;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.base.CaseFormat;
+import com.persagy.apm.common.model.dto.Sort;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * 商业报告详情(ReportHotelAreaDetail) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:06
+ */
+@Service
+public class ReportHotelAreaDetailServiceImpl extends ServiceImpl<ReportHotelAreaDetailMapper, ReportHotelAreaDetail>
+        implements IReportHotelAreaDetailService {
+    @Autowired
+    private IReportOutlineService reportOutlineService;
+
+    /**
+     * 创建商业报告详情
+     *
+     * @return 商业报告详情主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public String createReportHotelAreaDetail(AddReportHotelAreaDetailDTO addReportHotelAreaDetailDTO) {
+        ReportHotelAreaDetail reportHotelAreaDetail = ConvertReportHotelAreaDetailTool.INSTANCE.convertAddDto2Entity(addReportHotelAreaDetailDTO);
+        // 设置默认值
+        setDefaultValue(reportHotelAreaDetail);
+        save(reportHotelAreaDetail);
+        return reportHotelAreaDetail.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param reportHotelAreaDetail 商业报告详情实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(ReportHotelAreaDetail reportHotelAreaDetail) {
+        reportHotelAreaDetail.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 商业报告详情详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public ReportHotelAreaDetail getReportHotelAreaDetail(String id) {
+        ReportHotelAreaDetail reportHotelAreaDetail = getById(id);
+        if (reportHotelAreaDetail == null) {
+            throw new IllegalArgumentException("查看ReportHotelAreaDetail详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return reportHotelAreaDetail;
+    }
+
+    /**
+     * 更新商业报告详情
+     *
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public void updateReportHotelAreaDetail(UpdateReportHotelAreaDetailDTO updateReportHotelAreaDetailDTO) {
+        ReportHotelAreaDetail reportHotelAreaDetail = getById(updateReportHotelAreaDetailDTO.getId());
+        reportHotelAreaDetail = ConvertReportHotelAreaDetailTool.INSTANCE.convertUpdateDto2Entity(reportHotelAreaDetail, updateReportHotelAreaDetailDTO);
+        reportHotelAreaDetail.setModifier(AppContext.getContext().getAccountId());
+        updateById(reportHotelAreaDetail);
+    }
+
+    /**
+     * 校验商业报告详情是否可删除
+     *
+     * @param id 商业报告详情主键
+     * @return 商业报告详情do类
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    public ReportHotelAreaDetail checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除ReportHotelAreaDetail时发生异常,主键为空");
+        }
+
+        ReportHotelAreaDetail reportHotelAreaDetail = getById(id);
+
+        if (reportHotelAreaDetail == null) {
+            throw new IllegalArgumentException("删除ReportHotelAreaDetail时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return reportHotelAreaDetail;
+    }
+
+    /**
+     * 删除商业报告详情
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public void deleteReportHotelAreaDetail(String id) {
+        // 校验是否可删除
+        ReportHotelAreaDetail reportHotelAreaDetail = checkDeletable(id);
+
+        reportHotelAreaDetail.setValid(ValidEnum.FALSE.getType());
+        updateById(reportHotelAreaDetail);
+    }
+
+    /**
+     * 查询商业报告详情
+     *
+     * @return List<ReportHotelAreaDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public List<ReportHotelAreaDetail> queryReportHotelAreaDetailList(QueryReportHotelAreaDetailDTO queryReportHotelAreaDetailDTO) {
+        QueryWrapper<ReportHotelAreaDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportHotelAreaDetail.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, ReportHotelAreaDetail.PROP_CREATIONTIME);
+
+        if (queryReportHotelAreaDetailDTO != null) {
+
+            if (queryReportHotelAreaDetailDTO.getPlatformRuntimeInfo() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_INFO, queryReportHotelAreaDetailDTO.getPlatformRuntimeInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getPlatformRuntimeDescription())) {
+                queryWrapper.like(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, queryReportHotelAreaDetailDTO.getPlatformRuntimeDescription());
+            }
+
+            if (queryReportHotelAreaDetailDTO.getCostInfo() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_COST_INFO, queryReportHotelAreaDetailDTO.getCostInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getCostDescription())) {
+                queryWrapper.like(ReportHotelAreaDetail.PROP_COST_DESCRIPTION, queryReportHotelAreaDetailDTO.getCostDescription());
+            }
+
+            if (queryReportHotelAreaDetailDTO.getPowerUsageOutline() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_POWER_USAGE_OUTLINE, queryReportHotelAreaDetailDTO.getPowerUsageOutline());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getPowerUsageDescription())) {
+                queryWrapper.like(ReportHotelAreaDetail.PROP_POWER_USAGE_DESCRIPTION, queryReportHotelAreaDetailDTO.getPowerUsageDescription());
+            }
+
+            if (queryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_INFO, queryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription())) {
+                queryWrapper.like(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, queryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription());
+            }
+
+            if (queryReportHotelAreaDetailDTO.getAlarmDealInfo() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_ALARM_DEAL_INFO, queryReportHotelAreaDetailDTO.getAlarmDealInfo());
+            }
+
+            if (queryReportHotelAreaDetailDTO.getRemainProblemsDealInfo() != null) {
+                queryWrapper.eq(ReportHotelAreaDetail.PROP_REMAIN_PROBLEMS_DEAL_INFO, queryReportHotelAreaDetailDTO.getRemainProblemsDealInfo());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询商业报告详情
+     *
+     * @return IPage<ReportHotelAreaDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:06
+     */
+    @Override
+    public IPage<ReportHotelAreaDetail> pageQueryReportHotelAreaDetail(PageQueryReportHotelAreaDetailDTO pageQueryReportHotelAreaDetailDTO) {
+        QueryWrapper<ReportHotelAreaDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportHotelAreaDetail.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<ReportHotelAreaDetail> pageParam = new Page<>(pageQueryReportHotelAreaDetailDTO.getPage(), pageQueryReportHotelAreaDetailDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryReportHotelAreaDetailDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, ReportHotelAreaDetail.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryReportHotelAreaDetailDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeInfo() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_INFO, pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeDescription())) {
+            queryWrapper.like(ReportHotelAreaDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getPlatformRuntimeDescription());
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getCostInfo() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_COST_INFO, pageQueryReportHotelAreaDetailDTO.getCostInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getCostDescription())) {
+            queryWrapper.like(ReportHotelAreaDetail.PROP_COST_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getCostDescription());
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getPowerUsageOutline() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_POWER_USAGE_OUTLINE, pageQueryReportHotelAreaDetailDTO.getPowerUsageOutline());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getPowerUsageDescription())) {
+            queryWrapper.like(ReportHotelAreaDetail.PROP_POWER_USAGE_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getPowerUsageDescription());
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_INFO, pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription())) {
+            queryWrapper.like(ReportHotelAreaDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, pageQueryReportHotelAreaDetailDTO.getEnergyWorkOrderDescription());
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getAlarmDealInfo() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_ALARM_DEAL_INFO, pageQueryReportHotelAreaDetailDTO.getAlarmDealInfo());
+        }
+
+        if (pageQueryReportHotelAreaDetailDTO.getRemainProblemsDealInfo() != null) {
+            queryWrapper.eq(ReportHotelAreaDetail.PROP_REMAIN_PROBLEMS_DEAL_INFO, pageQueryReportHotelAreaDetailDTO.getRemainProblemsDealInfo());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+
+    @Override
+    public ResponseReportHotelAreaDetailItemVO getReportHotelAreaDetailByReportOutline(String reportOutlineId) {
+        ReportOutline reportOutline = reportOutlineService.queryReportOutlineDetail(reportOutlineId);
+        String detailId = reportOutline.getDetailId();
+        ReportHotelAreaDetail reportHotelAreaDetail = getReportHotelAreaDetail(detailId);
+        return ConvertReportHotelAreaDetailTool.INSTANCE.
+                convert2ResponseItemDTO(reportHotelAreaDetail);
+    }
+}

+ 93 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/controller/ReportHotelProjectDetailController.java

@@ -0,0 +1,93 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.controller;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.service.IReportHotelProjectDetailService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto.*;
+import com.persagy.apm.common.response.*;
+import com.persagy.apm.common.utils.ResultHelper;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 商业报告详情控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:56
+ */
+@Api(tags = "商业报告详情", hidden = true)
+@Validated
+@RestController
+@RequestMapping("reportHotelProjectDetails")
+public class ReportHotelProjectDetailController {
+    @Autowired
+    private IReportHotelProjectDetailService reportHotelProjectDetailService;
+
+    @ApiOperation(value = "创建商业报告详情")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createReportHotelProjectDetail(
+            @Valid @RequestBody AddReportHotelProjectDetailDTO addReportHotelProjectDetailDTO) {
+        String id = reportHotelProjectDetailService.createReportHotelProjectDetail(addReportHotelProjectDetailDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "商业报告详情详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseReportHotelProjectDetailItemVO> queryReportHotelProjectDetailDetail(
+            @Valid @RequestBody QueryReportHotelProjectDetailDetailDTO queryReportHotelProjectDetailDetailDTO) {
+        ReportHotelProjectDetail reportHotelProjectDetail = reportHotelProjectDetailService.getReportHotelProjectDetail(queryReportHotelProjectDetailDetailDTO.getId());
+        ResponseReportHotelProjectDetailItemVO responseReportHotelProjectDetailItemVO = ConvertReportHotelProjectDetailTool.INSTANCE.convert2ResponseItemDTO(reportHotelProjectDetail);
+        return ResultHelper.single(responseReportHotelProjectDetailItemVO);
+    }
+
+
+    @ApiOperation(value = "更新商业报告详情")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateReportHotelProjectDetail(
+            @Valid @RequestBody UpdateReportHotelProjectDetailDTO updateReportHotelProjectDetailDTO) {
+        reportHotelProjectDetailService.updateReportHotelProjectDetail(updateReportHotelProjectDetailDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateReportHotelProjectDetailDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除商业报告详情")
+    @PostMapping("/delete")
+    public CommonResult deleteReportHotelProjectDetail(
+            @RequestBody @Valid DeleteReportHotelProjectDetailDTO deleteReportHotelProjectDetailDTO) {
+        reportHotelProjectDetailService.deleteReportHotelProjectDetail(deleteReportHotelProjectDetailDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "商业报告详情列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseReportHotelProjectDetailListItemVO>> queryReportHotelProjectDetail(
+            @Valid @RequestBody QueryReportHotelProjectDetailDTO queryReportHotelProjectDetailDTO) {
+        List<ReportHotelProjectDetail> reportHotelProjectDetailList = reportHotelProjectDetailService.queryReportHotelProjectDetailList(queryReportHotelProjectDetailDTO);
+        List<ResponseReportHotelProjectDetailListItemVO> resultList = ConvertReportHotelProjectDetailTool.INSTANCE.convert2List(reportHotelProjectDetailList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "商业报告详情列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseReportHotelProjectDetailListItemVO>> queryReportHotelProjectDetail(
+    //        @Valid @RequestBody PageQueryReportHotelProjectDetailDTO pageQueryReportHotelProjectDetailDTO) {
+    //    IPage<ReportHotelProjectDetail> pagedList = reportHotelProjectDetailService.pageQueryReportHotelProjectDetail(pageQueryReportHotelProjectDetailDTO);
+    //    IPage<ResponseReportHotelProjectDetailListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertReportHotelProjectDetailTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,ReportHotelProjectDetail实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/dao/ReportHotelProjectDetailMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.dao;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.ReportHotelProjectDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 商业报告详情(ReportHotelProjectDetail)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:58
+ */
+@Mapper
+public interface ReportHotelProjectDetailMapper extends BaseMapper<ReportHotelProjectDetail> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/ConvertReportHotelProjectDetailTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 商业报告详情(ReportHotelProjectDetail) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59 2021-06-07 09:42:59
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertReportHotelProjectDetailTool {
+
+    ConvertReportHotelProjectDetailTool INSTANCE = Mappers.getMapper(ConvertReportHotelProjectDetailTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param reportHotelProjectDetail do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:59
+     */
+    ResponseReportHotelProjectDetailItemVO convert2ResponseItemDTO(ReportHotelProjectDetail reportHotelProjectDetail);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param reportHotelProjectDetail do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:59
+     */
+    ResponseReportHotelProjectDetailListItemVO convert2ResponseListItemDTO(ReportHotelProjectDetail reportHotelProjectDetail);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param reportHotelProjectDetailList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:59
+     */
+    List<ResponseReportHotelProjectDetailListItemVO> convert2List(List<ReportHotelProjectDetail> reportHotelProjectDetailList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addReportHotelProjectDetailDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:59
+     */
+    ReportHotelProjectDetail convertAddDto2Entity(AddReportHotelProjectDetailDTO addReportHotelProjectDetailDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param reportHotelProjectDetail          更新前的do对象
+     * @param updateReportHotelProjectDetailDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:59
+     */
+    ReportHotelProjectDetail convertUpdateDto2Entity(@MappingTarget ReportHotelProjectDetail reportHotelProjectDetail, UpdateReportHotelProjectDetailDTO updateReportHotelProjectDetailDTO);
+}
+

+ 86 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/ReportHotelProjectDetail.java

@@ -0,0 +1,86 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import com.persagy.apm.common.model.entity.AuditableEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 商业报告详情(ReportHotelProjectDetail)实体类
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:58
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "商业报告详情")
+public class ReportHotelProjectDetail extends AuditableEntity<ReportHotelProjectDetail> implements Serializable {
+    private static final long serialVersionUID = 706925849959914678L;
+
+    @ApiModelProperty("费用信息")
+    private Object costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private Object powerUsageOutline;
+
+    @ApiModelProperty("公区用电量")
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("冷站效率")
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty("冷站效率说明")
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty("环境信息")
+    private Object envInfo;
+
+    @ApiModelProperty("环境说明")
+    private String envDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("报警处理说明")
+    private String alarmDealDescription;
+
+
+    public static String PROP_COST_INFO = "cost_info";
+    public static String PROP_COST_DESCRIPTION = "cost_description";
+    public static String PROP_POWER_USAGE_OUTLINE = "power_usage_outline";
+    public static String PROP_PUBLIC_AREA_POWER_USAGE = "public_area_power_usage";
+    public static String PROP_POWER_USAGE_DESCRIPTION = "power_usage_description";
+    public static String PROP_AIR_CONDITIONER_EFFICIENCY = "air_conditioner_efficiency";
+    public static String PROP_AIR_CONDITIONER_EFFICIENCY_EXPLAIN = "air_conditioner_efficiency_explain";
+    public static String PROP_ENV_INFO = "env_info";
+    public static String PROP_ENV_DESCRIPTION = "env_description";
+    public static String PROP_ENERGY_WORK_ORDER_INFO = "energy_work_order_info";
+    public static String PROP_ENERGY_WORK_ORDER_DESCRIPTION = "energy_work_order_description";
+    public static String PROP_PLATFORM_RUNTIME_INFO = "platform_runtime_info";
+    public static String PROP_PLATFORM_RUNTIME_DESCRIPTION = "platform_runtime_description";
+    public static String PROP_ALARM_DEAL_INFO = "alarm_deal_info";
+    public static String PROP_ALARM_DEAL_DESCRIPTION = "alarm_deal_description";
+
+}

+ 79 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/AddReportHotelProjectDetailDTO.java

@@ -0,0 +1,79 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:58
+ */
+@Data
+@ApiModel(value = "创建商业报告详情入参")
+public class AddReportHotelProjectDetailDTO {
+    @ApiModelProperty(value = "费用信息", required = true)
+    @NotNull(message = "费用信息不能为空") // todo 更新校验规则
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    @NotNull(message = "费用说明不能为空") // todo 更新校验规则
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    @NotNull(message = "用电量概述不能为空") // todo 更新校验规则
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "公区用电量", required = true)
+    @NotNull(message = "公区用电量不能为空") // todo 更新校验规则
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    @NotNull(message = "用电量说明不能为空") // todo 更新校验规则
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "冷站效率", required = true)
+    @NotNull(message = "冷站效率不能为空") // todo 更新校验规则
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty(value = "冷站效率说明", required = true)
+    @NotNull(message = "冷站效率说明不能为空") // todo 更新校验规则
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty(value = "环境信息", required = true)
+    @NotNull(message = "环境信息不能为空") // todo 更新校验规则
+    private Object envInfo;
+
+    @ApiModelProperty(value = "环境说明", required = true)
+    @NotNull(message = "环境说明不能为空") // todo 更新校验规则
+    private String envDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    @NotNull(message = "节能工单信息不能为空") // todo 更新校验规则
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    @NotNull(message = "节能工单说明不能为空") // todo 更新校验规则
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    @NotNull(message = "平台运行信息不能为空") // todo 更新校验规则
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    @NotNull(message = "平台运行描述不能为空") // todo 更新校验规则
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    @NotNull(message = "报警处理信息不能为空") // todo 更新校验规则
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "报警处理说明", required = true)
+    @NotNull(message = "报警处理说明不能为空") // todo 更新校验规则
+    private String alarmDealDescription;
+
+}

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/DeleteReportHotelProjectDetailDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59
+ */
+@Data
+@ApiModel(value = "删除商业报告详情入参")
+public class DeleteReportHotelProjectDetailDTO {
+    @NotNull(message = "id不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 68 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/PageQueryReportHotelProjectDetailDTO.java

@@ -0,0 +1,68 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+import com.persagy.apm.common.model.dto.PageDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(value = "分页查询商业报告详情入参")
+public class PageQueryReportHotelProjectDetailDTO extends PageDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "公区用电量", required = true)
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "冷站效率", required = true)
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty(value = "冷站效率说明", required = true)
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty(value = "环境信息", required = true)
+    private Object envInfo;
+
+    @ApiModelProperty(value = "环境说明", required = true)
+    private String envDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "报警处理说明", required = true)
+    private String alarmDealDescription;
+
+}

+ 61 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/QueryReportHotelProjectDetailDTO.java

@@ -0,0 +1,61 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59
+ */
+@Data
+@ApiModel(value = "查询商业报告详情入参")
+public class QueryReportHotelProjectDetailDTO {
+    @ApiModelProperty(value = "费用信息", required = true)
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "公区用电量", required = true)
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "冷站效率", required = true)
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty(value = "冷站效率说明", required = true)
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty(value = "环境信息", required = true)
+    private Object envInfo;
+
+    @ApiModelProperty(value = "环境说明", required = true)
+    private String envDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "报警处理说明", required = true)
+    private String alarmDealDescription;
+
+}

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/QueryReportHotelProjectDetailDetailDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:58
+ */
+@Data
+@ApiModel(value = "获取商业报告详情详情入参")
+public class QueryReportHotelProjectDetailDetailDTO {
+    @NotNull(message = "主键不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 83 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/dto/UpdateReportHotelProjectDetailDTO.java

@@ -0,0 +1,83 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:58
+ */
+@Data
+@ApiModel(value = "更新商业报告详情入参")
+public class UpdateReportHotelProjectDetailDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    private String id;
+
+    @ApiModelProperty(value = "费用信息", required = true)
+    @NotNull(message = "费用信息不能为空") // todo 更新校验规则
+    private Object costInfo;
+
+    @ApiModelProperty(value = "费用说明", required = true)
+    @NotNull(message = "费用说明不能为空") // todo 更新校验规则
+    private String costDescription;
+
+    @ApiModelProperty(value = "用电量概述", required = true)
+    @NotNull(message = "用电量概述不能为空") // todo 更新校验规则
+    private Object powerUsageOutline;
+
+    @ApiModelProperty(value = "公区用电量", required = true)
+    @NotNull(message = "公区用电量不能为空") // todo 更新校验规则
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty(value = "用电量说明", required = true)
+    @NotNull(message = "用电量说明不能为空") // todo 更新校验规则
+    private String powerUsageDescription;
+
+    @ApiModelProperty(value = "冷站效率", required = true)
+    @NotNull(message = "冷站效率不能为空") // todo 更新校验规则
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty(value = "冷站效率说明", required = true)
+    @NotNull(message = "冷站效率说明不能为空") // todo 更新校验规则
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty(value = "环境信息", required = true)
+    @NotNull(message = "环境信息不能为空") // todo 更新校验规则
+    private Object envInfo;
+
+    @ApiModelProperty(value = "环境说明", required = true)
+    @NotNull(message = "环境说明不能为空") // todo 更新校验规则
+    private String envDescription;
+
+    @ApiModelProperty(value = "节能工单信息", required = true)
+    @NotNull(message = "节能工单信息不能为空") // todo 更新校验规则
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty(value = "节能工单说明", required = true)
+    @NotNull(message = "节能工单说明不能为空") // todo 更新校验规则
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty(value = "平台运行信息", required = true)
+    @NotNull(message = "平台运行信息不能为空") // todo 更新校验规则
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty(value = "平台运行描述", required = true)
+    @NotNull(message = "平台运行描述不能为空") // todo 更新校验规则
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty(value = "报警处理信息", required = true)
+    @NotNull(message = "报警处理信息不能为空") // todo 更新校验规则
+    private Object alarmDealInfo;
+
+    @ApiModelProperty(value = "报警处理说明", required = true)
+    @NotNull(message = "报警处理说明不能为空") // todo 更新校验规则
+    private String alarmDealDescription;
+
+}

+ 81 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/vo/ResponseReportHotelProjectDetailItemVO.java

@@ -0,0 +1,81 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.HotelProjectCostInfo;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.PowerUsageOutline;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59
+ */
+@Data
+@ApiModel(value = "酒店项目报告详情返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseReportHotelProjectDetailItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("费用信息")
+    private HotelProjectCostInfo costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private PowerUsageOutline powerUsageOutline;
+
+    @ApiModelProperty("公区用电量")
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("冷站效率")
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty("冷站效率说明")
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty("环境信息")
+    private Object envInfo;
+
+    @ApiModelProperty("环境说明")
+    private String envDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("报警处理说明")
+    private String alarmDealDescription;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 79 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/model/vo/ResponseReportHotelProjectDetailListItemVO.java

@@ -0,0 +1,79 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:59
+ */
+@Data
+@ApiModel(value = "商业报告详情列表返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseReportHotelProjectDetailListItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("费用信息")
+    private Object costInfo;
+
+    @ApiModelProperty("费用说明")
+    private String costDescription;
+
+    @ApiModelProperty("用电量概述")
+    private Object powerUsageOutline;
+
+    @ApiModelProperty("公区用电量")
+    private Object publicAreaPowerUsage;
+
+    @ApiModelProperty("用电量说明")
+    private String powerUsageDescription;
+
+    @ApiModelProperty("冷站效率")
+    private Object airConditionerEfficiency;
+
+    @ApiModelProperty("冷站效率说明")
+    private String airConditionerEfficiencyExplain;
+
+    @ApiModelProperty("环境信息")
+    private Object envInfo;
+
+    @ApiModelProperty("环境说明")
+    private String envDescription;
+
+    @ApiModelProperty("节能工单信息")
+    private Object energyWorkOrderInfo;
+
+    @ApiModelProperty("节能工单说明")
+    private String energyWorkOrderDescription;
+
+    @ApiModelProperty("平台运行信息")
+    private Object platformRuntimeInfo;
+
+    @ApiModelProperty("平台运行描述")
+    private String platformRuntimeDescription;
+
+    @ApiModelProperty("报警处理信息")
+    private Object alarmDealInfo;
+
+    @ApiModelProperty("报警处理说明")
+    private String alarmDealDescription;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 88 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/IReportHotelProjectDetailService.java

@@ -0,0 +1,88 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.service;
+
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.ResponseReportHotelProjectDetailItemVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 商业报告详情(ReportHotelProjectDetail) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:57
+ */
+public interface IReportHotelProjectDetailService {
+
+    /**
+     * 创建商业报告详情
+     *
+     * @param addReportHotelProjectDetailDTO addDTO
+     * @return 商业报告详情主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    String createReportHotelProjectDetail(AddReportHotelProjectDetailDTO addReportHotelProjectDetailDTO);
+
+    /**
+     * 商业报告详情详情
+     *
+     * @param id 主键
+     * @return 商业报告详情do对象
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    ReportHotelProjectDetail getReportHotelProjectDetail(String id);
+
+    /**
+     * 更新商业报告详情
+     *
+     * @param updateReportHotelProjectDetailDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    void updateReportHotelProjectDetail(UpdateReportHotelProjectDetailDTO updateReportHotelProjectDetailDTO);
+
+    /**
+     * 删除商业报告详情
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    void deleteReportHotelProjectDetail(String id);
+
+    /**
+     * 查询商业报告详情
+     *
+     * @param queryReportHotelProjectDetailDTO queryDTO
+     * @return List<ReportHotelProjectDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    List<ReportHotelProjectDetail> queryReportHotelProjectDetailList(QueryReportHotelProjectDetailDTO queryReportHotelProjectDetailDTO);
+
+    /**
+     * 分页查询商业报告详情
+     *
+     * @param pageQueryReportHotelProjectDetailDTO pageQueryDTO
+     * @return IPage<ReportHotelProjectDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    IPage<ReportHotelProjectDetail> pageQueryReportHotelProjectDetail(PageQueryReportHotelProjectDetailDTO pageQueryReportHotelProjectDetailDTO);
+
+    /**
+     * 获取酒店项目报告详情
+     *
+     * @param reportOutlineId 报告概要id
+     * @return 酒店项目报告详情
+     * @author lixing
+     * @version V1.0 2021/6/7 11:45 上午
+     */
+    ResponseReportHotelProjectDetailItemVO getReportHotelProjectDetailByReportOutline(String reportOutlineId);
+}

+ 328 - 0
src/main/java/com/persagy/apm/energy/report/monthly/detail/hotel/project/service/impl/ReportHotelProjectDetailServiceImpl.java

@@ -0,0 +1,328 @@
+package com.persagy.apm.energy.report.monthly.detail.hotel.project.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.dao.ReportHotelProjectDetailMapper;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.ResponseReportHotelProjectDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.service.IReportHotelProjectDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
+import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang.StringUtils;
+import com.persagy.apm.common.constant.enums.ValidEnum;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.*;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.base.CaseFormat;
+import com.persagy.apm.common.model.dto.Sort;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * 商业报告详情(ReportHotelProjectDetail) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-06-07 09:42:57
+ */
+@Service
+public class ReportHotelProjectDetailServiceImpl extends ServiceImpl<ReportHotelProjectDetailMapper, ReportHotelProjectDetail>
+        implements IReportHotelProjectDetailService {
+    @Autowired
+    private IReportOutlineService reportOutlineService;
+
+    /**
+     * 创建商业报告详情
+     *
+     * @return 商业报告详情主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public String createReportHotelProjectDetail(AddReportHotelProjectDetailDTO addReportHotelProjectDetailDTO) {
+        ReportHotelProjectDetail reportHotelProjectDetail = ConvertReportHotelProjectDetailTool.INSTANCE.convertAddDto2Entity(addReportHotelProjectDetailDTO);
+        // 设置默认值
+        setDefaultValue(reportHotelProjectDetail);
+        save(reportHotelProjectDetail);
+        return reportHotelProjectDetail.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param reportHotelProjectDetail 商业报告详情实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(ReportHotelProjectDetail reportHotelProjectDetail) {
+        reportHotelProjectDetail.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 商业报告详情详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public ReportHotelProjectDetail getReportHotelProjectDetail(String id) {
+        ReportHotelProjectDetail reportHotelProjectDetail = getById(id);
+        if (reportHotelProjectDetail == null) {
+            throw new IllegalArgumentException("查看ReportHotelProjectDetail详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return reportHotelProjectDetail;
+    }
+
+    /**
+     * 更新商业报告详情
+     *
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public void updateReportHotelProjectDetail(UpdateReportHotelProjectDetailDTO updateReportHotelProjectDetailDTO) {
+        ReportHotelProjectDetail reportHotelProjectDetail = getById(updateReportHotelProjectDetailDTO.getId());
+        reportHotelProjectDetail = ConvertReportHotelProjectDetailTool.INSTANCE.convertUpdateDto2Entity(reportHotelProjectDetail, updateReportHotelProjectDetailDTO);
+        reportHotelProjectDetail.setModifier(AppContext.getContext().getAccountId());
+        updateById(reportHotelProjectDetail);
+    }
+
+    /**
+     * 校验商业报告详情是否可删除
+     *
+     * @param id 商业报告详情主键
+     * @return 商业报告详情do类
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    public ReportHotelProjectDetail checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除ReportHotelProjectDetail时发生异常,主键为空");
+        }
+
+        ReportHotelProjectDetail reportHotelProjectDetail = getById(id);
+
+        if (reportHotelProjectDetail == null) {
+            throw new IllegalArgumentException("删除ReportHotelProjectDetail时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return reportHotelProjectDetail;
+    }
+
+    /**
+     * 删除商业报告详情
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public void deleteReportHotelProjectDetail(String id) {
+        // 校验是否可删除
+        ReportHotelProjectDetail reportHotelProjectDetail = checkDeletable(id);
+
+        reportHotelProjectDetail.setValid(ValidEnum.FALSE.getType());
+        updateById(reportHotelProjectDetail);
+    }
+
+    /**
+     * 查询商业报告详情
+     *
+     * @return List<ReportHotelProjectDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public List<ReportHotelProjectDetail> queryReportHotelProjectDetailList(QueryReportHotelProjectDetailDTO queryReportHotelProjectDetailDTO) {
+        QueryWrapper<ReportHotelProjectDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportHotelProjectDetail.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, ReportHotelProjectDetail.PROP_CREATIONTIME);
+
+        if (queryReportHotelProjectDetailDTO != null) {
+
+            if (queryReportHotelProjectDetailDTO.getCostInfo() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_COST_INFO, queryReportHotelProjectDetailDTO.getCostInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getCostDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_COST_DESCRIPTION, queryReportHotelProjectDetailDTO.getCostDescription());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getPowerUsageOutline() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_POWER_USAGE_OUTLINE, queryReportHotelProjectDetailDTO.getPowerUsageOutline());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getPublicAreaPowerUsage() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_PUBLIC_AREA_POWER_USAGE, queryReportHotelProjectDetailDTO.getPublicAreaPowerUsage());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getPowerUsageDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_POWER_USAGE_DESCRIPTION, queryReportHotelProjectDetailDTO.getPowerUsageDescription());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getAirConditionerEfficiency() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY, queryReportHotelProjectDetailDTO.getAirConditionerEfficiency());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY_EXPLAIN, queryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getEnvInfo() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_ENV_INFO, queryReportHotelProjectDetailDTO.getEnvInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getEnvDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_ENV_DESCRIPTION, queryReportHotelProjectDetailDTO.getEnvDescription());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_INFO, queryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, queryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getPlatformRuntimeInfo() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_INFO, queryReportHotelProjectDetailDTO.getPlatformRuntimeInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getPlatformRuntimeDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, queryReportHotelProjectDetailDTO.getPlatformRuntimeDescription());
+            }
+
+            if (queryReportHotelProjectDetailDTO.getAlarmDealInfo() != null) {
+                queryWrapper.eq(ReportHotelProjectDetail.PROP_ALARM_DEAL_INFO, queryReportHotelProjectDetailDTO.getAlarmDealInfo());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportHotelProjectDetailDTO.getAlarmDealDescription())) {
+                queryWrapper.like(ReportHotelProjectDetail.PROP_ALARM_DEAL_DESCRIPTION, queryReportHotelProjectDetailDTO.getAlarmDealDescription());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询商业报告详情
+     *
+     * @return IPage<ReportHotelProjectDetail>
+     * @author lixing
+     * @version V1.0 2021-06-07 09:42:57
+     */
+    @Override
+    public IPage<ReportHotelProjectDetail> pageQueryReportHotelProjectDetail(PageQueryReportHotelProjectDetailDTO pageQueryReportHotelProjectDetailDTO) {
+        QueryWrapper<ReportHotelProjectDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportHotelProjectDetail.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<ReportHotelProjectDetail> pageParam = new Page<>(pageQueryReportHotelProjectDetailDTO.getPage(), pageQueryReportHotelProjectDetailDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryReportHotelProjectDetailDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, ReportHotelProjectDetail.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryReportHotelProjectDetailDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getCostInfo() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_COST_INFO, pageQueryReportHotelProjectDetailDTO.getCostInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getCostDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_COST_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getCostDescription());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getPowerUsageOutline() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_POWER_USAGE_OUTLINE, pageQueryReportHotelProjectDetailDTO.getPowerUsageOutline());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getPublicAreaPowerUsage() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_PUBLIC_AREA_POWER_USAGE, pageQueryReportHotelProjectDetailDTO.getPublicAreaPowerUsage());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getPowerUsageDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_POWER_USAGE_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getPowerUsageDescription());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiency() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY, pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiency());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_AIR_CONDITIONER_EFFICIENCY_EXPLAIN, pageQueryReportHotelProjectDetailDTO.getAirConditionerEfficiencyExplain());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getEnvInfo() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_ENV_INFO, pageQueryReportHotelProjectDetailDTO.getEnvInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getEnvDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_ENV_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getEnvDescription());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_INFO, pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_ENERGY_WORK_ORDER_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getEnergyWorkOrderDescription());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeInfo() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_INFO, pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_PLATFORM_RUNTIME_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getPlatformRuntimeDescription());
+        }
+
+        if (pageQueryReportHotelProjectDetailDTO.getAlarmDealInfo() != null) {
+            queryWrapper.eq(ReportHotelProjectDetail.PROP_ALARM_DEAL_INFO, pageQueryReportHotelProjectDetailDTO.getAlarmDealInfo());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportHotelProjectDetailDTO.getAlarmDealDescription())) {
+            queryWrapper.like(ReportHotelProjectDetail.PROP_ALARM_DEAL_DESCRIPTION, pageQueryReportHotelProjectDetailDTO.getAlarmDealDescription());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+
+    @Override
+    public ResponseReportHotelProjectDetailItemVO getReportHotelProjectDetailByReportOutline(String reportOutlineId) {
+        ReportOutline reportOutline = reportOutlineService.queryReportOutlineDetail(reportOutlineId);
+        String detailId = reportOutline.getDetailId();
+        ReportHotelProjectDetail reportHotelProjectDetail = getReportHotelProjectDetail(detailId);
+        return ConvertReportHotelProjectDetailTool.INSTANCE.
+                convert2ResponseItemDTO(reportHotelProjectDetail);
+    }
+}

+ 23 - 10
src/main/java/com/persagy/apm/energy/report/monthly/outline/controller/ReportOutlineController.java

@@ -6,20 +6,15 @@ import com.persagy.apm.common.response.ApmResponseUpsertVO;
 import com.persagy.apm.common.response.CommonResult;
 import com.persagy.apm.common.response.PageList;
 import com.persagy.apm.common.utils.ResultHelper;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ConvertReportDetailStatisticsItemRelTool;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ReportDetailStatisticsItemRel;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.QueryReportDetailStatisticsItemRelDTO;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.ResponseReportDetailStatisticsItemRelListItemVO;
-import com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum;
 import com.persagy.apm.energy.report.monthly.config.type.model.ConvertReportTypeTool;
 import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
 import com.persagy.apm.energy.report.monthly.config.type.model.vo.ResponseReportTypeItemVO;
 import com.persagy.apm.energy.report.monthly.config.type.model.vo.ResponseReportTypeListItemVO;
 import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
-import com.persagy.apm.energy.report.monthly.detail.business.model.ConvertReportBusinessDetailTool;
-import com.persagy.apm.energy.report.monthly.detail.business.model.ReportBusinessDetail;
 import com.persagy.apm.energy.report.monthly.detail.business.model.dto.GetReportBusinessDetailDTO;
 import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.ResponseReportHotelProjectDetailItemVO;
 import com.persagy.apm.energy.report.monthly.outline.constants.enums.ReportStateEnum;
 import com.persagy.apm.energy.report.monthly.outline.model.ConvertReportOutlineTool;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
@@ -140,11 +135,29 @@ public class ReportOutlineController {
         return ResultHelper.multi(resultList);
     }
 
-    @ApiOperation(value = "查看报告详情")
-    @PostMapping("/get")
+    @ApiOperation(value = "查看商业报告详情")
+    @PostMapping("/business/get")
     public CommonResult<ResponseReportBusinessDetailItemVO> getReportBusinessDetail(
             @Valid @RequestBody GetReportBusinessDetailDTO getReportBusinessDetailDTO) {
-        ResponseReportBusinessDetailItemVO reportDetailInfo = reportOutlineService.getReportDetailInfo(
+        ResponseReportBusinessDetailItemVO reportDetailInfo = reportOutlineService.getReportBusinessDetailInfo(
+                getReportBusinessDetailDTO.getReportOutlineId());
+        return ResultHelper.single(reportDetailInfo);
+    }
+
+    @ApiOperation(value = "查看酒店项目报告详情")
+    @PostMapping("/hotel/project/get")
+    public CommonResult<ResponseReportHotelProjectDetailItemVO> getReportHotelProjectDetail(
+            @Valid @RequestBody GetReportBusinessDetailDTO getReportBusinessDetailDTO) {
+        ResponseReportHotelProjectDetailItemVO reportDetailInfo = reportOutlineService.getReportHotelProjectDetail(
+                getReportBusinessDetailDTO.getReportOutlineId());
+        return ResultHelper.single(reportDetailInfo);
+    }
+
+    @ApiOperation(value = "查看酒店区域报告详情")
+    @PostMapping("/hotel/area/get")
+    public CommonResult<ResponseReportHotelAreaDetailItemVO> getReportHotelAreaDetail(
+            @Valid @RequestBody GetReportBusinessDetailDTO getReportBusinessDetailDTO) {
+        ResponseReportHotelAreaDetailItemVO reportDetailInfo = reportOutlineService.getReportHotelAreaDetail(
                 getReportBusinessDetailDTO.getReportOutlineId());
         return ResultHelper.single(reportDetailInfo);
     }

+ 3 - 3
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IBusinessReportCostInfoService.java

@@ -1,9 +1,9 @@
 package com.persagy.apm.energy.report.monthly.outline.service;
 
 import com.persagy.apm.energy.report.monthly.config.function.model.Function;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostItemVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.GroupInfo;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostItemVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.GroupInfo;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
 

+ 3 - 4
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IBusinessReportPowerInfoService.java

@@ -1,11 +1,10 @@
 package com.persagy.apm.energy.report.monthly.outline.service;
 
 import com.persagy.apm.energy.report.monthly.config.function.model.Function;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.GroupInfo;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerItemVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.GroupInfo;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerItemVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
-import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
 
 import java.util.Date;
 import java.util.List;

+ 38 - 5
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/IReportOutlineService.java

@@ -1,12 +1,15 @@
 package com.persagy.apm.energy.report.monthly.outline.service;
 
 import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.ResponseReportHotelProjectDetailItemVO;
 import com.persagy.apm.energy.report.monthly.outline.model.*;
 import com.persagy.apm.energy.report.monthly.outline.model.dto.*;
 
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.persagy.apm.energy.report.saasweb.model.vo.SimpleProjectVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -39,14 +42,14 @@ public interface IReportOutlineService {
     ReportOutline queryReportOutlineDetail(String id);
 
     /**
-     * 获取报告详情信息
+     * 获取商业报告详情信息
      *
      * @param reportOutlineId 主键
-     * @return 报告详情信息
+     * @return 商业报告详情信息
      * @author lixing
      * @version V1.0 2021/5/31 6:24 下午
      */
-    ResponseReportBusinessDetailItemVO getReportDetailInfo(String reportOutlineId);
+    ResponseReportBusinessDetailItemVO getReportBusinessDetailInfo(String reportOutlineId);
 
     /**
      * 更新报告概要
@@ -67,14 +70,14 @@ public interface IReportOutlineService {
     void updateReportOutline(ReportOutline reportOutline);
 
     /**
-     * 查询和报告类型相关的项目
+     * 查询和报告类型相关的项目id列表
      *
      * @param reportOutline 报告概要对象
      * @return 项目id列表
      * @author lixing
      * @version V1.0 2021/5/30 8:48 下午
      */
-    List<String> queryRelatedProjects(ReportOutline reportOutline);
+    List<String> queryRelatedProjectIds(ReportOutline reportOutline);
 
     /**
      * 批量删除报告概要
@@ -106,6 +109,16 @@ public interface IReportOutlineService {
     IPage<ReportOutline> pageQueryReportOutline(PageQueryReportOutlineDTO pageQueryReportOutlineDTO);
 
     /**
+     * 查询和报告类型相关的项目列表
+     *
+     * @param reportOutline 报告概要对象
+     * @return 项目列表
+     * @author lixing
+     * @version V1.0 2021/5/30 8:48 下午
+     */
+    List<SimpleProjectVO> queryRelatedProjects(ReportOutline reportOutline);
+
+    /**
      * 重新生成报告
      *
      * @param recreateReportOutlineDTO 重新生成报告入参
@@ -125,4 +138,24 @@ public interface IReportOutlineService {
      * @version V1.0 2021/6/3 4:19 下午
      */
     String getBelongName(String reportBelongType, String belongId);
+
+    /**
+     * 获取酒店项目报告详情信息
+     *
+     * @param reportOutlineId 主键
+     * @return 酒店项目报告详情信息
+     * @author lixing
+     * @version V1.0 2021/5/31 6:24 下午
+     */
+    ResponseReportHotelProjectDetailItemVO getReportHotelProjectDetail(String reportOutlineId);
+
+    /**
+     * 获取酒店区域报告详情信息
+     *
+     * @param reportOutlineId 主键
+     * @return 酒店区域报告详情信息
+     * @author lixing
+     * @version V1.0 2021/5/31 6:24 下午
+     */
+    ResponseReportHotelAreaDetailItemVO getReportHotelAreaDetail(String reportOutlineId);
 }

+ 2 - 7
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/IBusinessReportBuilder.java

@@ -1,15 +1,10 @@
 package com.persagy.apm.energy.report.monthly.outline.service.builder;
 
-import com.persagy.apm.energy.report.monthly.config.function.model.Function;
 import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostItemVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.GroupInfo;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
-import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
 
-import java.util.Date;
 import java.util.List;
 
 /**

+ 0 - 5
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/IBusinessReportGenerator.java

@@ -1,12 +1,7 @@
 package com.persagy.apm.energy.report.monthly.outline.service.builder;
 
-import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 
-import java.util.List;
-
 /**
  * 生成商业报告建造者接口
  *

+ 43 - 11
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/builder/impl/BusinessReportBuilder.java

@@ -2,13 +2,17 @@ package com.persagy.apm.energy.report.monthly.outline.service.builder.impl;
 
 import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
 import com.persagy.apm.energy.report.monthly.detail.business.model.dto.AddReportBusinessDetailDTO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.detail.business.service.IReportBusinessDetailService;
+import com.persagy.apm.energy.report.monthly.detail.common.service.IReportDetailService;
 import com.persagy.apm.energy.report.monthly.outline.constants.BusinessReportParagraphs;
 import com.persagy.apm.energy.report.monthly.outline.constants.enums.ReportStateEnum;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
-import com.persagy.apm.energy.report.monthly.outline.service.*;
+import com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportCostInfoService;
+import com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportPlatformInfoService;
+import com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportPowerInfoService;
+import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
 import com.persagy.apm.energy.report.monthly.outline.service.builder.IBusinessReportBuilder;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +34,8 @@ public class BusinessReportBuilder implements IBusinessReportBuilder {
     @Autowired
     private IReportBusinessDetailService businessDetailService;
     @Autowired
+    private IReportDetailService reportDetailService;
+    @Autowired
     private IBusinessReportPowerInfoService businessReportPowerInfoService;
     @Autowired
     private IBusinessReportCostInfoService businessReportCostInfoService;
@@ -72,38 +78,64 @@ public class BusinessReportBuilder implements IBusinessReportBuilder {
         businessDetailService.deleteReportBusinessDetail(detailId);
     }
 
+    /**
+     * 获取段落包含的分组列表
+     *
+     * @param reportTypeId 报告类型id
+     * @param paragraph 段落
+     * @return 段落包含的分组列表
+     * @author lixing
+     * @version V1.0 2021/6/7 11:17 上午
+     */
+    private List<String> getGroupsByParagraph(String reportTypeId, String paragraph) {
+        return reportDetailService.getGroupsByParagraph(reportTypeId, paragraph);
+    }
+
+    /**
+     * 获取段落包含的功能点列表
+     *
+     * @param reportTypeId 报告类型id
+     * @param paragraph 段落
+     * @return 段落包含的功能点列表
+     * @author lixing
+     * @version V1.0 2021/6/7 11:17 上午
+     */
+    private List<String> getFunctionsByParagraph(String reportTypeId, String paragraph) {
+        return reportDetailService.getFunctionsByParagraph(reportTypeId, paragraph);
+    }
+
     @Override
     public PowerVO getOpenPowerInfo(ReportOutline reportOutline) {
-        List<String> powerGroupIdList = businessDetailService.getGroupsByParagraph(
+        List<String> powerGroupIdList = getGroupsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_POWER);
-        List<String> powerFunctionIdList = businessDetailService.getFunctionsByParagraph(
+        List<String> powerFunctionIdList = getFunctionsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_POWER);
         return businessReportPowerInfoService.getPowerInfo(reportOutline, powerGroupIdList, powerFunctionIdList);
     }
 
     @Override
     public PowerVO getComparePowerInfo(ReportOutline reportOutline) {
-        List<String> powerGroupIdList = businessDetailService.getGroupsByParagraph(
+        List<String> powerGroupIdList = getGroupsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_POWER);
-        List<String> powerFunctionIdList = businessDetailService.getFunctionsByParagraph(
+        List<String> powerFunctionIdList = getFunctionsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_POWER);
         return businessReportPowerInfoService.getComparePowerInfo(reportOutline, powerGroupIdList, powerFunctionIdList);
     }
 
     @Override
     public CostVO getOpenCostInfo(ReportOutline reportOutline) {
-        List<String> costGroupIdList = businessDetailService.getGroupsByParagraph(
+        List<String> costGroupIdList = getGroupsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_COST);
-        List<String> costFunctionIdList = businessDetailService.getFunctionsByParagraph(
+        List<String> costFunctionIdList = getFunctionsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_COST);
         return businessReportCostInfoService.getOpenCost(reportOutline, costGroupIdList, costFunctionIdList);
     }
 
     @Override
     public CostVO getCompareCostInfo(ReportOutline reportOutline) {
-        List<String> costGroupIdList = businessDetailService.getGroupsByParagraph(
+        List<String> costGroupIdList = getGroupsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_COST);
-        List<String> costFunctionIdList = businessDetailService.getFunctionsByParagraph(
+        List<String> costFunctionIdList = getFunctionsByParagraph(
                 reportOutline.getReportTypeId(), BusinessReportParagraphs.OPEN_COST);
         return businessReportCostInfoService.getCompareCost(reportOutline, costGroupIdList, costFunctionIdList);
     }

+ 2 - 2
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessProjectReportBuilder.java

@@ -1,7 +1,7 @@
 package com.persagy.apm.energy.report.monthly.outline.service.impl;
 
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.monthly.outline.service.builder.impl.BusinessReportBuilder;
 import lombok.extern.slf4j.Slf4j;

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportCostInfoServiceImpl.java

@@ -6,9 +6,9 @@ import com.persagy.apm.energy.report.monthly.config.function.model.Function;
 import com.persagy.apm.energy.report.monthly.config.function.service.IFunctionService;
 import com.persagy.apm.energy.report.monthly.config.functiongroup.model.FunctionGroup;
 import com.persagy.apm.energy.report.monthly.config.functiongroup.service.IFunctionGroupService;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostItemVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.CostVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.GroupInfo;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostItemVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.CostVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.GroupInfo;
 import com.persagy.apm.energy.report.monthly.functionvalue.service.IFunctionValueService;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportCostInfoService;
@@ -50,7 +50,7 @@ public class BusinessReportCostInfoServiceImpl implements IBusinessReportCostInf
 
         Date reportMonth = reportOutline.getReportMonth();
 
-        List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
+        List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
 
         return getCostInfoByProjectIds(groupIdList, functionIdList, reportMonth, projectIds);
     }
@@ -60,7 +60,7 @@ public class BusinessReportCostInfoServiceImpl implements IBusinessReportCostInf
 
         Date reportMonth = reportOutline.getReportMonth();
 
-        List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
+        List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
 
         List<String> comparableProjects = saasWebService.getComparableProjects(projectIds, reportMonth);
 

+ 1 - 1
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportPlatformInfoServiceImpl.java

@@ -71,7 +71,7 @@ public class BusinessReportPlatformInfoServiceImpl implements IBusinessReportPla
         }
 
         // 获取报告关联的项目
-        List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
+        List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
 
         // 获取报告类型的所属类型
         ReportType reportType = reportTypeService.queryReportTypeDetail(reportTypeId);

+ 5 - 5
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/BusinessReportPowerInfoServiceImpl.java

@@ -9,9 +9,9 @@ import com.persagy.apm.energy.report.monthly.config.function.model.Function;
 import com.persagy.apm.energy.report.monthly.config.function.service.IFunctionService;
 import com.persagy.apm.energy.report.monthly.config.functiongroup.model.FunctionGroup;
 import com.persagy.apm.energy.report.monthly.config.functiongroup.service.IFunctionGroupService;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.GroupInfo;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerItemVO;
-import com.persagy.apm.energy.report.monthly.detail.business.model.vo.PowerVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.GroupInfo;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerItemVO;
+import com.persagy.apm.energy.report.monthly.detail.common.model.vo.PowerVO;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.monthly.outline.service.IBusinessReportPowerInfoService;
 import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
@@ -48,7 +48,7 @@ public class BusinessReportPowerInfoServiceImpl implements IBusinessReportPowerI
     public PowerVO getPowerInfo(ReportOutline reportOutline, List<String> groupIdList, List<String> functionIdList) {
         Date reportMonth = reportOutline.getReportMonth();
 
-        List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
+        List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
 
         return getPowerInfoByProjectIds(groupIdList, functionIdList, reportMonth, projectIds);
     }
@@ -57,7 +57,7 @@ public class BusinessReportPowerInfoServiceImpl implements IBusinessReportPowerI
     public PowerVO getComparePowerInfo(ReportOutline reportOutline, List<String> groupIdList, List<String> functionIdList) {
         Date reportMonth = reportOutline.getReportMonth();
 
-        List<String> projectIds = reportOutlineService.queryRelatedProjects(reportOutline);
+        List<String> projectIds = reportOutlineService.queryRelatedProjectIds(reportOutline);
 
         List<String> comparableProjects = saasWebService.getComparableProjects(projectIds, reportMonth);
 

+ 43 - 34
src/main/java/com/persagy/apm/energy/report/monthly/outline/service/impl/ReportOutlineServiceImpl.java

@@ -9,24 +9,23 @@ import com.persagy.apm.common.constant.enums.ValidEnum;
 import com.persagy.apm.common.context.poems.PoemsContext;
 import com.persagy.apm.common.model.dto.Sort;
 import com.persagy.apm.energy.report.common.utils.DateUtils;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ConvertReportDetailStatisticsItemRelTool;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ReportDetailStatisticsItemRel;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.QueryReportDetailStatisticsItemRelDTO;
-import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.ResponseReportDetailStatisticsItemRelListItemVO;
 import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.IReportDetailStatisticsItemRelService;
 import com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum;
 import com.persagy.apm.energy.report.monthly.config.type.model.ReportType;
 import com.persagy.apm.energy.report.monthly.config.type.service.IReportTypeService;
-import com.persagy.apm.energy.report.monthly.detail.business.model.ConvertReportBusinessDetailTool;
-import com.persagy.apm.energy.report.monthly.detail.business.model.ReportBusinessDetail;
 import com.persagy.apm.energy.report.monthly.detail.business.model.vo.ResponseReportBusinessDetailItemVO;
 import com.persagy.apm.energy.report.monthly.detail.business.service.IReportBusinessDetailService;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.model.vo.ResponseReportHotelAreaDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.area.service.IReportHotelAreaDetailService;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.model.vo.ResponseReportHotelProjectDetailItemVO;
+import com.persagy.apm.energy.report.monthly.detail.hotel.project.service.IReportHotelProjectDetailService;
 import com.persagy.apm.energy.report.monthly.outline.constants.enums.ReportStateEnum;
 import com.persagy.apm.energy.report.monthly.outline.dao.ReportOutlineMapper;
 import com.persagy.apm.energy.report.monthly.outline.model.ConvertReportOutlineTool;
 import com.persagy.apm.energy.report.monthly.outline.model.ReportOutline;
 import com.persagy.apm.energy.report.monthly.outline.model.dto.*;
 import com.persagy.apm.energy.report.monthly.outline.service.IReportOutlineService;
+import com.persagy.apm.energy.report.saasweb.model.ConvertSaasWebTool;
 import com.persagy.apm.energy.report.saasweb.model.vo.PoemsProjectVO;
 import com.persagy.apm.energy.report.saasweb.model.vo.ReportAreaVO;
 import com.persagy.apm.energy.report.saasweb.model.vo.ReportProjectVO;
@@ -40,7 +39,6 @@ import org.springframework.util.CollectionUtils;
 
 import java.time.LocalDate;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -63,6 +61,10 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
     IReportBusinessDetailService reportBusinessDetailService;
     @Autowired
     IReportDetailStatisticsItemRelService reportDetailStatisticsItemRelService;
+    @Autowired
+    IReportHotelAreaDetailService hotelAreaDetailService;
+    @Autowired
+    IReportHotelProjectDetailService hotelProjectDetailService;
 
 
     /**
@@ -145,34 +147,18 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
     }
 
     @Override
-    public ResponseReportBusinessDetailItemVO getReportDetailInfo(String reportOutlineId) {
-        ReportOutline reportOutline = queryReportOutlineDetail(reportOutlineId);
-
-        ReportBusinessDetail reportBusinessDetail = reportBusinessDetailService.getReportBusinessDetail(reportOutline.getDetailId());
-        ResponseReportBusinessDetailItemVO responseReportBusinessDetailItemVO = ConvertReportBusinessDetailTool.INSTANCE.convert2ResponseItemDTO(reportBusinessDetail);
-
-        ReportType reportType = reportTypeService.queryReportTypeDetail(reportOutline.getReportTypeId());
-        if (BelongTypeEnum.PROJECT.getType().equals(reportType.getBelongType())) {
-            ReportProjectVO reportProjectInfo = saasWebService.getReportProjectInfo(reportOutline.getBelong());
-            responseReportBusinessDetailItemVO.setProjectInfo(reportProjectInfo);
-        } else {
-            ReportAreaVO openReportAreaInfo = saasWebService.getReportAreaInfo(reportOutline.getBelong(), reportType.getBuildingType());
-            responseReportBusinessDetailItemVO.setOpenAreaInfo(openReportAreaInfo);
-
-            ReportAreaVO compareReportAreaInfo = saasWebService.getCompareReportAreaInfo(
-                    reportOutline.getBelong(), reportType.getBuildingType(), reportOutline.getReportMonth());
-            responseReportBusinessDetailItemVO.setCompareAreaInfo(compareReportAreaInfo);
-        }
+    public ResponseReportBusinessDetailItemVO getReportBusinessDetailInfo(String reportOutlineId) {
+        return reportBusinessDetailService.getResponseBusinessDetail(reportOutlineId);
+    }
 
+    @Override
+    public ResponseReportHotelProjectDetailItemVO getReportHotelProjectDetail(String reportOutlineId) {
+        return hotelProjectDetailService.getReportHotelProjectDetailByReportOutline(reportOutlineId);
+    }
 
-        // 查询统计条目补充信息
-        QueryReportDetailStatisticsItemRelDTO queryReportDetailStatisticsItemRelDTO = new QueryReportDetailStatisticsItemRelDTO();
-        queryReportDetailStatisticsItemRelDTO.setReportDetailId(reportOutline.getDetailId());
-        queryReportDetailStatisticsItemRelDTO.setReportTypeId(reportOutline.getReportTypeId());
-        List<ReportDetailStatisticsItemRel> reportDetailStatisticsItemRels = reportDetailStatisticsItemRelService.queryReportDetailStatisticsItemRelList(queryReportDetailStatisticsItemRelDTO);
-        List<ResponseReportDetailStatisticsItemRelListItemVO> responseReportDetailStatisticsItemRelListItemVOList = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convert2List(reportDetailStatisticsItemRels);
-        responseReportBusinessDetailItemVO.setStatisticItemsSupplements(responseReportDetailStatisticsItemRelListItemVOList);
-        return responseReportBusinessDetailItemVO;
+    @Override
+    public ResponseReportHotelAreaDetailItemVO getReportHotelAreaDetail(String reportOutlineId) {
+        return hotelAreaDetailService.getReportHotelAreaDetailByReportOutline(reportOutlineId);
     }
 
     @Override
@@ -339,7 +325,7 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
     }
 
     @Override
-    public List<String> queryRelatedProjects(ReportOutline reportOutline) {
+    public List<String> queryRelatedProjectIds(ReportOutline reportOutline) {
         String reportTypeId = reportOutline.getReportTypeId();
 
         ReportType reportType = reportTypeService.queryReportTypeDetail(reportTypeId);
@@ -361,6 +347,29 @@ public class ReportOutlineServiceImpl extends ServiceImpl<ReportOutlineMapper, R
     }
 
     @Override
+    public List<SimpleProjectVO> queryRelatedProjects(ReportOutline reportOutline) {
+        String reportTypeId = reportOutline.getReportTypeId();
+
+        ReportType reportType = reportTypeService.queryReportTypeDetail(reportTypeId);
+        String belongType = reportType.getBelongType();
+
+        List<SimpleProjectVO> projects = new ArrayList<>();
+        if (BelongTypeEnum.PROJECT.getType().equals(belongType)) {
+            projects.add(saasWebService.getSimpleProjectInfo(reportOutline.getBelong()));
+        } else {
+            String areaId = reportOutline.getBelong();
+            // 获取区域下的项目
+            List<PoemsProjectVO> projectsByArea = saasWebService.getProjectsByArea(areaId);
+            if (!CollectionUtils.isEmpty(projectsByArea)) {
+                projects.addAll(projectsByArea.stream().map(
+                        ConvertSaasWebTool.INSTANCE::convert2SimpleProjectVO
+                ).collect(Collectors.toList()));
+            }
+        }
+        return projects;
+    }
+
+    @Override
     public String recreateReportOutline(RecreateReportOutlineDTO recreateReportOutlineDTO) {
         String id = recreateReportOutlineDTO.getId();
         ReportOutline reportOutline = checkExists(id);

+ 2 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/BuildingInfoVO.java

@@ -21,4 +21,6 @@ public class BuildingInfoVO {
     private String commercialArea;
     @ApiModelProperty(value = "地下车库面积")
     private String undergroundGarageArea;
+    @ApiModelProperty(value = "建筑总面积")
+    private String totalArea;
 }

+ 2 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/PoemsProjectVO.java

@@ -25,4 +25,6 @@ public class PoemsProjectVO {
     private String functionTypeName;
     @ApiModelProperty(value = "项目开业时间")
     private String businessOpeningTime;
+    @ApiModelProperty(value = "气候区")
+    private String climateZone;
 }

+ 2 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/model/vo/ReportProjectVO.java

@@ -17,4 +17,6 @@ public class ReportProjectVO extends SimpleProjectVO{
     private String commercialArea;
     @ApiModelProperty(value = "地下车库面积")
     private String undergroundGarageArea;
+    @ApiModelProperty(value = "总建筑面积")
+    private String totalBuildingArea;
 }

+ 18 - 0
src/main/java/com/persagy/apm/energy/report/saasweb/service/ISaasWebService.java

@@ -87,6 +87,24 @@ public interface ISaasWebService {
     List<PoemsProjectVO> getProjectsByArea(String areaCode);
 
     /**
+     * 获取集团下所有的项目
+     *
+     * @return 项目列表
+     * @author lixing
+     * @version V1.0 2021/5/24 5:37 下午
+     */
+    List<PoemsProjectVO> getAllProjects();
+
+    /**
+     * 根据气候带和建筑类型获取项目
+     *
+     * @return 项目列表
+     * @author lixing
+     * @version V1.0 2021/5/24 5:37 下午
+     */
+    List<PoemsProjectVO> getProjectsByClimateAndBuildingType(String climateZoneCode, String buildingTypeCode);
+
+    /**
      * 根据业态获取用户可选的项目
      *
      * @param buildingType 项目业态

+ 32 - 1
src/main/java/com/persagy/apm/energy/report/saasweb/service/impl/SaasWebServiceImpl.java

@@ -87,23 +87,29 @@ public class SaasWebServiceImpl implements ISaasWebService {
         // 获取项目下的建筑信息
         PoemsFeignResponse<BuildingInfoVO> buildsResponse = saasWebClientWrapper.listBuildingsByProjectId(queryByProjectIdDTO);
         List<BuildingInfoVO> buildingInfoVOList = buildsResponse.getContent();
-        // 统计项目下建筑总的商业面积,地下停车场面积
+        // 统计项目下建筑总的商业面积,地下停车场面积, 总面积
         BigDecimal totalCommercialArea = new BigDecimal("0");
         BigDecimal totalUndergroundGarageArea = new BigDecimal("0");
+        BigDecimal totalBuildingArea = new BigDecimal("0");
         if (!CollectionUtils.isEmpty(buildingInfoVOList)) {
             for (BuildingInfoVO buildingInfoVO : buildingInfoVOList) {
                 String commercialArea = buildingInfoVO.getCommercialArea();
                 String undergroundGarageArea = buildingInfoVO.getUndergroundGarageArea();
+                String totalArea = buildingInfoVO.getTotalArea();
                 if (StringUtils.isNotBlank(commercialArea)) {
                     totalCommercialArea = totalCommercialArea.add(new BigDecimal(commercialArea));
                 }
                 if (StringUtils.isNotBlank(undergroundGarageArea)) {
                     totalUndergroundGarageArea = totalUndergroundGarageArea.add(new BigDecimal(undergroundGarageArea));
                 }
+                if (StringUtils.isNotBlank(totalArea)) {
+                    totalBuildingArea = totalBuildingArea.add(new BigDecimal(totalArea));
+                }
             }
         }
         reportProjectVO.setCommercialArea(totalCommercialArea.toString());
         reportProjectVO.setUndergroundGarageArea(totalUndergroundGarageArea.toString());
+        reportProjectVO.setTotalBuildingArea(totalBuildingArea.toString());
         return reportProjectVO;
     }
 
@@ -174,6 +180,31 @@ public class SaasWebServiceImpl implements ISaasWebService {
         return projectsResponse.getContent();
     }
 
+    @Override
+    public List<PoemsProjectVO> getAllProjects() {
+        // 获取管理分区下的项目
+        QueryProjectDTO queryProjectDTO = new QueryProjectDTO();
+        PoemsFeignResponse<PoemsProjectVO> projectsResponse = saasWebClientWrapper.queryProjects(queryProjectDTO);
+        return projectsResponse.getContent();
+    }
+
+    @Override
+    public List<PoemsProjectVO> getProjectsByClimateAndBuildingType(String climateZoneCode, String buildingTypeCode) {
+        List<PoemsProjectVO> allProjects = getAllProjects();
+        List<String> buildingTypeCodes = getRelatedBuildingTypes(buildingTypeCode);
+
+        if (CollectionUtils.isEmpty(buildingTypeCodes) || StringUtils.isBlank(climateZoneCode)) {
+            return Lists.newArrayList();
+        }
+        return allProjects.stream().
+                filter(
+                        poemsProjectVO -> StringUtils.isNotBlank(poemsProjectVO.getFunctionType()) &&
+                                buildingTypeCodes.contains(poemsProjectVO.getFunctionType()) &&
+                                climateZoneCode.equals(poemsProjectVO.getClimateZone())
+                ).collect(Collectors.toList());
+    }
+
+
     /**
      * 根据区域和业态过滤项目
      *

+ 25 - 0
src/main/resources/mapper/ReportHotelAreaDetailMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.persagy.apm.energy.report.monthly.detail.hotel.area.dao.ReportHotelAreaDetailMapper">
+    <resultMap id="ReportHotelAreaDetailMap"
+               type="com.persagy.apm.energy.report.monthly.detail.hotel.area.model.ReportHotelAreaDetail">
+        <result column="id" property="id"/>
+        <result column="platform_runtime_info" property="platformRuntimeInfo"/>
+        <result column="platform_runtime_description" property="platformRuntimeDescription"/>
+        <result column="cost_info" property="costInfo"/>
+        <result column="cost_description" property="costDescription"/>
+        <result column="power_usage_outline" property="powerUsageOutline"/>
+        <result column="power_usage_description" property="powerUsageDescription"/>
+        <result column="energy_work_order_info" property="energyWorkOrderInfo"/>
+        <result column="energy_work_order_description" property="energyWorkOrderDescription"/>
+        <result column="alarm_deal_info" property="alarmDealInfo"/>
+        <result column="remain_problems_deal_info" property="remainProblemsDealInfo"/>
+        <result column="ts" property="ts"/>
+        <result column="creator" property="creator"/>
+        <result column="creation_time" property="creationTime"/>
+        <result column="modifier" property="modifier"/>
+        <result column="modified_time" property="modifiedTime"/>
+        <result column="valid" property="valid"/>
+    </resultMap>
+</mapper>
+

+ 30 - 0
src/main/resources/mapper/ReportHotelProjectDetailMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.persagy.apm.energy.report.monthly.detail.hotel.project.dao.ReportHotelProjectDetailMapper">
+    <resultMap id="ReportHotelProjectDetailMap"
+               type="com.persagy.apm.energy.report.monthly.detail.hotel.project.model.ReportHotelProjectDetail">
+        <result column="id" property="id"/>
+        <result column="cost_info" property="costInfo"/>
+        <result column="cost_description" property="costDescription"/>
+        <result column="power_usage_outline" property="powerUsageOutline"/>
+        <result column="public_area_power_usage" property="publicAreaPowerUsage"/>
+        <result column="power_usage_description" property="powerUsageDescription"/>
+        <result column="air_conditioner_efficiency" property="airConditionerEfficiency"/>
+        <result column="air_conditioner_efficiency_explain" property="airConditionerEfficiencyExplain"/>
+        <result column="env_info" property="envInfo"/>
+        <result column="env_description" property="envDescription"/>
+        <result column="energy_work_order_info" property="energyWorkOrderInfo"/>
+        <result column="energy_work_order_description" property="energyWorkOrderDescription"/>
+        <result column="platform_runtime_info" property="platformRuntimeInfo"/>
+        <result column="platform_runtime_description" property="platformRuntimeDescription"/>
+        <result column="alarm_deal_info" property="alarmDealInfo"/>
+        <result column="alarm_deal_description" property="alarmDealDescription"/>
+        <result column="ts" property="ts"/>
+        <result column="creator" property="creator"/>
+        <result column="creation_time" property="creationTime"/>
+        <result column="modifier" property="modifier"/>
+        <result column="modified_time" property="modifiedTime"/>
+        <result column="valid" property="valid"/>
+    </resultMap>
+</mapper>
+