Browse Source

Merge remote-tracking branch 'origin/dev_resi_event' into develop

master
yinzuomei 4 years ago
parent
commit
f2503d863b
  1. 6
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java
  2. 3
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java
  3. 18
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java
  4. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  5. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java
  6. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java
  7. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  8. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  9. 1
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql
  10. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml

6
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java

@ -32,4 +32,10 @@ public class MentionUserFormDTO implements Serializable {
* 注册网格的所有上级
*/
private String pids;
/**
* 人大代表姓名
*/
private String userShowName;
}

3
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java

@ -20,4 +20,7 @@ public class ReplyListFormDTO implements Serializable {
@NotBlank(message = "报事ID不能为空",groups = ReplyListForm.class)
private String resiEventId;
@NotBlank(message = "当前用户id不能为空",groups = ReplyListForm.class)
private String currentUserId;
}

18
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
@ -14,5 +16,21 @@ public class ReplyListResultDTO implements Serializable {
private static final long serialVersionUID = 4875335642497226847L;
/**
* 回复人的昵称比如南宁路社区,人大代表-李四,山东路-尹女士
* */
private String replyName;
/**
* 回复时间
* */
private Date replyTime;
/**
* 回复的内容
* */
private String replyContent;
@JsonIgnore
private String replyUserId;
}

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java

@ -17,6 +17,8 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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.dto.form.ReplyListFormDTO;
@ -51,7 +53,8 @@ public class ResiEventReplyController {
* @date 2021/8/3 11:11 上午
*/
@PostMapping("list")
public Result<List<ReplyListResultDTO>> replyList(@RequestBody ReplyListFormDTO formDTO){
public Result<List<ReplyListResultDTO>> replyList(@LoginUser TokenDto tokenDto, @RequestBody ReplyListFormDTO formDTO){
formDTO.setCurrentUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ReplyListFormDTO.ReplyListForm.class);
return new Result<List<ReplyListResultDTO>>().ok(resiEventReplyService.replyList(formDTO));
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java

@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.entity.ResiEventReplyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 事件回复表
*
@ -29,5 +32,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiEventReplyDao extends BaseDao<ResiEventReplyEntity> {
/**
* 查询事件的回复列表
*
* @param resiEventId
* @return java.util.List<com.epmet.dto.result.ReplyListResultDTO>
* @author yinzuomei
* @date 2021/8/4 13:22
*/
List<ReplyListResultDTO> selectReplyList(String resiEventId);
}

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java

@ -50,6 +50,11 @@ public class ResiEventMentionEntity extends BaseEpmetEntity {
*/
private String userType;
/**
* 人大代表目前显示姓名
*/
private String userShowName;
/**
* 居民端用户id
*/

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java

@ -44,6 +44,12 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
*/
@Override
public List<ReplyListResultDTO> replyList(ReplyListFormDTO formDTO) {
return null;
List<ReplyListResultDTO> list=baseDao.selectReplyList(formDTO.getResiEventId());
list.forEach(dto->{
if(dto.getReplyUserId().equals(formDTO.getCurrentUserId())){
dto.setReplyName("我");
}
});
return list;
}
}

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -200,6 +200,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
mentionEntity.setCustomerId(customerId);
mentionEntity.setResiEventId(resiEventId);
mentionEntity.setUserType(EventConstant.NPC_USER);
mentionEntity.setUserShowName(npc.getUserShowName());
mentionEntity.setUserId(npc.getUserId());
mentionEntity.setGridId(npc.getGridId());
mentionEntity.setAgencyId(npc.getAgencyId());

1
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql

@ -54,6 +54,7 @@ CREATE TABLE `resi_event_mention` (
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`USER_TYPE` varchar(32) NOT NULL COMMENT '人大代表:npc_user',
`USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '人大代表目前显示姓名',
`USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '居民注册网格ID',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '居民所属社区,就是grid_id的所属组织',

15
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.dao.ResiEventReplyDao">
<select id="selectReplyList" parameterType="java.lang.String" resultType="com.epmet.dto.result.ReplyListResultDTO">
SELECT
rer.USER_SHOW_NAME as replyName,
rer.CREATED_TIME as replyTime,
rer.CONTENT as replyContent,
rer.FROM_USER_ID as replyUserId
FROM
resi_event_reply rer
WHERE
rer.DEL_FLAG = '0'
AND rer.RESI_EVENT_ID = #{resiEventId}
ORDER BY
rer.CREATED_TIME DESC
</select>
</mapper>
Loading…
Cancel
Save