Browse Source

获取工单、数据质量和环境数据逻辑调整

wangchenghong 3 years ago
parent
commit
c94a0dcaeb

+ 5 - 0
pom.xml

@@ -96,6 +96,11 @@
         </dependency>
 
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>com.persagy</groupId>
             <artifactId>apm-mybatis</artifactId>
             <exclusions>

+ 32 - 0
src/main/java/com/persagy/apm/energy/report/common/dto/QueryPlatformParamDTO.java

@@ -0,0 +1,32 @@
+package com.persagy.apm.energy.report.common.dto;
+
+import com.persagy.apm.common.model.dto.PoemsFeignBaseDTO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@ApiModel
+public class QueryPlatformParamDTO extends PoemsFeignBaseDTO {
+
+    @ApiModelProperty("用户id")
+    private String userId;
+
+    @ApiModelProperty("集团编码")
+    private String groupCode;
+
+    @ApiModelProperty("项目id列表")
+    private List<String> projectIdList;
+
+    @ApiModelProperty("生成报告时间")
+    private Date reportDate;
+
+    @ApiModelProperty("报告所属类型")
+    private String belongType;
+
+}

+ 4 - 5
src/main/java/com/persagy/apm/energy/report/common/service/CommonService.java

@@ -1,6 +1,6 @@
 package com.persagy.apm.energy.report.common.service;
 
-import com.persagy.apm.energy.report.common.dto.QueryAreaPlatformParamDTO;
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
 import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
 import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
 import io.swagger.annotations.Api;
@@ -11,7 +11,6 @@ import java.util.List;
 public interface CommonService {
 
     /**
-     *
      * @param pjIdList 项目id列表
      * @return
      */
@@ -20,10 +19,10 @@ public interface CommonService {
     /**
      * 根据配置条目信息获取能耗管理平台运维数据
      *
-     * @param statisticItems 条目信息
-     * @param queryAreaPlatformParamDTO 查询条件对象
+     * @param statisticItems        条目信息
+     * @param queryPlatformParamDTO 查询条件对象
      * @return 能耗管理平台运维数据
      */
-    Platform getPlatform(StatisticItems statisticItems, QueryAreaPlatformParamDTO queryAreaPlatformParamDTO);
+    Platform getPlatform(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO);
 
 }

+ 17 - 0
src/main/java/com/persagy/apm/energy/report/common/service/PlatformService.java

@@ -0,0 +1,17 @@
+package com.persagy.apm.energy.report.common.service;
+
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import io.swagger.annotations.Api;
+
+import java.util.List;
+
+@Api(value = "platform能源平台管理service接口")
+public interface PlatformService {
+
+    List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO);
+
+    PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO);
+
+}

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

@@ -0,0 +1,111 @@
+package com.persagy.apm.energy.report.common.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
+import com.persagy.apm.energy.report.common.service.CommonService;
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
+import com.persagy.apm.energy.report.common.utils.DateUtils;
+import com.persagy.apm.energy.report.common.utils.HttpUtils;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service("bianSunRateDataAnalysisWebService")
+public class BianSunDataAnalysisPlatformServiceImpl implements PlatformService {
+    @Value("${iot.data.analysis.url}")
+    private String iotDataAnalysisUrl;
+
+    @Resource
+    private CommonService commonService;
+
+    public final static String SUCCESS = "success";
+
+    @Override
+    public List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || org.springframework.util.CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new ArrayList<>();
+        }
+        String pjId = queryPlatformParamDTO.getProjectIdList().get(0);
+        TreeMap<Date, Double> date_rateMap = new TreeMap<>();
+        Date reportDate = queryPlatformParamDTO.getReportDate();
+        Date startDate = DateUtils.getFirstDayOfYear(reportDate);
+        while (startDate.before(DateUtils.getMonthOff(reportDate, 1))) {
+            date_rateMap.put(startDate, getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, startDate));
+            startDate = DateUtils.getMonthOff(startDate, 1);
+        }
+        List<Double> bianSunMonthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return bianSunMonthlySummaries;
+    }
+
+    private Double getBianSunRate(String userId, String groupCode, String projectId, Date reportDate) {
+        Double bianSunRate = null;
+        try {
+            JSONObject paramObject = new JSONObject();
+            paramObject.put("userId", userId);
+            paramObject.put("groupCode", groupCode);
+            List<String> pjIdList = new ArrayList<>();
+            pjIdList.add(projectId);
+            paramObject.put("projectIdList", pjIdList.toString());
+            Date startTime = DateUtils.getStartTimeOfDay(reportDate);
+            Date endTime = DateUtils.getMonthOff(startTime, 1);
+            paramObject.put("alarmStartTime", startTime);
+            paramObject.put("alarmEndTime", endTime);
+            String url = iotDataAnalysisUrl + "/alarm/show/view/queryList";
+            String response = HttpUtils.postJson(url, paramObject.toString());
+            JSONObject responseObject = JSONObject.parseObject(response);
+            if (SUCCESS.equals(responseObject.getString("respMsg"))) {
+                List<Map> content = (List<Map>) responseObject.get("content");
+                if (CollectionUtils.isNotEmpty(content)) {
+                    Map data = content.get(0);
+                    bianSunRate = DataUtils.parseDouble(data.get("bianSunRate"));
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return bianSunRate;
+    }
+
+    @Override
+    public PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || org.springframework.util.CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new PlatformAreaInfoVO();
+        }
+        // 合格标准
+        String standardValueStr = statisticItems.getStandardValue();
+        Double standardValue = DataUtils.parseDouble(standardValueStr);
+        // 校验规则
+        String qualifyFormula = statisticItems.getQualifyFormula();
+        // 达标数量
+        Integer satisfiedCount = 0;
+        // 未达标数量
+        Integer unsatisfiedCount = 0;
+        // 未达标项目id列表
+        List<String> unsatisfiedPjIdList = new ArrayList<>();
+        for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
+            Double bianSunRate = getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, queryPlatformParamDTO.getReportDate());
+            if (null != bianSunRate && null != standardValue) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, bianSunRate) == 0.0) {
+                    unsatisfiedCount++;
+                    unsatisfiedPjIdList.add(pjId);
+                } else {
+                    satisfiedCount++;
+                }
+            }
+        }
+        // 根据未达标项目id列表获取不达标项目名称
+        List<String> unsatisfiedPjNameList = commonService.getPjNameByPjId(unsatisfiedPjIdList);
+        PlatformAreaInfoVO platformAreaInfoVO = new PlatformAreaInfoVO();
+        platformAreaInfoVO.setSatisfiedCount(satisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedCount(unsatisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedProjects(unsatisfiedPjNameList);
+        return platformAreaInfoVO;
+    }
+}

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

