@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant ;
import com.epmet.commons.tools.utils.DateUtils ;
import com.epmet.dto.org.GridInfoDTO ;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO ;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO ;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO ;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity ;
@ -77,8 +78,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//2.查询出客户下网格的相关信息
List < GridInfoDTO > gridList = customerGridService . queryGridInfoList ( param . getCustomerId ( ) ) ;
Map < String , GridInfoDTO > gridMap = new HashMap < > ( ) ;
gridList . forEach ( grid - > { gridMap . put ( grid . getGridId ( ) , grid ) ; } ) ;
Map < String , GridInfoDTO > gridMap = gridList . stream ( ) . collect ( Collectors . toMap ( GridInfoDTO : : getGridId , a - > a , ( o , n ) - > o ) ) ;
//3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分)
Map < String , Integer > pointMap = userPointService . getUserPointMap ( param . getCustomerId ( ) ) ;
@ -99,6 +99,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map < String , BigDecimal > scoreMap = cpcIndexCalculateService . getCpcScore ( param . getCustomerId ( ) , dateId ) ;
//剔除垃圾数据
for ( Iterator < ScreenPartyUserRankDataEntity > iter = registeredUsers . iterator ( ) ;
iter . hasNext ( ) ; ) {
if ( null = = gridMap . get ( iter . next ( ) . getGridId ( ) ) ) iter . remove ( ) ;
}
//5.整合数据
if ( ! CollectionUtils . isEmpty ( registeredUsers ) ) {
registeredUsers . forEach ( user - > {
@ -154,13 +160,26 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//查询数据
List < ScreenDifficultyDataEntity > difficulties = factOriginProjectMainDailyService . getDifficultyBaseInfo ( param . getCustomerId ( ) , projectService . getOvertimeProjectByParameter ( param . getCustomerId ( ) , existed ) ) ;
if ( CollectionUtils . isEmpty ( difficulties ) ) return ;
//剔除垃圾数据
//2.查询出客户下网格的相关信息
List < GridInfoDTO > gridList = customerGridService . queryGridInfoList ( param . getCustomerId ( ) ) ;
Map < String , GridInfoDTO > gridMap = gridList . stream ( ) . collect ( Collectors . toMap ( GridInfoDTO : : getGridId , a - > a , ( o , n ) - > o ) ) ;
List < String > missing = new LinkedList < > ( ) ;
for ( Iterator < ScreenDifficultyDataEntity > iter = difficulties . iterator ( ) ; iter . hasNext ( ) ; ) {
ScreenDifficultyDataEntity pointer = iter . next ( ) ;
if ( null = = gridMap . get ( pointer . getOrgId ( ) ) ) {
missing . add ( pointer . getEventId ( ) ) ;
iter . remove ( ) ;
}
}
List < String > projectIds = difficulties . stream ( ) . map ( ScreenDifficultyDataEntity : : getEventId ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
//最近一次操作
Map < String , String > latestOperationMap = projectProcessService . getLatestOperation ( projectIds , param . getCustomerId ( ) ) ;
//标题
Map < String , String > titleMap = projectProcessService . getProjectTitle ( projectIds , param . getCustomerId ( ) ) ;
Map < String , ProjectLatestOperationResultDTO > latestOperationMap = projectProcessService . getLatestOperation ( projectIds , param . getCustomerId ( ) ) ;
boolean isOperationNull = CollectionUtils . isEmpty ( latestOperationMap ) ? true : false ;
boolean isTitleNull = CollectionUtils . isEmpty ( titleMap ) ? true : false ;
//图片
List < ProjectSourceMapFormDTO > projectSourceMap = factOriginProjectMainDailyService . getNewProject ( param . getCustomerId ( ) , projectIds ) ;
@ -178,16 +197,20 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
diff . setEventContent ( contentMap . get ( diff . getEventId ( ) ) ) ;
}
if ( ! isOperationNull ) {
diff . setLatestOperateDesc ( latestOperationMap . get ( diff . getEventId ( ) ) ) ;
ProjectLatestOperationResultDTO oper = latestOperationMap . get ( diff . getEventId ( ) ) ;
if ( null ! = oper ) {
diff . setLatestOperateDesc ( oper . getOperationName ( ) ) ;
diff . setEventTitle ( oper . getTitle ( ) ) ;
diff . setEventCostTime ( oper . getCostTime ( ) ) ;
}
if ( ! isTitleNull ) {
diff . setEventTitle ( titleMap . get ( diff . getEventId ( ) ) ) ;
}
diff . setDataEndTime ( DateUtils . getBeforeNDay ( NumConstant . ONE ) ) ;
} ) ;
List < ScreenDifficultyImgDataEntity > imgList = new LinkedList < > ( ) ;
imgMap . values ( ) . forEach ( list - > { imgList . addAll ( list ) ; } ) ;
screenDifficultyDataService . dataClean ( param . getCustomerId ( ) , difficulties , imgList ) ;
screenDifficultyDataService . dataClean ( param . getCustomerId ( ) , difficulties , imgList , missing ) ;
}
}