Browse Source

获取用户可选报告所属

lixing 4 years ago
parent
commit
49b7393125
100 changed files with 2879 additions and 2717 deletions
  1. 0 16
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/dao/ItemGroupMapper.java
  2. 0 74
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/ConvertItemGroupTool.java
  3. 0 34
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/ItemGroup.java
  4. 0 27
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/AddItemGroupDTO.java
  5. 0 29
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/PageQueryItemGroupDTO.java
  6. 0 22
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/QueryItemGroupDTO.java
  7. 0 31
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/UpdateItemGroupDTO.java
  8. 0 27
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/vo/ResponseItemGroupItemVO.java
  9. 0 77
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/service/IItemGroupService.java
  10. 0 199
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/service/impl/ItemGroupServiceImpl.java
  11. 0 16
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/dao/ReportDetailModelRelMapper.java
  12. 0 74
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/ConvertReportDetailModelRelTool.java
  13. 0 77
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/service/IReportDetailModelRelService.java
  14. 0 229
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/service/impl/ReportDetailModelRelServiceImpl.java
  15. 0 16
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/dao/ModelItemRelMapper.java
  16. 0 38
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/ModelItemRel.java
  17. 0 31
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/AddModelItemRelDTO.java
  18. 0 32
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/PageQueryModelItemRelDTO.java
  19. 0 25
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/QueryModelItemRelDTO.java
  20. 0 35
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/UpdateModelItemRelDTO.java
  21. 0 77
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/service/IModelItemRelService.java
  22. 0 209
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/service/impl/ModelItemRelServiceImpl.java
  23. 0 16
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/dao/ReportTypeModelRelMapper.java
  24. 0 74
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/ConvertReportTypeModelRelTool.java
  25. 0 50
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/ReportTypeModelRel.java
  26. 0 43
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/AddReportTypeModelRelDTO.java
  27. 0 41
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/PageQueryReportTypeModelRelDTO.java
  28. 0 34
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/QueryReportTypeModelRelDTO.java
  29. 0 47
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/UpdateReportTypeModelRelDTO.java
  30. 0 52
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/vo/ResponseReportTypeModelRelItemVO.java
  31. 0 52
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/vo/ResponseReportTypeModelRelListItemVO.java
  32. 0 77
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/service/IReportTypeModelRelService.java
  33. 0 240
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/service/impl/ReportTypeModelRelServiceImpl.java
  34. 0 16
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/dao/ReportTypeProjectTypeRelMapper.java
  35. 0 74
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/ConvertReportTypeProjectTypeRelTool.java
  36. 0 34
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/ReportTypeProjectTypeRel.java
  37. 0 27
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/AddReportTypeProjectTypeRelDTO.java
  38. 0 20
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/DeleteReportTypeProjectTypeRelDTO.java
  39. 0 22
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/QueryReportTypeProjectTypeRelDTO.java
  40. 0 20
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/QueryReportTypeProjectTypeRelDetailDTO.java
  41. 0 77
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/service/IReportTypeProjectTypeRelService.java
  42. 0 199
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/service/impl/ReportTypeProjectTypeRelServiceImpl.java
  43. 101 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/controller/FunctionController.java
  44. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/dao/FunctionMapper.java
  45. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/ConvertFunctionTool.java
  46. 50 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/Function.java
  47. 43 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/AddFunctionDTO.java
  48. 4 4
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/DeleteItemGroupDTO.java
  49. 41 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/PageQueryFunctionDTO.java
  50. 34 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/QueryFunctionDTO.java
  51. 4 4
      src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/QueryItemGroupDetailDTO.java
  52. 47 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/UpdateFunctionDTO.java
  53. 52 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/vo/ResponseFunctionItemVO.java
  54. 52 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/vo/ResponseFunctionListItemVO.java
  55. 77 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/IFunctionService.java
  56. 239 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/impl/FunctionServiceImpl.java
  57. 101 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/controller/FunctionGroupController.java
  58. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/dao/FunctionGroupMapper.java
  59. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/ConvertFunctionGroupTool.java
  60. 42 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/FunctionGroup.java
  61. 35 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/AddFunctionGroupDTO.java
  62. 4 4
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/DeleteModelItemRelDTO.java
  63. 35 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/PageQueryFunctionGroupDTO.java
  64. 28 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/QueryFunctionGroupDTO.java
  65. 4 4
      src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/QueryModelItemRelDetailDTO.java
  66. 39 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/UpdateFunctionGroupDTO.java
  67. 46 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/vo/ResponseFunctionGroupItemVO.java
  68. 46 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/vo/ResponseFunctionGroupListItemVO.java
  69. 77 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/IFunctionGroupService.java
  70. 219 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/impl/FunctionGroupServiceImpl.java
  71. 101 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/controller/ReportDetailStatisticsItemRelController.java
  72. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/dao/ReportDetailStatisticsItemRelMapper.java
  73. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/ConvertReportDetailStatisticsItemRelTool.java
  74. 10 10
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/ReportDetailModelRel.java
  75. 8 8
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/AddReportDetailModelRelDTO.java
  76. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/DeleteReportDetailStatisticsItemRelDTO.java
  77. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/PageQueryReportDetailModelRelDTO.java
  78. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/QueryReportDetailModelRelDTO.java
  79. 20 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/QueryReportDetailStatisticsItemRelDetailDTO.java
  80. 8 8
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/UpdateReportDetailModelRelDTO.java
  81. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/vo/ResponseReportDetailModelRelItemVO.java
  82. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/vo/ResponseReportDetailModelRelListItemVO.java
  83. 77 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/IReportDetailStatisticsItemRelService.java
  84. 229 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/impl/ReportDetailStatisticsItemRelServiceImpl.java
  85. 101 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/controller/ReportTypeStatisticsItemRelController.java
  86. 16 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/dao/ReportTypeStatisticsItemRelMapper.java
  87. 74 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/ConvertReportTypeStatisticsItemRelTool.java
  88. 34 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/ReportTypeStatisticsItemRel.java
  89. 27 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/AddReportTypeStatisticsItemRelDTO.java
  90. 4 4
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/DeleteReportTypeModelRelDTO.java
  91. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/PageQueryReportTypeProjectTypeRelDTO.java
  92. 22 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/QueryReportTypeStatisticsItemRelDTO.java
  93. 4 4
      src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/QueryReportTypeModelRelDetailDTO.java
  94. 8 8
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/UpdateReportTypeProjectTypeRelDTO.java
  95. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/vo/ResponseReportTypeProjectTypeRelItemVO.java
  96. 7 7
      src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/vo/ResponseReportTypeProjectTypeRelListItemVO.java
  97. 77 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/IReportTypeStatisticsItemRelService.java
  98. 199 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/impl/ReportTypeStatisticsItemRelServiceImpl.java
  99. 101 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/controller/StatisticItemsController.java
  100. 0 0
      src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/dao/StatisticItemsMapper.java

+ 0 - 16
src/main/java/com/persagy/apm/energy/report/config/itemgroup/dao/ItemGroupMapper.java

@@ -1,16 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.dao;
-
-import com.persagy.apm.energy.report.config.itemgroup.model.ItemGroup;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 分项分组(ItemGroup)dao层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:17:46
- */
-@Mapper
-public interface ItemGroupMapper extends BaseMapper<ItemGroup> {
-
-}

+ 0 - 74
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/ConvertItemGroupTool.java

@@ -1,74 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.model;
-
-import org.mapstruct.*;
-import org.mapstruct.MappingTarget;
-import org.mapstruct.factory.Mappers;
-import com.persagy.apm.energy.report.config.itemgroup.model.vo.*;
-import com.persagy.apm.energy.report.config.itemgroup.model.dto.*;
-
-import java.util.List;
-
-/**
- * 分项分组(ItemGroup) dto、vo、do转换工具类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:17:49 2021-05-19 11:17:49
- */
-@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
-        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
-public interface ConvertItemGroupTool {
-
-    ConvertItemGroupTool INSTANCE = Mappers.getMapper(ConvertItemGroupTool.class);
-
-    /**
-     * do转换为ResponseItemVO
-     *
-     * @param itemGroup do对象
-     * @return ResponseItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:49
-     */
-    ResponseItemGroupItemVO convert2ResponseItemDTO(ItemGroup itemGroup);
-
-    /**
-     * do转换为ResponseListItemVO
-     *
-     * @param itemGroup do对象
-     * @return ResponseListItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:49
-     */
-    ResponseItemGroupListItemVO convert2ResponseListItemDTO(ItemGroup itemGroup);
-
-    /**
-     * do列表转换为ResponseListItemVO列表
-     *
-     * @param itemGroupList do列表
-     * @return ResponseListItemVO列表
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:49
-     */
-    List<ResponseItemGroupListItemVO> convert2List(List<ItemGroup> itemGroupList);
-
-    /**
-     * addDTO转换为do
-     *
-     * @param addItemGroupDTO addDTO
-     * @return 要创建的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:49
-     */
-    ItemGroup convertAddDto2Entity(AddItemGroupDTO addItemGroupDTO);
-
-    /**
-     * updateDTO转换为实体
-     *
-     * @param itemGroup          更新前的do对象
-     * @param updateItemGroupDTO updateDTO
-     * @return 更新后的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:49
-     */
-    ItemGroup convertUpdateDto2Entity(@MappingTarget ItemGroup itemGroup, UpdateItemGroupDTO updateItemGroupDTO);
-}
-

+ 0 - 34
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/ItemGroup.java

@@ -1,34 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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;
-
-/**
- * 分项分组(ItemGroup)实体类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:17:47
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(description = "分项分组")
-public class ItemGroup extends AuditableEntity<ItemGroup> implements Serializable {
-    private static final long serialVersionUID = -43918210159682367L;
-
-    @ApiModelProperty("分项分组名称")
-    private String name;
-
-    @ApiModelProperty("包含的分项编码")
-    private String items;
-
-
-    public static String PROP_NAME = "name";
-    public static String PROP_ITEMS = "items";
-
-}

+ 0 - 27
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/AddItemGroupDTO.java

@@ -1,27 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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-05-19 11:17:47
- */
-@Data
-@ApiModel(value = "创建分项分组入参")
-public class AddItemGroupDTO {
-    @ApiModelProperty(value = "分项分组名称", required = true)
-    @NotNull(message = "分项分组名称不能为空") // todo 更新校验规则
-    private String name;
-
-    @ApiModelProperty(value = "包含的分项编码", required = true)
-    @NotNull(message = "包含的分项编码不能为空") // todo 更新校验规则
-    private String items;
-
-}

+ 0 - 29
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/PageQueryItemGroupDTO.java

@@ -1,29 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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-05-19 11:17:48
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(value = "分页查询分项分组入参")
-public class PageQueryItemGroupDTO extends PageDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    private String id;
-
-    @ApiModelProperty(value = "分项分组名称", required = true)
-    private String name;
-
-    @ApiModelProperty(value = "包含的分项编码", required = true)
-    private String items;
-
-}

+ 0 - 22
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/QueryItemGroupDTO.java

@@ -1,22 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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-05-19 11:17:48
- */
-@Data
-@ApiModel(value = "查询分项分组入参")
-public class QueryItemGroupDTO {
-    @ApiModelProperty(value = "分项分组名称", required = true)
-    private String name;
-
-    @ApiModelProperty(value = "包含的分项编码", required = true)
-    private String items;
-
-}

+ 0 - 31
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/UpdateItemGroupDTO.java

@@ -1,31 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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-05-19 11:17:48
- */
-@Data
-@ApiModel(value = "更新分项分组入参")
-public class UpdateItemGroupDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
-    private String id;
-
-    @ApiModelProperty(value = "分项分组名称", required = true)
-    @NotNull(message = "分项分组名称不能为空") // todo 更新校验规则
-    private String name;
-
-    @ApiModelProperty(value = "包含的分项编码", required = true)
-    @NotNull(message = "包含的分项编码不能为空") // todo 更新校验规则
-    private String items;
-
-}

+ 0 - 27
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/vo/ResponseItemGroupItemVO.java

@@ -1,27 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.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-05-19 11:17:49
- */
-@Data
-@ApiModel(value = "分项分组返回结果参数")
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseItemGroupItemVO {
-    @ApiModelProperty("主键")
-    private String id;
-
-    @ApiModelProperty("分项分组名称")
-    private String name;
-
-    @ApiModelProperty("包含的分项编码")
-    private String items;
-}

+ 0 - 77
src/main/java/com/persagy/apm/energy/report/config/itemgroup/service/IItemGroupService.java

@@ -1,77 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.service;
-
-import com.persagy.apm.energy.report.config.itemgroup.model.*;
-import com.persagy.apm.energy.report.config.itemgroup.model.dto.*;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 分项分组(ItemGroup) service接口
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:17:45
- */
-public interface IItemGroupService {
-
-    /**
-     * 创建分项分组
-     *
-     * @param addItemGroupDTO addDTO
-     * @return 分项分组主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    String createItemGroup(AddItemGroupDTO addItemGroupDTO);
-
-    /**
-     * 分项分组详情
-     *
-     * @param id 主键
-     * @return 分项分组do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    ItemGroup queryItemGroupDetail(String id);
-
-    /**
-     * 更新分项分组
-     *
-     * @param updateItemGroupDTO updateDTO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    void updateItemGroup(UpdateItemGroupDTO updateItemGroupDTO);
-
-    /**
-     * 删除分项分组
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    void deleteItemGroup(String id);
-
-    /**
-     * 查询分项分组
-     *
-     * @param queryItemGroupDTO queryDTO
-     * @return List<ItemGroup>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    List<ItemGroup> queryItemGroupList(QueryItemGroupDTO queryItemGroupDTO);
-
-    /**
-     * 分页查询分项分组
-     *
-     * @param pageQueryItemGroupDTO pageQueryDTO
-     * @return IPage<ItemGroup>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:45
-     */
-    IPage<ItemGroup> pageQueryItemGroup(PageQueryItemGroupDTO pageQueryItemGroupDTO);
-}

+ 0 - 199
src/main/java/com/persagy/apm/energy/report/config/itemgroup/service/impl/ItemGroupServiceImpl.java

@@ -1,199 +0,0 @@
-package com.persagy.apm.energy.report.config.itemgroup.service.impl;
-
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.energy.report.config.itemgroup.dao.ItemGroupMapper;
-import com.persagy.apm.energy.report.config.itemgroup.service.IItemGroupService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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.config.itemgroup.model.*;
-import com.persagy.apm.energy.report.config.itemgroup.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;
-
-/**
- * 分项分组(ItemGroup) service层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:17:46
- */
-@Service
-public class ItemGroupServiceImpl extends ServiceImpl<ItemGroupMapper, ItemGroup>
-        implements IItemGroupService {
-
-    /**
-     * 创建分项分组
-     *
-     * @return 分项分组主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public String createItemGroup(AddItemGroupDTO addItemGroupDTO) {
-        ItemGroup itemGroup = ConvertItemGroupTool.INSTANCE.convertAddDto2Entity(addItemGroupDTO);
-        // 设置默认值
-        setDefaultValue(itemGroup);
-        save(itemGroup);
-        return itemGroup.getId();
-    }
-
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param itemGroup 分项分组实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(ItemGroup itemGroup) {
-        itemGroup.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
-
-    }
-
-    /**
-     * 分项分组详情
-     *
-     * @param id 主键
-     * @return 部门do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public ItemGroup queryItemGroupDetail(String id) {
-        ItemGroup itemGroup = getById(id);
-        if (itemGroup == null) {
-            throw new IllegalArgumentException("查看ItemGroup详情时发生异常,找不到要查看的记录,id=" + id);
-        }
-        return itemGroup;
-    }
-
-    /**
-     * 更新分项分组
-     *
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public void updateItemGroup(UpdateItemGroupDTO updateItemGroupDTO) {
-        ItemGroup itemGroup = getById(updateItemGroupDTO.getId());
-        itemGroup = ConvertItemGroupTool.INSTANCE.convertUpdateDto2Entity(itemGroup, updateItemGroupDTO);
-        itemGroup.setModifier(PoemsContext.getContext().getUserId());
-        updateById(itemGroup);
-    }
-
-    /**
-     * 校验分项分组是否可删除
-     *
-     * @param id 分项分组主键
-     * @return 分项分组do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    public ItemGroup checkDeletable(String id) {
-        if (id == null) {
-            throw new IllegalArgumentException("删除ItemGroup时发生异常,主键为空");
-        }
-
-        ItemGroup itemGroup = getById(id);
-
-        if (itemGroup == null) {
-            throw new IllegalArgumentException("删除ItemGroup时发生异常,找不到要删除的数据,id:" + id);
-        }
-
-        return itemGroup;
-    }
-
-    /**
-     * 删除分项分组
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public void deleteItemGroup(String id) {
-        // 校验是否可删除
-        ItemGroup itemGroup = checkDeletable(id);
-
-        itemGroup.setValid(ValidEnum.FALSE.getType());
-        updateById(itemGroup);
-    }
-
-    /**
-     * 查询分项分组
-     *
-     * @return List<ItemGroup>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public List<ItemGroup> queryItemGroupList(QueryItemGroupDTO queryItemGroupDTO) {
-        QueryWrapper<ItemGroup> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ItemGroup.PROP_VALID, ValidEnum.TRUE.getType());
-        // 默认按创建时间倒序排序
-        queryWrapper.orderBy(true, false, ItemGroup.PROP_CREATIONTIME);
-
-        if (queryItemGroupDTO != null) {
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryItemGroupDTO.getName())) {
-                queryWrapper.like(ItemGroup.PROP_NAME, queryItemGroupDTO.getName());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryItemGroupDTO.getItems())) {
-                queryWrapper.like(ItemGroup.PROP_ITEMS, queryItemGroupDTO.getItems());
-            }
-
-        }
-
-        return list(queryWrapper);
-    }
-
-    /**
-     * 分页查询分项分组
-     *
-     * @return IPage<ItemGroup>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:17:46
-     */
-    @Override
-    public IPage<ItemGroup> pageQueryItemGroup(PageQueryItemGroupDTO pageQueryItemGroupDTO) {
-        QueryWrapper<ItemGroup> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ItemGroup.PROP_VALID, ValidEnum.TRUE.getType());
-        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
-        IPage<ItemGroup> pageParam = new Page<>(pageQueryItemGroupDTO.getPage(), pageQueryItemGroupDTO.getSize(), true);
-        // 排序信息
-        if (CollectionUtils.isEmpty(pageQueryItemGroupDTO.getOrders())) {
-            // 默认按创建时间倒序排序
-            queryWrapper.orderBy(true, false, ItemGroup.PROP_CREATIONTIME);
-        } else {
-            List<Sort> orders = pageQueryItemGroupDTO.getOrders();
-            for (Sort sort : orders) {
-                // 将驼峰转换为下划线格式
-                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
-                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
-            }
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryItemGroupDTO.getName())) {
-            queryWrapper.like(ItemGroup.PROP_NAME, pageQueryItemGroupDTO.getName());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryItemGroupDTO.getItems())) {
-            queryWrapper.like(ItemGroup.PROP_ITEMS, pageQueryItemGroupDTO.getItems());
-        }
-
-        return getBaseMapper().selectPage(pageParam, queryWrapper);
-    }
-}

+ 0 - 16
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/dao/ReportDetailModelRelMapper.java

@@ -1,16 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.dao;
-
-import com.persagy.apm.energy.report.config.rel.detailmodel.model.ReportDetailModelRel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 报告模型关联关系(ReportDetailModelRel)dao层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:10
- */
-@Mapper
-public interface ReportDetailModelRelMapper extends BaseMapper<ReportDetailModelRel> {
-
-}

+ 0 - 74
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/ConvertReportDetailModelRelTool.java