@@ -3,9 +3,14 @@ package com.persagy.apm.energy.report.common.service.impl;
 import com.persagy.apm.common.model.dto.PoemsPuser;
 import com.persagy.apm.common.response.PoemsFeignResponse;
 import com.persagy.apm.energy.report.common.DataConstants;
-import com.persagy.apm.energy.report.common.dto.QueryAreaPlatformParamDTO;
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
 import com.persagy.apm.energy.report.common.service.CommonService;
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
+import com.persagy.apm.energy.report.common.utils.SpringContextHolder;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
 import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import com.persagy.apm.energy.report.monthly.config.type.constant.enums.BelongTypeEnum;
 import com.persagy.apm.energy.report.monthly.detail.business.model.Platform;
 import com.persagy.apm.energy.report.saasweb.model.dto.QueryProjectDTO;
 import com.persagy.apm.energy.report.saasweb.model.vo.PoemsProjectVO;
@@ -25,6 +30,9 @@ public class CommonServiceImpl implements CommonService {
     @Autowired
     SaasWebClientWrapper saasWebClientWrapper;
 
+    @Autowired
+    SpringContextHolder holder;
+
     @Override
     public List<String> getPjNameByPjId(List<String> pjIdList) {
         if (CollectionUtils.isEmpty(pjIdList)) {
@@ -52,8 +60,28 @@ public class CommonServiceImpl implements CommonService {
     }
 
     @Override
-    public Platform getPlatform(StatisticItems statisticItems, QueryAreaPlatformParamDTO queryAreaPlatformParamDTO) {
-        String serviceName = "I" + statisticItems.getItemCode() + statisticItems.getItemSource() + "WebService";
-        return null;
+    public Platform getPlatform(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO) {
+        String serviceName = statisticItems.getItemCode() + statisticItems.getItemSource() + "WebService";
+        PlatformService platformService = holder.getPlatformService(serviceName);
+        Platform platform = new Platform();
+        platform.setItemCode(statisticItems.getItemCode());
+        // TODO 条目名称赋值
+        platform.setModelName("");
+        if (queryPlatformParamDTO.getBelongType().equals(BelongTypeEnum.PROJECT.getType())) {
+            platform.setMonthlySummaries(platformService.getPjPlatformRate(queryPlatformParamDTO));
+        } else if (queryPlatformParamDTO.getBelongType().equals(BelongTypeEnum.AREA.getType())) {
+            // 合格标准
+            String standardValueStr = statisticItems.getStandardValue();
+            Double standardValue = DataUtils.parseDouble(standardValueStr);
+            platform.setStandardValue(standardValue);
+            platform.setQualifyFormula(statisticItems.getQualifyFormula());
+            PlatformAreaInfoVO platformAreaInfoVO = platformService.getAreaPlatformRate(statisticItems, queryPlatformParamDTO);
+            if (null != platformAreaInfoVO) {
+                platform.setSatisfiedCount(platformAreaInfoVO.getSatisfiedCount());
+                platform.setUnsatisfiedCount(platformAreaInfoVO.getUnsatisfiedCount());
+                platform.setUnsatisfiedProjects(platformAreaInfoVO.getUnsatisfiedProjects());
+            }
+        }
+        return platform;
     }
 }

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

@@ -0,0 +1,109 @@
+package com.persagy.apm.energy.report.common.service.impl;
+
+import com.persagy.apm.common.response.PoemsFeignResponse;
+import com.persagy.apm.energy.report.common.DataConstants;
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
+import com.persagy.apm.energy.report.common.service.CommonService;
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
+import com.persagy.apm.energy.report.common.utils.DateUtils;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
+import com.persagy.apm.energy.report.environment.model.dto.QueryEnvListByParamDTO;
+import com.persagy.apm.energy.report.environment.model.vo.EnvAvgRateVO;
+import com.persagy.apm.energy.report.environment.service.impl.EnvironmentWebClientWrapper;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+@Service("TemperatureRateEnvironmentWebService")
+public class EnvironmentPlatformServiceImpl implements PlatformService {
+
+    @Autowired
+    private EnvironmentWebClientWrapper environmentWebClientWrapper;
+    @Resource
+    private CommonService commonService;
+
+    @Override
+    public List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new ArrayList<>();
+        }
+        String pjId = queryPlatformParamDTO.getProjectIdList().get(0);
+        TreeMap<Date, Double> date_rateMap = new TreeMap<>();
+        Date reportDate = queryPlatformParamDTO.getReportDate();
+        Date startDate = DateUtils.getFirstDayOfYear(reportDate);
+        while (startDate.before(DateUtils.getMonthOff(reportDate, 1))) {
+            date_rateMap.put(startDate, getEnvAvgRate(pjId, startDate));
+            startDate = DateUtils.getMonthOff(startDate, 1);
+        }
+        List<Double> monthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return monthlySummaries;
+    }
+
+    private Double getEnvAvgRate(String pjId, Date reportDate) {
+        Double avgRate = null;
+        try {
+            QueryEnvListByParamDTO paramDTO = new QueryEnvListByParamDTO();
+            paramDTO.setProjectId(pjId);
+            paramDTO.setEnvTypeId(DataConstants.ENV_TYPE_ID);
+            paramDTO.setEnvParentTypeId(DataConstants.ENV_PARENT_TYPE_ID);
+            paramDTO.setStartTime(DateUtils.date2Str(reportDate, DateUtils.SDF_SECOND));
+            paramDTO.setEndTime(DateUtils.date2Str(DateUtils.getMonthOff(reportDate, 1), DateUtils.SDF_SECOND));
+            PoemsFeignResponse<EnvAvgRateVO> response = environmentWebClientWrapper.listWorkOrderByParam(paramDTO);
+            List<EnvAvgRateVO> envAvgRateVOList = response.getContent();
+            if (!CollectionUtils.isEmpty(envAvgRateVOList)) {
+                EnvAvgRateVO envAvgRateVO = envAvgRateVOList.get(0);
+                if (null != envAvgRateVO) {
+                    return envAvgRateVO.getAvgNum();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return avgRate;
+    }
+
+    @Override
+    public PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new PlatformAreaInfoVO();
+        }
+        // 合格标准
+        String standardValueStr = statisticItems.getStandardValue();
+        Double standardValue = DataUtils.parseDouble(standardValueStr);
+        // 校验规则
+        String qualifyFormula = statisticItems.getQualifyFormula();
+        // 达标数量
+        Integer satisfiedCount = 0;
+        // 未达标数量
+        Integer unsatisfiedCount = 0;
+        // 未达标项目id列表
+        List<String> unsatisfiedPjIdList = new ArrayList<>();
+        for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
+            Double completeRate = getEnvAvgRate(pjId, queryPlatformParamDTO.getReportDate());
+            if (null != completeRate && null != standardValue) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, completeRate) == 0.0) {
+                    unsatisfiedCount++;
+                    unsatisfiedPjIdList.add(pjId);
+                } else {
+                    satisfiedCount++;
+                }
+            }
+        }
+        // 根据未达标项目id列表获取不达标项目名称
+        List<String> pjNameList = commonService.getPjNameByPjId(unsatisfiedPjIdList);
+        PlatformAreaInfoVO platformAreaInfoVO = new PlatformAreaInfoVO();
+        platformAreaInfoVO.setSatisfiedCount(satisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedCount(unsatisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedProjects(pjNameList);
+        return platformAreaInfoVO;
+    }
+}

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

