Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

dev
jianjun 4 years ago
parent
commit
e0caf70882
  1. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  4. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  5. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java
  6. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  7. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  8. 5
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  9. 3
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml
  10. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  11. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java
  12. 46
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java
  13. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  14. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java

@ -63,7 +63,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
//1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据 //1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据
//如果还是查不出数据,继续向下执行,这部分数据设置默认值 //如果还是查不出数据,继续向下执行,这部分数据设置默认值
//注册用户数 //注册用户数 fact_reg_user_grid_daily 或 fact_reg_user_agency_daily agency级别
List<ScreenUserTotalDataEntity> result = List<ScreenUserTotalDataEntity> result =
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(result)){ if(CollectionUtils.isEmpty(result)){
@ -72,6 +72,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
} }
if(null == result) result = new LinkedList<>(); if(null == result) result = new LinkedList<>();
} }
// 网格级别
List<ScreenUserTotalDataEntity> gridUserResult = List<ScreenUserTotalDataEntity> gridUserResult =
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
@ -84,13 +85,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
result.addAll(gridUserResult); result.addAll(gridUserResult);
} }
//2.组 //2.组 fact_group_grid_daily 或 fact_group_agency_daily
List<ScreenUserTotalDataEntity> agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); List<ScreenUserTotalDataEntity> agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyGroup)){ if(CollectionUtils.isEmpty(agencyGroup)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
} }
} }
// 网格级别
List<ScreenUserTotalDataEntity> gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); List<ScreenUserTotalDataEntity> gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridGroup)){ if(CollectionUtils.isEmpty(gridGroup)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -101,13 +103,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal))); groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal)));
//3.话题 //3.话题 fact_topic_total_grid_daily或fact_topic_total_agency_daily
List<ScreenUserTotalDataEntity> agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); List<ScreenUserTotalDataEntity> agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyTopic)){ if(CollectionUtils.isEmpty(agencyTopic)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
} }
} }
// 网格级别
List<ScreenUserTotalDataEntity> gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); List<ScreenUserTotalDataEntity> gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridTopic)){ if(CollectionUtils.isEmpty(gridTopic)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -117,13 +120,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
Map<String,Integer> topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)); Map<String,Integer> topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal));
topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal))); topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)));
//4.议题 //4.议题 fact_issue_grid_daily 或 fact_issue_agency_daily
List<ScreenUserTotalDataEntity> agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); List<ScreenUserTotalDataEntity> agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyIssue)){ if(CollectionUtils.isEmpty(agencyIssue)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
} }
} }
// 网格级别
List<ScreenUserTotalDataEntity> gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); List<ScreenUserTotalDataEntity> gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridIssue)){ if(CollectionUtils.isEmpty(gridIssue)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -133,13 +137,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
Map<String,Integer> issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)); Map<String,Integer> issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal));
issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal))); issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)));
//5.项目 //5.项目 fact_grid_project_daily 或 fact_agency_project_daily
List<ScreenUserTotalDataEntity> agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); List<ScreenUserTotalDataEntity> agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyProject)){ if(CollectionUtils.isEmpty(agencyProject)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
} }
} }
// 网格级别
List<ScreenUserTotalDataEntity> gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId); List<ScreenUserTotalDataEntity> gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridProject)){ if(CollectionUtils.isEmpty(gridProject)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService {
agencies.forEach(agency -> { agencies.forEach(agency -> {
initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency);
}); });
//计算网格-组-话题映射关系
List<ResiGroupTopicResultDTO> topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); List<ResiGroupTopicResultDTO> topics = topicDao.selectGroupOrderByGrid(targetDate,customerId);
topics.forEach(groupTopic -> { topics.forEach(groupTopic -> {
if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){

10
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -335,6 +335,7 @@
gridInfo.allParentIds gridInfo.allParentIds
FROM FROM
fact_origin_project_main_daily project fact_origin_project_main_daily project
<!--获取部门名称路径相关信息-->
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
grid.ID AS dimGridId, grid.ID AS dimGridId,
@ -368,7 +369,9 @@
grid.DEL_FLAG = '0' grid.DEL_FLAG = '0'
AND grid.CUSTOMER_ID = #{customerId} AND grid.CUSTOMER_ID = #{customerId}
) gridInfo ON project.GRID_ID = gridInfo.dimGridId ) gridInfo ON project.GRID_ID = gridInfo.dimGridId
<!--获取经过处理的部门数-->
LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID
<!--获取事件被处理次数-->
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
PROJECT_ID, PROJECT_ID,
@ -387,14 +390,15 @@
AND project.CUSTOMER_ID = #{customerId} AND project.CUSTOMER_ID = #{customerId}
AND project.ID IN ( AND project.ID IN (
<!--如果项目的某一个或几个节点超过了 项目超期时间 则算难点堵点-->
SELECT DISTINCT SELECT DISTINCT
period.project_id period.project_id
FROM FROM
fact_origin_project_org_period_daily period fact_origin_project_org_period_daily period
LEFT JOIN LEFT JOIN
( (
<!--如果项目结案 则按照结案时间,否则是当前时间 作为节点的处理时长-->
<!--项目结案时间-->
SELECT SELECT
project.ID AS projectId, project.ID AS projectId,
IFNULL(period.handled_date,NOW()) AS finishDate IFNULL(period.handled_date,NOW()) AS finishDate
@ -571,4 +575,4 @@
</choose> </choose>
</select> </select>
</mapper> </mapper>

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java

@ -197,12 +197,14 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public InitPointRuleResultDTO initPointRule() { public InitPointRuleResultDTO initPointRule() {
//得到所有客户Id
Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList();
log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult)); log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult));
if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) {
throw new RenException("获取所有客户列表失败"); throw new RenException("获取所有客户列表失败");
} }
List<CustomerDTO> customerDTOList = customerListResult.getData(); List<CustomerDTO> customerDTOList = customerListResult.getData();
//获取默认规则列表
List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null); List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null);
if (CollectionUtils.isEmpty(ruleDefaultEntities)) { if (CollectionUtils.isEmpty(ruleDefaultEntities)) {
log.warn("initPointRule pointRuleDefaultDao.selectList return empty"); log.warn("initPointRule pointRuleDefaultDao.selectList return empty");
@ -211,15 +213,18 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
List<PointRuleEntity> insertList = new ArrayList<>(); List<PointRuleEntity> insertList = new ArrayList<>();
//获取全部默认规则code集合
List<String> defaultEventCodeList = ruleDefaultEntities.stream().map(PointRuleDefaultEntity :: getEventCode).distinct().collect(Collectors.toList()); List<String> defaultEventCodeList = ruleDefaultEntities.stream().map(PointRuleDefaultEntity :: getEventCode).distinct().collect(Collectors.toList());
//获取所有客户的积分规则
List<PointRuleEntity> customerRule = baseDao.selectList(null); List<PointRuleEntity> customerRule = baseDao.selectList(null);
if(!CollectionUtils.isEmpty(customerRule)){ if(!CollectionUtils.isEmpty(customerRule)){
//key :: customerId || value :: 客户规则集合
Map<String,List<PointRuleEntity>> customerRuleMap = Map<String,List<PointRuleEntity>> customerRuleMap =
customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId)); customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId));
customerRuleMap.forEach((customerId,ruleList) -> { customerRuleMap.forEach((customerId,ruleList) -> {
if(null != ruleList){ if(null != ruleList){
List<String> event = new LinkedList<>(defaultEventCodeList); List<String> event = new LinkedList<>(defaultEventCodeList);
//取差集 //取差集,event只剩下当前客户没有的积分规则
event.removeAll(ruleList.stream().map(PointRuleEntity :: getEventCode).distinct().collect(Collectors.toList())); event.removeAll(ruleList.stream().map(PointRuleEntity :: getEventCode).distinct().collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(event)){ if(!CollectionUtils.isEmpty(event)){
ruleDefaultEntities.stream().filter(rule -> event.contains(rule.getEventCode())).map(o -> { ruleDefaultEntities.stream().filter(rule -> event.contains(rule.getEventCode())).map(o -> {
@ -238,7 +243,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
}); });
} }
//从未被初始化的customerId //被初始化的customerId
List<String> haveInitCustomerIds = baseDao.selectCustomerIds(); List<String> haveInitCustomerIds = baseDao.selectCustomerIds();
if (haveInitCustomerIds == null) { if (haveInitCustomerIds == null) {
haveInitCustomerIds = new ArrayList<>(); haveInitCustomerIds = new ArrayList<>();
@ -249,6 +254,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
if (haveInitCustomerIds.contains(customerDTO.getId())) { if (haveInitCustomerIds.contains(customerDTO.getId())) {
continue; continue;
} }
//对从未被初始化过积分规则的客户进行积分规则初始化
PointRuleEntity entity = ConvertUtils.sourceToTarget(defaultRule, PointRuleEntity.class); PointRuleEntity entity = ConvertUtils.sourceToTarget(defaultRule, PointRuleEntity.class);
entity.setId(""); entity.setId("");
entity.setCreatedBy("INITIALIZATION"); entity.setCreatedBy("INITIALIZATION");

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java

@ -115,6 +115,14 @@ public class IssueAuditController {
return new Result<List<ApplicationHistoryWorkResultDTO>>().ok(issueApplicationHistoryService.applicationHistoryWork(applicationHistoryWorkFormDTO)); return new Result<List<ApplicationHistoryWorkResultDTO>>().ok(issueApplicationHistoryService.applicationHistoryWork(applicationHistoryWorkFormDTO));
} }
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
@PostMapping("audit") @PostMapping("audit")
public Result<String> audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){ public Result<String> audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){
return new Result<String>().ok(issueService.audit(token,param)); return new Result<String>().ok(issueService.audit(token,param));

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -152,7 +152,14 @@ public interface IssueService extends BaseService<IssueEntity> {
* @date 2020.11.19 10:02 * @date 2020.11.19 10:02
*/ */
FirstTopicShiftedToIssueApplicationResultDTO topicShiftedToIssueV2(IssueShiftedFromTopicFormDTO issueShiftedFromTopicFormDTO); FirstTopicShiftedToIssueApplicationResultDTO topicShiftedToIssueV2(IssueShiftedFromTopicFormDTO issueShiftedFromTopicFormDTO);
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
String audit(TokenDto token, IssueAuditionFormDTO param); String audit(TokenDto token, IssueAuditionFormDTO param);
/** /**

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -443,6 +443,14 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return result; return result;
} }
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String audit(TokenDto token, IssueAuditionFormDTO param){ public String audit(TokenDto token, IssueAuditionFormDTO param){

5
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -258,6 +258,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void syncVotingCacheToDb() { public void syncVotingCacheToDb() {
IssueDTO issueParam = new IssueDTO(); IssueDTO issueParam = new IssueDTO();
// 表决中
issueParam.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING); issueParam.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING);
//获取所有voting的议题 //获取所有voting的议题
Set<IssueDTO> issues = Set<IssueDTO> issues =
@ -265,18 +266,20 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
if(null == issues || issues.isEmpty()){ if(null == issues || issues.isEmpty()){
return; return;
} }
// 议题ID集合
Set<String> ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); Set<String> ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet());
List<String> gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList()); List<String> gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList());
CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO(); CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO();
gridIdList.setGridIds(gridIds); gridIdList.setGridIds(gridIds);
// 根据网格Id查询网格下所有加入组的组员
Result<GridVotableCountResultDTO> votableCountResult = resiGroupFeignClient.votableCounts(gridIdList); Result<GridVotableCountResultDTO> votableCountResult = resiGroupFeignClient.votableCounts(gridIdList);
Map<String,Integer> votableCountMap1 = null; Map<String,Integer> votableCountMap1 = null;
if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){ if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){
votableCountMap1 = votableCountResult.getData().getVotableCountMap(); votableCountMap1 = votableCountResult.getData().getVotableCountMap();
} }
final Map<String,Integer> votableCountMap = votableCountMap1; final Map<String,Integer> votableCountMap = votableCountMap1;
//查询指定议题的统计数据
List<IssueVoteStatisticalDTO> statisticalList = List<IssueVoteStatisticalDTO> statisticalList =
baseDao.selectListByIds(ids); baseDao.selectListByIds(ids);
if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) { if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) {

3
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml

@ -23,6 +23,9 @@
</resultMap> </resultMap>
<!-- 生成昨日的话题统计信息 --> <!-- 生成昨日的话题统计信息 -->
<!-- 第一个left Join,每个议题,每种状态的投票总次数 【从当前时间-创建时间,天数大于0】-->
<!-- 第二个left Join,每个议题,每种状态的投票次数 【从当前时间-创建时间,1 >= 天数 >0.也就是昨天】-->
<!-- 关闭天数在一天之内包括1天,转项目天数在一天之内包括1天 -->
<select id="getIssueVotingStatistical" resultType="com.epmet.dto.result.IssuesToBeCountedResultDTO"> <select id="getIssueVotingStatistical" resultType="com.epmet.dto.result.IssuesToBeCountedResultDTO">
SELECT SELECT

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -1107,6 +1107,17 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
} }
/**
* @Description
* @param ifPrecise imprecise(不精确两个日期中间包含多少工作日都按照二十四小时计算) | precise(精确两个日期中间包含多少工作日开头一天的时间到第二日凌晨所剩的分钟数以及最后一次从凌晨到精确时分的分钟数)
* @param ifCustom custom使用客户自定义计算方式 | default(使用默认计算方式)
* @param identity 给此次计算一个唯一索引为了在批量计算中锁定结果
* @param left 开始日期
* @param right 结束日期
* @return java.lang.Integer
* @author wangc
* @date 2021.03.21 23:32
*/
private Integer calculateDelta_T(String ifPrecise,String ifCustom,String identity,Date left,Date right){ private Integer calculateDelta_T(String ifPrecise,String ifCustom,String identity,Date left,Date right){
WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO(); WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO();
timeParam.setIfPrecise(ifPrecise); timeParam.setIfPrecise(ifPrecise);

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java

@ -51,7 +51,7 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable {
* */ * */
private String memberMobile; private String memberMobile;
/** /**
* 组Id不存在redis的value中存在redis的key中 * 组Id
* */ * */
private String groupId; private String groupId;
@ -64,7 +64,8 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable {
"userShowName": "山东路-尹女士", "userShowName": "山东路-尹女士",
"groupLeaderFlag": "leader", "groupLeaderFlag": "leader",
"enterGroupType": "created", "enterGroupType": "created",
"memberStatus": "approved" "memberStatus": "approved",
"groupId":"***"
} }
* *
* *

46
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java

@ -18,6 +18,7 @@
package com.epmet.modules.member.redis; package com.epmet.modules.member.redis;
import cn.hutool.core.bean.BeanUtil;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
@ -25,6 +26,7 @@ import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.constant.ResiGroupRedisKeys;
import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient;
@ -85,7 +87,7 @@ public class ResiGroupMemberRedis {
} }
/** /**
* @Description 得到一个指定组内成员信息,如果redis中没有返回null * @Description 得到一个指定组内成员信息,如果redis中没有去数据库查询并放入缓存
* @Param groupId * @Param groupId
* @Param userId * @Param userId
* @return ResiGroupMemberInfoRedisDTO.class * @return ResiGroupMemberInfoRedisDTO.class
@ -97,7 +99,7 @@ public class ResiGroupMemberRedis {
ResiGroupMemberInfoRedisDTO memberCache = ResiGroupMemberInfoRedisDTO memberCache =
(ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId)); (ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId));
//如果缓存中没有该成员数据 //如果缓存中没有该成员数据
if(null == memberCache || StringUtils.isNotBlank(memberCache.getUserId())){ if(null == memberCache || StringUtils.isBlank(memberCache.getUserId())){
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.CUSTOMER_USER_ID,userId); param.put(TopicConstant.CUSTOMER_USER_ID,userId);
param.put(TopicConstant.RESI_GROUP_ID,groupId); param.put(TopicConstant.RESI_GROUP_ID,groupId);
@ -115,21 +117,34 @@ public class ResiGroupMemberRedis {
memberRedis.setMemberStatus(memberMySql.getStatus()); memberRedis.setMemberStatus(memberMySql.getStatus());
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(memberMySql.getCustomerUserId()); Map<String,Object> map = redisUtils.hGetAll(String.format("epmet:resi:user:%s",userId));
userParam.setCustomerId(groupService.get(groupId).getCustomerId()); if(null != map && !map.isEmpty()) {
Result<UserResiInfoResultDTO> userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam); //缓存中有数据,直接返回
if(userInfo.success()){ UserBaseInfoResultDTO userInfo =
if(null != userInfo.getData()){ BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true);
memberRedis.setUserShowName(userInfo.getData().getShowName()); if(null != userInfo){
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto()); memberRedis.setUserShowName(userInfo.getShowName());
memberRedis.setMemberMobile(userInfo.getData().getRegMobile()); memberRedis.setUserHeadPhoto(userInfo.getHeadImgUrl());
memberRedis.setMemberMobile(userInfo.getMobile());
set(memberRedis);
}
}else {
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(memberMySql.getCustomerUserId());
userParam.setCustomerId(groupService.get(groupId).getCustomerId());
Result<UserResiInfoResultDTO> userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam);
if (userInfo.success()) {
if (null != userInfo.getData()) {
memberRedis.setUserShowName(userInfo.getData().getShowName());
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto());
memberRedis.setMemberMobile(userInfo.getData().getRegMobile());
set(memberRedis);
}
} else {
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
} }
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
} }
set(memberRedis);
return memberRedis; return memberRedis;
}else{ }else{
//日志打印效果:找不到组员信息,组Id: ********,用户Id:******** //日志打印效果:找不到组员信息,组Id: ********,用户Id:********
@ -140,7 +155,6 @@ public class ResiGroupMemberRedis {
.concat(userId)); .concat(userId));
} }
} }
memberCache.setGroupId(groupId);
return memberCache; return memberCache;
} }

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -814,9 +814,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
} }
GridVotableCountResultDTO result = new GridVotableCountResultDTO(); GridVotableCountResultDTO result = new GridVotableCountResultDTO();
Map<String,Integer> votableCountMap = new HashMap<>(); Map<String,Integer> votableCountMap = new HashMap<>();
// 给每个网格初始化 加入小组人数:0
gridList.getGridIds().forEach(gridId -> { gridList.getGridIds().forEach(gridId -> {
votableCountMap.put(gridId, NumConstant.ZERO ); votableCountMap.put(gridId, NumConstant.ZERO );
}); });
// 查询 每个网格的人数 STATE = approved的
List<VotableCountResultDTO> list = baseDao.getMembersCountInGrids(gridList.getGridIds()); List<VotableCountResultDTO> list = baseDao.getMembersCountInGrids(gridList.getGridIds());
if(null == list || list.size() < NumConstant.ZERO){ if(null == list || list.size() < NumConstant.ZERO){
result.setVotableCountMap(votableCountMap); result.setVotableCountMap(votableCountMap);

10
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java

@ -201,6 +201,16 @@ public class UserResiInfoController {
return new Result(); return new Result();
} }
/**
* @Description 在分享链接之后完成注册居民之后调用的接口
* 作用
*
* 更改邀请浏览记录里"是否通过邀请链接注册居民"
* @param param
* @return void
* @author wangc
* @date 2020.12.18 16:34
*/
@PostMapping("submitinlink") @PostMapping("submitinlink")
public Result submitInLink(@RequestBody AfterRegisterResidentInSharableLinkFormDTO param, @LoginUser TokenDto token){ public Result submitInLink(@RequestBody AfterRegisterResidentInSharableLinkFormDTO param, @LoginUser TokenDto token){
param.setInviteeId(token.getUserId()); param.setInviteeId(token.getUserId());

Loading…
Cancel
Save