|
|
|
@ -101,7 +101,7 @@ public class DemandServiceImpl implements DemandService { |
|
|
|
// 分片开始下标
|
|
|
|
int shardingStartIndex = 0; |
|
|
|
// 分片大小(条数)
|
|
|
|
int shardingSize = 2; |
|
|
|
int shardingSize = 100; |
|
|
|
|
|
|
|
// 分片去确定党员身份,防止in条件过大
|
|
|
|
while (true) { |
|
|
|
@ -130,43 +130,44 @@ public class DemandServiceImpl implements DemandService { |
|
|
|
//2. 查询志愿者服务次数
|
|
|
|
|
|
|
|
// 总服务次数
|
|
|
|
int totalDemandServiceCount = 0; |
|
|
|
int totalDemandServeTimes = 0; |
|
|
|
// 党员服务次数
|
|
|
|
int partymemberDemandServiceCount = 0; |
|
|
|
int partymemberDemandServeTimes = 0; |
|
|
|
// 居民服务次数
|
|
|
|
int resiDemandServiceCount = 0; |
|
|
|
int resiDemandServeTimes = 0; |
|
|
|
|
|
|
|
int serviceCountPageNo = 0; |
|
|
|
int serviceCountPageSize = 1000; |
|
|
|
while (true) { |
|
|
|
|
|
|
|
List<DemandServiceCountResultDTO> damendServiceCounts = heartDemandService.listDemandServiceCountPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); |
|
|
|
// 取出每一个服务者的服务次数
|
|
|
|
List<DemandServiceCountResultDTO> damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); |
|
|
|
|
|
|
|
for (DemandServiceCountResultDTO damendServiceCount : damendServiceCounts) { |
|
|
|
String serverId = damendServiceCount.getServerId(); |
|
|
|
for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) { |
|
|
|
String serverId = damendServiceTimes.getServerId(); |
|
|
|
if (partymemberVolunteerUserIds.contains(serverId)) { |
|
|
|
partymemberDemandServiceCount++; |
|
|
|
partymemberDemandServeTimes += damendServiceTimes.getServeTimes(); |
|
|
|
} else { |
|
|
|
resiDemandServiceCount++; |
|
|
|
resiDemandServeTimes += damendServiceTimes.getServeTimes(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
totalDemandServiceCount += damendServiceCounts.size(); |
|
|
|
|
|
|
|
if (damendServiceCounts.size() <= serviceCountPageSize) { |
|
|
|
if (damendServeTimes.size() <= serviceCountPageSize) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
totalDemandServeTimes = partymemberDemandServeTimes + resiDemandServeTimes; |
|
|
|
|
|
|
|
// 3.持久化
|
|
|
|
FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity(); |
|
|
|
insert.setDateId(DimIdGenerator.getDateDimId(belongTime)); |
|
|
|
insert.setCustomerId(customerId); |
|
|
|
insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime)); |
|
|
|
insert.setPartyServiceTotal(partymemberDemandServiceCount); |
|
|
|
insert.setServiceTotal(totalDemandServiceCount); |
|
|
|
insert.setPartyServiceTotal(partymemberDemandServeTimes); |
|
|
|
insert.setServiceTotal(totalDemandServeTimes); |
|
|
|
insert.setPartyTotal(partymemberVolunteerCount); |
|
|
|
insert.setResiServiceTotal(resiDemandServiceCount); |
|
|
|
insert.setResiServiceTotal(resiDemandServeTimes); |
|
|
|
insert.setResiTotal(resiVolunteerCount); |
|
|
|
insert.setVolunteerTotal(volunteerTotalCount); |
|
|
|
|
|
|
|
|