|
@@ -9,6 +9,7 @@ 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 lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
|
|
import org.elasticsearch.index.query.QueryBuilders;
|
|
@@ -27,6 +28,7 @@ import java.util.TreeMap;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service("OrderCompleteRateWorkOrderWebService")
|
|
|
+@Slf4j
|
|
|
public class WorkOrderPlatformServiceImpl implements PlatformService {
|
|
|
|
|
|
@Resource
|
|
@@ -56,12 +58,12 @@ public class WorkOrderPlatformServiceImpl implements PlatformService {
|
|
|
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;
|
|
|
+ if (null != workCount && workCount != 0 && null != dealCount) {
|
|
|
+ completeRate = DataUtils.parseDouble(dealCount) / workCount * 100;
|
|
|
}
|
|
|
return completeRate;
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("计算工单完成率异常", e);
|
|
|
}
|
|
|
return completeRate;
|
|
|
}
|
|
@@ -79,7 +81,7 @@ public class WorkOrderPlatformServiceImpl implements PlatformService {
|
|
|
return resultList.getSize();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ log.error("获取工单数据异常", e);
|
|
|
}
|
|
|
return null;
|
|
|
}
|