|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.dataaggre.service.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
@ -21,11 +22,7 @@ import com.google.common.collect.Lists; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class AggreGridServiceImpl implements AggreGridService { |
|
|
@ -144,13 +141,17 @@ public class AggreGridServiceImpl implements AggreGridService { |
|
|
|
if (gridAndData != null) { |
|
|
|
GridMemberDataAnalysisResultDTO data = gridAndData.get(d.getGridId()); |
|
|
|
if (data != null) { |
|
|
|
data.setPatrolTimes(d.getPatrolTimes()); |
|
|
|
|
|
|
|
// 巡查时长,转为h为单位
|
|
|
|
double f = ((double)d.getTotalTime()) / 3600; |
|
|
|
BigDecimal h = new BigDecimal(f).setScale(2, RoundingMode.HALF_UP); |
|
|
|
data.setTotalTime(h.doubleValue()); |
|
|
|
data.setPatrolRoutineWorkTimes(d.getPatrolRoutineWorkTimes()); |
|
|
|
data.setPatrolTimes(d.getPatrolTimes()); |
|
|
|
data.setTotalTime(NumConstant.ZERO_STR); |
|
|
|
int totalTime = d.getTotalTime(); |
|
|
|
if (totalTime > NumConstant.ZERO){ |
|
|
|
int minutes = totalTime / NumConstant.SIXTY; |
|
|
|
if (minutes > NumConstant.ZERO){ |
|
|
|
String totalTimeDesc = minutes / NumConstant.SIXTY + "小时"+ minutes % NumConstant.SIXTY + "分钟"; |
|
|
|
data.setTotalTime(totalTimeDesc); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|