@@ -1,74 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model;
-
-import org.mapstruct.*;
-import org.mapstruct.MappingTarget;
-import org.mapstruct.factory.Mappers;
-import com.persagy.apm.energy.report.config.rel.detailmodel.model.vo.*;
-import com.persagy.apm.energy.report.config.rel.detailmodel.model.dto.*;
-
-import java.util.List;
-
-/**
- * 报告模型关联关系(ReportDetailModelRel) dto、vo、do转换工具类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:11 2021-05-19 11:19:11
- */
-@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
-        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
-public interface ConvertReportDetailModelRelTool {
-
-    ConvertReportDetailModelRelTool INSTANCE = Mappers.getMapper(ConvertReportDetailModelRelTool.class);
-
-    /**
-     * do转换为ResponseItemVO
-     *
-     * @param reportDetailModelRel do对象
-     * @return ResponseItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:11
-     */
-    ResponseReportDetailModelRelItemVO convert2ResponseItemDTO(ReportDetailModelRel reportDetailModelRel);
-
-    /**
-     * do转换为ResponseListItemVO
-     *
-     * @param reportDetailModelRel do对象
-     * @return ResponseListItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:11
-     */
-    ResponseReportDetailModelRelListItemVO convert2ResponseListItemDTO(ReportDetailModelRel reportDetailModelRel);
-
-    /**
-     * do列表转换为ResponseListItemVO列表
-     *
-     * @param reportDetailModelRelList do列表
-     * @return ResponseListItemVO列表
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:11
-     */
-    List<ResponseReportDetailModelRelListItemVO> convert2List(List<ReportDetailModelRel> reportDetailModelRelList);
-
-    /**
-     * addDTO转换为do
-     *
-     * @param addReportDetailModelRelDTO addDTO
-     * @return 要创建的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:11
-     */
-    ReportDetailModelRel convertAddDto2Entity(AddReportDetailModelRelDTO addReportDetailModelRelDTO);
-
-    /**
-     * updateDTO转换为实体
-     *
-     * @param reportDetailModelRel          更新前的do对象
-     * @param updateReportDetailModelRelDTO updateDTO
-     * @return 更新后的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:11
-     */
-    ReportDetailModelRel convertUpdateDto2Entity(@MappingTarget ReportDetailModelRel reportDetailModelRel, UpdateReportDetailModelRelDTO updateReportDetailModelRelDTO);
-}
-

+ 0 - 77
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/service/IReportDetailModelRelService.java

@@ -1,77 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.service;
-
-import com.persagy.apm.energy.report.config.rel.detailmodel.model.*;
-import com.persagy.apm.energy.report.config.rel.detailmodel.model.dto.*;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 报告模型关联关系(ReportDetailModelRel) service接口
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:09
- */
-public interface IReportDetailModelRelService {
-
-    /**
-     * 创建报告模型关联关系
-     *
-     * @param addReportDetailModelRelDTO addDTO
-     * @return 报告模型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    String createReportDetailModelRel(AddReportDetailModelRelDTO addReportDetailModelRelDTO);
-
-    /**
-     * 报告模型关联关系详情
-     *
-     * @param id 主键
-     * @return 报告模型关联关系do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    ReportDetailModelRel queryReportDetailModelRelDetail(String id);
-
-    /**
-     * 更新报告模型关联关系
-     *
-     * @param updateReportDetailModelRelDTO updateDTO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    void updateReportDetailModelRel(UpdateReportDetailModelRelDTO updateReportDetailModelRelDTO);
-
-    /**
-     * 删除报告模型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    void deleteReportDetailModelRel(String id);
-
-    /**
-     * 查询报告模型关联关系
-     *
-     * @param queryReportDetailModelRelDTO queryDTO
-     * @return List<ReportDetailModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    List<ReportDetailModelRel> queryReportDetailModelRelList(QueryReportDetailModelRelDTO queryReportDetailModelRelDTO);
-
-    /**
-     * 分页查询报告模型关联关系
-     *
-     * @param pageQueryReportDetailModelRelDTO pageQueryDTO
-     * @return IPage<ReportDetailModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    IPage<ReportDetailModelRel> pageQueryReportDetailModelRel(PageQueryReportDetailModelRelDTO pageQueryReportDetailModelRelDTO);
-}

+ 0 - 229
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/service/impl/ReportDetailModelRelServiceImpl.java

@@ -1,229 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.service.impl;
-
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.energy.report.config.rel.detailmodel.dao.ReportDetailModelRelMapper;
-import com.persagy.apm.energy.report.config.rel.detailmodel.service.IReportDetailModelRelService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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.config.rel.detailmodel.model.*;
-import com.persagy.apm.energy.report.config.rel.detailmodel.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;
-
-/**
- * 报告模型关联关系(ReportDetailModelRel) service层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:09
- */
-@Service
-public class ReportDetailModelRelServiceImpl extends ServiceImpl<ReportDetailModelRelMapper, ReportDetailModelRel>
-        implements IReportDetailModelRelService {
-
-    /**
-     * 创建报告模型关联关系
-     *
-     * @return 报告模型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public String createReportDetailModelRel(AddReportDetailModelRelDTO addReportDetailModelRelDTO) {
-        ReportDetailModelRel reportDetailModelRel = ConvertReportDetailModelRelTool.INSTANCE.convertAddDto2Entity(addReportDetailModelRelDTO);
-        // 设置默认值
-        setDefaultValue(reportDetailModelRel);
-        save(reportDetailModelRel);
-        return reportDetailModelRel.getId();
-    }
-
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param reportDetailModelRel 报告模型关联关系实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(ReportDetailModelRel reportDetailModelRel) {
-        reportDetailModelRel.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
-
-    }
-
-    /**
-     * 报告模型关联关系详情
-     *
-     * @param id 主键
-     * @return 部门do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public ReportDetailModelRel queryReportDetailModelRelDetail(String id) {
-        ReportDetailModelRel reportDetailModelRel = getById(id);
-        if (reportDetailModelRel == null) {
-            throw new IllegalArgumentException("查看ReportDetailModelRel详情时发生异常,找不到要查看的记录,id=" + id);
-        }
-        return reportDetailModelRel;
-    }
-
-    /**
-     * 更新报告模型关联关系
-     *
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public void updateReportDetailModelRel(UpdateReportDetailModelRelDTO updateReportDetailModelRelDTO) {
-        ReportDetailModelRel reportDetailModelRel = getById(updateReportDetailModelRelDTO.getId());
-        reportDetailModelRel = ConvertReportDetailModelRelTool.INSTANCE.convertUpdateDto2Entity(reportDetailModelRel, updateReportDetailModelRelDTO);
-        reportDetailModelRel.setModifier(PoemsContext.getContext().getUserId());
-        updateById(reportDetailModelRel);
-    }
-
-    /**
-     * 校验报告模型关联关系是否可删除
-     *
-     * @param id 报告模型关联关系主键
-     * @return 报告模型关联关系do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    public ReportDetailModelRel checkDeletable(String id) {
-        if (id == null) {
-            throw new IllegalArgumentException("删除ReportDetailModelRel时发生异常,主键为空");
-        }
-
-        ReportDetailModelRel reportDetailModelRel = getById(id);
-
-        if (reportDetailModelRel == null) {
-            throw new IllegalArgumentException("删除ReportDetailModelRel时发生异常,找不到要删除的数据,id:" + id);
-        }
-
-        return reportDetailModelRel;
-    }
-
-    /**
-     * 删除报告模型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public void deleteReportDetailModelRel(String id) {
-        // 校验是否可删除
-        ReportDetailModelRel reportDetailModelRel = checkDeletable(id);
-
-        reportDetailModelRel.setValid(ValidEnum.FALSE.getType());
-        updateById(reportDetailModelRel);
-    }
-
-    /**
-     * 查询报告模型关联关系
-     *
-     * @return List<ReportDetailModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public List<ReportDetailModelRel> queryReportDetailModelRelList(QueryReportDetailModelRelDTO queryReportDetailModelRelDTO) {
-        QueryWrapper<ReportDetailModelRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportDetailModelRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 默认按创建时间倒序排序
-        queryWrapper.orderBy(true, false, ReportDetailModelRel.PROP_CREATIONTIME);
-
-        if (queryReportDetailModelRelDTO != null) {
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportDetailModelRelDTO.getReportDetailId())) {
-                queryWrapper.like(ReportDetailModelRel.PROP_REPORT_DETAIL_ID, queryReportDetailModelRelDTO.getReportDetailId());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportDetailModelRelDTO.getModelCode())) {
-                queryWrapper.like(ReportDetailModelRel.PROP_MODEL_CODE, queryReportDetailModelRelDTO.getModelCode());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportDetailModelRelDTO.getReportTypeId())) {
-                queryWrapper.like(ReportDetailModelRel.PROP_REPORT_TYPE_ID, queryReportDetailModelRelDTO.getReportTypeId());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportDetailModelRelDTO.getUnqualifiedReason())) {
-                queryWrapper.like(ReportDetailModelRel.PROP_UNQUALIFIED_REASON, queryReportDetailModelRelDTO.getUnqualifiedReason());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportDetailModelRelDTO.getRemark())) {
-                queryWrapper.like(ReportDetailModelRel.PROP_REMARK, queryReportDetailModelRelDTO.getRemark());
-            }
-
-        }
-
-        return list(queryWrapper);
-    }
-
-    /**
-     * 分页查询报告模型关联关系
-     *
-     * @return IPage<ReportDetailModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:09
-     */
-    @Override
-    public IPage<ReportDetailModelRel> pageQueryReportDetailModelRel(PageQueryReportDetailModelRelDTO pageQueryReportDetailModelRelDTO) {
-        QueryWrapper<ReportDetailModelRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportDetailModelRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
-        IPage<ReportDetailModelRel> pageParam = new Page<>(pageQueryReportDetailModelRelDTO.getPage(), pageQueryReportDetailModelRelDTO.getSize(), true);
-        // 排序信息
-        if (CollectionUtils.isEmpty(pageQueryReportDetailModelRelDTO.getOrders())) {
-            // 默认按创建时间倒序排序
-            queryWrapper.orderBy(true, false, ReportDetailModelRel.PROP_CREATIONTIME);
-        } else {
-            List<Sort> orders = pageQueryReportDetailModelRelDTO.getOrders();
-            for (Sort sort : orders) {
-                // 将驼峰转换为下划线格式
-                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
-                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
-            }
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportDetailModelRelDTO.getReportDetailId())) {
-            queryWrapper.like(ReportDetailModelRel.PROP_REPORT_DETAIL_ID, pageQueryReportDetailModelRelDTO.getReportDetailId());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportDetailModelRelDTO.getModelCode())) {
-            queryWrapper.like(ReportDetailModelRel.PROP_MODEL_CODE, pageQueryReportDetailModelRelDTO.getModelCode());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportDetailModelRelDTO.getReportTypeId())) {
-            queryWrapper.like(ReportDetailModelRel.PROP_REPORT_TYPE_ID, pageQueryReportDetailModelRelDTO.getReportTypeId());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportDetailModelRelDTO.getUnqualifiedReason())) {
-            queryWrapper.like(ReportDetailModelRel.PROP_UNQUALIFIED_REASON, pageQueryReportDetailModelRelDTO.getUnqualifiedReason());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportDetailModelRelDTO.getRemark())) {
-            queryWrapper.like(ReportDetailModelRel.PROP_REMARK, pageQueryReportDetailModelRelDTO.getRemark());
-        }
-
-        return getBaseMapper().selectPage(pageParam, queryWrapper);
-    }
-}

+ 0 - 16
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/dao/ModelItemRelMapper.java

@@ -1,16 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.dao;
-
-import com.persagy.apm.energy.report.config.rel.modelitem.model.ModelItemRel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 能耗模型与分项关联关系(ModelItemRel)dao层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:16:52
- */
-@Mapper
-public interface ModelItemRelMapper extends BaseMapper<ModelItemRel> {
-
-}

+ 0 - 38
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/ModelItemRel.java

@@ -1,38 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.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;
-
-/**
- * 能耗模型与分项关联关系(ModelItemRel)实体类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:16:54
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(description = "能耗模型与分项关联关系")
-public class ModelItemRel extends AuditableEntity<ModelItemRel> implements Serializable {
-    private static final long serialVersionUID = -72765023965462621L;
-
-    @ApiModelProperty("能耗模型编码")
-    private String modelCode;
-
-    @ApiModelProperty("分项分组id")
-    private String itemGroupId;
-
-    @ApiModelProperty("分项编码")
-    private String itemCode;
-
-
-    public static String PROP_MODEL_CODE = "model_code";
-    public static String PROP_ITEM_GROUP_ID = "item_group_id";
-    public static String PROP_ITEM_CODE = "item_code";
-
-}

+ 0 - 31
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/AddModelItemRelDTO.java

@@ -1,31 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.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-05-19 11:16:55
- */
-@Data
-@ApiModel(value = "创建能耗模型与分项关联关系入参")
-public class AddModelItemRelDTO {
-    @ApiModelProperty(value = "能耗模型编码", required = true)
-    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
-    private String modelCode;
-
-    @ApiModelProperty(value = "分项分组id", required = true)
-    @NotNull(message = "分项分组id不能为空") // todo 更新校验规则
-    private String itemGroupId;
-
-    @ApiModelProperty(value = "分项编码", required = true)
-    @NotNull(message = "分项编码不能为空") // todo 更新校验规则
-    private String itemCode;
-
-}

+ 0 - 32
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/PageQueryModelItemRelDTO.java

@@ -1,32 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.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-05-19 11:17:00
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(value = "分页查询能耗模型与分项关联关系入参")
-public class PageQueryModelItemRelDTO extends PageDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    private String id;
-
-    @ApiModelProperty(value = "能耗模型编码", required = true)
-    private String modelCode;
-
-    @ApiModelProperty(value = "分项分组id", required = true)
-    private String itemGroupId;
-
-    @ApiModelProperty(value = "分项编码", required = true)
-    private String itemCode;
-
-}

+ 0 - 25
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/QueryModelItemRelDTO.java

@@ -1,25 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.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-05-19 11:16:59
- */
-@Data
-@ApiModel(value = "查询能耗模型与分项关联关系入参")
-public class QueryModelItemRelDTO {
-    @ApiModelProperty(value = "能耗模型编码", required = true)
-    private String modelCode;
-
-    @ApiModelProperty(value = "分项分组id", required = true)
-    private String itemGroupId;
-
-    @ApiModelProperty(value = "分项编码", required = true)
-    private String itemCode;
-
-}

+ 0 - 35
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/UpdateModelItemRelDTO.java

@@ -1,35 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.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-05-19 11:16:57
- */
-@Data
-@ApiModel(value = "更新能耗模型与分项关联关系入参")
-public class UpdateModelItemRelDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
-    private String id;
-
-    @ApiModelProperty(value = "能耗模型编码", required = true)
-    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
-    private String modelCode;
-
-    @ApiModelProperty(value = "分项分组id", required = true)
-    @NotNull(message = "分项分组id不能为空") // todo 更新校验规则
-    private String itemGroupId;
-
-    @ApiModelProperty(value = "分项编码", required = true)
-    @NotNull(message = "分项编码不能为空") // todo 更新校验规则
-    private String itemCode;
-
-}

+ 0 - 77
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/service/IModelItemRelService.java

@@ -1,77 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.service;
-
-import com.persagy.apm.energy.report.config.rel.modelitem.model.*;
-import com.persagy.apm.energy.report.config.rel.modelitem.model.dto.*;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 能耗模型与分项关联关系(ModelItemRel) service接口
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:16:45
- */
-public interface IModelItemRelService {
-
-    /**
-     * 创建能耗模型与分项关联关系
-     *
-     * @param addModelItemRelDTO addDTO
-     * @return 能耗模型与分项关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    String createModelItemRel(AddModelItemRelDTO addModelItemRelDTO);
-
-    /**
-     * 能耗模型与分项关联关系详情
-     *
-     * @param id 主键
-     * @return 能耗模型与分项关联关系do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    ModelItemRel queryModelItemRelDetail(String id);
-
-    /**
-     * 更新能耗模型与分项关联关系
-     *
-     * @param updateModelItemRelDTO updateDTO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    void updateModelItemRel(UpdateModelItemRelDTO updateModelItemRelDTO);
-
-    /**
-     * 删除能耗模型与分项关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    void deleteModelItemRel(String id);
-
-    /**
-     * 查询能耗模型与分项关联关系
-     *
-     * @param queryModelItemRelDTO queryDTO
-     * @return List<ModelItemRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    List<ModelItemRel> queryModelItemRelList(QueryModelItemRelDTO queryModelItemRelDTO);
-
-    /**
-     * 分页查询能耗模型与分项关联关系
-     *
-     * @param pageQueryModelItemRelDTO pageQueryDTO
-     * @return IPage<ModelItemRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:45
-     */
-    IPage<ModelItemRel> pageQueryModelItemRel(PageQueryModelItemRelDTO pageQueryModelItemRelDTO);
-}

+ 0 - 209
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/service/impl/ModelItemRelServiceImpl.java

@@ -1,209 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.service.impl;
-
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.energy.report.config.rel.modelitem.dao.ModelItemRelMapper;
-import com.persagy.apm.energy.report.config.rel.modelitem.service.IModelItemRelService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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.config.rel.modelitem.model.*;
-import com.persagy.apm.energy.report.config.rel.modelitem.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;
-
-/**
- * 能耗模型与分项关联关系(ModelItemRel) service层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:16:51
- */
-@Service
-public class ModelItemRelServiceImpl extends ServiceImpl<ModelItemRelMapper, ModelItemRel>
-        implements IModelItemRelService {
-
-    /**
-     * 创建能耗模型与分项关联关系
-     *
-     * @return 能耗模型与分项关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public String createModelItemRel(AddModelItemRelDTO addModelItemRelDTO) {
-        ModelItemRel modelItemRel = ConvertModelItemRelTool.INSTANCE.convertAddDto2Entity(addModelItemRelDTO);
-        // 设置默认值
-        setDefaultValue(modelItemRel);
-        save(modelItemRel);
-        return modelItemRel.getId();
-    }
-
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param modelItemRel 能耗模型与分项关联关系实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(ModelItemRel modelItemRel) {
-        modelItemRel.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
-
-    }
-
-    /**
-     * 能耗模型与分项关联关系详情
-     *
-     * @param id 主键
-     * @return 部门do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public ModelItemRel queryModelItemRelDetail(String id) {
-        ModelItemRel modelItemRel = getById(id);
-        if (modelItemRel == null) {
-            throw new IllegalArgumentException("查看ModelItemRel详情时发生异常,找不到要查看的记录,id=" + id);
-        }
-        return modelItemRel;
-    }
-
-    /**
-     * 更新能耗模型与分项关联关系
-     *
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public void updateModelItemRel(UpdateModelItemRelDTO updateModelItemRelDTO) {
-        ModelItemRel modelItemRel = getById(updateModelItemRelDTO.getId());
-        modelItemRel = ConvertModelItemRelTool.INSTANCE.convertUpdateDto2Entity(modelItemRel, updateModelItemRelDTO);
-        modelItemRel.setModifier(PoemsContext.getContext().getUserId());
-        updateById(modelItemRel);
-    }
-
-    /**
-     * 校验能耗模型与分项关联关系是否可删除
-     *
-     * @param id 能耗模型与分项关联关系主键
-     * @return 能耗模型与分项关联关系do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    public ModelItemRel checkDeletable(String id) {
-        if (id == null) {
-            throw new IllegalArgumentException("删除ModelItemRel时发生异常,主键为空");
-        }
-
-        ModelItemRel modelItemRel = getById(id);
-
-        if (modelItemRel == null) {
-            throw new IllegalArgumentException("删除ModelItemRel时发生异常,找不到要删除的数据,id:" + id);
-        }
-
-        return modelItemRel;
-    }
-
-    /**
-     * 删除能耗模型与分项关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public void deleteModelItemRel(String id) {
-        // 校验是否可删除
-        ModelItemRel modelItemRel = checkDeletable(id);
-
-        modelItemRel.setValid(ValidEnum.FALSE.getType());
-        updateById(modelItemRel);
-    }
-
-    /**
-     * 查询能耗模型与分项关联关系
-     *
-     * @return List<ModelItemRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public List<ModelItemRel> queryModelItemRelList(QueryModelItemRelDTO queryModelItemRelDTO) {
-        QueryWrapper<ModelItemRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ModelItemRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 默认按创建时间倒序排序
-        queryWrapper.orderBy(true, false, ModelItemRel.PROP_CREATIONTIME);
-
-        if (queryModelItemRelDTO != null) {
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryModelItemRelDTO.getModelCode())) {
-                queryWrapper.like(ModelItemRel.PROP_MODEL_CODE, queryModelItemRelDTO.getModelCode());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryModelItemRelDTO.getItemGroupId())) {
-                queryWrapper.like(ModelItemRel.PROP_ITEM_GROUP_ID, queryModelItemRelDTO.getItemGroupId());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryModelItemRelDTO.getItemCode())) {
-                queryWrapper.like(ModelItemRel.PROP_ITEM_CODE, queryModelItemRelDTO.getItemCode());
-            }
-
-        }
-
-        return list(queryWrapper);
-    }
-
-    /**
-     * 分页查询能耗模型与分项关联关系
-     *
-     * @return IPage<ModelItemRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:16:51
-     */
-    @Override
-    public IPage<ModelItemRel> pageQueryModelItemRel(PageQueryModelItemRelDTO pageQueryModelItemRelDTO) {
-        QueryWrapper<ModelItemRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ModelItemRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
-        IPage<ModelItemRel> pageParam = new Page<>(pageQueryModelItemRelDTO.getPage(), pageQueryModelItemRelDTO.getSize(), true);
-        // 排序信息
-        if (CollectionUtils.isEmpty(pageQueryModelItemRelDTO.getOrders())) {
-            // 默认按创建时间倒序排序
-            queryWrapper.orderBy(true, false, ModelItemRel.PROP_CREATIONTIME);
-        } else {
-            List<Sort> orders = pageQueryModelItemRelDTO.getOrders();
-            for (Sort sort : orders) {
-                // 将驼峰转换为下划线格式
-                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
-                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
-            }
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryModelItemRelDTO.getModelCode())) {
-            queryWrapper.like(ModelItemRel.PROP_MODEL_CODE, pageQueryModelItemRelDTO.getModelCode());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryModelItemRelDTO.getItemGroupId())) {
-            queryWrapper.like(ModelItemRel.PROP_ITEM_GROUP_ID, pageQueryModelItemRelDTO.getItemGroupId());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryModelItemRelDTO.getItemCode())) {
-            queryWrapper.like(ModelItemRel.PROP_ITEM_CODE, pageQueryModelItemRelDTO.getItemCode());
-        }
-
-        return getBaseMapper().selectPage(pageParam, queryWrapper);
-    }
-}