@@ -0,0 +1,145 @@
+package com.persagy.apm.energy.report.common.service.impl;
+
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
+import com.persagy.apm.energy.report.common.service.CommonService;
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
+import com.persagy.apm.energy.report.common.utils.DateUtils;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import com.persagy.apm.energy.report.workorder.model.WorkOrder;
+import com.persagy.apm.energy.report.workorder.repository.WorkOrderRepository;
+import org.apache.commons.lang.StringUtils;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
+@Service("OrderCompleteRateWorkOrderWebService")
+public class WorkOrderPlatformServiceImpl implements PlatformService {
+
+    @Resource
+    private CommonService commonService;
+    @Autowired
+    private WorkOrderRepository workOrderRepository;
+
+    @Override
+    public List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new ArrayList<>();
+        }
+        String pjId = queryPlatformParamDTO.getProjectIdList().get(0);
+        TreeMap<Date, Double> date_rateMap = new TreeMap<>();
+        Date reportDate = queryPlatformParamDTO.getReportDate();
+        Date startDate = DateUtils.getFirstDayOfYear(reportDate);
+        while (startDate.before(DateUtils.getMonthOff(reportDate, 1))) {
+            date_rateMap.put(startDate, getWorkOrderCompleteRate(pjId, startDate));
+            startDate = DateUtils.getMonthOff(startDate, 1);
+        }
+        List<Double> monthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return monthlySummaries;
+    }
+
+    private Double getWorkOrderCompleteRate(String projectId, Date reportDate) {
+        Double completeRate = null;
+        try {
+            Integer workCount = getWorkOrderNumByParam(projectId, reportDate, "ask_end_time");
+            Integer dealCount = getWorkOrderNumByParam(projectId, reportDate, "create_time");
+            if (null != workCount && workCount != 0) {
+                completeRate = Double.valueOf(dealCount) / workCount * 100;
+            }
+            return completeRate;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return completeRate;
+    }
+
+    private Integer getWorkOrderNumByParam(String projectId, Date reportDate, String timeType) {
+        try {
+            String startTime = DateUtils.date2Str(reportDate, DateUtils.SDFSECOND);
+            String endTime = DateUtils.date2Str(DateUtils.getMonthOff(reportDate, 1), DateUtils.SDFSECOND);
+            BoolQueryBuilder queryOrderNumBuilder = createQueryParam(projectId, timeType, startTime, endTime);
+            NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder();
+            nativeSearchQueryBuilder.withQuery(queryOrderNumBuilder);
+            NativeSearchQuery query = nativeSearchQueryBuilder.build();
+            Page<WorkOrder> resultList = workOrderRepository.search(query);
+            if (null != resultList) {
+                return resultList.getSize();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    private BoolQueryBuilder createQueryParam(String pjId, String timeType, String startTime, String endTime) {
+        BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
+        queryBuilder.must(QueryBuilders.matchQuery("project_id", pjId));
+        //时间查询
+        if (StringUtils.isNotBlank(timeType)) {
+            if (StringUtils.isNotBlank(startTime)) {
+                if ("create_time".equals(timeType)) {
+                    queryBuilder.must(QueryBuilders.rangeQuery("create_time").gte(startTime));
+                } else if ("ask_end_time".equals(timeType)) {
+                    queryBuilder.must(QueryBuilders.rangeQuery("ask_end_time").gte(startTime));
+                }
+            }
+            if (StringUtils.isNotBlank(endTime)) {
+                if ("create_time".equals(timeType)) {
+                    queryBuilder.must(QueryBuilders.rangeQuery("create_time").lt(endTime));
+                } else if ("ask_end_time".equals(timeType)) {
+                    queryBuilder.must(QueryBuilders.rangeQuery("ask_end_time").lt(endTime));
+                }
+            }
+        }
+        return queryBuilder;
+    }
+
+    @Override
+    public PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new PlatformAreaInfoVO();
+        }
+        // 合格标准
+        String standardValueStr = statisticItems.getStandardValue();
+        Double standardValue = DataUtils.parseDouble(standardValueStr);
+        // 校验规则
+        String qualifyFormula = statisticItems.getQualifyFormula();
+        // 达标数量
+        Integer satisfiedCount = 0;
+        // 未达标数量
+        Integer unsatisfiedCount = 0;
+        // 未达标项目id列表
+        List<String> unsatisfiedPjIdList = new ArrayList<>();
+        for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
+            Double completeRate = getWorkOrderCompleteRate(pjId, queryPlatformParamDTO.getReportDate());
+            if (null != completeRate && null != standardValue) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, completeRate) == 0.0) {
+                    unsatisfiedCount++;
+                    unsatisfiedPjIdList.add(pjId);
+                } else {
+                    satisfiedCount++;
+                }
+            }
+        }
+        // 根据未达标项目id列表获取不达标项目名称
+        List<String> pjNameList = commonService.getPjNameByPjId(unsatisfiedPjIdList);
+        PlatformAreaInfoVO platformAreaInfoVO = new PlatformAreaInfoVO();
+        platformAreaInfoVO.setSatisfiedCount(satisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedCount(unsatisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedProjects(pjNameList);
+        return platformAreaInfoVO;
+    }
+}

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

