Browse Source

Merge remote-tracking branch 'origin/dev_issue_project' into dev_issue_project

dev_shibei_match
yinzuomei 5 years ago
parent
commit
9ffbe6497b
  1. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java
  3. 27
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  4. 5
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java
  5. 10
      epmet-module/gov-voice/gov-voice-server/pom.xml
  6. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -103,4 +103,14 @@ public interface ServiceConstant {
* 共通 * 共通
*/ */
String EPMET_COMMON_SERVICE = "common-service-server"; String EPMET_COMMON_SERVICE = "common-service-server";
/**
* 政府端-党建声音
*/
String GOV_VOICE_SERVER="gov-voice-server";
/**
* 居民端-党建声音
*/
String RESI_VOICE_SERVER="resi-voice-server";
} }

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java

@ -23,14 +23,12 @@ import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.IssueConstant; import com.epmet.constant.IssueConstant;
import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueVoteStatisticalDTO;
import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.VoteRedisFormDTO; import com.epmet.dto.form.VoteRedisFormDTO;
import com.epmet.entity.IssueVoteStatisticalEntity;
import com.epmet.feign.ResiGroupFeignClient; import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.service.IssueService; import com.epmet.service.IssueService;
import com.epmet.service.IssueVoteDetailService; import com.epmet.service.IssueVoteDetailService;
import com.epmet.service.IssueVoteStatisticalService; import com.epmet.utils.ModuleConstants;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -55,9 +53,6 @@ public class IssueVoteDetailRedis {
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired
private IssueVoteStatisticalService issueVoteStatisticalService;
@Autowired @Autowired
private ResiGroupFeignClient resiGroupFeignClient; private ResiGroupFeignClient resiGroupFeignClient;
@ -166,7 +161,7 @@ public class IssueVoteDetailRedis {
} }
}else{ }else{
//如果没有该议题,终止所有操作 //如果没有该议题,终止所有操作
logger.warn(String.format("找不到指定Id的议题,Id:【%s】",issueId)); logger.warn(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId));
return null; return null;
} }
@ -208,7 +203,7 @@ public class IssueVoteDetailRedis {
set(voteCache); set(voteCache);
return voteCache; return voteCache;
}else{ }else{
logger.warn(String.format("找不到指定Id的议题,Id:【%s】",issueId)); logger.warn(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId));
return null; return null;
} }
} }

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