+ 0 - 16
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/dao/ReportTypeModelRelMapper.java

@@ -1,16 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.dao;
-
-import com.persagy.apm.energy.report.config.rel.typemodel.model.ReportTypeModelRel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 报告类型和模型关联关系(ReportTypeModelRel)dao层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:57
- */
-@Mapper
-public interface ReportTypeModelRelMapper extends BaseMapper<ReportTypeModelRel> {
-
-}

+ 0 - 74
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/ConvertReportTypeModelRelTool.java

@@ -1,74 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.model;
-
-import org.mapstruct.*;
-import org.mapstruct.MappingTarget;
-import org.mapstruct.factory.Mappers;
-import com.persagy.apm.energy.report.config.rel.typemodel.model.vo.*;
-import com.persagy.apm.energy.report.config.rel.typemodel.model.dto.*;
-
-import java.util.List;
-
-/**
- * 报告类型和模型关联关系(ReportTypeModelRel) dto、vo、do转换工具类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:58 2021-05-19 11:19:58
- */
-@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
-        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
-public interface ConvertReportTypeModelRelTool {
-
-    ConvertReportTypeModelRelTool INSTANCE = Mappers.getMapper(ConvertReportTypeModelRelTool.class);
-
-    /**
-     * do转换为ResponseItemVO
-     *
-     * @param reportTypeModelRel do对象
-     * @return ResponseItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:58
-     */
-    ResponseReportTypeModelRelItemVO convert2ResponseItemDTO(ReportTypeModelRel reportTypeModelRel);
-
-    /**
-     * do转换为ResponseListItemVO
-     *
-     * @param reportTypeModelRel do对象
-     * @return ResponseListItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:58
-     */
-    ResponseReportTypeModelRelListItemVO convert2ResponseListItemDTO(ReportTypeModelRel reportTypeModelRel);
-
-    /**
-     * do列表转换为ResponseListItemVO列表
-     *
-     * @param reportTypeModelRelList do列表
-     * @return ResponseListItemVO列表
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:58
-     */
-    List<ResponseReportTypeModelRelListItemVO> convert2List(List<ReportTypeModelRel> reportTypeModelRelList);
-
-    /**
-     * addDTO转换为do
-     *
-     * @param addReportTypeModelRelDTO addDTO
-     * @return 要创建的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:58
-     */
-    ReportTypeModelRel convertAddDto2Entity(AddReportTypeModelRelDTO addReportTypeModelRelDTO);
-
-    /**
-     * updateDTO转换为实体
-     *
-     * @param reportTypeModelRel          更新前的do对象
-     * @param updateReportTypeModelRelDTO updateDTO
-     * @return 更新后的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:58
-     */
-    ReportTypeModelRel convertUpdateDto2Entity(@MappingTarget ReportTypeModelRel reportTypeModelRel, UpdateReportTypeModelRelDTO updateReportTypeModelRelDTO);
-}
-

+ 0 - 50
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/ReportTypeModelRel.java

@@ -1,50 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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;
-
-/**
- * 报告类型和模型关联关系(ReportTypeModelRel)实体类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:57
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(description = "报告类型和模型关联关系")
-public class ReportTypeModelRel extends AuditableEntity<ReportTypeModelRel> implements Serializable {
-    private static final long serialVersionUID = -83806086985843326L;
-
-    @ApiModelProperty("报告类型id")
-    private String reportTypeId;
-
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
-    @ApiModelProperty("模型来源")
-    private String modelSource;
-
-    @ApiModelProperty("关联类型, 1: 费用,2:用电量")
-    private String relType;
-
-    @ApiModelProperty("模型合格的标准")
-    private String modelStandardValue;
-
-    @ApiModelProperty("模型合格的判断公式")
-    private String modelQualifyFormula;
-
-
-    public static String PROP_REPORT_TYPE_ID = "report_type_id";
-    public static String PROP_MODEL_CODE = "model_code";
-    public static String PROP_MODEL_SOURCE = "model_source";
-    public static String PROP_REL_TYPE = "rel_type";
-    public static String PROP_MODEL_STANDARD_VALUE = "model_standard_value";
-    public static String PROP_MODEL_QUALIFY_FORMULA = "model_qualify_formula";
-
-}

+ 0 - 43
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/AddReportTypeModelRelDTO.java

@@ -1,43 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@Data
-@ApiModel(value = "创建报告类型和模型关联关系入参")
-public class AddReportTypeModelRelDTO {
-    @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
-    private String reportTypeId;
-
-    @ApiModelProperty(value = "模型编码", required = true)
-    @NotNull(message = "模型编码不能为空") // todo 更新校验规则
-    private String modelCode;
-
-    @ApiModelProperty(value = "模型来源", required = true)
-    @NotNull(message = "模型来源不能为空") // todo 更新校验规则
-    private String modelSource;
-
-    @ApiModelProperty(value = "关联类型, 1: 费用,2:用电量", required = true)
-    @NotNull(message = "关联类型, 1: 费用,2:用电量不能为空") // todo 更新校验规则
-    private String relType;
-
-    @ApiModelProperty(value = "模型合格的标准", required = true)
-    @NotNull(message = "模型合格的标准不能为空") // todo 更新校验规则
-    private String modelStandardValue;
-
-    @ApiModelProperty(value = "模型合格的判断公式", required = true)
-    @NotNull(message = "模型合格的判断公式不能为空") // todo 更新校验规则
-    private String modelQualifyFormula;
-
-}

+ 0 - 41
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/PageQueryReportTypeModelRelDTO.java

@@ -1,41 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(value = "分页查询报告类型和模型关联关系入参")
-public class PageQueryReportTypeModelRelDTO extends PageDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    private String id;
-
-    @ApiModelProperty(value = "报告类型id", required = true)
-    private String reportTypeId;
-
-    @ApiModelProperty(value = "模型编码", required = true)
-    private String modelCode;
-
-    @ApiModelProperty(value = "模型来源", required = true)
-    private String modelSource;
-
-    @ApiModelProperty(value = "关联类型, 1: 费用,2:用电量", required = true)
-    private String relType;
-
-    @ApiModelProperty(value = "模型合格的标准", required = true)
-    private String modelStandardValue;
-
-    @ApiModelProperty(value = "模型合格的判断公式", required = true)
-    private String modelQualifyFormula;
-
-}

+ 0 - 34
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/QueryReportTypeModelRelDTO.java

@@ -1,34 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@Data
-@ApiModel(value = "查询报告类型和模型关联关系入参")
-public class QueryReportTypeModelRelDTO {
-    @ApiModelProperty(value = "报告类型id", required = true)
-    private String reportTypeId;
-
-    @ApiModelProperty(value = "模型编码", required = true)
-    private String modelCode;
-
-    @ApiModelProperty(value = "模型来源", required = true)
-    private String modelSource;
-
-    @ApiModelProperty(value = "关联类型, 1: 费用,2:用电量", required = true)
-    private String relType;
-
-    @ApiModelProperty(value = "模型合格的标准", required = true)
-    private String modelStandardValue;
-
-    @ApiModelProperty(value = "模型合格的判断公式", required = true)
-    private String modelQualifyFormula;
-
-}

+ 0 - 47
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/UpdateReportTypeModelRelDTO.java

@@ -1,47 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@Data
-@ApiModel(value = "更新报告类型和模型关联关系入参")
-public class UpdateReportTypeModelRelDTO {
-    @ApiModelProperty(value = "主键", required = true)
-    @NotNull(message = "主键不能为空") // todo 更新校验规则
-    private String id;
-
-    @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
-    private String reportTypeId;
-
-    @ApiModelProperty(value = "模型编码", required = true)
-    @NotNull(message = "模型编码不能为空") // todo 更新校验规则
-    private String modelCode;
-
-    @ApiModelProperty(value = "模型来源", required = true)
-    @NotNull(message = "模型来源不能为空") // todo 更新校验规则
-    private String modelSource;
-
-    @ApiModelProperty(value = "关联类型, 1: 费用,2:用电量", required = true)
-    @NotNull(message = "关联类型, 1: 费用,2:用电量不能为空") // todo 更新校验规则
-    private String relType;
-
-    @ApiModelProperty(value = "模型合格的标准", required = true)
-    @NotNull(message = "模型合格的标准不能为空") // todo 更新校验规则
-    private String modelStandardValue;
-
-    @ApiModelProperty(value = "模型合格的判断公式", required = true)
-    @NotNull(message = "模型合格的判断公式不能为空") // todo 更新校验规则
-    private String modelQualifyFormula;
-
-}

+ 0 - 52
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/vo/ResponseReportTypeModelRelItemVO.java

@@ -1,52 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@Data
-@ApiModel(value = "报告类型和模型关联关系返回结果参数")
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportTypeModelRelItemVO {
-    @ApiModelProperty("主键")
-    private String id;
-
-    @ApiModelProperty("报告类型id")
-    private String reportTypeId;
-
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
-    @ApiModelProperty("模型来源")
-    private String modelSource;
-
-    @ApiModelProperty("关联类型, 1: 费用,2:用电量")
-    private String relType;
-
-    @ApiModelProperty("模型合格的标准")
-    private String modelStandardValue;
-
-    @ApiModelProperty("模型合格的判断公式")
-    private String modelQualifyFormula;
-
-    @ApiModelProperty("创建人")
-    private String creator;
-
-    @ApiModelProperty("创建时间")
-    private Date creationTime;
-
-    @ApiModelProperty("最后修改人")
-    private String modifier;
-
-    @ApiModelProperty("最后修改时间")
-    private Date modifiedTime;
-
-}

+ 0 - 52
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/vo/ResponseReportTypeModelRelListItemVO.java

@@ -1,52 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.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-05-19 11:19:58
- */
-@Data
-@ApiModel(value = "报告类型和模型关联关系列表返回结果参数")
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportTypeModelRelListItemVO {
-    @ApiModelProperty("主键")
-    private String id;
-
-    @ApiModelProperty("报告类型id")
-    private String reportTypeId;
-
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
-    @ApiModelProperty("模型来源")
-    private String modelSource;
-
-    @ApiModelProperty("关联类型, 1: 费用,2:用电量")
-    private String relType;
-
-    @ApiModelProperty("模型合格的标准")
-    private String modelStandardValue;
-
-    @ApiModelProperty("模型合格的判断公式")
-    private String modelQualifyFormula;
-
-    @ApiModelProperty("创建人")
-    private String creator;
-
-    @ApiModelProperty("创建时间")
-    private Date creationTime;
-
-    @ApiModelProperty("最后修改人")
-    private String modifier;
-
-    @ApiModelProperty("最后修改时间")
-    private Date modifiedTime;
-
-}

+ 0 - 77
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/service/IReportTypeModelRelService.java

@@ -1,77 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.service;
-
-import com.persagy.apm.energy.report.config.rel.typemodel.model.*;
-import com.persagy.apm.energy.report.config.rel.typemodel.model.dto.*;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 报告类型和模型关联关系(ReportTypeModelRel) service接口
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:56
- */
-public interface IReportTypeModelRelService {
-
-    /**
-     * 创建报告类型和模型关联关系
-     *
-     * @param addReportTypeModelRelDTO addDTO
-     * @return 报告类型和模型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    String createReportTypeModelRel(AddReportTypeModelRelDTO addReportTypeModelRelDTO);
-
-    /**
-     * 报告类型和模型关联关系详情
-     *
-     * @param id 主键
-     * @return 报告类型和模型关联关系do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    ReportTypeModelRel queryReportTypeModelRelDetail(String id);
-
-    /**
-     * 更新报告类型和模型关联关系
-     *
-     * @param updateReportTypeModelRelDTO updateDTO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    void updateReportTypeModelRel(UpdateReportTypeModelRelDTO updateReportTypeModelRelDTO);
-
-    /**
-     * 删除报告类型和模型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    void deleteReportTypeModelRel(String id);
-
-    /**
-     * 查询报告类型和模型关联关系
-     *
-     * @param queryReportTypeModelRelDTO queryDTO
-     * @return List<ReportTypeModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    List<ReportTypeModelRel> queryReportTypeModelRelList(QueryReportTypeModelRelDTO queryReportTypeModelRelDTO);
-
-    /**
-     * 分页查询报告类型和模型关联关系
-     *
-     * @param pageQueryReportTypeModelRelDTO pageQueryDTO
-     * @return IPage<ReportTypeModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    IPage<ReportTypeModelRel> pageQueryReportTypeModelRel(PageQueryReportTypeModelRelDTO pageQueryReportTypeModelRelDTO);
-}

+ 0 - 240
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/service/impl/ReportTypeModelRelServiceImpl.java

@@ -1,240 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.service.impl;
-
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.energy.report.config.rel.typemodel.dao.ReportTypeModelRelMapper;
-import com.persagy.apm.energy.report.config.rel.typemodel.service.IReportTypeModelRelService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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.config.rel.typemodel.model.*;
-import com.persagy.apm.energy.report.config.rel.typemodel.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;
-
-/**
- * 报告类型和模型关联关系(ReportTypeModelRel) service层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:19:56
- */
-@Service
-public class ReportTypeModelRelServiceImpl extends ServiceImpl<ReportTypeModelRelMapper, ReportTypeModelRel>
-        implements IReportTypeModelRelService {
-
-    /**
-     * 创建报告类型和模型关联关系
-     *
-     * @return 报告类型和模型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public String createReportTypeModelRel(AddReportTypeModelRelDTO addReportTypeModelRelDTO) {
-        ReportTypeModelRel reportTypeModelRel = ConvertReportTypeModelRelTool.INSTANCE.convertAddDto2Entity(addReportTypeModelRelDTO);
-        // 设置默认值
-        setDefaultValue(reportTypeModelRel);
-        save(reportTypeModelRel);
-        return reportTypeModelRel.getId();
-    }
-
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param reportTypeModelRel 报告类型和模型关联关系实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(ReportTypeModelRel reportTypeModelRel) {
-        reportTypeModelRel.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
-
-    }
-
-    /**
-     * 报告类型和模型关联关系详情
-     *
-     * @param id 主键
-     * @return 部门do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public ReportTypeModelRel queryReportTypeModelRelDetail(String id) {
-        ReportTypeModelRel reportTypeModelRel = getById(id);
-        if (reportTypeModelRel == null) {
-            throw new IllegalArgumentException("查看ReportTypeModelRel详情时发生异常,找不到要查看的记录,id=" + id);
-        }
-        return reportTypeModelRel;
-    }
-
-    /**
-     * 更新报告类型和模型关联关系
-     *
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public void updateReportTypeModelRel(UpdateReportTypeModelRelDTO updateReportTypeModelRelDTO) {
-        ReportTypeModelRel reportTypeModelRel = getById(updateReportTypeModelRelDTO.getId());
-        reportTypeModelRel = ConvertReportTypeModelRelTool.INSTANCE.convertUpdateDto2Entity(reportTypeModelRel, updateReportTypeModelRelDTO);
-        reportTypeModelRel.setModifier(PoemsContext.getContext().getUserId());
-        updateById(reportTypeModelRel);
-    }
-
-    /**
-     * 校验报告类型和模型关联关系是否可删除
-     *
-     * @param id 报告类型和模型关联关系主键
-     * @return 报告类型和模型关联关系do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    public ReportTypeModelRel checkDeletable(String id) {
-        if (id == null) {
-            throw new IllegalArgumentException("删除ReportTypeModelRel时发生异常,主键为空");
-        }
-
-        ReportTypeModelRel reportTypeModelRel = getById(id);
-
-        if (reportTypeModelRel == null) {
-            throw new IllegalArgumentException("删除ReportTypeModelRel时发生异常,找不到要删除的数据,id:" + id);
-        }
-
-        return reportTypeModelRel;
-    }
-
-    /**
-     * 删除报告类型和模型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public void deleteReportTypeModelRel(String id) {
-        // 校验是否可删除
-        ReportTypeModelRel reportTypeModelRel = checkDeletable(id);
-
-        reportTypeModelRel.setValid(ValidEnum.FALSE.getType());
-        updateById(reportTypeModelRel);
-    }
-
-    /**
-     * 查询报告类型和模型关联关系
-     *
-     * @return List<ReportTypeModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public List<ReportTypeModelRel> queryReportTypeModelRelList(QueryReportTypeModelRelDTO queryReportTypeModelRelDTO) {
-        QueryWrapper<ReportTypeModelRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportTypeModelRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 默认按创建时间倒序排序
-        queryWrapper.orderBy(true, false, ReportTypeModelRel.PROP_CREATIONTIME);
-
-        if (queryReportTypeModelRelDTO != null) {
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getReportTypeId())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_REPORT_TYPE_ID, queryReportTypeModelRelDTO.getReportTypeId());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getModelCode())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_MODEL_CODE, queryReportTypeModelRelDTO.getModelCode());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getModelSource())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_MODEL_SOURCE, queryReportTypeModelRelDTO.getModelSource());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getRelType())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_REL_TYPE, queryReportTypeModelRelDTO.getRelType());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getModelStandardValue())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_MODEL_STANDARD_VALUE, queryReportTypeModelRelDTO.getModelStandardValue());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeModelRelDTO.getModelQualifyFormula())) {
-                queryWrapper.like(ReportTypeModelRel.PROP_MODEL_QUALIFY_FORMULA, queryReportTypeModelRelDTO.getModelQualifyFormula());
-            }
-
-        }
-
-        return list(queryWrapper);
-    }
-
-    /**
-     * 分页查询报告类型和模型关联关系
-     *
-     * @return IPage<ReportTypeModelRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:19:56
-     */
-    @Override
-    public IPage<ReportTypeModelRel> pageQueryReportTypeModelRel(PageQueryReportTypeModelRelDTO pageQueryReportTypeModelRelDTO) {
-        QueryWrapper<ReportTypeModelRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportTypeModelRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
-        IPage<ReportTypeModelRel> pageParam = new Page<>(pageQueryReportTypeModelRelDTO.getPage(), pageQueryReportTypeModelRelDTO.getSize(), true);
-        // 排序信息
-        if (CollectionUtils.isEmpty(pageQueryReportTypeModelRelDTO.getOrders())) {
-            // 默认按创建时间倒序排序
-            queryWrapper.orderBy(true, false, ReportTypeModelRel.PROP_CREATIONTIME);
-        } else {
-            List<Sort> orders = pageQueryReportTypeModelRelDTO.getOrders();
-            for (Sort sort : orders) {
-                // 将驼峰转换为下划线格式
-                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
-                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
-            }
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getReportTypeId())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_REPORT_TYPE_ID, pageQueryReportTypeModelRelDTO.getReportTypeId());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getModelCode())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_MODEL_CODE, pageQueryReportTypeModelRelDTO.getModelCode());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getModelSource())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_MODEL_SOURCE, pageQueryReportTypeModelRelDTO.getModelSource());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getRelType())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_REL_TYPE, pageQueryReportTypeModelRelDTO.getRelType());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getModelStandardValue())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_MODEL_STANDARD_VALUE, pageQueryReportTypeModelRelDTO.getModelStandardValue());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeModelRelDTO.getModelQualifyFormula())) {
-            queryWrapper.like(ReportTypeModelRel.PROP_MODEL_QUALIFY_FORMULA, pageQueryReportTypeModelRelDTO.getModelQualifyFormula());
-        }
-
-        return getBaseMapper().selectPage(pageParam, queryWrapper);
-    }
-}

