Browse Source

Merge remote-tracking branch 'origin/dev_bugfix' into dev

dev_shibei_match
wxz 5 years ago
parent
commit
e1e976776f
  1. 11
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java
  2. 12
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java
  3. 62
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java
  4. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  5. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  6. 31
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  7. 44
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/GovCommentResultDTO.java
  8. 51
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java
  9. 56
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java
  10. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

11
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiTopicController.java

@ -5,11 +5,12 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovHiddenTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import com.epmet.service.ResiTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -34,7 +35,7 @@ public class ResiTopicController {
* @Date 2020.04.01 16:45
**/
@PostMapping("hiddenlist")
Result<List<ResiTopicInfoResultDTO>> hiddenList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){
Result<List<GovHiddenTopicInfoResultDTO>> hiddenList(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicPageFormDTO topicPageFormDTO){
topicPageFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(topicPageFormDTO);
return resiTopicService.hiddenList(topicPageFormDTO);
@ -49,7 +50,7 @@ public class ResiTopicController {
* @Date 2020.04.01 10:36
**/
@PostMapping("alltopics")
Result<List<ResiTopicInfoResultDTO>> allTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){
Result<List<GovTopicInfoResultDTO>> allTopics(@LoginUser TokenDto tokenDto,@RequestBody ResiTopicPageFormDTO topicPageFormDTO){
topicPageFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(topicPageFormDTO);
return resiTopicService.allTopics(topicPageFormDTO);
@ -78,7 +79,7 @@ public class ResiTopicController {
* @Date 2020.04.01 23:49
**/
@PostMapping("topiccomments")
Result<List<ResiCommentResultDTO>> topicComments(@LoginUser TokenDto tokenDto,@RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){
Result<List<GovCommentResultDTO>> topicComments(@LoginUser TokenDto tokenDto, @RequestBody ResiQueryCommentFormDTO queryCommentFormDTO){
ValidatorUtils.validateEntity(queryCommentFormDTO);
return resiTopicService.topicComments(queryCommentFormDTO);
}

12
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiTopicService.java

@ -2,12 +2,12 @@ package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovHiddenTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -21,7 +21,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 16:45
**/
Result<List<ResiTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO);
Result<List<GovHiddenTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO);
/**
* @Description 政府端群组管理-查看历史话题(分页,允许状态筛选)
@ -31,7 +31,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 10:36
**/
Result<List<ResiTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO);
Result<List<GovTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO);
/**
* @Description 政府端群组管理-获取话题详情
@ -51,7 +51,7 @@ public interface ResiTopicService {
* @Author wangc
* @Date 2020.04.01 23:49
**/
Result<List<ResiCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO);
Result<List<GovCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO);
}

62
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java

@ -4,15 +4,19 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO;
import com.epmet.resi.group.dto.comment.result.GovCommentResultDTO;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.GovHiddenTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.GovTopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import com.epmet.service.ResiTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@ -30,10 +34,26 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 16:45
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO) {
public Result<List<GovHiddenTopicInfoResultDTO>> hiddenList(ResiTopicPageFormDTO topicPageFormDTO) {
topicPageFormDTO.setPageNo(NumConstant.ONE);
topicPageFormDTO.setPageSize(NumConstant.MAX);
return resiGroupFeignClient.getHiddenTopicGov(topicPageFormDTO);
Result<List<ResiTopicInfoResultDTO>> topics = resiGroupFeignClient.getHiddenTopicGov(topicPageFormDTO);
List<GovHiddenTopicInfoResultDTO> topicsResult = new ArrayList<>();
if(topics.success() && null != topics.getData() && topics.getData().size() > NumConstant.ZERO) {
topics.getData().forEach(top -> {
GovHiddenTopicInfoResultDTO govTopic = new GovHiddenTopicInfoResultDTO();
govTopic.setTopicContent(top.getTopicContent());
govTopic.setUserId(top.getUserId());
govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto());
govTopic.setUserNickName(top.getReleaseUserName());
govTopic.setTopicId(top.getTopicId());
govTopic.setTopicRealseTime(top.getReleaseTime().getTime());
govTopic.setTopicFirstPhoto(top.getFirstPhoto());
topicsResult.add(govTopic);
});
}
return new Result<List<GovHiddenTopicInfoResultDTO>>().ok(topicsResult);
}
/**
@ -45,8 +65,24 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 10:36
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO) {
return resiGroupFeignClient.getPastTopicListGov(topicPageFormDTO);
public Result<List<GovTopicInfoResultDTO>> allTopics(ResiTopicPageFormDTO topicPageFormDTO) {
Result<List<ResiTopicInfoResultDTO>> topics = resiGroupFeignClient.getPastTopicListGov(topicPageFormDTO);
List<GovTopicInfoResultDTO> topicsResult = new ArrayList<>();
if(topics.success() && null != topics.getData() && topics.getData().size() > NumConstant.ZERO) {
topics.getData().forEach(top -> {
GovTopicInfoResultDTO govTopic = new GovTopicInfoResultDTO();
govTopic.setTopicContent(top.getTopicContent());
govTopic.setUserId(top.getUserId());
govTopic.setUserHeadPhoto(top.getReleaseUserHeadPhoto());
govTopic.setUserNickName(top.getReleaseUserName());
govTopic.setTopicId(top.getTopicId());
govTopic.setTopicRealseTime(top.getReleaseTime().getTime());
govTopic.setTopicFirstPhoto(top.getFirstPhoto());
govTopic.setTopicState(top.getStatus());
topicsResult.add(govTopic);
});
}
return new Result<List<GovTopicInfoResultDTO>>().ok(topicsResult);
}
/**
@ -71,7 +107,21 @@ public class ResiTopicServiceImpl implements ResiTopicService {
* @Date 2020.04.01 23:49
**/
@Override
public Result<List<ResiCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO) {
return resiGroupFeignClient.getCommentListOfTopicGov(queryCommentFormDTO);
public Result<List<GovCommentResultDTO>> topicComments(ResiQueryCommentFormDTO queryCommentFormDTO) {
Result<List<ResiCommentResultDTO>> comments = resiGroupFeignClient.getCommentListOfTopicGov(queryCommentFormDTO);
List<GovCommentResultDTO> commentsResult = new ArrayList<>();
if(comments.success() && null != comments.getData() && comments.getData().size() > NumConstant.ZERO){
comments.getData().forEach(com -> {
GovCommentResultDTO govComment = new GovCommentResultDTO();
govComment.setCommentId(com.getCommentId());
govComment.setCommentContent(com.getCommentContent());
govComment.setCommentUserHeadPhoto(com.getCommentUserHeadPhoto());
govComment.setCommentUserName(com.getCommentUserName());
govComment.setCommentTime(com.getCommentTime());
commentsResult.add(govComment);
});
}
return new Result<List<GovCommentResultDTO>>().ok(commentsResult);
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -60,6 +60,12 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
**/
List<CustomerGridForStrangerResultDTO> selectRestGridWithoutGivenAreaCode(Map<String, Object> paramsMap);
/**
* @Description 通过gridId查询网格信息网格名称格式 上级组织名称-网格名称
* @param customerGridFormDTO
* @author wangc
* @date 2020.04.30 13:57
**/
CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO);
/**

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -166,6 +166,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
/** 根据网格Id查询用户数据
* @param customerGridFormDTO
* @return
* @date 2020-03-17
*/
@Override
public Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) {
return new Result<CustomerGridDTO>().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO));

