|
|
|
@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.temporal.ChronoUnit;
|
|
|
|
|
import java.util.*;
|
|
|
|
@ -232,7 +233,7 @@ public class CockpitWorkflowAnalysisCmd {
|
|
|
|
|
WeaResult<List<RequestListInfoPAEntity>> requestListData = wflRequestListRest.getRequestListByTabId(employee, RequestListInitDimensionTabEnum.DONE_FLOWALL.getTabid(), 1, wfcount, conditionEntity);
|
|
|
|
|
int code2 = requestListData.getCode();
|
|
|
|
|
if(code2 == 200){
|
|
|
|
|
Long minutescount = 0L;
|
|
|
|
|
Long secondscount = 0L;
|
|
|
|
|
List<RequestListInfoPAEntity> requestCountInfoPAEntityList = requestListData.getData();
|
|
|
|
|
int requestLength = requestCountInfoPAEntityList.size() ;
|
|
|
|
|
log.error("requestLength:"+requestLength);
|
|
|
|
@ -242,18 +243,29 @@ public class CockpitWorkflowAnalysisCmd {
|
|
|
|
|
LocalDateTime operateDateTime = requestListInfoPAEntity.getOperateTime();
|
|
|
|
|
log.error("receiveDateTime:"+receiveDateTime);
|
|
|
|
|
log.error("operateDateTime:"+operateDateTime);
|
|
|
|
|
Long minutesDiff = ChronoUnit.MINUTES.between(receiveDateTime, operateDateTime);
|
|
|
|
|
log.error("minutesDiff:"+minutesDiff);
|
|
|
|
|
minutescount += minutesDiff ;
|
|
|
|
|
Long secondsDiff = ChronoUnit.SECONDS.between(receiveDateTime, operateDateTime);
|
|
|
|
|
log.error("secondsDiff:"+secondsDiff);
|
|
|
|
|
secondscount += secondsDiff ;
|
|
|
|
|
}
|
|
|
|
|
log.error("minutescount:"+minutescount);
|
|
|
|
|
if(requestLength > 0 && minutescount > 0){
|
|
|
|
|
|
|
|
|
|
double average = minutescount/(requestLength*1.0) ;
|
|
|
|
|
BigDecimal dividend = new BigDecimal(average);
|
|
|
|
|
dividend = dividend.setScale(2, RoundingMode.HALF_UP);
|
|
|
|
|
count = dividend.toString();
|
|
|
|
|
|
|
|
|
|
log.error("secondscount:"+secondscount);
|
|
|
|
|
if(requestLength > 0 && secondscount > 0){
|
|
|
|
|
|
|
|
|
|
Long average = secondscount/requestLength ;
|
|
|
|
|
Duration duration = Duration.ofSeconds(average);
|
|
|
|
|
long days = duration.toDays();
|
|
|
|
|
long hours = duration.toHours() % 24;
|
|
|
|
|
long mins = duration.toMinutes() % 60;
|
|
|
|
|
if(days > 0){
|
|
|
|
|
count += days+"天";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(hours > 0){
|
|
|
|
|
count += hours+"小时";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(mins > 0){
|
|
|
|
|
count += mins+"分";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|