@ -302,7 +302,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
summaryList.stream().collect(Collectors.groupingBy(IssueAttitudeCountResultDTO::getIssueId)); summaryList.stream().collect(Collectors.groupingBy(IssueAttitudeCountResultDTO::getIssueId));
for (Map.Entry<String, List<IssueAttitudeCountResultDTO>> entry : summaryMap.entrySet()) { for (Map.Entry<String, List<IssueAttitudeCountResultDTO>> entry : summaryMap.entrySet()) {
IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO(); IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO();
obj.setCreatedBy("system"); obj.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);
obj.setIssueId(entry.getKey()); obj.setIssueId(entry.getKey());
List<IssueAttitudeCountResultDTO> v = entry.getValue(); List<IssueAttitudeCountResultDTO> v = entry.getValue();
if (v.size() > NumConstant.ONE) { if (v.size() > NumConstant.ONE) {
@ -338,7 +338,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO();
dto.setOppositionCount(NumConstant.ZERO); dto.setOppositionCount(NumConstant.ZERO);
dto.setSupportCount(NumConstant.ZERO); dto.setSupportCount(NumConstant.ZERO);
dto.setCreatedBy("system"); dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -468,10 +468,6 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
String k = entry.getKey(); String k = entry.getKey();
List<IssueDTO> v = entry.getValue(); List<IssueDTO> v = entry.getValue();
for(IssueDTO issue : v){ for(IssueDTO issue : v){
//TODO 待删除
Integer a = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.SUPPORT);
//TODO 待删除
Integer b = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.OPPOSE);
IssueVoteStatisticalDTO vote = new IssueVoteStatisticalDTO(); IssueVoteStatisticalDTO vote = new IssueVoteStatisticalDTO();
vote.setIssueId(issue.getId()); vote.setIssueId(issue.getId());
@ -479,31 +475,22 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
if(null == cache) if(null == cache)
continue; continue;
if(StringUtils.isBlank(cache.getIssueId())) cache.setIssueId(issue.getId()); if(StringUtils.isBlank(cache.getIssueId())) cache.setIssueId(issue.getId());
vote.setCreatedBy("system"); vote.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);
vote.setUpdatedBy("system"); vote.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM);
vote.setSupportCount(cache.getSupportAmount()); vote.setSupportCount(cache.getSupportAmount());
vote.setOppositionCount(cache.getOppositionAmount()); vote.setOppositionCount(cache.getOppositionAmount());
vote.setVotableCount( null == votableCountMap ? vote.setVotableCount( null == votableCountMap ?
NumConstant.ZERO : NumConstant.ZERO :
null == votableCountMap.get(k) ? NumConstant.ZERO : votableCountMap.get(k) null == votableCountMap.get(k) ? NumConstant.ZERO : votableCountMap.get(k)
); );
//TODO 待删除
vote.setSupportCount(a);
//TODO 待删除
vote.setOppositionCount(b);
list.add(vote); list.add(vote);
//TODO 待删除 if(cache.getShouldVoteCount() != vote.getVotableCount()){
cache.setOppositionAmount(vote.getOppositionCount());
//TODO 待删除
cache.setSupportAmount(vote.getSupportCount());
//TODO 待恢复
//if(cache.getShouldVoteCount() != vote.getVotableCount()){
cache.setShouldVoteCount(vote.getVotableCount()); cache.setShouldVoteCount(vote.getVotableCount());
cache.setIssueId(issue.getId()); cache.setIssueId(issue.getId());
issueVoteDetailRedis.set(cache); issueVoteDetailRedis.set(cache);
//TODO 待恢复 }
//}
} }
} }

5
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java

@ -104,4 +104,9 @@ public interface ModuleConstants {
* */ * */
String ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE = "没有找到指定议题,议题Id:【%s】"; String ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE = "没有找到指定议题,议题Id:【%s】";
/**
* 定时任务创建的数据 created_by
* */
String CREATED_BY_SYSTEM = "system";
} }

10
epmet-module/gov-voice/gov-voice-server/pom.xml

@ -94,9 +94,9 @@
<!-- 数据库配置--> <!-- 数据库配置-->
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epmet_voice_user</spring.datasource.druid.username> <spring.datasource.druid.username>epmet_gov_voice_user</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password> <spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
@ -122,6 +122,12 @@
<server.port>8104</server.port> <server.port>8104</server.port>
<spring.profiles.active>test</spring.profiles.active> <spring.profiles.active>test</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_gov_voice?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username>
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -246,10 +246,13 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
userResiInfoFormDTO.setUserId(enterGridFormDTO.getUserId()); userResiInfoFormDTO.setUserId(enterGridFormDTO.getUserId());
UserResiInfoResultDTO userResiInfo = userResiInfoDao.selectUserResiInfoNotByCustId(userResiInfoFormDTO); UserResiInfoResultDTO userResiInfo = userResiInfoDao.selectUserResiInfoNotByCustId(userResiInfoFormDTO);
//如果没有注册居民,昵称、用户头像为空
resultObj.setNickname(ModuleConstant.EMPTY_STR);
resultObj.setUserHeadPhoto(ModuleConstant.EMPTY_STR);
if(null != userResiInfo) { if(null != userResiInfo) {
//已经注册居民
resultObj.setNickname(userResiInfo.getShowName()); resultObj.setNickname(userResiInfo.getShowName());
}else{ resultObj.setUserHeadPhoto(userResiInfo.getHeadPhoto());
log.warn(String.format("查找用户居民注册信息失败,用户Id:【%s】",enterGridFormDTO.getUserId()));
} }
} }

Loading…
Cancel
Save