Browse Source

Merge branch 'dev_bugfix' into dev

dev_shibei_match
sunyuchao 5 years ago
parent
commit
9c2b5fcf04
  1. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java
  2. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java
  3. 22
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  4. 10
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml
  5. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

18
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java

@ -38,4 +38,22 @@ public class MyPartIssuesResultDTO implements Serializable {
@JsonIgnore
private String gridId;
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
MyPartIssuesResultDTO u = (MyPartIssuesResultDTO)obj;
return issueId.equals(u.issueId);
}
@Override
public int hashCode() {
String in = issueId;
return in.hashCode();
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java

@ -81,7 +81,7 @@ public interface IssueVoteDetailDao extends BaseDao<IssueVoteDetailEntity> {
* @author zxc
* @date 2020/11/10 10:01 上午
*/
List<MyPartIssuesResultDTO> myPartIssues(@Param("userId")String userId);
List<MyPartIssuesResultDTO> myPartIssues(@Param("userId")String userId, @Param("topicIds")List<String> topicIds);
List<MyPartIssuesResultDTO> myPartIssuesByTopicId(@Param("topicIds")List<String> topicIds);
}

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

@ -45,6 +45,7 @@ import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.redis.IssueVoteDetailRedis;
import com.epmet.redis.IssueVoteStatisticalRedis;
import com.epmet.resi.group.dto.topic.form.MyPartIssueFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO;
import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.service.IssueVoteDetailService;
@ -549,22 +550,35 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
*/
@Override
public List<MyPartIssuesResultDTO> myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) {
List<MyPartIssuesResultDTO> myPartIssuesResult = issueVoteDetailDao.myPartIssues(myPartIssuesFormDTO.getUserId());
List<MyPartIssuesResultDTO> myPartIssuesResult = new ArrayList<>();
//我创建的话题
TopicIdListFormDTO topicIdListFormDTO = new TopicIdListFormDTO();
topicIdListFormDTO.setUserId(myPartIssuesFormDTO.getUserId());
Result<List<String>> myCreateIssueResult = resiGroupOpenFeignClient.selectMyCreateTopic(topicIdListFormDTO);
if (!myCreateIssueResult.success()){
throw new RenException("查询我创建的话题失败......");
}
//我参与的议题
myPartIssuesResult = issueVoteDetailDao.myPartIssues(myPartIssuesFormDTO.getUserId(), myCreateIssueResult.getData());
//我参与的话题
MyPartIssueFormDTO formDTO = new MyPartIssueFormDTO();
formDTO.setUserId(myPartIssuesFormDTO.getUserId());
Result<MyPartIssueResultDTO> myPartIssueResult = resiGroupOpenFeignClient.selectMyPartTopic(formDTO);
if (!myPartIssueResult.success()){
throw new RenException("查询我评论过的话题失败......");
}
//我参与的话题转了议题的
if (!CollectionUtils.isEmpty(myPartIssueResult.getData().getTopicIds())){
List<MyPartIssuesResultDTO> myPartIssuesResultDTOS = issueVoteDetailDao.myPartIssuesByTopicId(myPartIssueResult.getData().getTopicIds());
myPartIssuesResult.addAll(myPartIssuesResultDTOS);
List<MyPartIssuesResultDTO> myPartIssues = issueVoteDetailDao.myPartIssuesByTopicId(myPartIssueResult.getData().getTopicIds());
myPartIssuesResult.addAll(myPartIssues);
}
if (CollectionUtils.isEmpty(myPartIssuesResult)){
return new ArrayList<>();
}
Set<MyPartIssuesResultDTO> set = new HashSet<>(myPartIssuesResult);
myPartIssuesResult = new ArrayList<>(set);
List<MyPartIssuesResultDTO> collect = myPartIssuesResult.stream().sorted(Comparator.comparing(MyPartIssuesResultDTO::getShiftIssueTime).reversed()).distinct().collect(Collectors.toList());
List<String> orgIds = collect.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<String> orgIds = collect.stream().map(MyPartIssuesResultDTO::getGridId).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> listResult = govOrgOpenFeignClient.getGridListByGridIds(orgIds);
if (!listResult.success()){
throw new RenException("查询议题来源网格名称失败......");

10
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml

@ -73,7 +73,7 @@
</select>
<!-- 个人中心-我参与的议题列表 -->
<select id="myPartIssues" resultType="com.epmet.dto.result.MyPartIssuesResultDTO">
<select id="myPartIssues" resultType="com.epmet.dto.result.MyPartIssuesResultDTO">
SELECT
vd.ISSUE_ID,
i.SUGGESTION,
@ -85,6 +85,11 @@
WHERE i.DEL_FLAG = '0'
AND vd.DEL_FLAG = '0'
AND vd.CREATED_BY = #{userId}
<if test='null!=topicIds and topicIds.size()>0'>
<foreach collection="topicIds" item="topicId" open="AND (" separator="AND" close=")">
i.SOURCE_ID != #{topicId}
</foreach>
</if>
ORDER BY i.CREATED_TIME DESC
</select>
@ -97,8 +102,7 @@
UNIX_TIMESTAMP(i.CREATED_TIME) AS shiftIssueTime
FROM issue i
WHERE i.DEL_FLAG = '0'
AND
<foreach collection="topicIds" item="topicId" separator=" OR ">
<foreach collection="topicIds" item="topicId" open="AND (" separator="OR" close=")">
i.SOURCE_ID = #{topicId}
</foreach>
ORDER BY i.CREATED_TIME DESC

2
epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

@ -78,7 +78,7 @@
REAL_NAME realName,
ID_NUM idNum,
GENDER gender,
MOBILE mobile,
IFNULL(MOBILE,'') mobile,
STREET street,
DISTRICT district,
BUILDING_ADDRESS buildingAddress,

Loading…
Cancel
Save