+ 0 - 16
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/dao/ReportTypeProjectTypeRelMapper.java

@@ -1,16 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.dao;
-
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.model.ReportTypeProjectTypeRel;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 报告类型和项目所属功能类型关联关系(ReportTypeProjectTypeRel)dao层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:20:23
- */
-@Mapper
-public interface ReportTypeProjectTypeRelMapper extends BaseMapper<ReportTypeProjectTypeRel> {
-
-}

+ 0 - 74
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/ConvertReportTypeProjectTypeRelTool.java

@@ -1,74 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.model;
-
-import org.mapstruct.*;
-import org.mapstruct.MappingTarget;
-import org.mapstruct.factory.Mappers;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.model.vo.*;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.model.dto.*;
-
-import java.util.List;
-
-/**
- * 报告类型和项目所属功能类型关联关系(ReportTypeProjectTypeRel) dto、vo、do转换工具类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:20:24 2021-05-19 11:20:24
- */
-@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
-        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
-public interface ConvertReportTypeProjectTypeRelTool {
-
-    ConvertReportTypeProjectTypeRelTool INSTANCE = Mappers.getMapper(ConvertReportTypeProjectTypeRelTool.class);
-
-    /**
-     * do转换为ResponseItemVO
-     *
-     * @param reportTypeProjectTypeRel do对象
-     * @return ResponseItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:24
-     */
-    ResponseReportTypeProjectTypeRelItemVO convert2ResponseItemDTO(ReportTypeProjectTypeRel reportTypeProjectTypeRel);
-
-    /**
-     * do转换为ResponseListItemVO
-     *
-     * @param reportTypeProjectTypeRel do对象
-     * @return ResponseListItemVO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:24
-     */
-    ResponseReportTypeProjectTypeRelListItemVO convert2ResponseListItemDTO(ReportTypeProjectTypeRel reportTypeProjectTypeRel);
-
-    /**
-     * do列表转换为ResponseListItemVO列表
-     *
-     * @param reportTypeProjectTypeRelList do列表
-     * @return ResponseListItemVO列表
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:24
-     */
-    List<ResponseReportTypeProjectTypeRelListItemVO> convert2List(List<ReportTypeProjectTypeRel> reportTypeProjectTypeRelList);
-
-    /**
-     * addDTO转换为do
-     *
-     * @param addReportTypeProjectTypeRelDTO addDTO
-     * @return 要创建的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:24
-     */
-    ReportTypeProjectTypeRel convertAddDto2Entity(AddReportTypeProjectTypeRelDTO addReportTypeProjectTypeRelDTO);
-
-    /**
-     * updateDTO转换为实体
-     *
-     * @param reportTypeProjectTypeRel          更新前的do对象
-     * @param updateReportTypeProjectTypeRelDTO updateDTO
-     * @return 更新后的do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:24
-     */
-    ReportTypeProjectTypeRel convertUpdateDto2Entity(@MappingTarget ReportTypeProjectTypeRel reportTypeProjectTypeRel, UpdateReportTypeProjectTypeRelDTO updateReportTypeProjectTypeRelDTO);
-}
-

+ 0 - 34
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/ReportTypeProjectTypeRel.java

@@ -1,34 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.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;
-
-/**
- * 报告类型和项目所属功能类型关联关系(ReportTypeProjectTypeRel)实体类
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:20:23
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@ApiModel(description = "报告类型和项目所属功能类型关联关系")
-public class ReportTypeProjectTypeRel extends AuditableEntity<ReportTypeProjectTypeRel> implements Serializable {
-    private static final long serialVersionUID = -98816657597977651L;
-
-    @ApiModelProperty("报告类型id")
-    private String configId;
-
-    @ApiModelProperty("项目所属功能类型")
-    private String functionType;
-
-
-    public static String PROP_CONFIG_ID = "config_id";
-    public static String PROP_FUNCTION_TYPE = "function_type";
-
-}

+ 0 - 27
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/AddReportTypeProjectTypeRelDTO.java

@@ -1,27 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.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-05-19 11:20:24
- */
-@Data
-@ApiModel(value = "创建报告类型和项目所属功能类型关联关系入参")
-public class AddReportTypeProjectTypeRelDTO {
-    @ApiModelProperty(value = "报告类型id", required = true)
-    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
-    private String configId;
-
-    @ApiModelProperty(value = "项目所属功能类型", required = true)
-    @NotNull(message = "项目所属功能类型不能为空") // todo 更新校验规则
-    private String functionType;
-
-}

+ 0 - 20
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/DeleteReportTypeProjectTypeRelDTO.java

@@ -1,20 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.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-05-19 11:20:24
- */
-@Data
-@ApiModel(value = "删除报告类型和项目所属功能类型关联关系入参")
-public class DeleteReportTypeProjectTypeRelDTO {
-    @NotNull(message = "id不能为空")
-    @ApiModelProperty(value = "主键", required = true)
-    private String id;
-
-}

+ 0 - 22
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/QueryReportTypeProjectTypeRelDTO.java

@@ -1,22 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.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-05-19 11:20:24
- */
-@Data
-@ApiModel(value = "查询报告类型和项目所属功能类型关联关系入参")
-public class QueryReportTypeProjectTypeRelDTO {
-    @ApiModelProperty(value = "报告类型id", required = true)
-    private String configId;
-
-    @ApiModelProperty(value = "项目所属功能类型", required = true)
-    private String functionType;
-
-}

+ 0 - 20
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/QueryReportTypeProjectTypeRelDetailDTO.java

@@ -1,20 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.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-05-19 11:20:24
- */
-@Data
-@ApiModel(value = "获取报告类型和项目所属功能类型关联关系详情入参")
-public class QueryReportTypeProjectTypeRelDetailDTO {
-    @NotNull(message = "主键不能为空")
-    @ApiModelProperty(value = "主键", required = true)
-    private String id;
-
-}

+ 0 - 77
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/service/IReportTypeProjectTypeRelService.java

@@ -1,77 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.service;
-
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.model.*;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.model.dto.*;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 报告类型和项目所属功能类型关联关系(ReportTypeProjectTypeRel) service接口
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:20:22
- */
-public interface IReportTypeProjectTypeRelService {
-
-    /**
-     * 创建报告类型和项目所属功能类型关联关系
-     *
-     * @param addReportTypeProjectTypeRelDTO addDTO
-     * @return 报告类型和项目所属功能类型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    String createReportTypeProjectTypeRel(AddReportTypeProjectTypeRelDTO addReportTypeProjectTypeRelDTO);
-
-    /**
-     * 报告类型和项目所属功能类型关联关系详情
-     *
-     * @param id 主键
-     * @return 报告类型和项目所属功能类型关联关系do对象
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    ReportTypeProjectTypeRel queryReportTypeProjectTypeRelDetail(String id);
-
-    /**
-     * 更新报告类型和项目所属功能类型关联关系
-     *
-     * @param updateReportTypeProjectTypeRelDTO updateDTO
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    void updateReportTypeProjectTypeRel(UpdateReportTypeProjectTypeRelDTO updateReportTypeProjectTypeRelDTO);
-
-    /**
-     * 删除报告类型和项目所属功能类型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    void deleteReportTypeProjectTypeRel(String id);
-
-    /**
-     * 查询报告类型和项目所属功能类型关联关系
-     *
-     * @param queryReportTypeProjectTypeRelDTO queryDTO
-     * @return List<ReportTypeProjectTypeRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    List<ReportTypeProjectTypeRel> queryReportTypeProjectTypeRelList(QueryReportTypeProjectTypeRelDTO queryReportTypeProjectTypeRelDTO);
-
-    /**
-     * 分页查询报告类型和项目所属功能类型关联关系
-     *
-     * @param pageQueryReportTypeProjectTypeRelDTO pageQueryDTO
-     * @return IPage<ReportTypeProjectTypeRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:22
-     */
-    IPage<ReportTypeProjectTypeRel> pageQueryReportTypeProjectTypeRel(PageQueryReportTypeProjectTypeRelDTO pageQueryReportTypeProjectTypeRelDTO);
-}

+ 0 - 199
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/service/impl/ReportTypeProjectTypeRelServiceImpl.java

@@ -1,199 +0,0 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.service.impl;
-
-import com.persagy.apm.common.context.poems.PoemsContext;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.dao.ReportTypeProjectTypeRelMapper;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.service.IReportTypeProjectTypeRelService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-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.config.rel.typeprojecttype.model.*;
-import com.persagy.apm.energy.report.config.rel.typeprojecttype.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;
-
-/**
- * 报告类型和项目所属功能类型关联关系(ReportTypeProjectTypeRel) service层
- *
- * @author lixing
- * @version V1.0 2021-05-19 11:20:23
- */
-@Service
-public class ReportTypeProjectTypeRelServiceImpl extends ServiceImpl<ReportTypeProjectTypeRelMapper, ReportTypeProjectTypeRel>
-        implements IReportTypeProjectTypeRelService {
-
-    /**
-     * 创建报告类型和项目所属功能类型关联关系
-     *
-     * @return 报告类型和项目所属功能类型关联关系主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public String createReportTypeProjectTypeRel(AddReportTypeProjectTypeRelDTO addReportTypeProjectTypeRelDTO) {
-        ReportTypeProjectTypeRel reportTypeProjectTypeRel = ConvertReportTypeProjectTypeRelTool.INSTANCE.convertAddDto2Entity(addReportTypeProjectTypeRelDTO);
-        // 设置默认值
-        setDefaultValue(reportTypeProjectTypeRel);
-        save(reportTypeProjectTypeRel);
-        return reportTypeProjectTypeRel.getId();
-    }
-
-    /**
-     * 如果某些字段没有赋值,使用默认的值
-     *
-     * @param reportTypeProjectTypeRel 报告类型和项目所属功能类型关联关系实体
-     * @author lixing
-     * @version V1.0 2021/3/12 12:29 下午
-     */
-    private void setDefaultValue(ReportTypeProjectTypeRel reportTypeProjectTypeRel) {
-        reportTypeProjectTypeRel.setCreator(PoemsContext.getContext().getUserId());
-        // todo 其他默认的属性
-
-    }
-
-    /**
-     * 报告类型和项目所属功能类型关联关系详情
-     *
-     * @param id 主键
-     * @return 部门do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public ReportTypeProjectTypeRel queryReportTypeProjectTypeRelDetail(String id) {
-        ReportTypeProjectTypeRel reportTypeProjectTypeRel = getById(id);
-        if (reportTypeProjectTypeRel == null) {
-            throw new IllegalArgumentException("查看ReportTypeProjectTypeRel详情时发生异常,找不到要查看的记录,id=" + id);
-        }
-        return reportTypeProjectTypeRel;
-    }
-
-    /**
-     * 更新报告类型和项目所属功能类型关联关系
-     *
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public void updateReportTypeProjectTypeRel(UpdateReportTypeProjectTypeRelDTO updateReportTypeProjectTypeRelDTO) {
-        ReportTypeProjectTypeRel reportTypeProjectTypeRel = getById(updateReportTypeProjectTypeRelDTO.getId());
-        reportTypeProjectTypeRel = ConvertReportTypeProjectTypeRelTool.INSTANCE.convertUpdateDto2Entity(reportTypeProjectTypeRel, updateReportTypeProjectTypeRelDTO);
-        reportTypeProjectTypeRel.setModifier(PoemsContext.getContext().getUserId());
-        updateById(reportTypeProjectTypeRel);
-    }
-
-    /**
-     * 校验报告类型和项目所属功能类型关联关系是否可删除
-     *
-     * @param id 报告类型和项目所属功能类型关联关系主键
-     * @return 报告类型和项目所属功能类型关联关系do类
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    public ReportTypeProjectTypeRel checkDeletable(String id) {
-        if (id == null) {
-            throw new IllegalArgumentException("删除ReportTypeProjectTypeRel时发生异常,主键为空");
-        }
-
-        ReportTypeProjectTypeRel reportTypeProjectTypeRel = getById(id);
-
-        if (reportTypeProjectTypeRel == null) {
-            throw new IllegalArgumentException("删除ReportTypeProjectTypeRel时发生异常,找不到要删除的数据,id:" + id);
-        }
-
-        return reportTypeProjectTypeRel;
-    }
-
-    /**
-     * 删除报告类型和项目所属功能类型关联关系
-     *
-     * @param id 主键
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public void deleteReportTypeProjectTypeRel(String id) {
-        // 校验是否可删除
-        ReportTypeProjectTypeRel reportTypeProjectTypeRel = checkDeletable(id);
-
-        reportTypeProjectTypeRel.setValid(ValidEnum.FALSE.getType());
-        updateById(reportTypeProjectTypeRel);
-    }
-
-    /**
-     * 查询报告类型和项目所属功能类型关联关系
-     *
-     * @return List<ReportTypeProjectTypeRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public List<ReportTypeProjectTypeRel> queryReportTypeProjectTypeRelList(QueryReportTypeProjectTypeRelDTO queryReportTypeProjectTypeRelDTO) {
-        QueryWrapper<ReportTypeProjectTypeRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportTypeProjectTypeRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 默认按创建时间倒序排序
-        queryWrapper.orderBy(true, false, ReportTypeProjectTypeRel.PROP_CREATIONTIME);
-
-        if (queryReportTypeProjectTypeRelDTO != null) {
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeProjectTypeRelDTO.getConfigId())) {
-                queryWrapper.like(ReportTypeProjectTypeRel.PROP_CONFIG_ID, queryReportTypeProjectTypeRelDTO.getConfigId());
-            }
-
-            // todo 需判断使用like还是eq
-            if (StringUtils.isNotEmpty(queryReportTypeProjectTypeRelDTO.getFunctionType())) {
-                queryWrapper.like(ReportTypeProjectTypeRel.PROP_FUNCTION_TYPE, queryReportTypeProjectTypeRelDTO.getFunctionType());
-            }
-
-        }
-
-        return list(queryWrapper);
-    }
-
-    /**
-     * 分页查询报告类型和项目所属功能类型关联关系
-     *
-     * @return IPage<ReportTypeProjectTypeRel>
-     * @author lixing
-     * @version V1.0 2021-05-19 11:20:23
-     */
-    @Override
-    public IPage<ReportTypeProjectTypeRel> pageQueryReportTypeProjectTypeRel(PageQueryReportTypeProjectTypeRelDTO pageQueryReportTypeProjectTypeRelDTO) {
-        QueryWrapper<ReportTypeProjectTypeRel> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq(ReportTypeProjectTypeRel.PROP_VALID, ValidEnum.TRUE.getType());
-        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
-        IPage<ReportTypeProjectTypeRel> pageParam = new Page<>(pageQueryReportTypeProjectTypeRelDTO.getPage(), pageQueryReportTypeProjectTypeRelDTO.getSize(), true);
-        // 排序信息
-        if (CollectionUtils.isEmpty(pageQueryReportTypeProjectTypeRelDTO.getOrders())) {
-            // 默认按创建时间倒序排序
-            queryWrapper.orderBy(true, false, ReportTypeProjectTypeRel.PROP_CREATIONTIME);
-        } else {
-            List<Sort> orders = pageQueryReportTypeProjectTypeRelDTO.getOrders();
-            for (Sort sort : orders) {
-                // 将驼峰转换为下划线格式
-                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
-                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
-            }
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeProjectTypeRelDTO.getConfigId())) {
-            queryWrapper.like(ReportTypeProjectTypeRel.PROP_CONFIG_ID, pageQueryReportTypeProjectTypeRelDTO.getConfigId());
-        }
-
-        // todo 需判断使用like还是eq
-        if (StringUtils.isNotEmpty(pageQueryReportTypeProjectTypeRelDTO.getFunctionType())) {
-            queryWrapper.like(ReportTypeProjectTypeRel.PROP_FUNCTION_TYPE, pageQueryReportTypeProjectTypeRelDTO.getFunctionType());
-        }
-
-        return getBaseMapper().selectPage(pageParam, queryWrapper);
-    }
-}

+ 101 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/controller/FunctionController.java