@@ -0,0 +1,111 @@
+package com.persagy.apm.energy.report.common.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.persagy.apm.energy.report.common.dto.QueryPlatformParamDTO;
+import com.persagy.apm.energy.report.common.service.CommonService;
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import com.persagy.apm.energy.report.common.utils.DataUtils;
+import com.persagy.apm.energy.report.common.utils.DateUtils;
+import com.persagy.apm.energy.report.common.utils.HttpUtils;
+import com.persagy.apm.energy.report.common.vo.PlatformAreaInfoVO;
+import com.persagy.apm.energy.report.monthly.config.statisticsitems.model.StatisticItems;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service("zongZhiRateDataAnalysisWebService")
+public class ZongZhiDataAnalysisPlatformServiceImpl implements PlatformService {
+    @Value("${iot.data.analysis.url}")
+    private String iotDataAnalysisUrl;
+
+    @Resource
+    private CommonService commonService;
+
+    public final static String SUCCESS = "success";
+
+    @Override
+    public List<Double> getPjPlatformRate(QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || org.springframework.util.CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new ArrayList<>();
+        }
+        String pjId = queryPlatformParamDTO.getProjectIdList().get(0);
+        TreeMap<Date, Double> date_rateMap = new TreeMap<>();
+        Date reportDate = queryPlatformParamDTO.getReportDate();
+        Date startDate = DateUtils.getFirstDayOfYear(reportDate);
+        while (startDate.before(DateUtils.getMonthOff(reportDate, 1))) {
+            date_rateMap.put(startDate, getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, startDate));
+            startDate = DateUtils.getMonthOff(startDate, 1);
+        }
+        List<Double> bianSunMonthlySummaries = date_rateMap.values().stream().collect(Collectors.toList());
+        return bianSunMonthlySummaries;
+    }
+
+    private Double getBianSunRate(String userId, String groupCode, String projectId, Date reportDate) {
+        Double bianSunRate = null;
+        try {
+            JSONObject paramObject = new JSONObject();
+            paramObject.put("userId", userId);
+            paramObject.put("groupCode", groupCode);
+            List<String> pjIdList = new ArrayList<>();
+            pjIdList.add(projectId);
+            paramObject.put("projectIdList", pjIdList.toString());
+            Date startTime = DateUtils.getStartTimeOfDay(reportDate);
+            Date endTime = DateUtils.getMonthOff(startTime, 1);
+            paramObject.put("alarmStartTime", startTime);
+            paramObject.put("alarmEndTime", endTime);
+            String url = iotDataAnalysisUrl + "/alarm/show/view/queryList";
+            String response = HttpUtils.postJson(url, paramObject.toString());
+            JSONObject responseObject = JSONObject.parseObject(response);
+            if (SUCCESS.equals(responseObject.getString("respMsg"))) {
+                List<Map> content = (List<Map>) responseObject.get("content");
+                if (CollectionUtils.isNotEmpty(content)) {
+                    Map data = content.get(0);
+                    bianSunRate = DataUtils.parseDouble(data.get("zongZhiRate"));
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return bianSunRate;
+    }
+
+    @Override
+    public PlatformAreaInfoVO getAreaPlatformRate(StatisticItems statisticItems, QueryPlatformParamDTO queryPlatformParamDTO) {
+        if (null == queryPlatformParamDTO || org.springframework.util.CollectionUtils.isEmpty(queryPlatformParamDTO.getProjectIdList()) || null == queryPlatformParamDTO.getReportDate()) {
+            return new PlatformAreaInfoVO();
+        }
+        // 合格标准
+        String standardValueStr = statisticItems.getStandardValue();
+        Double standardValue = DataUtils.parseDouble(standardValueStr);
+        // 校验规则
+        String qualifyFormula = statisticItems.getQualifyFormula();
+        // 达标数量
+        Integer satisfiedCount = 0;
+        // 未达标数量
+        Integer unsatisfiedCount = 0;
+        // 未达标项目id列表
+        List<String> unsatisfiedPjIdList = new ArrayList<>();
+        for (String pjId : queryPlatformParamDTO.getProjectIdList()) {
+            Double bianSunRate = getBianSunRate(queryPlatformParamDTO.getUserId(), queryPlatformParamDTO.getGroupCode(), pjId, queryPlatformParamDTO.getReportDate());
+            if (null != bianSunRate && null != standardValue) {
+                if (DataUtils.getQualifyResult(standardValue, qualifyFormula, bianSunRate) == 0.0) {
+                    unsatisfiedCount++;
+                    unsatisfiedPjIdList.add(pjId);
+                } else {
+                    satisfiedCount++;
+                }
+            }
+        }
+        // 根据未达标项目id列表获取不达标项目名称
+        List<String> unsatisfiedPjNameList = commonService.getPjNameByPjId(unsatisfiedPjIdList);
+        PlatformAreaInfoVO platformAreaInfoVO = new PlatformAreaInfoVO();
+        platformAreaInfoVO.setSatisfiedCount(satisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedCount(unsatisfiedCount);
+        platformAreaInfoVO.setUnsatisfiedProjects(unsatisfiedPjNameList);
+        return platformAreaInfoVO;
+    }
+}

+ 14 - 0
src/main/java/com/persagy/apm/energy/report/common/utils/SpringContextHolder.java

@@ -0,0 +1,14 @@
+package com.persagy.apm.energy.report.common.utils;
+
+import com.persagy.apm.energy.report.common.service.PlatformService;
+import org.springframework.context.support.ApplicationObjectSupport;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SpringContextHolder extends ApplicationObjectSupport {
+
+    public PlatformService getPlatformService(String beanName) {
+        return super.getApplicationContext().getBean(beanName, PlatformService.class);
+    }
+
+}

+ 20 - 0
src/main/java/com/persagy/apm/energy/report/common/vo/PlatformAreaInfoVO.java

@@ -0,0 +1,20 @@
+package com.persagy.apm.energy.report.common.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@ApiModel
+@Data
+public class PlatformAreaInfoVO {
+    @ApiModelProperty("达标数量")
+    private Integer satisfiedCount;
+
+    @ApiModelProperty("未达标数量")
+    private Integer unsatisfiedCount;
+
+    @ApiModelProperty("未达标项目名称")
+    private List<String> unsatisfiedProjects;
+}

+ 531 - 0
src/main/java/com/persagy/apm/energy/report/workorder/model/WorkOrder.java

@@ -0,0 +1,531 @@
+package com.persagy.apm.energy.report.workorder.model;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.elasticsearch.annotations.Document;
+import org.springframework.data.elasticsearch.annotations.Field;
+import org.springframework.data.elasticsearch.annotations.FieldType;
+
+import java.util.List;
+import java.util.Set;
+
+@Document(indexName = "work_order", type = "work_order")
+public class WorkOrder {
+    //工单id
+    @Id
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "order_id", alternateNames = {"order_id", "orderId"})
+    private String orderId;
+    //工单名称
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "wo_name", alternateNames = {"wo_name", "woName"})
+    private String woName;
+    //工单概述,保存工单时将事项名称连接起来的字符串,用"、"隔开
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "summary", alternateNames = {"summary"})
+    private String summary;
+    //项目id
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "project_id", alternateNames = {"project_id"})
+    private String projectId;
+    //工单状态 2-抢单中 3-指派中 4-未开始 5-执行中 6-审核中 7-延期完成 8-正常完成 9-异常结束 10-已删除
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "order_state", alternateNames = {"order_state"})
+    private String orderState;
+    //工作类型 1-维保 2-维修 3-巡检 4-运行
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "work_type", alternateNames = {"work_type"})
+    private String workType;
+    //工单类型,FM配置->工单配置中的工单类型
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "order_type", alternateNames = {"order_type"})
+    private String orderType;
+    //时间类型 temp-临时、plan-计划
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "execute_type", alternateNames = {"execute_type"})
+    private String executeType;
+    //工单来源类型,1-正常创建 2-工单计划 3-报修转工单
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "order_from_type", alternateNames = {"order_from_type"})
+    private String orderFromType;
+    //工单来源id,工单计划id或者报修id
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "order_from_id", alternateNames = {"order_from_id"})
+    private String orderFromId;
+    //创建人id
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "creator_id", alternateNames = {"creator_id"})
+    private String creatorId;
+    //专业过滤
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "domain_requires", alternateNames = {"domain_requires"})
+    private List<String> domainRequires;
+    //创建时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "create_time", alternateNames = {"create_time"})
+    private String createTime;
+    //创建时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "create_time_year", alternateNames = {"create_time_year"})
+    private String createTimeYear;
+    //创建时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "create_time_month", alternateNames = {"create_time_month"})
+    private String createTimeMonth;
+    //创建时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "create_time_day", alternateNames = {"create_time_day"})
+    private String createTimeDay;
+    //创建时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "create_time_hour", alternateNames = {"create_time_hour"})
+    private String createTimeHour;
+    //要求结束时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "ask_end_time", alternateNames = {"ask_end_time"})
+    private String askEndTime;
+    //要求结束时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "ask_end_time_year", alternateNames = {"ask_end_time_year"})
+    private String askEndTimeYear;
+    //要求结束时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "ask_end_time_month", alternateNames = {"ask_end_time_month"})
+    private String askEndTimeMonth;
+    //要求结束时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "ask_end_time_day", alternateNames = {"ask_end_time_day"})
+    private String askEndTimeDay;
+    //要求结束时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "ask_end_time_hour", alternateNames = {"ask_end_time_hour"})
+    private String askEndTimeHour;
+    //实际完成时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "real_finish_time", alternateNames = {"real_finish_time"})
+    private String realFinishTime;
+    //实际完成时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "real_finish_time_year", alternateNames = {"real_finish_time_year"})
+    private String realFinishTimeYear;
+    //实际完成时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "real_finish_time_month", alternateNames = {"real_finish_time_month"})
+    private String realFinishTimeMonth;
+    //实际完成时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "real_finish_time_day", alternateNames = {"real_finish_time_day"})
+    private String realFinishTimeDay;
+    //实际完成时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "real_finish_time_hour", alternateNames = {"real_finish_time_hour"})
+    private String realFinishTimeHour;
+    //关闭时间,yyyyMMddhhmmss
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "close_time", alternateNames = {"close_time"})
+    private String closeTime;
+    //所需工具名称数组
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "required_tools", alternateNames = {"required_tools"})
+    private Set<String> requiredTools;
+    //所需物料
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "required_material", alternateNames = {"required_material"})
+    private Set<String> requiredMaterial;
+    //是否抢单 true-是 false-否
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "robbing_flag", alternateNames = {"robbing_flag"})
+    private boolean robbingFlag;
+    //是否申请延期 true-是 false-否
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "applyDelay_flag", alternateNames = {"applyDelay_flag"})
+    private boolean applyDelayFlag;
+    //是否申请换人 true-是 false-否
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "applyReplacePeople_flag", alternateNames = {"applyReplacePeople_flag"})
+    private boolean applyReplacePeopleFlag;
+    //是否申请加人 true-是 false-否
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "applyAddPeople_flag", alternateNames = {"applyAddPeople_flag"})
+    private boolean applyAddPeopleFlag;
+    //是否抢单转派单 true-是 false-否
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "robbingToAssign_flag", alternateNames = {"robbingToAssign_flag", "robbingToAssignFlag"})
+    private boolean robbingToAssignFlag;
+    //工单相关对象id
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "obj_ids", alternateNames = {"obj_ids", "objIds"})
+    private Set<String> objIds;
+    //工单相关对象大类id
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "obj_class_ids", alternateNames = {"obj_class_ids", "objClassIds"})
+    private Set<String> objClassIds;
+    //执行人id(路由表中已接单的执行人)
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "executor", alternateNames = {"executor", "executor"})
+    private Set<String> executor;
+    //参与人id(路由表中已接单的人)
+    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", fielddata = true)
+    @JSONField(name = "participant_ids", alternateNames = {"participant_ids", "participantIds"})
+    private Set<String> participantIds;
+    //漏检对象个数
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "undetected_obj_count", alternateNames = {"undetected_obj_count", "undetectedObjCount"})
+    private String undetectedObjCount;
+    //漏检对象个数
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "complete_obj_count", alternateNames = {"complete_obj_count", "completeObjCount"})
+    private String completeObjCount;
+    //有无异常,0-无异常,1-有异常
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "info_point_flag", alternateNames = {"info_point_flag", "infoPointFlag"})
+    private String infoPointFlag;
+    //有无漏检,0-无漏检,1-有漏检
+    @Field(type = FieldType.Keyword, store = true)
+    @JSONField(name = "missed_detection_flag", alternateNames = {"missed_detection_flag", "missedDetectionFlag"})
+    private String missedDetectionFlag;
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getWoName() {
+        return woName;
+    }
+
+    public void setWoName(String woName) {
+        this.woName = woName;
+    }
+
+    public String getSummary() {
+        return summary;
+    }
+
+    public void setSummary(String summary) {
+        this.summary = summary;
+    }
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getOrderState() {
+        return orderState;
+    }
+
+    public void setOrderState(String orderState) {
+        this.orderState = orderState;
+    }
+
+    public String getWorkType() {
+        return workType;
+    }
+
+    public void setWorkType(String workType) {
+        this.workType = workType;
+    }
+
+    public String getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(String orderType) {
+        this.orderType = orderType;
+    }
+
+    public String getExecuteType() {
+        return executeType;
+    }
+
+    public void setExecuteType(String executeType) {
+        this.executeType = executeType;
+    }
+
+    public String getOrderFromType() {
+        return orderFromType;
+    }
+
+    public void setOrderFromType(String orderFromType) {
+        this.orderFromType = orderFromType;
+    }
+
+    public String getOrderFromId() {
+        return orderFromId;
+    }
+
+    public void setOrderFromId(String orderFromId) {
+        this.orderFromId = orderFromId;
+    }
+
+    public String getCreatorId() {
+        return creatorId;
+    }
+
+    public void setCreatorId(String creatorId) {
+        this.creatorId = creatorId;
+    }
+
+    public List<String> getDomainRequires() {
+        return domainRequires;
+    }
+
+    public void setDomainRequires(List<String> domainRequires) {
+        this.domainRequires = domainRequires;
+    }
+
+    public String getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateTimeYear() {
+        return createTimeYear;
+    }
+
+    public void setCreateTimeYear(String createTimeYear) {
+        this.createTimeYear = createTimeYear;
+    }
+
+    public String getCreateTimeMonth() {
+        return createTimeMonth;
+    }
+
+    public void setCreateTimeMonth(String createTimeMonth) {
+        this.createTimeMonth = createTimeMonth;
+    }
+
+    public String getCreateTimeDay() {
+        return createTimeDay;
+    }
+
+    public void setCreateTimeDay(String createTimeDay) {
+        this.createTimeDay = createTimeDay;
+    }
+
+    public String getCreateTimeHour() {
+        return createTimeHour;
+    }
+
+    public void setCreateTimeHour(String createTimeHour) {
+        this.createTimeHour = createTimeHour;
+    }
+
+    public String getAskEndTime() {
+        return askEndTime;
+    }
+
+    public void setAskEndTime(String askEndTime) {
+        this.askEndTime = askEndTime;
+    }
+
+    public String getAskEndTimeYear() {
+        return askEndTimeYear;
+    }
+
+    public void setAskEndTimeYear(String askEndTimeYear) {
+        this.askEndTimeYear = askEndTimeYear;
+    }
+
+    public String getAskEndTimeMonth() {
+        return askEndTimeMonth;
+    }
+
+    public void setAskEndTimeMonth(String askEndTimeMonth) {
+        this.askEndTimeMonth = askEndTimeMonth;
+    }
+
+    public String getAskEndTimeDay() {
+        return askEndTimeDay;
+    }
+
+    public void setAskEndTimeDay(String askEndTimeDay) {
+        this.askEndTimeDay = askEndTimeDay;
+    }
+
+    public String getAskEndTimeHour() {
+        return askEndTimeHour;
+    }
+
+    public void setAskEndTimeHour(String askEndTimeHour) {
+        this.askEndTimeHour = askEndTimeHour;
+    }
+
+    public String getRealFinishTime() {
+        return realFinishTime;
+    }
+
+    public void setRealFinishTime(String realFinishTime) {
+        this.realFinishTime = realFinishTime;
+    }
+
+    public String getRealFinishTimeYear() {
+        return realFinishTimeYear;
+    }
+
+    public void setRealFinishTimeYear(String realFinishTimeYear) {
+        this.realFinishTimeYear = realFinishTimeYear;
+    }
+
+    public String getRealFinishTimeMonth() {
+        return realFinishTimeMonth;
+    }
+
+    public void setRealFinishTimeMonth(String realFinishTimeMonth) {
+        this.realFinishTimeMonth = realFinishTimeMonth;
+    }
+
+    public String getRealFinishTimeDay() {
+        return realFinishTimeDay;
+    }
+
+    public void setRealFinishTimeDay(String realFinishTimeDay) {
+        this.realFinishTimeDay = realFinishTimeDay;
+    }
+
+    public String getRealFinishTimeHour() {
+        return realFinishTimeHour;
+    }
+
+    public void setRealFinishTimeHour(String realFinishTimeHour) {
+        this.realFinishTimeHour = realFinishTimeHour;
+    }
+
+    public String getCloseTime() {
+        return closeTime;
+    }
+
+    public void setCloseTime(String closeTime) {
+        this.closeTime = closeTime;
+    }
+
+    public Set<String> getRequiredTools() {
+        return requiredTools;
+    }
+
+    public void setRequiredTools(Set<String> requiredTools) {
+        this.requiredTools = requiredTools;
+    }
+
+    public Set<String> getRequiredMaterial() {
+        return requiredMaterial;
+    }
+
+    public void setRequiredMaterial(Set<String> requiredMaterial) {
+        this.requiredMaterial = requiredMaterial;
+    }
+
+    public boolean isRobbingFlag() {
+        return robbingFlag;
+    }
+
+    public void setRobbingFlag(boolean robbingFlag) {
+        this.robbingFlag = robbingFlag;
+    }
+
+    public boolean isApplyDelayFlag() {
+        return applyDelayFlag;
+    }
+
+    public void setApplyDelayFlag(boolean applyDelayFlag) {
+        this.applyDelayFlag = applyDelayFlag;
+    }
+
+    public boolean isApplyReplacePeopleFlag() {
+        return applyReplacePeopleFlag;
+    }
+
+    public void setApplyReplacePeopleFlag(boolean applyReplacePeopleFlag) {
+        this.applyReplacePeopleFlag = applyReplacePeopleFlag;
+    }
+
+    public boolean isApplyAddPeopleFlag() {
+        return applyAddPeopleFlag;
+    }
+
+    public void setApplyAddPeopleFlag(boolean applyAddPeopleFlag) {
+        this.applyAddPeopleFlag = applyAddPeopleFlag;
+    }
+
+    public boolean isRobbingToAssignFlag() {
+        return robbingToAssignFlag;
+    }
+
+    public void setRobbingToAssignFlag(boolean robbingToAssignFlag) {
+        this.robbingToAssignFlag = robbingToAssignFlag;
+    }
+
+    public Set<String> getObjIds() {
+        return objIds;
+    }
+
+    public void setObjIds(Set<String> objIds) {
+        this.objIds = objIds;
+    }
+
+    public Set<String> getObjClassIds() {
+        return objClassIds;
+    }
+
+    public void setObjClassIds(Set<String> objClassIds) {
+        this.objClassIds = objClassIds;
+    }
+
+    public Set<String> getExecutor() {
+        return executor;
+    }
+
+    public void setExecutor(Set<String> executor) {
+        this.executor = executor;
+    }
+
+    public Set<String> getParticipantIds() {
+        return participantIds;
+    }
+
+    public void setParticipantIds(Set<String> participantIds) {
+        this.participantIds = participantIds;
+    }
+
+    public String getUndetectedObjCount() {
+        return undetectedObjCount;
+    }
+
+    public void setUndetectedObjCount(String undetectedObjCount) {
+        this.undetectedObjCount = undetectedObjCount;
+    }
+
+    public String getCompleteObjCount() {
+        return completeObjCount;
+    }
+
+    public void setCompleteObjCount(String completeObjCount) {
+        this.completeObjCount = completeObjCount;
+    }
+
+    public String getInfoPointFlag() {
+        return infoPointFlag;
+    }
+
+    public void setInfoPointFlag(String infoPointFlag) {
+        this.infoPointFlag = infoPointFlag;
+    }
+
+    public String getMissedDetectionFlag() {
+        return missedDetectionFlag;
+    }
+
+    public void setMissedDetectionFlag(String missedDetectionFlag) {
+        this.missedDetectionFlag = missedDetectionFlag;
+    }
+}

+ 7 - 0
src/main/java/com/persagy/apm/energy/report/workorder/repository/WorkOrderRepository.java

@@ -0,0 +1,7 @@
+package com.persagy.apm.energy.report.workorder.repository;
+
+import com.persagy.apm.energy.report.workorder.model.WorkOrder;
+import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
+
+public interface WorkOrderRepository extends ElasticsearchRepository<WorkOrder, String> {
+}