@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant ;
import com.epmet.dataaggre.dao.datastats.DataStatsDao ;
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO ;
import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO ;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO ;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO ;
import com.epmet.dataaggre.dto.datastats.result.* ;
@ -47,7 +48,7 @@ public class DataStatsServiceImpl implements DataStatsService {
AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO ( ) ;
resultDTO . setAgencyId ( formDTO . getAgencyId ( ) ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -78,29 +79,32 @@ public class DataStatsServiceImpl implements DataStatsService {
//3.查询组织下最新话题日统计数据
//状态话题-机关日统计数据表最新日期三种状态数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List < AgencyBasicDataResultDTO . Topic > topic = dataStatsDao . getAgencyTopic ( formDTO . getAgencyId ( ) , formDTO . getDateId ( ) ) ;
//转议题话题-机关日统计数据表
AgencyBasicDataResultDTO . Topic topicSHiftIssue = dataStatsDao . getAgencyTopicShiftIssue ( formDTO . getAgencyId ( ) , formDTO . getDateId ( ) ) ;
//热议中话题-机关日统计数据
AgencyBasicDataResultDTO . Topic hotdiscuss = dataStatsDao . getAgencyTopicHotDiscuss ( formDTO . getAgencyId ( ) , formDTO . getDateId ( ) ) ;
AtomicReference < Integer > closedTotal = new AtomicReference < > ( 0 ) ;
AtomicReference < Integer > hiddenTotal = new AtomicReference < > ( 0 ) ;
if ( topic . size ( ) > NumConstant . ZERO ) {
resultDTO . setTopicTotal ( topic . stream ( ) . collect ( Collectors . summingInt ( AgencyBasicDataResultDTO . Topic : : getTopicCount ) ) ) ;
topic . forEach ( t - > {
if ( t . getTopicStatus ( ) . equals ( "closed" ) ) {
closedTotal . set ( t . getTopicCount ( ) ) ;
}
if ( t . getTopicStatus ( ) . equals ( "hidden" ) ) {
hiddenTotal . set ( t . getTopicCount ( ) ) ;
}
} ) ;
}
//转议题
if ( null ! = topicSHiftIssue ) {
resultDTO . setShiftIssueTotal ( topicSHiftIssue . getShiftedIssueTotal ( ) ) ;
resultDTO . setShiftIssueRatio ( resultDTO . getShiftIssueTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getShiftIssueTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
}
resultDTO . setDiscussingTotal ( resultDTO . getTopicTotal ( ) - closedTotal . get ( ) - hiddenTotal . get ( ) - resultDTO . getShiftIssueTotal ( ) ) ;
resultDTO . setDiscussingRatio ( resultDTO . getDiscussingTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getDiscussingTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
//热议中
if ( null ! = hotdiscuss ) {
resultDTO . setDiscussingTotal ( hotdiscuss . getTopicCount ( ) ) ;
resultDTO . setDiscussingRatio ( resultDTO . getDiscussingTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getDiscussingTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
}
//已处理
resultDTO . setClosedTopicTotal ( closedTotal . get ( ) ) ;
resultDTO . setClosedTopicRatio ( resultDTO . getClosedTopicTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedTopicTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
@ -129,6 +133,103 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultDTO ;
}
/ * *
* @Param formDTO
* @Description 网格下五项基础数据汇总
* @author sun
* /
@Override
public GridBasicDataResultDTO gridBasicData ( GridBasicDataFormDTO formDTO ) {
GridBasicDataResultDTO resultDTO = new GridBasicDataResultDTO ( ) ;
resultDTO . setGridId ( formDTO . getGridId ( ) ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
Date yesterday = DateUtils . addDateDays ( new Date ( ) , - 1 ) ;
SimpleDateFormat format = new SimpleDateFormat ( DateUtils . DATE_PATTERN_YYYYMMDD ) ;
formDTO . setDateId ( format . format ( yesterday ) ) ;
}
//1.查询网格下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
List < String > gridIds = new ArrayList < > ( ) ;
gridIds . add ( formDTO . getGridId ( ) ) ;
List < SubGridUserResultDTO > userList = dataStatsDao . getSubGridUser ( gridIds , formDTO . getDateId ( ) ) ;
if ( userList . size ( ) > NumConstant . ZERO ) {
resultDTO . setUserTotal ( userList . get ( 0 ) . getUserTotal ( ) ) ;
resultDTO . setResiTotal ( userList . get ( 0 ) . getResiTotal ( ) ) ;
resultDTO . setResiRatio ( resultDTO . getResiTotal ( ) = = 0 | | resultDTO . getUserTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getResiTotal ( ) / ( float ) resultDTO . getUserTotal ( ) ) ) ) ;
resultDTO . setPartyMemberTotal ( userList . get ( 0 ) . getPartyMemberTotal ( ) ) ;
resultDTO . setPartyMemberRatio ( resultDTO . getPartyMemberTotal ( ) = = 0 | | resultDTO . getUserTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getPartyMemberTotal ( ) / ( float ) resultDTO . getUserTotal ( ) ) ) ) ;
}
//2.查询网格下最新群组日统计数据
List < SubGridGroupResultDTO > groupList = dataStatsDao . getSubGridGroup ( gridIds , formDTO . getDateId ( ) ) ;
if ( groupList . size ( ) > NumConstant . ZERO ) {
resultDTO . setGroupTotal ( groupList . get ( 0 ) . getGroupTotal ( ) ) ;
resultDTO . setOrdinaryTotal ( groupList . get ( 0 ) . getOrdinaryTotal ( ) ) ;
resultDTO . setOrdinaryRatio ( resultDTO . getOrdinaryTotal ( ) = = 0 | | resultDTO . getGroupTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getOrdinaryTotal ( ) / ( float ) resultDTO . getGroupTotal ( ) ) ) ) ;
resultDTO . setBranchTotal ( groupList . get ( 0 ) . getBranchTotal ( ) ) ;
resultDTO . setBranchRatio ( resultDTO . getBranchTotal ( ) = = 0 | | resultDTO . getGroupTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getBranchTotal ( ) / ( float ) resultDTO . getGroupTotal ( ) ) ) ) ;
}
//3.查询网格下最新话题日统计数据
//状态话题-网格日统计数据表最新日期三种状态数据
//网格日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List < SubGridFormDTO . Topic > topicList = dataStatsDao . getSubGridTopic ( gridIds , formDTO . getDateId ( ) ) ;
//转议题话题-网格日统计数据表
List < SubGridFormDTO . Topic > topicShiftIssueList = dataStatsDao . getSubGridTopicShiftIssue ( gridIds , formDTO . getDateId ( ) ) ;
//热议中话题-网格日统计数据
List < SubGridFormDTO . Topic > hotdiscussList = dataStatsDao . getSubGridTopicHotDiscuss ( gridIds , formDTO . getDateId ( ) ) ;
AtomicReference < Integer > closedTotal = new AtomicReference < > ( 0 ) ;
if ( topicList . size ( ) > NumConstant . ZERO ) {
resultDTO . setTopicTotal ( topicList . stream ( ) . collect ( Collectors . summingInt ( SubGridFormDTO . Topic : : getTopicCount ) ) ) ;
topicList . forEach ( t - > {
if ( t . getTopicStatus ( ) . equals ( "closed" ) ) {
closedTotal . set ( t . getTopicCount ( ) ) ;
}
} ) ;
}
//转议题
if ( topicShiftIssueList . size ( ) > NumConstant . ZERO ) {
resultDTO . setShiftIssueTotal ( topicShiftIssueList . get ( 0 ) . getShiftedIssueTotal ( ) ) ;
resultDTO . setShiftIssueRatio ( resultDTO . getShiftIssueTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getShiftIssueTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
}
//热议中
if ( hotdiscussList . size ( ) > NumConstant . ZERO ) {
resultDTO . setDiscussingTotal ( hotdiscussList . get ( 0 ) . getTopicCount ( ) ) ;
resultDTO . setDiscussingRatio ( resultDTO . getDiscussingTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getDiscussingTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
}
//已处理
resultDTO . setClosedTopicTotal ( closedTotal . get ( ) ) ;
resultDTO . setClosedTopicRatio ( resultDTO . getClosedTopicTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedTopicTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
//4.查询网格下最新议题日统计数据
List < SubGridIssueResultDTO > issueList = dataStatsDao . getSubGridIssue ( gridIds , formDTO . getDateId ( ) ) ;
if ( issueList . size ( ) > NumConstant . ZERO ) {
resultDTO . setIssueTotal ( issueList . get ( 0 ) . getIssueTotal ( ) ) ;
resultDTO . setVotingTotal ( issueList . get ( 0 ) . getVotingTotal ( ) ) ;
resultDTO . setVotingRatio ( resultDTO . getVotingTotal ( ) = = 0 | | resultDTO . getIssueTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getVotingTotal ( ) / ( float ) resultDTO . getIssueTotal ( ) ) ) ) ;
resultDTO . setClosedIssueTotal ( issueList . get ( 0 ) . getClosedIssueTotal ( ) ) ;
resultDTO . setClosedIssueRatio ( resultDTO . getClosedIssueTotal ( ) = = 0 | | resultDTO . getIssueTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedIssueTotal ( ) / ( float ) resultDTO . getIssueTotal ( ) ) ) ) ;
resultDTO . setShiftProjectTotal ( issueList . get ( 0 ) . getShiftProjectTotal ( ) ) ;
resultDTO . setShiftProjectRatio ( resultDTO . getShiftProjectTotal ( ) = = 0 | | resultDTO . getIssueTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getShiftProjectTotal ( ) / ( float ) resultDTO . getIssueTotal ( ) ) ) ) ;
}
//5.查询网格下最新项目日统计数据
List < SubGridProjectResultDTO > projectList = dataStatsDao . getSubGridProject ( gridIds , formDTO . getDateId ( ) ) ;
if ( projectList . size ( ) > NumConstant . ZERO ) {
resultDTO . setProjectTotal ( projectList . get ( 0 ) . getProjectTotal ( ) ) ;
resultDTO . setPendingTotal ( projectList . get ( 0 ) . getPendingTotal ( ) ) ;
resultDTO . setPendingRatio ( resultDTO . getPendingTotal ( ) = = 0 | | resultDTO . getProjectTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getPendingTotal ( ) / ( float ) resultDTO . getProjectTotal ( ) ) ) ) ;
resultDTO . setClosedProjectTotal ( projectList . get ( 0 ) . getClosedProjectTotal ( ) ) ;
resultDTO . setClosedProjectRatio ( resultDTO . getClosedProjectTotal ( ) = = 0 | | resultDTO . getProjectTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedProjectTotal ( ) / ( float ) resultDTO . getProjectTotal ( ) ) ) ) ;
}
return resultDTO ;
}
/ * *
* @Param formDTO
* @Description 查询当前组织的直属下级组织用户数据
@ -138,7 +239,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubAgencyUserResultDTO > subAgencyUser ( SubAgencyFormDTO formDTO ) {
List < SubAgencyUserResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -201,7 +302,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubGridUserResultDTO > subGridUser ( SubGridFormDTO formDTO ) {
List < SubGridUserResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -262,7 +363,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubAgencyGroupResultDTO > subAgencyGroup ( SubAgencyFormDTO formDTO ) {
List < SubAgencyGroupResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -322,7 +423,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubGridGroupResultDTO > subGridGroup ( SubGridFormDTO formDTO ) {
List < SubGridGroupResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -383,7 +484,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubAgencyTopicResultDTO > subAgencyTopic ( SubAgencyFormDTO formDTO ) {
List < SubAgencyTopicResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -404,16 +505,18 @@ public class DataStatsServiceImpl implements DataStatsService {
List < String > agencyIds = subAgencyList . stream ( ) . map ( DimAgencyEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
//2.查询直属下级组织状态话题-日统计数据
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念
List < SubAgencyFormDTO . Topic > topic = dataStatsDao . getSubAgencyTopic ( agencyIds , formDTO . getDateId ( ) ) ;
//查询直属下级组织转议题话题-日统计数据表
List < SubAgencyFormDTO . Topic > topicShiftIssue = dataStatsDao . getSubAgencyTopicShiftIssue ( agencyIds , formDTO . getDateId ( ) ) ;
//查询直属下级组织热议中话题-机关日统计数据
List < SubAgencyFormDTO . Topic > hotdiscuss = dataStatsDao . getSubAgencyTopicHotDiscuss ( agencyIds , formDTO . getDateId ( ) ) ;
agencyIds . forEach ( agencyId - > {
SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO ( ) ;
AtomicInteger topicTotal = new AtomicInteger ( 0 ) ;
AtomicInteger closedTotal = new AtomicInteger ( 0 ) ;
AtomicInteger hiddenTotal = new AtomicInteger ( 0 ) ;
AtomicInteger shiftIssueTotal = new AtomicInteger ( 0 ) ;
AtomicInteger hotdiscussTotal = new AtomicInteger ( 0 ) ;
AtomicReference < String > agencyName = new AtomicReference < > ( "" ) ;
topic . forEach ( t - > {
if ( t . getAgencyId ( ) . equals ( agencyId ) ) {
@ -421,9 +524,6 @@ public class DataStatsServiceImpl implements DataStatsService {
if ( t . getTopicStatus ( ) . equals ( "closed" ) ) {
closedTotal . set ( t . getTopicCount ( ) ) ;
}
if ( t . getTopicStatus ( ) . equals ( "hidden" ) ) {
hiddenTotal . set ( t . getTopicCount ( ) ) ;
}
}
} ) ;
topicShiftIssue . forEach ( t - > {
@ -431,6 +531,11 @@ public class DataStatsServiceImpl implements DataStatsService {
shiftIssueTotal . addAndGet ( t . getShiftedIssueTotal ( ) ) ;
}
} ) ;
hotdiscuss . forEach ( t - > {
if ( t . getAgencyId ( ) . equals ( agencyId ) ) {
hotdiscussTotal . addAndGet ( t . getTopicCount ( ) ) ;
}
} ) ;
subAgencyList . forEach ( sub - > {
if ( agencyId . equals ( sub . getId ( ) ) ) {
agencyName . set ( sub . getAgencyName ( ) ) ;
@ -440,7 +545,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO . setAgencyId ( agencyId ) ;
resultDTO . setAgencyName ( agencyName . get ( ) ) ;
resultDTO . setTopicTotal ( topicTotal . get ( ) ) ;
resultDTO . setDiscussingTotal ( topicTotal . get ( ) - closedTotal . get ( ) - hiddenTotal . get ( ) - shiftIssue Total. get ( ) ) ;
resultDTO . setDiscussingTotal ( hotdiscuss Total. get ( ) ) ;
resultDTO . setDiscussingRatio ( resultDTO . getDiscussingTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getDiscussingTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
resultDTO . setClosedTopicTotal ( closedTotal . get ( ) ) ;
resultDTO . setClosedTopicRatio ( resultDTO . getClosedTopicTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedTopicTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
@ -479,7 +584,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubGridTopicResultDTO > subGridTopic ( SubGridFormDTO formDTO ) {
List < SubGridTopicResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -504,12 +609,14 @@ public class DataStatsServiceImpl implements DataStatsService {
List < SubGridFormDTO . Topic > topic = dataStatsDao . getSubGridTopic ( gridIds , formDTO . getDateId ( ) ) ;
//查询网格层级转议题话题-日统计数据表
List < SubGridFormDTO . Topic > topicShiftIssue = dataStatsDao . getSubGridTopicShiftIssue ( gridIds , formDTO . getDateId ( ) ) ;
//查询网格层级热议中话题-日统计数据
List < SubGridFormDTO . Topic > hotdiscuss = dataStatsDao . getSubGridTopicHotDiscuss ( gridIds , formDTO . getDateId ( ) ) ;
gridIds . forEach ( gridId - > {
SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO ( ) ;
AtomicInteger topicTotal = new AtomicInteger ( 0 ) ;
AtomicInteger closedTotal = new AtomicInteger ( 0 ) ;
AtomicInteger hiddenTotal = new AtomicInteger ( 0 ) ;
AtomicInteger shiftIssueTotal = new AtomicInteger ( 0 ) ;
AtomicInteger hotdiscussTotal = new AtomicInteger ( 0 ) ;
AtomicReference < String > gridName = new AtomicReference < > ( "" ) ;
topic . forEach ( t - > {
if ( t . getGridId ( ) . equals ( gridId ) ) {
@ -517,9 +624,6 @@ public class DataStatsServiceImpl implements DataStatsService {
if ( t . getTopicStatus ( ) . equals ( "closed" ) ) {
closedTotal . set ( t . getTopicCount ( ) ) ;
}
if ( t . getTopicStatus ( ) . equals ( "hidden" ) ) {
hiddenTotal . set ( t . getTopicCount ( ) ) ;
}
}
} ) ;
topicShiftIssue . forEach ( t - > {
@ -527,6 +631,11 @@ public class DataStatsServiceImpl implements DataStatsService {
shiftIssueTotal . addAndGet ( t . getShiftedIssueTotal ( ) ) ;
}
} ) ;
hotdiscuss . forEach ( t - > {
if ( t . getGridId ( ) . equals ( gridId ) ) {
hotdiscussTotal . addAndGet ( t . getTopicCount ( ) ) ;
}
} ) ;
gridList . forEach ( sub - > {
if ( gridId . equals ( sub . getId ( ) ) ) {
gridName . set ( sub . getGridName ( ) ) ;
@ -536,7 +645,7 @@ public class DataStatsServiceImpl implements DataStatsService {
resultDTO . setGridId ( gridId ) ;
resultDTO . setGridName ( gridName . get ( ) ) ;
resultDTO . setTopicTotal ( topicTotal . get ( ) ) ;
resultDTO . setDiscussingTotal ( topicTotal . get ( ) - closedTotal . get ( ) - hiddenTotal . get ( ) - shiftIssue Total. get ( ) ) ;
resultDTO . setDiscussingTotal ( hotdiscuss Total. get ( ) ) ;
resultDTO . setDiscussingRatio ( resultDTO . getDiscussingTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getDiscussingTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
resultDTO . setClosedTopicTotal ( closedTotal . get ( ) ) ;
resultDTO . setClosedTopicRatio ( resultDTO . getClosedTopicTotal ( ) = = 0 | | resultDTO . getTopicTotal ( ) = = 0 ? BigDecimal . ZERO : new BigDecimal ( numberFormat . format ( ( float ) resultDTO . getClosedTopicTotal ( ) / ( float ) resultDTO . getTopicTotal ( ) ) ) ) ;
@ -574,7 +683,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubAgencyIssueResultDTO > subAgencyIssue ( SubAgencyFormDTO formDTO ) {
List < SubAgencyIssueResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -637,7 +746,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubGridIssueResultDTO > subGridIssue ( SubGridFormDTO formDTO ) {
List < SubGridIssueResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -700,7 +809,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubAgencyProjectResultDTO > subAgencyProject ( SubAgencyFormDTO formDTO ) {
List < SubAgencyProjectResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {
@ -760,7 +869,7 @@ public class DataStatsServiceImpl implements DataStatsService {
public List < SubGridProjectResultDTO > subGridProject ( SubGridFormDTO formDTO ) {
List < SubGridProjectResultDTO > resultList = new ArrayList < > ( ) ;
NumberFormat numberFormat = NumberFormat . getInstance ( ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . FOUR ) ;
numberFormat . setMaximumFractionDigits ( NumConstant . THREE ) ;
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if ( StringUtils . isBlank ( formDTO . getDateId ( ) ) ) {