@@ -0,0 +1,101 @@
+package com.persagy.apm.energy.report.monthly.config.function.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.config.function.model.ConvertFunctionTool;
+import com.persagy.apm.energy.report.monthly.config.function.model.Function;
+import com.persagy.apm.energy.report.monthly.config.function.model.dto.*;
+import com.persagy.apm.energy.report.monthly.config.function.model.vo.ResponseFunctionItemVO;
+import com.persagy.apm.energy.report.monthly.config.function.model.vo.ResponseFunctionListItemVO;
+import com.persagy.apm.energy.report.monthly.config.function.service.IFunctionService;
+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 springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 能耗报告信息点控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:33
+ */
+@ApiIgnore
+@Api(tags = "能耗报告信息点", hidden = true)
+@Validated
+@RestController
+@RequestMapping("functions")
+public class FunctionController {
+    @Autowired
+    private IFunctionService functionService;
+
+    @ApiOperation(value = "创建能耗报告信息点")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createFunction(
+            @Valid @RequestBody AddFunctionDTO addFunctionDTO) {
+        String id = functionService.createFunction(addFunctionDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "能耗报告信息点详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseFunctionItemVO> queryFunctionDetail(
+            @Valid @RequestBody QueryFunctionDetailDTO queryFunctionDetailDTO) {
+        Function function = functionService.queryFunctionDetail(queryFunctionDetailDTO.getId());
+        ResponseFunctionItemVO responseFunctionItemVO = ConvertFunctionTool.INSTANCE.convert2ResponseItemDTO(function);
+        return ResultHelper.single(responseFunctionItemVO);
+    }
+
+
+    @ApiOperation(value = "更新能耗报告信息点")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateFunction(
+            @Valid @RequestBody UpdateFunctionDTO updateFunctionDTO) {
+        functionService.updateFunction(updateFunctionDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateFunctionDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除能耗报告信息点")
+    @PostMapping("/delete")
+    public CommonResult deleteFunction(
+            @RequestBody @Valid DeleteFunctionDTO deleteFunctionDTO) {
+        functionService.deleteFunction(deleteFunctionDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "能耗报告信息点列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseFunctionListItemVO>> queryFunction(
+            @Valid @RequestBody QueryFunctionDTO queryFunctionDTO) {
+        List<Function> functionList = functionService.queryFunctionList(queryFunctionDTO);
+        List<ResponseFunctionListItemVO> resultList = ConvertFunctionTool.INSTANCE.convert2List(functionList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "能耗报告信息点列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseFunctionListItemVO>> queryFunction(
+    //        @Valid @RequestBody PageQueryFunctionDTO pageQueryFunctionDTO) {
+    //    IPage<Function> pagedList = functionService.pageQueryFunction(pageQueryFunctionDTO);
+    //    IPage<ResponseFunctionListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertFunctionTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,Function实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/dao/FunctionMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.config.function.dao;
+
+import com.persagy.apm.energy.report.monthly.config.function.model.Function;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 能耗报告信息点(Function)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:35
+ */
+@Mapper
+public interface FunctionMapper extends BaseMapper<Function> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/ConvertFunctionTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.config.function.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.config.function.model.vo.*;
+import com.persagy.apm.energy.report.monthly.config.function.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 能耗报告信息点(Function) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:36 2021-05-20 19:05:36
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertFunctionTool {
+
+    ConvertFunctionTool INSTANCE = Mappers.getMapper(ConvertFunctionTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param function do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:36
+     */
+    ResponseFunctionItemVO convert2ResponseItemDTO(Function function);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param function do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:36
+     */
+    ResponseFunctionListItemVO convert2ResponseListItemDTO(Function function);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param functionList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:36
+     */
+    List<ResponseFunctionListItemVO> convert2List(List<Function> functionList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addFunctionDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:36
+     */
+    Function convertAddDto2Entity(AddFunctionDTO addFunctionDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param function          更新前的do对象
+     * @param updateFunctionDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:36
+     */
+    Function convertUpdateDto2Entity(@MappingTarget Function function, UpdateFunctionDTO updateFunctionDTO);
+}
+

+ 50 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/Function.java

@@ -0,0 +1,50 @@
+package com.persagy.apm.energy.report.monthly.config.function.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;
+
+/**
+ * 能耗报告信息点(Function)实体类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:35
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "能耗报告信息点")
+public class Function extends AuditableEntity<Function> implements Serializable {
+    private static final long serialVersionUID = 108688063917803317L;
+
+    @ApiModelProperty("集团编码")
+    private String groupCode;
+
+    @ApiModelProperty("能耗类型")
+    private String energyType;
+
+    @ApiModelProperty("建筑类型(业态)")
+    private String buildingType;
+
+    @ApiModelProperty("信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)")
+    private String functionType;
+
+    @ApiModelProperty("能耗模型编码")
+    private String modelCode;
+
+    @ApiModelProperty("分项id")
+    private String itemId;
+
+
+    public static String PROP_GROUP_CODE = "group_code";
+    public static String PROP_ENERGY_TYPE = "energy_type";
+    public static String PROP_BUILDING_TYPE = "building_type";
+    public static String PROP_FUNCTION_TYPE = "function_type";
+    public static String PROP_MODEL_CODE = "model_code";
+    public static String PROP_ITEM_ID = "item_id";
+
+}

+ 43 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/AddFunctionDTO.java

@@ -0,0 +1,43 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:35
+ */
+@Data
+@ApiModel(value = "创建能耗报告信息点入参")
+public class AddFunctionDTO {
+    @ApiModelProperty(value = "集团编码", required = true)
+    @NotNull(message = "集团编码不能为空") // todo 更新校验规则
+    private String groupCode;
+
+    @ApiModelProperty(value = "能耗类型", required = true)
+    @NotNull(message = "能耗类型不能为空") // todo 更新校验规则
+    private String energyType;
+
+    @ApiModelProperty(value = "建筑类型(业态)", required = true)
+    @NotNull(message = "建筑类型(业态)不能为空") // todo 更新校验规则
+    private String buildingType;
+
+    @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
+    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空") // todo 更新校验规则
+    private String functionType;
+
+    @ApiModelProperty(value = "能耗模型编码", required = true)
+    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
+    private String modelCode;
+
+    @ApiModelProperty(value = "分项id", required = true)
+    @NotNull(message = "分项id不能为空") // todo 更新校验规则
+    private String itemId;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/DeleteItemGroupDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.itemgroup.model.dto;
+package com.persagy.apm.energy.report.monthly.config.function.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:17:48
+ * @version V1.0 2021-05-20 19:05:36
  */
 @Data
-@ApiModel(value = "删除分项分组入参")
-public class DeleteItemGroupDTO {
+@ApiModel(value = "删除能耗报告信息点入参")
+public class DeleteFunctionDTO {
     @NotNull(message = "id不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 41 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/PageQueryFunctionDTO.java

@@ -0,0 +1,41 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:36
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(value = "分页查询能耗报告信息点入参")
+public class PageQueryFunctionDTO extends PageDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+    @ApiModelProperty(value = "集团编码", required = true)
+    private String groupCode;
+
+    @ApiModelProperty(value = "能耗类型", required = true)
+    private String energyType;
+
+    @ApiModelProperty(value = "建筑类型(业态)", required = true)
+    private String buildingType;
+
+    @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
+    private String functionType;
+
+    @ApiModelProperty(value = "能耗模型编码", required = true)
+    private String modelCode;
+
+    @ApiModelProperty(value = "分项id", required = true)
+    private String itemId;
+
+}

+ 34 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/QueryFunctionDTO.java

@@ -0,0 +1,34 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:36
+ */
+@Data
+@ApiModel(value = "查询能耗报告信息点入参")
+public class QueryFunctionDTO {
+    @ApiModelProperty(value = "集团编码", required = true)
+    private String groupCode;
+
+    @ApiModelProperty(value = "能耗类型", required = true)
+    private String energyType;
+
+    @ApiModelProperty(value = "建筑类型(业态)", required = true)
+    private String buildingType;
+
+    @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
+    private String functionType;
+
+    @ApiModelProperty(value = "能耗模型编码", required = true)
+    private String modelCode;
+
+    @ApiModelProperty(value = "分项id", required = true)
+    private String itemId;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/itemgroup/model/dto/QueryItemGroupDetailDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.itemgroup.model.dto;
+package com.persagy.apm.energy.report.monthly.config.function.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:17:47
+ * @version V1.0 2021-05-20 19:05:36
  */
 @Data
-@ApiModel(value = "获取分项分组详情入参")
-public class QueryItemGroupDetailDTO {
+@ApiModel(value = "获取能耗报告信息点详情入参")
+public class QueryFunctionDetailDTO {
     @NotNull(message = "主键不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 47 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/dto/UpdateFunctionDTO.java

@@ -0,0 +1,47 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:36
+ */
+@Data
+@ApiModel(value = "更新能耗报告信息点入参")
+public class UpdateFunctionDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    private String id;
+
+    @ApiModelProperty(value = "集团编码", required = true)
+    @NotNull(message = "集团编码不能为空") // todo 更新校验规则
+    private String groupCode;
+
+    @ApiModelProperty(value = "能耗类型", required = true)
+    @NotNull(message = "能耗类型不能为空") // todo 更新校验规则
+    private String energyType;
+
+    @ApiModelProperty(value = "建筑类型(业态)", required = true)
+    @NotNull(message = "建筑类型(业态)不能为空") // todo 更新校验规则
+    private String buildingType;
+
+    @ApiModelProperty(value = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)", required = true)
+    @NotNull(message = "信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)不能为空") // todo 更新校验规则
+    private String functionType;
+
+    @ApiModelProperty(value = "能耗模型编码", required = true)
+    @NotNull(message = "能耗模型编码不能为空") // todo 更新校验规则
+    private String modelCode;
+
+    @ApiModelProperty(value = "分项id", required = true)
+    @NotNull(message = "分项id不能为空") // todo 更新校验规则
+    private String itemId;
+
+}

+ 52 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/vo/ResponseFunctionItemVO.java

@@ -0,0 +1,52 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:36
+ */
+@Data
+@ApiModel(value = "能耗报告信息点返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseFunctionItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("集团编码")
+    private String groupCode;
+
+    @ApiModelProperty("能耗类型")
+    private String energyType;
+
+    @ApiModelProperty("建筑类型(业态)")
+    private String buildingType;
+
+    @ApiModelProperty("信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)")
+    private String functionType;
+
+    @ApiModelProperty("能耗模型编码")
+    private String modelCode;
+
+    @ApiModelProperty("分项id")
+    private String itemId;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 52 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/model/vo/ResponseFunctionListItemVO.java

@@ -0,0 +1,52 @@
+package com.persagy.apm.energy.report.monthly.config.function.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-05-20 19:05:36
+ */
+@Data
+@ApiModel(value = "能耗报告信息点列表返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseFunctionListItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("集团编码")
+    private String groupCode;
+
+    @ApiModelProperty("能耗类型")
+    private String energyType;
+
+    @ApiModelProperty("建筑类型(业态)")
+    private String buildingType;
+
+    @ApiModelProperty("信息点类型(0-能耗,1-费用 ,2-能耗预算,3-费用预算)")
+    private String functionType;
+
+    @ApiModelProperty("能耗模型编码")
+    private String modelCode;
+
+    @ApiModelProperty("分项id")
+    private String itemId;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 77 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/IFunctionService.java

@@ -0,0 +1,77 @@
+package com.persagy.apm.energy.report.monthly.config.function.service;
+
+import com.persagy.apm.energy.report.monthly.config.function.model.*;
+import com.persagy.apm.energy.report.monthly.config.function.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 能耗报告信息点(Function) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:33
+ */
+public interface IFunctionService {
+
+    /**
+     * 创建能耗报告信息点
+     *
+     * @param addFunctionDTO addDTO
+     * @return 能耗报告信息点主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    String createFunction(AddFunctionDTO addFunctionDTO);
+
+    /**
+     * 能耗报告信息点详情
+     *
+     * @param id 主键
+     * @return 能耗报告信息点do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    Function queryFunctionDetail(String id);
+
+    /**
+     * 更新能耗报告信息点
+     *
+     * @param updateFunctionDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    void updateFunction(UpdateFunctionDTO updateFunctionDTO);
+
+    /**
+     * 删除能耗报告信息点
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    void deleteFunction(String id);
+
+    /**
+     * 查询能耗报告信息点
+     *
+     * @param queryFunctionDTO queryDTO
+     * @return List<Function>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    List<Function> queryFunctionList(QueryFunctionDTO queryFunctionDTO);
+
+    /**
+     * 分页查询能耗报告信息点
+     *
+     * @param pageQueryFunctionDTO pageQueryDTO
+     * @return IPage<Function>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:33
+     */
+    IPage<Function> pageQueryFunction(PageQueryFunctionDTO pageQueryFunctionDTO);
+}

+ 239 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/function/service/impl/FunctionServiceImpl.java

@@ -0,0 +1,239 @@
+package com.persagy.apm.energy.report.monthly.config.function.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.config.function.dao.FunctionMapper;
+import com.persagy.apm.energy.report.monthly.config.function.service.IFunctionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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.config.function.model.*;
+import com.persagy.apm.energy.report.monthly.config.function.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;
+
+/**
+ * 能耗报告信息点(Function) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:05:34
+ */
+@Service
+public class FunctionServiceImpl extends ServiceImpl<FunctionMapper, Function>
+        implements IFunctionService {
+
+    /**
+     * 创建能耗报告信息点
+     *
+     * @return 能耗报告信息点主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public String createFunction(AddFunctionDTO addFunctionDTO) {
+        Function function = ConvertFunctionTool.INSTANCE.convertAddDto2Entity(addFunctionDTO);
+        // 设置默认值
+        setDefaultValue(function);
+        save(function);
+        return function.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param function 能耗报告信息点实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(Function function) {
+        function.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 能耗报告信息点详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public Function queryFunctionDetail(String id) {
+        Function function = getById(id);
+        if (function == null) {
+            throw new IllegalArgumentException("查看Function详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return function;
+    }
+
+    /**
+     * 更新能耗报告信息点
+     *
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public void updateFunction(UpdateFunctionDTO updateFunctionDTO) {
+        Function function = getById(updateFunctionDTO.getId());
+        function = ConvertFunctionTool.INSTANCE.convertUpdateDto2Entity(function, updateFunctionDTO);
+        function.setModifier(AppContext.getContext().getAccountId());
+        updateById(function);
+    }
+
+    /**
+     * 校验能耗报告信息点是否可删除
+     *
+     * @param id 能耗报告信息点主键
+     * @return 能耗报告信息点do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    public Function checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除Function时发生异常,主键为空");
+        }
+
+        Function function = getById(id);
+
+        if (function == null) {
+            throw new IllegalArgumentException("删除Function时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return function;
+    }
+
+    /**
+     * 删除能耗报告信息点
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public void deleteFunction(String id) {
+        // 校验是否可删除
+        Function function = checkDeletable(id);
+
+        function.setValid(ValidEnum.FALSE.getType());
+        updateById(function);
+    }
+
+    /**
+     * 查询能耗报告信息点
+     *
+     * @return List<Function>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public List<Function> queryFunctionList(QueryFunctionDTO queryFunctionDTO) {
+        QueryWrapper<Function> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(Function.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, Function.PROP_CREATIONTIME);
+
+        if (queryFunctionDTO != null) {
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getGroupCode())) {
+                queryWrapper.like(Function.PROP_GROUP_CODE, queryFunctionDTO.getGroupCode());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getEnergyType())) {
+                queryWrapper.like(Function.PROP_ENERGY_TYPE, queryFunctionDTO.getEnergyType());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getBuildingType())) {
+                queryWrapper.like(Function.PROP_BUILDING_TYPE, queryFunctionDTO.getBuildingType());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getFunctionType())) {
+                queryWrapper.like(Function.PROP_FUNCTION_TYPE, queryFunctionDTO.getFunctionType());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getModelCode())) {
+                queryWrapper.like(Function.PROP_MODEL_CODE, queryFunctionDTO.getModelCode());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionDTO.getItemId())) {
+                queryWrapper.like(Function.PROP_ITEM_ID, queryFunctionDTO.getItemId());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询能耗报告信息点
+     *
+     * @return IPage<Function>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:05:34
+     */
+    @Override
+    public IPage<Function> pageQueryFunction(PageQueryFunctionDTO pageQueryFunctionDTO) {
+        QueryWrapper<Function> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(Function.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<Function> pageParam = new Page<>(pageQueryFunctionDTO.getPage(), pageQueryFunctionDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryFunctionDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, Function.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryFunctionDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getGroupCode())) {
+            queryWrapper.like(Function.PROP_GROUP_CODE, pageQueryFunctionDTO.getGroupCode());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getEnergyType())) {
+            queryWrapper.like(Function.PROP_ENERGY_TYPE, pageQueryFunctionDTO.getEnergyType());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getBuildingType())) {
+            queryWrapper.like(Function.PROP_BUILDING_TYPE, pageQueryFunctionDTO.getBuildingType());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getFunctionType())) {
+            queryWrapper.like(Function.PROP_FUNCTION_TYPE, pageQueryFunctionDTO.getFunctionType());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getModelCode())) {
+            queryWrapper.like(Function.PROP_MODEL_CODE, pageQueryFunctionDTO.getModelCode());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionDTO.getItemId())) {
+            queryWrapper.like(Function.PROP_ITEM_ID, pageQueryFunctionDTO.getItemId());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+}

+ 101 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/controller/FunctionGroupController.java

@@ -0,0 +1,101 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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.config.functiongroup.model.ConvertFunctionGroupTool;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.FunctionGroup;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.dto.*;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.vo.ResponseFunctionGroupItemVO;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.vo.ResponseFunctionGroupListItemVO;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.service.IFunctionGroupService;
+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 springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 信息点分组控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:28
+ */
+@ApiIgnore
+@Api(tags = "信息点分组", hidden = true)
+@Validated
+@RestController
+@RequestMapping("functionGroups")
+public class FunctionGroupController {
+    @Autowired
+    private IFunctionGroupService functionGroupService;
+
+    @ApiOperation(value = "创建信息点分组")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createFunctionGroup(
+            @Valid @RequestBody AddFunctionGroupDTO addFunctionGroupDTO) {
+        String id = functionGroupService.createFunctionGroup(addFunctionGroupDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "信息点分组详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseFunctionGroupItemVO> queryFunctionGroupDetail(
+            @Valid @RequestBody QueryFunctionGroupDetailDTO queryFunctionGroupDetailDTO) {
+        FunctionGroup functionGroup = functionGroupService.queryFunctionGroupDetail(queryFunctionGroupDetailDTO.getId());
+        ResponseFunctionGroupItemVO responseFunctionGroupItemVO = ConvertFunctionGroupTool.INSTANCE.convert2ResponseItemDTO(functionGroup);
+        return ResultHelper.single(responseFunctionGroupItemVO);
+    }
+
+
+    @ApiOperation(value = "更新信息点分组")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateFunctionGroup(
+            @Valid @RequestBody UpdateFunctionGroupDTO updateFunctionGroupDTO) {
+        functionGroupService.updateFunctionGroup(updateFunctionGroupDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateFunctionGroupDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除信息点分组")
+    @PostMapping("/delete")
+    public CommonResult deleteFunctionGroup(
+            @RequestBody @Valid DeleteFunctionGroupDTO deleteFunctionGroupDTO) {
+        functionGroupService.deleteFunctionGroup(deleteFunctionGroupDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "信息点分组列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseFunctionGroupListItemVO>> queryFunctionGroup(
+            @Valid @RequestBody QueryFunctionGroupDTO queryFunctionGroupDTO) {
+        List<FunctionGroup> functionGroupList = functionGroupService.queryFunctionGroupList(queryFunctionGroupDTO);
+        List<ResponseFunctionGroupListItemVO> resultList = ConvertFunctionGroupTool.INSTANCE.convert2List(functionGroupList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "信息点分组列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseFunctionGroupListItemVO>> queryFunctionGroup(
+    //        @Valid @RequestBody PageQueryFunctionGroupDTO pageQueryFunctionGroupDTO) {
+    //    IPage<FunctionGroup> pagedList = functionGroupService.pageQueryFunctionGroup(pageQueryFunctionGroupDTO);
+    //    IPage<ResponseFunctionGroupListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertFunctionGroupTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,FunctionGroup实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/dao/FunctionGroupMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.dao;
+
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.FunctionGroup;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 信息点分组(FunctionGroup)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:29
+ */
+@Mapper
+public interface FunctionGroupMapper extends BaseMapper<FunctionGroup> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/ConvertFunctionGroupTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.vo.*;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 信息点分组(FunctionGroup) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:31 2021-05-20 19:06:31
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertFunctionGroupTool {
+
+    ConvertFunctionGroupTool INSTANCE = Mappers.getMapper(ConvertFunctionGroupTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param functionGroup do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:31
+     */
+    ResponseFunctionGroupItemVO convert2ResponseItemDTO(FunctionGroup functionGroup);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param functionGroup do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:31
+     */
+    ResponseFunctionGroupListItemVO convert2ResponseListItemDTO(FunctionGroup functionGroup);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param functionGroupList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:31
+     */
+    List<ResponseFunctionGroupListItemVO> convert2List(List<FunctionGroup> functionGroupList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addFunctionGroupDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:31
+     */
+    FunctionGroup convertAddDto2Entity(AddFunctionGroupDTO addFunctionGroupDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param functionGroup          更新前的do对象
+     * @param updateFunctionGroupDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:31
+     */
+    FunctionGroup convertUpdateDto2Entity(@MappingTarget FunctionGroup functionGroup, UpdateFunctionGroupDTO updateFunctionGroupDTO);
+}
+

+ 42 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/FunctionGroup.java

@@ -0,0 +1,42 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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;
+
+/**
+ * 信息点分组(FunctionGroup)实体类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:29
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "信息点分组")
+public class FunctionGroup extends AuditableEntity<FunctionGroup> implements Serializable {
+    private static final long serialVersionUID = 104212607171794817L;
+
+    @ApiModelProperty("分组名称")
+    private String name;
+
+    @ApiModelProperty("包含的分组id(预留字段)")
+    private String groupIds;
+
+    @ApiModelProperty("包含的信息点id")
+    private String functionIds;
+
+    @ApiModelProperty("所属段落(如果不直属段落,这里不填)")
+    private String belongParagraph;
+
+
+    public static String PROP_NAME = "name";
+    public static String PROP_GROUP_IDS = "group_ids";
+    public static String PROP_FUNCTION_IDS = "function_ids";
+    public static String PROP_BELONG_PARAGRAPH = "belong_paragraph";
+
+}

+ 35 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/AddFunctionGroupDTO.java

@@ -0,0 +1,35 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:29
+ */
+@Data
+@ApiModel(value = "创建信息点分组入参")
+public class AddFunctionGroupDTO {
+    @ApiModelProperty(value = "分组名称", required = true)
+    @NotNull(message = "分组名称不能为空") // todo 更新校验规则
+    private String name;
+
+    @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
+    @NotNull(message = "包含的分组id(预留字段)不能为空") // todo 更新校验规则
+    private String groupIds;
+
+    @ApiModelProperty(value = "包含的信息点id", required = true)
+    @NotNull(message = "包含的信息点id不能为空") // todo 更新校验规则
+    private String functionIds;
+
+    @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
+    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") // todo 更新校验规则
+    private String belongParagraph;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/DeleteModelItemRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.model.dto;
+package com.persagy.apm.energy.report.monthly.config.functiongroup.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:16:58
+ * @version V1.0 2021-05-20 19:06:30
  */
 @Data
-@ApiModel(value = "删除能耗模型与分项关联关系入参")
-public class DeleteModelItemRelDTO {
+@ApiModel(value = "删除信息点分组入参")
+public class DeleteFunctionGroupDTO {
     @NotNull(message = "id不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 35 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/PageQueryFunctionGroupDTO.java

@@ -0,0 +1,35 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:30
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(value = "分页查询信息点分组入参")
+public class PageQueryFunctionGroupDTO extends PageDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+    @ApiModelProperty(value = "分组名称", required = true)
+    private String name;
+
+    @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
+    private String groupIds;
+
+    @ApiModelProperty(value = "包含的信息点id", required = true)
+    private String functionIds;
+
+    @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
+    private String belongParagraph;
+
+}

+ 28 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/QueryFunctionGroupDTO.java

@@ -0,0 +1,28 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:30
+ */
+@Data
+@ApiModel(value = "查询信息点分组入参")
+public class QueryFunctionGroupDTO {
+    @ApiModelProperty(value = "分组名称", required = true)
+    private String name;
+
+    @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
+    private String groupIds;
+
+    @ApiModelProperty(value = "包含的信息点id", required = true)
+    private String functionIds;
+
+    @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
+    private String belongParagraph;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/rel/modelitem/model/dto/QueryModelItemRelDetailDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.modelitem.model.dto;
+package com.persagy.apm.energy.report.monthly.config.functiongroup.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:16:56
+ * @version V1.0 2021-05-20 19:06:30
  */
 @Data
-@ApiModel(value = "获取能耗模型与分项关联关系详情入参")
-public class QueryModelItemRelDetailDTO {
+@ApiModel(value = "获取信息点分组详情入参")
+public class QueryFunctionGroupDetailDTO {
     @NotNull(message = "主键不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 39 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/dto/UpdateFunctionGroupDTO.java

@@ -0,0 +1,39 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:30
+ */
+@Data
+@ApiModel(value = "更新信息点分组入参")
+public class UpdateFunctionGroupDTO {
+    @ApiModelProperty(value = "主键", required = true)
+    @NotNull(message = "主键不能为空") // todo 更新校验规则
+    private String id;
+
+    @ApiModelProperty(value = "分组名称", required = true)
+    @NotNull(message = "分组名称不能为空") // todo 更新校验规则
+    private String name;
+
+    @ApiModelProperty(value = "包含的分组id(预留字段)", required = true)
+    @NotNull(message = "包含的分组id(预留字段)不能为空") // todo 更新校验规则
+    private String groupIds;
+
+    @ApiModelProperty(value = "包含的信息点id", required = true)
+    @NotNull(message = "包含的信息点id不能为空") // todo 更新校验规则
+    private String functionIds;
+
+    @ApiModelProperty(value = "所属段落(如果不直属段落,这里不填)", required = true)
+    @NotNull(message = "所属段落(如果不直属段落,这里不填)不能为空") // todo 更新校验规则
+    private String belongParagraph;
+
+}

+ 46 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/vo/ResponseFunctionGroupItemVO.java

@@ -0,0 +1,46 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:30
+ */
+@Data
+@ApiModel(value = "信息点分组返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseFunctionGroupItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("分组名称")
+    private String name;
+
+    @ApiModelProperty("包含的分组id(预留字段)")
+    private String groupIds;
+
+    @ApiModelProperty("包含的信息点id")
+    private String functionIds;
+
+    @ApiModelProperty("所属段落(如果不直属段落,这里不填)")
+    private String belongParagraph;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 46 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/model/vo/ResponseFunctionGroupListItemVO.java

@@ -0,0 +1,46 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.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-05-20 19:06:31
+ */
+@Data
+@ApiModel(value = "信息点分组列表返回结果参数")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseFunctionGroupListItemVO {
+    @ApiModelProperty("主键")
+    private String id;
+
+    @ApiModelProperty("分组名称")
+    private String name;
+
+    @ApiModelProperty("包含的分组id(预留字段)")
+    private String groupIds;
+
+    @ApiModelProperty("包含的信息点id")
+    private String functionIds;
+
+    @ApiModelProperty("所属段落(如果不直属段落,这里不填)")
+    private String belongParagraph;
+
+    @ApiModelProperty("创建人")
+    private String creator;
+
+    @ApiModelProperty("创建时间")
+    private Date creationTime;
+
+    @ApiModelProperty("最后修改人")
+    private String modifier;
+
+    @ApiModelProperty("最后修改时间")
+    private Date modifiedTime;
+
+}

+ 77 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/IFunctionGroupService.java

@@ -0,0 +1,77 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.service;
+
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.*;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 信息点分组(FunctionGroup) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:28
+ */
+public interface IFunctionGroupService {
+
+    /**
+     * 创建信息点分组
+     *
+     * @param addFunctionGroupDTO addDTO
+     * @return 信息点分组主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    String createFunctionGroup(AddFunctionGroupDTO addFunctionGroupDTO);
+
+    /**
+     * 信息点分组详情
+     *
+     * @param id 主键
+     * @return 信息点分组do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    FunctionGroup queryFunctionGroupDetail(String id);
+
+    /**
+     * 更新信息点分组
+     *
+     * @param updateFunctionGroupDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    void updateFunctionGroup(UpdateFunctionGroupDTO updateFunctionGroupDTO);
+
+    /**
+     * 删除信息点分组
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    void deleteFunctionGroup(String id);
+
+    /**
+     * 查询信息点分组
+     *
+     * @param queryFunctionGroupDTO queryDTO
+     * @return List<FunctionGroup>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    List<FunctionGroup> queryFunctionGroupList(QueryFunctionGroupDTO queryFunctionGroupDTO);
+
+    /**
+     * 分页查询信息点分组
+     *
+     * @param pageQueryFunctionGroupDTO pageQueryDTO
+     * @return IPage<FunctionGroup>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:28
+     */
+    IPage<FunctionGroup> pageQueryFunctionGroup(PageQueryFunctionGroupDTO pageQueryFunctionGroupDTO);
+}

+ 219 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/functiongroup/service/impl/FunctionGroupServiceImpl.java

@@ -0,0 +1,219 @@
+package com.persagy.apm.energy.report.monthly.config.functiongroup.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.dao.FunctionGroupMapper;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.service.IFunctionGroupService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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.config.functiongroup.model.*;
+import com.persagy.apm.energy.report.monthly.config.functiongroup.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;
+
+/**
+ * 信息点分组(FunctionGroup) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:06:29
+ */
+@Service
+public class FunctionGroupServiceImpl extends ServiceImpl<FunctionGroupMapper, FunctionGroup>
+        implements IFunctionGroupService {
+
+    /**
+     * 创建信息点分组
+     *
+     * @return 信息点分组主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public String createFunctionGroup(AddFunctionGroupDTO addFunctionGroupDTO) {
+        FunctionGroup functionGroup = ConvertFunctionGroupTool.INSTANCE.convertAddDto2Entity(addFunctionGroupDTO);
+        // 设置默认值
+        setDefaultValue(functionGroup);
+        save(functionGroup);
+        return functionGroup.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param functionGroup 信息点分组实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(FunctionGroup functionGroup) {
+        functionGroup.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 信息点分组详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public FunctionGroup queryFunctionGroupDetail(String id) {
+        FunctionGroup functionGroup = getById(id);
+        if (functionGroup == null) {
+            throw new IllegalArgumentException("查看FunctionGroup详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return functionGroup;
+    }
+
+    /**
+     * 更新信息点分组
+     *
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public void updateFunctionGroup(UpdateFunctionGroupDTO updateFunctionGroupDTO) {
+        FunctionGroup functionGroup = getById(updateFunctionGroupDTO.getId());
+        functionGroup = ConvertFunctionGroupTool.INSTANCE.convertUpdateDto2Entity(functionGroup, updateFunctionGroupDTO);
+        functionGroup.setModifier(AppContext.getContext().getAccountId());
+        updateById(functionGroup);
+    }
+
+    /**
+     * 校验信息点分组是否可删除
+     *
+     * @param id 信息点分组主键
+     * @return 信息点分组do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    public FunctionGroup checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除FunctionGroup时发生异常,主键为空");
+        }
+
+        FunctionGroup functionGroup = getById(id);
+
+        if (functionGroup == null) {
+            throw new IllegalArgumentException("删除FunctionGroup时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return functionGroup;
+    }
+
+    /**
+     * 删除信息点分组
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public void deleteFunctionGroup(String id) {
+        // 校验是否可删除
+        FunctionGroup functionGroup = checkDeletable(id);
+
+        functionGroup.setValid(ValidEnum.FALSE.getType());
+        updateById(functionGroup);
+    }
+
+    /**
+     * 查询信息点分组
+     *
+     * @return List<FunctionGroup>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public List<FunctionGroup> queryFunctionGroupList(QueryFunctionGroupDTO queryFunctionGroupDTO) {
+        QueryWrapper<FunctionGroup> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(FunctionGroup.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, FunctionGroup.PROP_CREATIONTIME);
+
+        if (queryFunctionGroupDTO != null) {
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getName())) {
+                queryWrapper.like(FunctionGroup.PROP_NAME, queryFunctionGroupDTO.getName());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getGroupIds())) {
+                queryWrapper.like(FunctionGroup.PROP_GROUP_IDS, queryFunctionGroupDTO.getGroupIds());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getFunctionIds())) {
+                queryWrapper.like(FunctionGroup.PROP_FUNCTION_IDS, queryFunctionGroupDTO.getFunctionIds());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryFunctionGroupDTO.getBelongParagraph())) {
+                queryWrapper.like(FunctionGroup.PROP_BELONG_PARAGRAPH, queryFunctionGroupDTO.getBelongParagraph());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询信息点分组
+     *
+     * @return IPage<FunctionGroup>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:06:29
+     */
+    @Override
+    public IPage<FunctionGroup> pageQueryFunctionGroup(PageQueryFunctionGroupDTO pageQueryFunctionGroupDTO) {
+        QueryWrapper<FunctionGroup> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(FunctionGroup.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<FunctionGroup> pageParam = new Page<>(pageQueryFunctionGroupDTO.getPage(), pageQueryFunctionGroupDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryFunctionGroupDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, FunctionGroup.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryFunctionGroupDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getName())) {
+            queryWrapper.like(FunctionGroup.PROP_NAME, pageQueryFunctionGroupDTO.getName());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getGroupIds())) {
+            queryWrapper.like(FunctionGroup.PROP_GROUP_IDS, pageQueryFunctionGroupDTO.getGroupIds());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getFunctionIds())) {
+            queryWrapper.like(FunctionGroup.PROP_FUNCTION_IDS, pageQueryFunctionGroupDTO.getFunctionIds());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryFunctionGroupDTO.getBelongParagraph())) {
+            queryWrapper.like(FunctionGroup.PROP_BELONG_PARAGRAPH, pageQueryFunctionGroupDTO.getBelongParagraph());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+}

+ 101 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/controller/ReportDetailStatisticsItemRelController.java

@@ -0,0 +1,101 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.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.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.*;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.ResponseReportDetailStatisticsItemRelItemVO;
+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 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 springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 报告详情与统计条目的关联控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:19:38
+ */
+@ApiIgnore
+@Api(tags = "报告详情与统计条目的关联", hidden = true)
+@Validated
+@RestController
+@RequestMapping("reportDetailStatisticsItemRels")
+public class ReportDetailStatisticsItemRelController {
+    @Autowired
+    private IReportDetailStatisticsItemRelService reportDetailStatisticsItemRelService;
+
+    @ApiOperation(value = "创建报告详情与统计条目的关联")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createReportDetailStatisticsItemRel(
+            @Valid @RequestBody AddReportDetailStatisticsItemRelDTO addReportDetailStatisticsItemRelDTO) {
+        String id = reportDetailStatisticsItemRelService.createReportDetailStatisticsItemRel(addReportDetailStatisticsItemRelDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "报告详情与统计条目的关联详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseReportDetailStatisticsItemRelItemVO> queryReportDetailStatisticsItemRelDetail(
+            @Valid @RequestBody QueryReportDetailStatisticsItemRelDetailDTO queryReportDetailStatisticsItemRelDetailDTO) {
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = reportDetailStatisticsItemRelService.queryReportDetailStatisticsItemRelDetail(queryReportDetailStatisticsItemRelDetailDTO.getId());
+        ResponseReportDetailStatisticsItemRelItemVO responseReportDetailStatisticsItemRelItemVO = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convert2ResponseItemDTO(reportDetailStatisticsItemRel);
+        return ResultHelper.single(responseReportDetailStatisticsItemRelItemVO);
+    }
+
+
+    @ApiOperation(value = "更新报告详情与统计条目的关联")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateReportDetailStatisticsItemRel(
+            @Valid @RequestBody UpdateReportDetailStatisticsItemRelDTO updateReportDetailStatisticsItemRelDTO) {
+        reportDetailStatisticsItemRelService.updateReportDetailStatisticsItemRel(updateReportDetailStatisticsItemRelDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateReportDetailStatisticsItemRelDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除报告详情与统计条目的关联")
+    @PostMapping("/delete")
+    public CommonResult deleteReportDetailStatisticsItemRel(
+            @RequestBody @Valid DeleteReportDetailStatisticsItemRelDTO deleteReportDetailStatisticsItemRelDTO) {
+        reportDetailStatisticsItemRelService.deleteReportDetailStatisticsItemRel(deleteReportDetailStatisticsItemRelDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "报告详情与统计条目的关联列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseReportDetailStatisticsItemRelListItemVO>> queryReportDetailStatisticsItemRel(
+            @Valid @RequestBody QueryReportDetailStatisticsItemRelDTO queryReportDetailStatisticsItemRelDTO) {
+        List<ReportDetailStatisticsItemRel> reportDetailStatisticsItemRelList = reportDetailStatisticsItemRelService.queryReportDetailStatisticsItemRelList(queryReportDetailStatisticsItemRelDTO);
+        List<ResponseReportDetailStatisticsItemRelListItemVO> resultList = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convert2List(reportDetailStatisticsItemRelList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "报告详情与统计条目的关联列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseReportDetailStatisticsItemRelListItemVO>> queryReportDetailStatisticsItemRel(
+    //        @Valid @RequestBody PageQueryReportDetailStatisticsItemRelDTO pageQueryReportDetailStatisticsItemRelDTO) {
+    //    IPage<ReportDetailStatisticsItemRel> pagedList = reportDetailStatisticsItemRelService.pageQueryReportDetailStatisticsItemRel(pageQueryReportDetailStatisticsItemRelDTO);
+    //    IPage<ResponseReportDetailStatisticsItemRelListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertReportDetailStatisticsItemRelTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,ReportDetailStatisticsItemRel实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/dao/ReportDetailStatisticsItemRelMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.dao;
+
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.ReportDetailStatisticsItemRel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 报告详情与统计条目的关联(ReportDetailStatisticsItemRel)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:19:39
+ */
+@Mapper
+public interface ReportDetailStatisticsItemRelMapper extends BaseMapper<ReportDetailStatisticsItemRel> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/ConvertReportDetailStatisticsItemRelTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo.*;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 报告详情与统计条目的关联(ReportDetailStatisticsItemRel) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:19:41 2021-05-20 19:19:41
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertReportDetailStatisticsItemRelTool {
+
+    ConvertReportDetailStatisticsItemRelTool INSTANCE = Mappers.getMapper(ConvertReportDetailStatisticsItemRelTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param reportDetailStatisticsItemRel do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:41
+     */
+    ResponseReportDetailStatisticsItemRelItemVO convert2ResponseItemDTO(ReportDetailStatisticsItemRel reportDetailStatisticsItemRel);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param reportDetailStatisticsItemRel do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:41
+     */
+    ResponseReportDetailStatisticsItemRelListItemVO convert2ResponseListItemDTO(ReportDetailStatisticsItemRel reportDetailStatisticsItemRel);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param reportDetailStatisticsItemRelList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:41
+     */
+    List<ResponseReportDetailStatisticsItemRelListItemVO> convert2List(List<ReportDetailStatisticsItemRel> reportDetailStatisticsItemRelList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addReportDetailStatisticsItemRelDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:41
+     */
+    ReportDetailStatisticsItemRel convertAddDto2Entity(AddReportDetailStatisticsItemRelDTO addReportDetailStatisticsItemRelDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param reportDetailStatisticsItemRel          更新前的do对象
+     * @param updateReportDetailStatisticsItemRelDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:41
+     */
+    ReportDetailStatisticsItemRel convertUpdateDto2Entity(@MappingTarget ReportDetailStatisticsItemRel reportDetailStatisticsItemRel, UpdateReportDetailStatisticsItemRelDTO updateReportDetailStatisticsItemRelDTO);
+}
+

+ 10 - 10
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/ReportDetailModelRel.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,26 +10,26 @@ import java.io.Serializable;
 import java.util.Date;
 
 /**
- * 报告模型关联关系(ReportDetailModelRel)实体类
+ * 报告详情与统计条目的关联(ReportDetailStatisticsItemRel)实体类
  *
  * @author lixing
- * @version V1.0 2021-05-19 11:19:10
+ * @version V1.0 2021-05-20 19:19:40
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-@ApiModel(description = "报告模型关联关系")
-public class ReportDetailModelRel extends AuditableEntity<ReportDetailModelRel> implements Serializable {
-    private static final long serialVersionUID = -32859202038112682L;
+@ApiModel(description = "报告详情与统计条目的关联")
+public class ReportDetailStatisticsItemRel extends AuditableEntity<ReportDetailStatisticsItemRel> implements Serializable {
+    private static final long serialVersionUID = -23777287365374831L;
 
     @ApiModelProperty("报告详情主键")
     private String reportDetailId;
 
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
     @ApiModelProperty("报告类型id")
     private String reportTypeId;
 
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
+
     @ApiModelProperty("不合格原因")
     private String unqualifiedReason;
 
@@ -38,8 +38,8 @@ public class ReportDetailModelRel extends AuditableEntity<ReportDetailModelRel>
 
 
     public static String PROP_REPORT_DETAIL_ID = "report_detail_id";
-    public static String PROP_MODEL_CODE = "model_code";
     public static String PROP_REPORT_TYPE_ID = "report_type_id";
+    public static String PROP_STATISTICS_ITEM_ID = "statistics_item_id";
     public static String PROP_UNQUALIFIED_REASON = "unqualified_reason";
     public static String PROP_REMARK = "remark";
 

+ 8 - 8
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/AddReportDetailModelRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,23 +11,23 @@ import java.util.Date;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:10
+ * @version V1.0 2021-05-20 19:19:40
  */
 @Data
-@ApiModel(value = "创建报告模型关联关系入参")
-public class AddReportDetailModelRelDTO {
+@ApiModel(value = "创建报告详情与统计条目的关联入参")
+public class AddReportDetailStatisticsItemRelDTO {
     @ApiModelProperty(value = "报告详情主键", required = true)
     @NotNull(message = "报告详情主键不能为空")
     private String reportDetailId;
 
-    @ApiModelProperty(value = "模型编码", required = true)
-    @NotNull(message = "模型编码不能为空")
-    private String modelCode;
-
     @ApiModelProperty(value = "报告类型id", required = true)
     @NotNull(message = "报告类型id不能为空")
     private String reportTypeId;
 
+    @ApiModelProperty(value = "统计条目id", required = true)
+    @NotNull(message = "统计条目id不能为空")
+    private String statisticsItemId;
+
     @ApiModelProperty(value = "不合格原因")
     private String unqualifiedReason;
 

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/DeleteReportDetailStatisticsItemRelDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.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-05-20 19:19:40
+ */
+@Data
+@ApiModel(value = "删除报告详情与统计条目的关联入参")
+public class DeleteReportDetailStatisticsItemRelDTO {
+    @NotNull(message = "id不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/PageQueryReportDetailModelRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,24 +11,24 @@ import lombok.EqualsAndHashCode;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:11
+ * @version V1.0 2021-05-20 19:19:40
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-@ApiModel(value = "分页查询报告模型关联关系入参")
-public class PageQueryReportDetailModelRelDTO extends PageDTO {
+@ApiModel(value = "分页查询报告详情与统计条目的关联入参")
+public class PageQueryReportDetailStatisticsItemRelDTO extends PageDTO {
     @ApiModelProperty(value = "主键", required = true)
     private String id;
 
     @ApiModelProperty(value = "报告详情主键", required = true)
     private String reportDetailId;
 
-    @ApiModelProperty(value = "模型编码", required = true)
-    private String modelCode;
-
     @ApiModelProperty(value = "报告类型id", required = true)
     private String reportTypeId;
 
+    @ApiModelProperty(value = "统计条目id", required = true)
+    private String statisticsItemId;
+
     @ApiModelProperty(value = "不合格原因", required = true)
     private String unqualifiedReason;
 

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/QueryReportDetailModelRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,20 +8,20 @@ import java.util.Date;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:11
+ * @version V1.0 2021-05-20 19:19:40
  */
 @Data
-@ApiModel(value = "查询报告模型关联关系入参")
-public class QueryReportDetailModelRelDTO {
+@ApiModel(value = "查询报告详情与统计条目的关联入参")
+public class QueryReportDetailStatisticsItemRelDTO {
     @ApiModelProperty(value = "报告详情主键", required = true)
     private String reportDetailId;
 
-    @ApiModelProperty(value = "模型编码", required = true)
-    private String modelCode;
-
     @ApiModelProperty(value = "报告类型id", required = true)
     private String reportTypeId;
 
+    @ApiModelProperty(value = "统计条目id", required = true)
+    private String statisticsItemId;
+
     @ApiModelProperty(value = "不合格原因", required = true)
     private String unqualifiedReason;
 

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/model/dto/QueryReportDetailStatisticsItemRelDetailDTO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.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-05-20 19:19:40
+ */
+@Data
+@ApiModel(value = "获取报告详情与统计条目的关联详情入参")
+public class QueryReportDetailStatisticsItemRelDetailDTO {
+    @NotNull(message = "主键不能为空")
+    @ApiModelProperty(value = "主键", required = true)
+    private String id;
+
+}

+ 8 - 8
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/dto/UpdateReportDetailModelRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,11 +11,11 @@ import java.util.Date;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:11
+ * @version V1.0 2021-05-20 19:19:40
  */
 @Data
-@ApiModel(value = "更新报告模型关联关系入参")
-public class UpdateReportDetailModelRelDTO {
+@ApiModel(value = "更新报告详情与统计条目的关联入参")
+public class UpdateReportDetailStatisticsItemRelDTO {
     @ApiModelProperty(value = "主键", required = true)
     @NotNull(message = "主键不能为空") // todo 更新校验规则
     private String id;
@@ -24,14 +24,14 @@ public class UpdateReportDetailModelRelDTO {
     @NotNull(message = "报告详情主键不能为空") // todo 更新校验规则
     private String reportDetailId;
 
-    @ApiModelProperty(value = "模型编码", required = true)
-    @NotNull(message = "模型编码不能为空") // todo 更新校验规则
-    private String modelCode;
-
     @ApiModelProperty(value = "报告类型id", required = true)
     @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
     private String reportTypeId;
 
+    @ApiModelProperty(value = "统计条目id", required = true)
+    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    private String statisticsItemId;
+
     @ApiModelProperty(value = "不合格原因", required = true)
     @NotNull(message = "不合格原因不能为空") // todo 更新校验规则
     private String unqualifiedReason;

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/vo/ResponseReportDetailModelRelItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.vo;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,24 +10,24 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:11
+ * @version V1.0 2021-05-20 19:19:40
  */
 @Data
-@ApiModel(value = "报告模型关联关系返回结果参数")
+@ApiModel(value = "报告详情与统计条目的关联返回结果参数")
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportDetailModelRelItemVO {
+public class ResponseReportDetailStatisticsItemRelItemVO {
     @ApiModelProperty("主键")
     private String id;
 
     @ApiModelProperty("报告详情主键")
     private String reportDetailId;
 
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
     @ApiModelProperty("报告类型id")
     private String reportTypeId;
 
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
+
     @ApiModelProperty("不合格原因")
     private String unqualifiedReason;
 

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/detailmodel/model/vo/ResponseReportDetailModelRelListItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.detailmodel.model.vo;
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.vo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,24 +10,24 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:11
+ * @version V1.0 2021-05-20 19:19:41
  */
 @Data
-@ApiModel(value = "报告模型关联关系列表返回结果参数")
+@ApiModel(value = "报告详情与统计条目的关联列表返回结果参数")
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportDetailModelRelListItemVO {
+public class ResponseReportDetailStatisticsItemRelListItemVO {
     @ApiModelProperty("主键")
     private String id;
 
     @ApiModelProperty("报告详情主键")
     private String reportDetailId;
 
-    @ApiModelProperty("模型编码")
-    private String modelCode;
-
     @ApiModelProperty("报告类型id")
     private String reportTypeId;
 
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
+
     @ApiModelProperty("不合格原因")
     private String unqualifiedReason;
 

+ 77 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/IReportDetailStatisticsItemRelService.java

@@ -0,0 +1,77 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service;
+
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.*;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 报告详情与统计条目的关联(ReportDetailStatisticsItemRel) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:19:39
+ */
+public interface IReportDetailStatisticsItemRelService {
+
+    /**
+     * 创建报告详情与统计条目的关联
+     *
+     * @param addReportDetailStatisticsItemRelDTO addDTO
+     * @return 报告详情与统计条目的关联主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    String createReportDetailStatisticsItemRel(AddReportDetailStatisticsItemRelDTO addReportDetailStatisticsItemRelDTO);
+
+    /**
+     * 报告详情与统计条目的关联详情
+     *
+     * @param id 主键
+     * @return 报告详情与统计条目的关联do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    ReportDetailStatisticsItemRel queryReportDetailStatisticsItemRelDetail(String id);
+
+    /**
+     * 更新报告详情与统计条目的关联
+     *
+     * @param updateReportDetailStatisticsItemRelDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    void updateReportDetailStatisticsItemRel(UpdateReportDetailStatisticsItemRelDTO updateReportDetailStatisticsItemRelDTO);
+
+    /**
+     * 删除报告详情与统计条目的关联
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    void deleteReportDetailStatisticsItemRel(String id);
+
+    /**
+     * 查询报告详情与统计条目的关联
+     *
+     * @param queryReportDetailStatisticsItemRelDTO queryDTO
+     * @return List<ReportDetailStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    List<ReportDetailStatisticsItemRel> queryReportDetailStatisticsItemRelList(QueryReportDetailStatisticsItemRelDTO queryReportDetailStatisticsItemRelDTO);
+
+    /**
+     * 分页查询报告详情与统计条目的关联
+     *
+     * @param pageQueryReportDetailStatisticsItemRelDTO pageQueryDTO
+     * @return IPage<ReportDetailStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    IPage<ReportDetailStatisticsItemRel> pageQueryReportDetailStatisticsItemRel(PageQueryReportDetailStatisticsItemRelDTO pageQueryReportDetailStatisticsItemRelDTO);
+}

+ 229 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/detailstatisticsitem/service/impl/ReportDetailStatisticsItemRelServiceImpl.java

@@ -0,0 +1,229 @@
+package com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.dao.ReportDetailStatisticsItemRelMapper;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.service.IReportDetailStatisticsItemRelService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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.config.rel.detailstatisticsitem.model.*;
+import com.persagy.apm.energy.report.monthly.config.rel.detailstatisticsitem.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;
+
+/**
+ * 报告详情与统计条目的关联(ReportDetailStatisticsItemRel) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:19:39
+ */
+@Service
+public class ReportDetailStatisticsItemRelServiceImpl extends ServiceImpl<ReportDetailStatisticsItemRelMapper, ReportDetailStatisticsItemRel>
+        implements IReportDetailStatisticsItemRelService {
+
+    /**
+     * 创建报告详情与统计条目的关联
+     *
+     * @return 报告详情与统计条目的关联主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public String createReportDetailStatisticsItemRel(AddReportDetailStatisticsItemRelDTO addReportDetailStatisticsItemRelDTO) {
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convertAddDto2Entity(addReportDetailStatisticsItemRelDTO);
+        // 设置默认值
+        setDefaultValue(reportDetailStatisticsItemRel);
+        save(reportDetailStatisticsItemRel);
+        return reportDetailStatisticsItemRel.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param reportDetailStatisticsItemRel 报告详情与统计条目的关联实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(ReportDetailStatisticsItemRel reportDetailStatisticsItemRel) {
+        reportDetailStatisticsItemRel.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 报告详情与统计条目的关联详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public ReportDetailStatisticsItemRel queryReportDetailStatisticsItemRelDetail(String id) {
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = getById(id);
+        if (reportDetailStatisticsItemRel == null) {
+            throw new IllegalArgumentException("查看ReportDetailStatisticsItemRel详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return reportDetailStatisticsItemRel;
+    }
+
+    /**
+     * 更新报告详情与统计条目的关联
+     *
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public void updateReportDetailStatisticsItemRel(UpdateReportDetailStatisticsItemRelDTO updateReportDetailStatisticsItemRelDTO) {
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = getById(updateReportDetailStatisticsItemRelDTO.getId());
+        reportDetailStatisticsItemRel = ConvertReportDetailStatisticsItemRelTool.INSTANCE.convertUpdateDto2Entity(reportDetailStatisticsItemRel, updateReportDetailStatisticsItemRelDTO);
+        reportDetailStatisticsItemRel.setModifier(AppContext.getContext().getAccountId());
+        updateById(reportDetailStatisticsItemRel);
+    }
+
+    /**
+     * 校验报告详情与统计条目的关联是否可删除
+     *
+     * @param id 报告详情与统计条目的关联主键
+     * @return 报告详情与统计条目的关联do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    public ReportDetailStatisticsItemRel checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除ReportDetailStatisticsItemRel时发生异常,主键为空");
+        }
+
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = getById(id);
+
+        if (reportDetailStatisticsItemRel == null) {
+            throw new IllegalArgumentException("删除ReportDetailStatisticsItemRel时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return reportDetailStatisticsItemRel;
+    }
+
+    /**
+     * 删除报告详情与统计条目的关联
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public void deleteReportDetailStatisticsItemRel(String id) {
+        // 校验是否可删除
+        ReportDetailStatisticsItemRel reportDetailStatisticsItemRel = checkDeletable(id);
+
+        reportDetailStatisticsItemRel.setValid(ValidEnum.FALSE.getType());
+        updateById(reportDetailStatisticsItemRel);
+    }
+
+    /**
+     * 查询报告详情与统计条目的关联
+     *
+     * @return List<ReportDetailStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public List<ReportDetailStatisticsItemRel> queryReportDetailStatisticsItemRelList(QueryReportDetailStatisticsItemRelDTO queryReportDetailStatisticsItemRelDTO) {
+        QueryWrapper<ReportDetailStatisticsItemRel> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportDetailStatisticsItemRel.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, ReportDetailStatisticsItemRel.PROP_CREATIONTIME);
+
+        if (queryReportDetailStatisticsItemRelDTO != null) {
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getReportDetailId())) {
+                queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_DETAIL_ID, queryReportDetailStatisticsItemRelDTO.getReportDetailId());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getReportTypeId())) {
+                queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_TYPE_ID, queryReportDetailStatisticsItemRelDTO.getReportTypeId());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getStatisticsItemId())) {
+                queryWrapper.like(ReportDetailStatisticsItemRel.PROP_STATISTICS_ITEM_ID, queryReportDetailStatisticsItemRelDTO.getStatisticsItemId());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getUnqualifiedReason())) {
+                queryWrapper.like(ReportDetailStatisticsItemRel.PROP_UNQUALIFIED_REASON, queryReportDetailStatisticsItemRelDTO.getUnqualifiedReason());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportDetailStatisticsItemRelDTO.getRemark())) {
+                queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REMARK, queryReportDetailStatisticsItemRelDTO.getRemark());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询报告详情与统计条目的关联
+     *
+     * @return IPage<ReportDetailStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:19:39
+     */
+    @Override
+    public IPage<ReportDetailStatisticsItemRel> pageQueryReportDetailStatisticsItemRel(PageQueryReportDetailStatisticsItemRelDTO pageQueryReportDetailStatisticsItemRelDTO) {
+        QueryWrapper<ReportDetailStatisticsItemRel> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportDetailStatisticsItemRel.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<ReportDetailStatisticsItemRel> pageParam = new Page<>(pageQueryReportDetailStatisticsItemRelDTO.getPage(), pageQueryReportDetailStatisticsItemRelDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryReportDetailStatisticsItemRelDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, ReportDetailStatisticsItemRel.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryReportDetailStatisticsItemRelDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getReportDetailId())) {
+            queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_DETAIL_ID, pageQueryReportDetailStatisticsItemRelDTO.getReportDetailId());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getReportTypeId())) {
+            queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REPORT_TYPE_ID, pageQueryReportDetailStatisticsItemRelDTO.getReportTypeId());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getStatisticsItemId())) {
+            queryWrapper.like(ReportDetailStatisticsItemRel.PROP_STATISTICS_ITEM_ID, pageQueryReportDetailStatisticsItemRelDTO.getStatisticsItemId());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getUnqualifiedReason())) {
+            queryWrapper.like(ReportDetailStatisticsItemRel.PROP_UNQUALIFIED_REASON, pageQueryReportDetailStatisticsItemRelDTO.getUnqualifiedReason());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportDetailStatisticsItemRelDTO.getRemark())) {
+            queryWrapper.like(ReportDetailStatisticsItemRel.PROP_REMARK, pageQueryReportDetailStatisticsItemRelDTO.getRemark());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+}

+ 101 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/controller/ReportTypeStatisticsItemRelController.java

@@ -0,0 +1,101 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.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.config.rel.typestatisticsitem.model.ConvertReportTypeStatisticsItemRelTool;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.ReportTypeStatisticsItemRel;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto.*;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.vo.ResponseReportTypeStatisticsItemRelItemVO;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.vo.ResponseReportTypeStatisticsItemRelListItemVO;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.service.IReportTypeStatisticsItemRelService;
+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 springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 报告类型和统计条目关联关系控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:19
+ */
+@ApiIgnore
+@Api(tags = "报告类型和统计条目关联关系", hidden = true)
+@Validated
+@RestController
+@RequestMapping("reportTypeStatisticsItemRels")
+public class ReportTypeStatisticsItemRelController {
+    @Autowired
+    private IReportTypeStatisticsItemRelService reportTypeStatisticsItemRelService;
+
+    @ApiOperation(value = "创建报告类型和统计条目关联关系")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createReportTypeStatisticsItemRel(
+            @Valid @RequestBody AddReportTypeStatisticsItemRelDTO addReportTypeStatisticsItemRelDTO) {
+        String id = reportTypeStatisticsItemRelService.createReportTypeStatisticsItemRel(addReportTypeStatisticsItemRelDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "报告类型和统计条目关联关系详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseReportTypeStatisticsItemRelItemVO> queryReportTypeStatisticsItemRelDetail(
+            @Valid @RequestBody QueryReportTypeStatisticsItemRelDetailDTO queryReportTypeStatisticsItemRelDetailDTO) {
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = reportTypeStatisticsItemRelService.queryReportTypeStatisticsItemRelDetail(queryReportTypeStatisticsItemRelDetailDTO.getId());
+        ResponseReportTypeStatisticsItemRelItemVO responseReportTypeStatisticsItemRelItemVO = ConvertReportTypeStatisticsItemRelTool.INSTANCE.convert2ResponseItemDTO(reportTypeStatisticsItemRel);
+        return ResultHelper.single(responseReportTypeStatisticsItemRelItemVO);
+    }
+
+
+    @ApiOperation(value = "更新报告类型和统计条目关联关系")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateReportTypeStatisticsItemRel(
+            @Valid @RequestBody UpdateReportTypeStatisticsItemRelDTO updateReportTypeStatisticsItemRelDTO) {
+        reportTypeStatisticsItemRelService.updateReportTypeStatisticsItemRel(updateReportTypeStatisticsItemRelDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateReportTypeStatisticsItemRelDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除报告类型和统计条目关联关系")
+    @PostMapping("/delete")
+    public CommonResult deleteReportTypeStatisticsItemRel(
+            @RequestBody @Valid DeleteReportTypeStatisticsItemRelDTO deleteReportTypeStatisticsItemRelDTO) {
+        reportTypeStatisticsItemRelService.deleteReportTypeStatisticsItemRel(deleteReportTypeStatisticsItemRelDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "报告类型和统计条目关联关系列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseReportTypeStatisticsItemRelListItemVO>> queryReportTypeStatisticsItemRel(
+            @Valid @RequestBody QueryReportTypeStatisticsItemRelDTO queryReportTypeStatisticsItemRelDTO) {
+        List<ReportTypeStatisticsItemRel> reportTypeStatisticsItemRelList = reportTypeStatisticsItemRelService.queryReportTypeStatisticsItemRelList(queryReportTypeStatisticsItemRelDTO);
+        List<ResponseReportTypeStatisticsItemRelListItemVO> resultList = ConvertReportTypeStatisticsItemRelTool.INSTANCE.convert2List(reportTypeStatisticsItemRelList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "报告类型和统计条目关联关系列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseReportTypeStatisticsItemRelListItemVO>> queryReportTypeStatisticsItemRel(
+    //        @Valid @RequestBody PageQueryReportTypeStatisticsItemRelDTO pageQueryReportTypeStatisticsItemRelDTO) {
+    //    IPage<ReportTypeStatisticsItemRel> pagedList = reportTypeStatisticsItemRelService.pageQueryReportTypeStatisticsItemRel(pageQueryReportTypeStatisticsItemRelDTO);
+    //    IPage<ResponseReportTypeStatisticsItemRelListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertReportTypeStatisticsItemRelTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,ReportTypeStatisticsItemRel实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 16 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/dao/ReportTypeStatisticsItemRelMapper.java

@@ -0,0 +1,16 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.dao;
+
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.ReportTypeStatisticsItemRel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 报告类型和统计条目关联关系(ReportTypeStatisticsItemRel)dao层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:21
+ */
+@Mapper
+public interface ReportTypeStatisticsItemRelMapper extends BaseMapper<ReportTypeStatisticsItemRel> {
+
+}

+ 74 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/ConvertReportTypeStatisticsItemRelTool.java

@@ -0,0 +1,74 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model;
+
+import org.mapstruct.*;
+import org.mapstruct.MappingTarget;
+import org.mapstruct.factory.Mappers;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.vo.*;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto.*;
+
+import java.util.List;
+
+/**
+ * 报告类型和统计条目关联关系(ReportTypeStatisticsItemRel) dto、vo、do转换工具类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:23 2021-05-20 19:20:23
+ */
+@Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
+        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
+public interface ConvertReportTypeStatisticsItemRelTool {
+
+    ConvertReportTypeStatisticsItemRelTool INSTANCE = Mappers.getMapper(ConvertReportTypeStatisticsItemRelTool.class);
+
+    /**
+     * do转换为ResponseItemVO
+     *
+     * @param reportTypeStatisticsItemRel do对象
+     * @return ResponseItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:23
+     */
+    ResponseReportTypeStatisticsItemRelItemVO convert2ResponseItemDTO(ReportTypeStatisticsItemRel reportTypeStatisticsItemRel);
+
+    /**
+     * do转换为ResponseListItemVO
+     *
+     * @param reportTypeStatisticsItemRel do对象
+     * @return ResponseListItemVO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:23
+     */
+    ResponseReportTypeStatisticsItemRelListItemVO convert2ResponseListItemDTO(ReportTypeStatisticsItemRel reportTypeStatisticsItemRel);
+
+    /**
+     * do列表转换为ResponseListItemVO列表
+     *
+     * @param reportTypeStatisticsItemRelList do列表
+     * @return ResponseListItemVO列表
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:23
+     */
+    List<ResponseReportTypeStatisticsItemRelListItemVO> convert2List(List<ReportTypeStatisticsItemRel> reportTypeStatisticsItemRelList);
+
+    /**
+     * addDTO转换为do
+     *
+     * @param addReportTypeStatisticsItemRelDTO addDTO
+     * @return 要创建的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:23
+     */
+    ReportTypeStatisticsItemRel convertAddDto2Entity(AddReportTypeStatisticsItemRelDTO addReportTypeStatisticsItemRelDTO);
+
+    /**
+     * updateDTO转换为实体
+     *
+     * @param reportTypeStatisticsItemRel          更新前的do对象
+     * @param updateReportTypeStatisticsItemRelDTO updateDTO
+     * @return 更新后的do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:23
+     */
+    ReportTypeStatisticsItemRel convertUpdateDto2Entity(@MappingTarget ReportTypeStatisticsItemRel reportTypeStatisticsItemRel, UpdateReportTypeStatisticsItemRelDTO updateReportTypeStatisticsItemRelDTO);
+}
+

+ 34 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/ReportTypeStatisticsItemRel.java

@@ -0,0 +1,34 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.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;
+
+/**
+ * 报告类型和统计条目关联关系(ReportTypeStatisticsItemRel)实体类
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:21
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel(description = "报告类型和统计条目关联关系")
+public class ReportTypeStatisticsItemRel extends AuditableEntity<ReportTypeStatisticsItemRel> implements Serializable {
+    private static final long serialVersionUID = -21196831096124914L;
+
+    @ApiModelProperty("报告类型id")
+    private String reportTypeId;
+
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
+
+
+    public static String PROP_REPORT_TYPE_ID = "report_type_id";
+    public static String PROP_STATISTICS_ITEM_ID = "statistics_item_id";
+
+}

+ 27 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/AddReportTypeStatisticsItemRelDTO.java

@@ -0,0 +1,27 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.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-05-20 19:20:21
+ */
+@Data
+@ApiModel(value = "创建报告类型和统计条目关联关系入参")
+public class AddReportTypeStatisticsItemRelDTO {
+    @ApiModelProperty(value = "报告类型id", required = true)
+    @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
+    private String reportTypeId;
+
+    @ApiModelProperty(value = "统计条目id", required = true)
+    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    private String statisticsItemId;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/DeleteReportTypeModelRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:58
+ * @version V1.0 2021-05-20 19:20:23
  */
 @Data
-@ApiModel(value = "删除报告类型和模型关联关系入参")
-public class DeleteReportTypeModelRelDTO {
+@ApiModel(value = "删除报告类型和统计条目关联关系入参")
+public class DeleteReportTypeStatisticsItemRelDTO {
     @NotNull(message = "id不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/PageQueryReportTypeProjectTypeRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,19 +11,19 @@ import lombok.EqualsAndHashCode;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:20:24
+ * @version V1.0 2021-05-20 19:20:23
  */
 @EqualsAndHashCode(callSuper = true)
 @Data
-@ApiModel(value = "分页查询报告类型和项目所属功能类型关联关系入参")
-public class PageQueryReportTypeProjectTypeRelDTO extends PageDTO {
+@ApiModel(value = "分页查询报告类型和统计条目关联关系入参")
+public class PageQueryReportTypeStatisticsItemRelDTO extends PageDTO {
     @ApiModelProperty(value = "主键", required = true)
     private String id;
 
     @ApiModelProperty(value = "报告类型id", required = true)
-    private String configId;
+    private String reportTypeId;
 
-    @ApiModelProperty(value = "项目所属功能类型", required = true)
-    private String functionType;
+    @ApiModelProperty(value = "统计条目id", required = true)
+    private String statisticsItemId;
 
 }

+ 22 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/model/dto/QueryReportTypeStatisticsItemRelDTO.java

@@ -0,0 +1,22 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.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-05-20 19:20:23
+ */
+@Data
+@ApiModel(value = "查询报告类型和统计条目关联关系入参")
+public class QueryReportTypeStatisticsItemRelDTO {
+    @ApiModelProperty(value = "报告类型id", required = true)
+    private String reportTypeId;
+
+    @ApiModelProperty(value = "统计条目id", required = true)
+    private String statisticsItemId;
+
+}

+ 4 - 4
src/main/java/com/persagy/apm/energy/report/config/rel/typemodel/model/dto/QueryReportTypeModelRelDetailDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typemodel.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:19:58
+ * @version V1.0 2021-05-20 19:20:22
  */
 @Data
-@ApiModel(value = "获取报告类型和模型关联关系详情入参")
-public class QueryReportTypeModelRelDetailDTO {
+@ApiModel(value = "获取报告类型和统计条目关联关系详情入参")
+public class QueryReportTypeStatisticsItemRelDetailDTO {
     @NotNull(message = "主键不能为空")
     @ApiModelProperty(value = "主键", required = true)
     private String id;

+ 8 - 8
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/dto/UpdateReportTypeProjectTypeRelDTO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.model.dto;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -11,21 +11,21 @@ import java.util.Date;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:20:24
+ * @version V1.0 2021-05-20 19:20:22
  */
 @Data
-@ApiModel(value = "更新报告类型和项目所属功能类型关联关系入参")
-public class UpdateReportTypeProjectTypeRelDTO {
+@ApiModel(value = "更新报告类型和统计条目关联关系入参")
+public class UpdateReportTypeStatisticsItemRelDTO {
     @ApiModelProperty(value = "主键", required = true)
     @NotNull(message = "主键不能为空") // todo 更新校验规则
     private String id;
 
     @ApiModelProperty(value = "报告类型id", required = true)
     @NotNull(message = "报告类型id不能为空") // todo 更新校验规则
-    private String configId;
+    private String reportTypeId;
 
-    @ApiModelProperty(value = "项目所属功能类型", required = true)
-    @NotNull(message = "项目所属功能类型不能为空") // todo 更新校验规则
-    private String functionType;
+    @ApiModelProperty(value = "统计条目id", required = true)
+    @NotNull(message = "统计条目id不能为空") // todo 更新校验规则
+    private String statisticsItemId;
 
 }

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/vo/ResponseReportTypeProjectTypeRelItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.model.vo;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.vo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,20 +10,20 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:20:24
+ * @version V1.0 2021-05-20 19:20:23
  */
 @Data
-@ApiModel(value = "报告类型和项目所属功能类型关联关系返回结果参数")
+@ApiModel(value = "报告类型和统计条目关联关系返回结果参数")
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportTypeProjectTypeRelItemVO {
+public class ResponseReportTypeStatisticsItemRelItemVO {
     @ApiModelProperty("主键")
     private String id;
 
     @ApiModelProperty("报告类型id")
-    private String configId;
+    private String reportTypeId;
 
-    @ApiModelProperty("项目所属功能类型")
-    private String functionType;
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
 
     @ApiModelProperty("创建人")
     private String creator;

+ 7 - 7
src/main/java/com/persagy/apm/energy/report/config/rel/typeprojecttype/model/vo/ResponseReportTypeProjectTypeRelListItemVO.java

@@ -1,4 +1,4 @@
-package com.persagy.apm.energy.report.config.rel.typeprojecttype.model.vo;
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.vo;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -10,20 +10,20 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 
 /**
  * @author lixing
- * @version V1.0 2021-05-19 11:20:24
+ * @version V1.0 2021-05-20 19:20:23
  */
 @Data
-@ApiModel(value = "报告类型和项目所属功能类型关联关系列表返回结果参数")
+@ApiModel(value = "报告类型和统计条目关联关系列表返回结果参数")
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseReportTypeProjectTypeRelListItemVO {
+public class ResponseReportTypeStatisticsItemRelListItemVO {
     @ApiModelProperty("主键")
     private String id;
 
     @ApiModelProperty("报告类型id")
-    private String configId;
+    private String reportTypeId;
 
-    @ApiModelProperty("项目所属功能类型")
-    private String functionType;
+    @ApiModelProperty("统计条目id")
+    private String statisticsItemId;
 
     @ApiModelProperty("创建人")
     private String creator;

+ 77 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/IReportTypeStatisticsItemRelService.java

@@ -0,0 +1,77 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.service;
+
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.*;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.model.dto.*;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 报告类型和统计条目关联关系(ReportTypeStatisticsItemRel) service接口
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:20
+ */
+public interface IReportTypeStatisticsItemRelService {
+
+    /**
+     * 创建报告类型和统计条目关联关系
+     *
+     * @param addReportTypeStatisticsItemRelDTO addDTO
+     * @return 报告类型和统计条目关联关系主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    String createReportTypeStatisticsItemRel(AddReportTypeStatisticsItemRelDTO addReportTypeStatisticsItemRelDTO);
+
+    /**
+     * 报告类型和统计条目关联关系详情
+     *
+     * @param id 主键
+     * @return 报告类型和统计条目关联关系do对象
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    ReportTypeStatisticsItemRel queryReportTypeStatisticsItemRelDetail(String id);
+
+    /**
+     * 更新报告类型和统计条目关联关系
+     *
+     * @param updateReportTypeStatisticsItemRelDTO updateDTO
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    void updateReportTypeStatisticsItemRel(UpdateReportTypeStatisticsItemRelDTO updateReportTypeStatisticsItemRelDTO);
+
+    /**
+     * 删除报告类型和统计条目关联关系
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    void deleteReportTypeStatisticsItemRel(String id);
+
+    /**
+     * 查询报告类型和统计条目关联关系
+     *
+     * @param queryReportTypeStatisticsItemRelDTO queryDTO
+     * @return List<ReportTypeStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    List<ReportTypeStatisticsItemRel> queryReportTypeStatisticsItemRelList(QueryReportTypeStatisticsItemRelDTO queryReportTypeStatisticsItemRelDTO);
+
+    /**
+     * 分页查询报告类型和统计条目关联关系
+     *
+     * @param pageQueryReportTypeStatisticsItemRelDTO pageQueryDTO
+     * @return IPage<ReportTypeStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    IPage<ReportTypeStatisticsItemRel> pageQueryReportTypeStatisticsItemRel(PageQueryReportTypeStatisticsItemRelDTO pageQueryReportTypeStatisticsItemRelDTO);
+}

+ 199 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/rel/typestatisticsitem/service/impl/ReportTypeStatisticsItemRelServiceImpl.java

@@ -0,0 +1,199 @@
+package com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.service.impl;
+
+import com.persagy.apm.common.context.AppContext;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.dao.ReportTypeStatisticsItemRelMapper;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.service.IReportTypeStatisticsItemRelService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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.config.rel.typestatisticsitem.model.*;
+import com.persagy.apm.energy.report.monthly.config.rel.typestatisticsitem.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;
+
+/**
+ * 报告类型和统计条目关联关系(ReportTypeStatisticsItemRel) service层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:20:20
+ */
+@Service
+public class ReportTypeStatisticsItemRelServiceImpl extends ServiceImpl<ReportTypeStatisticsItemRelMapper, ReportTypeStatisticsItemRel>
+        implements IReportTypeStatisticsItemRelService {
+
+    /**
+     * 创建报告类型和统计条目关联关系
+     *
+     * @return 报告类型和统计条目关联关系主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public String createReportTypeStatisticsItemRel(AddReportTypeStatisticsItemRelDTO addReportTypeStatisticsItemRelDTO) {
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = ConvertReportTypeStatisticsItemRelTool.INSTANCE.convertAddDto2Entity(addReportTypeStatisticsItemRelDTO);
+        // 设置默认值
+        setDefaultValue(reportTypeStatisticsItemRel);
+        save(reportTypeStatisticsItemRel);
+        return reportTypeStatisticsItemRel.getId();
+    }
+
+    /**
+     * 如果某些字段没有赋值,使用默认的值
+     *
+     * @param reportTypeStatisticsItemRel 报告类型和统计条目关联关系实体
+     * @author lixing
+     * @version V1.0 2021/3/12 12:29 下午
+     */
+    private void setDefaultValue(ReportTypeStatisticsItemRel reportTypeStatisticsItemRel) {
+        reportTypeStatisticsItemRel.setCreator(AppContext.getContext().getAccountId());
+        // todo 其他默认的属性
+
+    }
+
+    /**
+     * 报告类型和统计条目关联关系详情
+     *
+     * @param id 主键
+     * @return 部门do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public ReportTypeStatisticsItemRel queryReportTypeStatisticsItemRelDetail(String id) {
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = getById(id);
+        if (reportTypeStatisticsItemRel == null) {
+            throw new IllegalArgumentException("查看ReportTypeStatisticsItemRel详情时发生异常,找不到要查看的记录,id=" + id);
+        }
+        return reportTypeStatisticsItemRel;
+    }
+
+    /**
+     * 更新报告类型和统计条目关联关系
+     *
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public void updateReportTypeStatisticsItemRel(UpdateReportTypeStatisticsItemRelDTO updateReportTypeStatisticsItemRelDTO) {
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = getById(updateReportTypeStatisticsItemRelDTO.getId());
+        reportTypeStatisticsItemRel = ConvertReportTypeStatisticsItemRelTool.INSTANCE.convertUpdateDto2Entity(reportTypeStatisticsItemRel, updateReportTypeStatisticsItemRelDTO);
+        reportTypeStatisticsItemRel.setModifier(AppContext.getContext().getAccountId());
+        updateById(reportTypeStatisticsItemRel);
+    }
+
+    /**
+     * 校验报告类型和统计条目关联关系是否可删除
+     *
+     * @param id 报告类型和统计条目关联关系主键
+     * @return 报告类型和统计条目关联关系do类
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    public ReportTypeStatisticsItemRel checkDeletable(String id) {
+        if (id == null) {
+            throw new IllegalArgumentException("删除ReportTypeStatisticsItemRel时发生异常,主键为空");
+        }
+
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = getById(id);
+
+        if (reportTypeStatisticsItemRel == null) {
+            throw new IllegalArgumentException("删除ReportTypeStatisticsItemRel时发生异常,找不到要删除的数据,id:" + id);
+        }
+
+        return reportTypeStatisticsItemRel;
+    }
+
+    /**
+     * 删除报告类型和统计条目关联关系
+     *
+     * @param id 主键
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public void deleteReportTypeStatisticsItemRel(String id) {
+        // 校验是否可删除
+        ReportTypeStatisticsItemRel reportTypeStatisticsItemRel = checkDeletable(id);
+
+        reportTypeStatisticsItemRel.setValid(ValidEnum.FALSE.getType());
+        updateById(reportTypeStatisticsItemRel);
+    }
+
+    /**
+     * 查询报告类型和统计条目关联关系
+     *
+     * @return List<ReportTypeStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public List<ReportTypeStatisticsItemRel> queryReportTypeStatisticsItemRelList(QueryReportTypeStatisticsItemRelDTO queryReportTypeStatisticsItemRelDTO) {
+        QueryWrapper<ReportTypeStatisticsItemRel> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportTypeStatisticsItemRel.PROP_VALID, ValidEnum.TRUE.getType());
+        // 默认按创建时间倒序排序
+        queryWrapper.orderBy(true, false, ReportTypeStatisticsItemRel.PROP_CREATIONTIME);
+
+        if (queryReportTypeStatisticsItemRelDTO != null) {
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportTypeStatisticsItemRelDTO.getReportTypeId())) {
+                queryWrapper.like(ReportTypeStatisticsItemRel.PROP_REPORT_TYPE_ID, queryReportTypeStatisticsItemRelDTO.getReportTypeId());
+            }
+
+            // todo 需判断使用like还是eq
+            if (StringUtils.isNotEmpty(queryReportTypeStatisticsItemRelDTO.getStatisticsItemId())) {
+                queryWrapper.like(ReportTypeStatisticsItemRel.PROP_STATISTICS_ITEM_ID, queryReportTypeStatisticsItemRelDTO.getStatisticsItemId());
+            }
+
+        }
+
+        return list(queryWrapper);
+    }
+
+    /**
+     * 分页查询报告类型和统计条目关联关系
+     *
+     * @return IPage<ReportTypeStatisticsItemRel>
+     * @author lixing
+     * @version V1.0 2021-05-20 19:20:20
+     */
+    @Override
+    public IPage<ReportTypeStatisticsItemRel> pageQueryReportTypeStatisticsItemRel(PageQueryReportTypeStatisticsItemRelDTO pageQueryReportTypeStatisticsItemRelDTO) {
+        QueryWrapper<ReportTypeStatisticsItemRel> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(ReportTypeStatisticsItemRel.PROP_VALID, ValidEnum.TRUE.getType());
+        // 这里认为pageQueryDTO是经过校验的,肯定包含分页信息
+        IPage<ReportTypeStatisticsItemRel> pageParam = new Page<>(pageQueryReportTypeStatisticsItemRelDTO.getPage(), pageQueryReportTypeStatisticsItemRelDTO.getSize(), true);
+        // 排序信息
+        if (CollectionUtils.isEmpty(pageQueryReportTypeStatisticsItemRelDTO.getOrders())) {
+            // 默认按创建时间倒序排序
+            queryWrapper.orderBy(true, false, ReportTypeStatisticsItemRel.PROP_CREATIONTIME);
+        } else {
+            List<Sort> orders = pageQueryReportTypeStatisticsItemRelDTO.getOrders();
+            for (Sort sort : orders) {
+                // 将驼峰转换为下划线格式
+                sort.setColumn(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sort.getColumn()));
+                queryWrapper.orderBy(true, sort.isAsc(), sort.getColumn());
+            }
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportTypeStatisticsItemRelDTO.getReportTypeId())) {
+            queryWrapper.like(ReportTypeStatisticsItemRel.PROP_REPORT_TYPE_ID, pageQueryReportTypeStatisticsItemRelDTO.getReportTypeId());
+        }
+
+        // todo 需判断使用like还是eq
+        if (StringUtils.isNotEmpty(pageQueryReportTypeStatisticsItemRelDTO.getStatisticsItemId())) {
+            queryWrapper.like(ReportTypeStatisticsItemRel.PROP_STATISTICS_ITEM_ID, pageQueryReportTypeStatisticsItemRelDTO.getStatisticsItemId());
+        }
+
+        return getBaseMapper().selectPage(pageParam, queryWrapper);
+    }
+}

+ 101 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/controller/StatisticItemsController.java

@@ -0,0 +1,101 @@
+package com.persagy.apm.energy.report.monthly.config.statisticsitems.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.config.statisticsitems.model.ConvertStatisticItemsTool;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.dto.*;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.vo.ResponseStatisticItemsItemVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.vo.ResponseStatisticItemsListItemVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.service.IStatisticItemsService;
+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 springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 统计条目控制层
+ *
+ * @author lixing
+ * @version V1.0 2021-05-20 19:21:08
+ */
+@ApiIgnore
+@Api(tags = "统计条目", hidden = true)
+@Validated
+@RestController
+@RequestMapping("statisticItemss")
+public class StatisticItemsController {
+    @Autowired
+    private IStatisticItemsService statisticItemsService;
+
+    @ApiOperation(value = "创建统计条目")
+    @PostMapping("/create")
+    public CommonResult<ApmResponseUpsertVO> createStatisticItems(
+            @Valid @RequestBody AddStatisticItemsDTO addStatisticItemsDTO) {
+        String id = statisticItemsService.createStatisticItems(addStatisticItemsDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(id));
+    }
+
+    @ApiOperation(value = "统计条目详情")
+    @PostMapping("/get")
+    public CommonResult<ResponseStatisticItemsItemVO> queryStatisticItemsDetail(
+            @Valid @RequestBody QueryStatisticItemsDetailDTO queryStatisticItemsDetailDTO) {
+        StatisticItems statisticItems = statisticItemsService.queryStatisticItemsDetail(queryStatisticItemsDetailDTO.getId());
+        ResponseStatisticItemsItemVO responseStatisticItemsItemVO = ConvertStatisticItemsTool.INSTANCE.convert2ResponseItemDTO(statisticItems);
+        return ResultHelper.single(responseStatisticItemsItemVO);
+    }
+
+
+    @ApiOperation(value = "更新统计条目")
+    @PostMapping("/update")
+    public CommonResult<ApmResponseUpsertVO> updateStatisticItems(
+            @Valid @RequestBody UpdateStatisticItemsDTO updateStatisticItemsDTO) {
+        statisticItemsService.updateStatisticItems(updateStatisticItemsDTO);
+        return ResultHelper.single(new ApmResponseUpsertVO(updateStatisticItemsDTO.getId()));
+    }
+
+
+    @ApiOperation(value = "删除统计条目")
+    @PostMapping("/delete")
+    public CommonResult deleteStatisticItems(
+            @RequestBody @Valid DeleteStatisticItemsDTO deleteStatisticItemsDTO) {
+        statisticItemsService.deleteStatisticItems(deleteStatisticItemsDTO.getId());
+        return ResultHelper.success();
+    }
+
+
+    @ApiOperation(value = "统计条目列表")
+    @PostMapping("/query")
+    public CommonResult<PageList<ResponseStatisticItemsListItemVO>> queryStatisticItems(
+            @Valid @RequestBody QueryStatisticItemsDTO queryStatisticItemsDTO) {
+        List<StatisticItems> statisticItemsList = statisticItemsService.queryStatisticItemsList(queryStatisticItemsDTO);
+        List<ResponseStatisticItemsListItemVO> resultList = ConvertStatisticItemsTool.INSTANCE.convert2List(statisticItemsList);
+        return ResultHelper.multi(resultList);
+    }
+
+    //@ApiOperation(value = "统计条目列表, 分页查询")
+    //@PostMapping("/query")
+    //public CommonResult<PageList<ResponseStatisticItemsListItemVO>> queryStatisticItems(
+    //        @Valid @RequestBody PageQueryStatisticItemsDTO pageQueryStatisticItemsDTO) {
+    //    IPage<StatisticItems> pagedList = statisticItemsService.pageQueryStatisticItems(pageQueryStatisticItemsDTO);
+    //    IPage<ResponseStatisticItemsListItemVO> pagedResultList = pagedList.convert(item -> {
+    //        try {
+    //           return ConvertStatisticItemsTool.INSTANCE.convert2ResponseListItemDTO(item);
+    //        } catch (Exception e) {
+    //            throw new IllegalArgumentException("分页查询,StatisticItems实体类转换为列表对象发生异常", e);
+    //        }
+    //    });
+    //    return ResultHelper.multi(pagedResultList);
+    //}
+}
+

+ 0 - 0
src/main/java/com/persagy/apm/energy/report/monthly/config/statisticsitems/dao/StatisticItemsMapper.java


Some files were not shown because too many files changed in this diff