@ -422,7 +422,6 @@ public class ReportServiceImpl implements ReportService {
s . setUserId ( userId ) ;
s . setUserId ( userId ) ;
if ( CollUtil . isEmpty ( ids ) ) {
if ( CollUtil . isEmpty ( ids ) ) {
ids = new ArrayList < > ( ) ;
ids = new ArrayList < > ( ) ;
log . debug ( "==================== the userId as {} ====================" , userId ) ;
getTaskId ( ids , userId ) ;
getTaskId ( ids , userId ) ;
s . setIds ( ids ) ;
s . setIds ( ids ) ;
}
}
@ -562,12 +561,10 @@ public class ReportServiceImpl implements ReportService {
for ( Task info : tasks ) {
for ( Task info : tasks ) {
taskInfos . put ( info . getId ( ) , info ) ;
taskInfos . put ( info . getId ( ) , info ) ;
}
}
log . debug ( "================== the map size as {} ==================" , mapByTask . size ( ) ) ;
for ( Long key : mapByTask . keySet ( ) ) {
for ( Long key : mapByTask . keySet ( ) ) {
HashMap < String , Object > mapVo = new HashMap < String , Object > ( 16 ) ;
HashMap < String , Object > mapVo = new HashMap < String , Object > ( 16 ) ;
//按时间分
//按时间分
HashMap < String , List < CallClueInfo > > mapByTime = getGroupByTime ( s . getBeginTime ( ) , s . getEndTime ( ) , mapByTask . get ( key ) , s . getType ( ) ) ;
HashMap < String , List < CallClueInfo > > mapByTime = getGroupByTime ( s . getBeginTime ( ) , s . getEndTime ( ) , mapByTask . get ( key ) , s . getType ( ) ) ;
log . debug ( "================== the task json as {} ==================" , JSONUtil . toJsonStr ( taskInfos . get ( key ) ) ) ;
int total = taskInfos . get ( key ) . getTotalNumber ( ) ;
int total = taskInfos . get ( key ) . getTotalNumber ( ) ;
String taskName = taskInfos . get ( key ) . getTaskName ( ) ;
String taskName = taskInfos . get ( key ) . getTaskName ( ) ;
@ -660,18 +657,23 @@ public class ReportServiceImpl implements ReportService {
//统计通话时长
//统计通话时长
int doubleClueTime = 0 ;
int doubleClueTime = 0 ;
if ( CollUtil . isNotEmpty ( doubleCallInfo ) ) {
if ( CollUtil . isNotEmpty ( doubleCallInfo ) ) {
doubleClueTime = doubleCallInfo . stream ( ) . mapToInt ( AllCallInfo : : getDuration ) . sum ( ) ;
for ( AllCallInfo ai : doubleCallInfo ) {
if ( doubleClueTime > 0 ) {
if ( ai . getStatus ( ) = = DefaultNumberConstants . TWO_NUMBER ) {
//有通话时长 说明电话打通
turnOnNum + + ;
turnOnNum + + ;
doubleClueTime + = ai . getDuration ( ) ;
}
}
}
}
// doubleClueTime = doubleCallInfo.stream().mapToInt(AllCallInfo::getDuration).sum();
// if (doubleClueTime > 0) {
// //有通话时长 说明电话打通
// turnOnNum++;
// }
}
breatheTotalDuration + = doubleClueTime ;
breatheTotalDuration + = doubleClueTime ;
}
}
breatheAverageDuration = NumberUtil . div ( breatheTotalDuration , callClueInfos . size ( ) , 2 ) ;
breatheAverageDuration = NumberUtil . div ( breatheTotalDuration , callClueInfos . size ( ) , 2 ) ;
}
}
//这里使用数和接通数是分开的,真实的使用数 为 这里的使用数+接通数
usrNum + = turnOnNum ;
if ( usrNum ! = 0 ) {
if ( usrNum ! = 0 ) {
//接通率=接通数/使用数
//接通率=接通数/使用数
turnOnRate = NumberUtil . div ( turnOnNum , usrNum , 2 ) ;
turnOnRate = NumberUtil . div ( turnOnNum , usrNum , 2 ) ;