|
@ -1,14 +1,11 @@ |
|
|
package com.epmet.service.evaluationindex.extract.impl; |
|
|
package com.epmet.service.evaluationindex.extract.impl; |
|
|
|
|
|
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.constant.IndexCalConstant; |
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; |
|
|
|
|
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; |
|
|
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; |
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; |
|
|
import com.epmet.service.evaluationindex.extract.*; |
|
|
import com.epmet.service.evaluationindex.extract.*; |
|
|
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; |
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
@ -35,8 +32,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DimCustomerPartymemberService dimCustomerPartymemberService; |
|
|
private DimCustomerPartymemberService dimCustomerPartymemberService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactOriginTopicLogDailyService factOriginTopicLogDailyService; |
|
|
private FactOriginTopicLogDailyService factOriginTopicLogDailyService; |
|
@ -45,7 +40,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; |
|
|
private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private FactOriginGroupMainDailyService factOriginGroupMainDailyService; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId 客户id |
|
|
* @param customerId 客户id |
|
@ -66,7 +63,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
String quarterId= DateUtils.getQuarterId(monthId); |
|
|
String quarterId= DateUtils.getQuarterId(monthId); |
|
|
String yearId=DateUtils.getYearId(monthId); |
|
|
String yearId=DateUtils.getYearId(monthId); |
|
|
//2、删除之前统计过的
|
|
|
//2、删除之前统计过的
|
|
|
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
|
|
factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//1、党员提出话题数
|
|
|
//1、党员提出话题数
|
|
@ -132,7 +129,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
//4、分批插入批量插入
|
|
|
//4、分批插入批量插入
|
|
|
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); |
|
|
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); |
|
|
partition.forEach(list -> { |
|
|
partition.forEach(list -> { |
|
|
this.saveFactIndexPartyAblityCpcMonthlyEntity(list); |
|
|
factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -150,7 +147,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
Map<String, List<String>> map = new HashMap<>(); |
|
|
Map<String, List<String>> map = new HashMap<>(); |
|
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
|
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
|
|
//查询当前党员建了多少个组
|
|
|
//查询当前党员建了多少个组
|
|
|
List<String> groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId()); |
|
|
List<String> groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId()); |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
map.put(partyMember.getUserId(), new ArrayList<>()); |
|
|
map.put(partyMember.getUserId(), new ArrayList<>()); |
|
|
continue; |
|
|
continue; |
|
@ -259,12 +256,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
//查询当前党员建了多少个组
|
|
|
//查询当前党员建了多少个组
|
|
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
|
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
|
|
|
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0"); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
//去重组里面的成员
|
|
|
//去重组里面的成员
|
|
|
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); |
|
|
List<String> memberIdList=factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); |
|
|
if (CollectionUtils.isEmpty(memberIdList)) { |
|
|
if (CollectionUtils.isEmpty(memberIdList)) { |
|
|
|
|
|
//memberIdList肯定不会为空,因为起码会有群主一个人
|
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
continue; |
|
|
continue; |
|
|
} else { |
|
|
} else { |
|
@ -303,11 +302,12 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
//1、查询当前党员建了多少个组
|
|
|
//1、查询当前党员建了多少个组
|
|
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
|
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
if (CollectionUtils.isEmpty(groupIdList)) { |
|
|
|
|
|
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0"); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
//2、去重组里面的成员
|
|
|
//2、去重组里面的成员
|
|
|
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); |
|
|
List<String> memberIdList = factOriginGroupMainDailyService.selectGroupMemberList(groupIdList); |
|
|
if (CollectionUtils.isEmpty(memberIdList)) { |
|
|
if (CollectionUtils.isEmpty(memberIdList)) { |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
|
|
continue; |
|
|
continue; |
|
@ -404,32 +404,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
|
|
return map; |
|
|
return map; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @param monthId |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author yinzuomei |
|
|
|
|
|
* @description 删除这个客户这个月 党员相关-党建能力的数据 |
|
|
|
|
|
* @Date 2020/9/18 10:20 |
|
|
|
|
|
**/ |
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|
|
|
|
|
public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { |
|
|
|
|
|
int deleteNum; |
|
|
|
|
|
do { |
|
|
|
|
|
deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
|
|
|
|
|
} while (deleteNum > NumConstant.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param list |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author yinzuomei |
|
|
|
|
|
* @description 批量插入党员相关党建能力表 |
|
|
|
|
|
* @Date 2020/9/18 10:27 |
|
|
|
|
|
**/ |
|
|
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
|
|
|
|
|
private void saveFactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list) { |
|
|
|
|
|
factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|