31
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -7,15 +7,19 @@
SELECT
gr.id,
gr.customer_id,
gr.grid_name,
CONCAT(ag.ORGANIZATION_NAME,'-',gr.grid_name) AS gridName,
gr.pid,
gr.pids,
gr.longitude,
gr.latitude,
gr.area_code
FROM customer_grid gr
LEFT JOIN customer_agency ag
ON gr.PID = ag.ID
WHERE
gr.del_flag = '0'
AND
ag.DEL_FLAG = '0'
<if test='gridId != "" and gridId != null'>
AND gr.id = #{gridId}
</if>
@ -265,16 +269,27 @@
<select id="selectGridByIds" resultType="com.epmet.dto.result.AllGridsByUserIdResultDTO">
SELECT
id AS 'gridId',
grid_name AS 'gridName',
customer_id AS 'customerId'
FROM customer_grid
WHERE del_flag = '0'
AND id IN
cg.id AS 'gridId',
IF(
ca.ORGANIZATION_NAME = '',
cg.grid_name,
CONCAT(ca.organization_name,'-',cg.grid_name)
) AS 'gridName',
cg.customer_id AS 'customerId'
FROM customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE cg.del_flag = '0'
AND ca.del_flag = '0'
AND cg.id IN
<foreach item="id" collection="gridIdList" open="(" separator="," close=")">
#{id}
</foreach>
ORDER BY CONVERT (grid_name USING gbk) ASC<!-- 网格名称对应拼音升序排序 -->
ORDER BY field(
cg.id,
<foreach item="id" collection="gridIdList" separator=",">
#{id}
</foreach>
)<!-- 按照foreach中遍历的Id顺序排序(按网格访问时间倒序) -->
</select>
</mapper>

44
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/GovCommentResultDTO.java

@ -0,0 +1,44 @@
package com.epmet.resi.group.dto.comment.result;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @ClassName GovCommentResultDTO
* @Auth wangc
* @Date 2020-04-30 13:07
*/
@Data
public class GovCommentResultDTO implements Serializable {
private static final long serialVersionUID = -6141574797811146831L;
/**
* 评论Id
* */
private String commentId;
/**
* 评论内容
* */
private String commentContent;
/**
* 评论者头像
* */
private String commentUserHeadPhoto;
/**
* 评论者姓名
* */
private String commentUserName;
/**
* 评论时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
private Date commentTime;
}

51
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java

@ -0,0 +1,51 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GovHiddenTopicInfoResultDTO
* @Auth wangc
* @Date 2020-04-30 13:42
*/
@Data
public class GovHiddenTopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = 6993547275260814680L;
/**
* 作者的Id
* */
private String userId;
/**
* 用户头像
* */
private String userHeadPhoto;
/**
* 用户昵称
* */
private String userNickName;
/**
* 话题Id
* */
private String topicId;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题发布时间 时间戳
* */
private Long topicRealseTime;
/**
* 话题的第一张图片地址
* */
private String topicFirstPhoto;
}

56
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.resi.group.dto.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GovTopicInfoResultDTO
* @Auth wangc
* @Date 2020-04-30 13:08
*/
@Data
public class GovTopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = -3495808492616727671L;
/**
* 作者的Id
* */
private String userId;
/**
* 用户头像
* */
private String userHeadPhoto;
/**
* 用户昵称
* */
private String userNickName;
/**
* 话题Id
* */
private String topicId;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题发布时间 时间戳
* */
private Long topicRealseTime;
/**
* 话题的第一张图片地址
* */
private String topicFirstPhoto;
/**
* 话题的状态
* */
private String topicState;
}

1
epmet-user/epmet-user-server/src/main/resources/mapper/GridLatestDao.xml

@ -80,5 +80,6 @@
WHERE
del_flag = '0'
AND customer_user_id = #{userId}
ORDER BY latest_time DESC
</select>
</mapper>

Loading…
Cancel
Save