Browse Source

议题详情

master
zxc 5 years ago
parent
commit
1d4c09868b
  1. 23
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BelongGridNameFormDTO.java
  2. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BelongGridNameResultDTO.java
  3. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  4. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  5. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  7. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  8. 43
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicInfoDTO.java
  9. 23
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicInfoFormDTO.java
  10. 11
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
  11. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallback.java
  12. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java
  13. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java
  14. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java
  15. 35
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  16. 14
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
  17. 43
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/PolyLineDTO.java
  18. 23
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/BelongGridNameFormDTO.java
  19. 21
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java
  20. 4
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java
  21. 23
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/TopicInfoFormDTO.java
  22. 23
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/BelongGridNameResultDTO.java
  23. 48
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java
  24. 38
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingTrendResultDTO.java
  25. 5
      epmet-module/resi-hall/resi-hall-server/pom.xml
  26. 7
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java
  27. 2
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  28. 29
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java
  29. 24
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  30. 28
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java
  31. 22
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java
  32. 23
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  33. 21
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java
  34. 4
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java
  35. 51
      epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  36. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java
  37. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IssueInitiatorResultDTO.java
  38. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java
  39. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java
  40. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java
  41. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  42. 24
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

23
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BelongGridNameFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询所属网格
* @CreateTime 2020/5/11 9:36
*/
@Data
public class BelongGridNameFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BelongGridNameResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @CreateTime 2020/5/11 18:30
*/
@Data
public class BelongGridNameResultDTO implements Serializable {
private static final long serialVersionUID = -5513674274570554563L;
/**
* 所属网格(网格所属机关单位名称-网格名称)
*/
private String BelongsGridName;
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.SelectGridNameByGridIdFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.form.CustomerGridFormDTO;
@ -182,4 +183,15 @@ public class CustomerGridController {
return customerGridService.getGridListByGridIds(gridIdList);
}
/**
* @Description 获取所属网格
* @param formDTO
* @author zxc
* @date 2020/5/11 18:37
*/
@PostMapping("getgridnamebygridid")
public Result<BelongGridNameResultDTO> getGridNameByGridId(@RequestBody BelongGridNameFormDTO formDTO){
return new Result<BelongGridNameResultDTO>().ok(customerGridService.getGridNameByGridId(formDTO));
}
}

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

@ -19,11 +19,8 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.*;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.form.SelectGridNameByGridIdFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.DeleteGridFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
@ -155,4 +152,12 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Author sun
*/
List<AllGridsByUserIdResultDTO> selectGridByIds(@Param("gridIdList") List<String> gridIdList);
/**
* @Description 获取所属网格
* @param formDTO
* @author zxc
* @date 2020/5/11 18:50
*/
BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -228,4 +228,12 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
*/
Result<List<AllGridsByUserIdResultDTO>> getGridListByGridIds(List<String> gridIdList);
/**
* @Description 获取所属网格
* @param formDTO
* @author zxc
* @date 2020/5/11 18:36
*/
BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO);
}

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

@ -536,4 +536,15 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
List<AllGridsByUserIdResultDTO> list = baseDao.selectGridByIds(gridIdList);
return result.ok(list);
}
/**
* @Description 获取所属网格
* @param formDTO
* @author zxc
* @date 2020/5/11 18:37
*/
@Override
public BelongGridNameResultDTO getGridNameByGridId(BelongGridNameFormDTO formDTO) {
return baseDao.getGridNameByGridId(formDTO);
}
}

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

@ -270,4 +270,19 @@
)<!-- 按照foreach中遍历的Id顺序排序(按网格访问时间倒序) -->
</select>
<!-- 获取所属网格 -->
<select id="getGridNameByGridId" parameterType="com.epmet.dto.form.BelongGridNameFormDTO" resultType="com.epmet.dto.result.BelongGridNameResultDTO">
SELECT
CONCAT(
IFNULL( ca.organization_name, '' ),
'-',
IFNULL( cg.grid_name, '' )) AS belongsGridName
FROM
customer_grid cg
LEFT JOIN customer_agency ca ON ca.id = cg.pid
WHERE
cg.id = #{gridId}
AND cg.del_flag = 0
</select>
</mapper>

43
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicInfoDTO.java

@ -0,0 +1,43 @@
package com.epmet.resi.group.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* 话题详情(议题详情中的)
* @CreateTime 2020/5/11 9:36
*/
@Data
public class TopicInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
*/
private String topicId;
/**
* 话题内容
*/
private String topicContent;
/**
* 图片列表
*/
private List<String> topicImgs;
/**
* 话题发表人山东路168-尹女士
*/
private String publishedUser;
/**
* 话题发表时间 (时间戳 毫秒级)
*/
private Long publishedTime;
}

23
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicInfoFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询话题信息
* @CreateTime 2020/5/11 9:36
*/
@Data
public class TopicInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
*/
private String topicId;
}

11
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java

@ -3,6 +3,7 @@ package com.epmet.modules.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallback;
@ -17,6 +18,7 @@ import java.util.List;
* @Description epmet_user服务fegin
* @Author yinzuomei
* @Date 2020/3/16 14:48
* url = "localhost:8087"
*/
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class)
public interface EpmetUserFeignClient {
@ -63,4 +65,13 @@ public interface EpmetUserFeignClient {
@PostMapping(value = "epmetuser/staffrole/specificrolesstaffs", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<String>> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO);
/**
* @Description 查询议题发起人
* @param formDTO
* @author zxc
* @date 2020/5/11 10:53
*/
@PostMapping(value = "/epmetuser/userresiinfo/selectissueinitiator")
Result<IssueInitiatorResultDTO> selectIssueInitiator(@RequestBody IssueInitiatorFormDTO formDTO);
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallback.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
@ -43,4 +44,9 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient {
public Result<List<String>> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "specificRolesStaffs", rolesUsersListFormDTO);
}
@Override
public Result<IssueInitiatorResultDTO> selectIssueInitiator(IssueInitiatorFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectIssueInitiator", formDTO);
}
}

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java

@ -5,6 +5,7 @@ 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.modules.topic.service.ResiTopicService;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueDetailResultDTO;
@ -187,4 +188,15 @@ public class ResiTopicController {
return topicService.getTopicDetailGov(topicDetailFormDTO.getTopicId());
}
/**
* @Description 根据topicId查询话题信息 议题详情话题信息
* @param topicInfo
* @author zxc
* @date 2020/5/11 14:15
*/
@PostMapping(value = "selectdetail")
public Result<TopicInfoDTO> selectDetail(@RequestBody TopicInfoFormDTO topicInfo){
return new Result<TopicInfoDTO>().ok(topicService.selectDetail(topicInfo));
}
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java

@ -21,8 +21,10 @@ package com.epmet.modules.topic.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.topic.entity.ResiTopicEntity;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueInfoResultDTO;
import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -110,4 +112,12 @@ public interface ResiTopicDao extends BaseDao<ResiTopicEntity> {
* @Date 2020.04.01 15:21
**/
List<ResiTopicDTO> selectTopicList(ResiTopicDTO resiTopicDTO);
/**
* @Description 根据topicId查询话题信息 议题详情话题信息
* @param formDTO
* @author zxc
* @date 2020/5/11 15:28
*/
TopicInfoDTO selectDetail(TopicInfoFormDTO formDTO);
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java

@ -26,9 +26,11 @@ import com.epmet.modules.topic.entity.ResiTopicEntity;
import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicOperationFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPublishFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueInfoResultDTO;
@ -219,4 +221,12 @@ public interface ResiTopicService extends BaseService<ResiTopicEntity> {
**/
Result<ResiTopicDetailResultDTO> getTopicDetailGov(String topicId);
/**
* @Description 根据topicId查询话题信息 议题详情话题信息
* @param formDTO
* @author zxc
* @date 2020/5/11 14:16
*/
TopicInfoDTO selectDetail(TopicInfoFormDTO formDTO);
}

35
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -29,7 +29,9 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.constant.GroupMemberConstant;
import com.epmet.modules.feign.EpmetUserFeignClient;
@ -60,9 +62,11 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO;
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.TopicInfoDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicOperationFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPublishFormDTO;
import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueInfoResultDTO;
@ -117,6 +121,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
@Autowired
private ResiGroupRedis resiGroupRedis;
@Autowired
private ResiTopicDao resiTopicDao;
private final Log logger = LogFactory.getLog(getClass());
@Override
@ -896,6 +903,34 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
}
/**
* @Description 根据topicId查询话题信息 议题详情话题信息
* @param formDTO
* @author zxc
* @date 2020/5/11 14:16
*/
@Override
public TopicInfoDTO selectDetail(TopicInfoFormDTO formDTO) {
TopicInfoDTO topicInfo = resiTopicDao.selectDetail(formDTO);
//话题图片
QueryWrapper<ResiTopicAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(TopicConstant.TOPIC_ID,formDTO.getTopicId());
wrapper.orderByAsc(TopicConstant.SORT);
List<ResiTopicAttachmentEntity> attachments = resiTopicAttachmentDao.selectList(wrapper);
List<String> attachmentUrls = new ArrayList<>();
for(ResiTopicAttachmentEntity attachment : attachments){
attachmentUrls.add(attachment.getAttachmentUrl());
}
topicInfo.setTopicImgs(attachmentUrls);
//话题发起人
IssueInitiatorFormDTO issueInitiator = new IssueInitiatorFormDTO();
issueInitiator.setUserId(topicInfo.getTopicId());
Result<IssueInitiatorResultDTO> issueInitiatorResult = epmetUserFeignClient.selectIssueInitiator(issueInitiator);
topicInfo.setPublishedUser(issueInitiatorResult.getData().getIssueInitiator());
return topicInfo;
}
}

14
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -337,4 +337,18 @@
</foreach>
</update>
<!-- 根据topicId查询话题信息 (议题详情——话题信息) -->
<select id="selectDetail" parameterType="com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO" resultType="com.epmet.resi.group.dto.topic.TopicInfoDTO">
SELECT
id AS topicId,
topic_content AS topicContent,
created_by AS publishedUser,
UNIX_TIMESTAMP( created_time ) AS publishedTime
FROM
resi_topic
WHERE
id = #{topicId}
AND del_flag = 0
</select>
</mapper>

43
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/PolyLineDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* 投票折线数据
* @CreateTime 2020/5/11 9:36
*/
@Data
public class PolyLineDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
*/
private String topicId;
/**
* 话题内容
*/
private String topicContent;
/**
* 图片列表
*/
private List<String> topicImgs;
/**
* 话题发表人山东路168-尹女士
*/
private String publishedUser;
/**
* 话题发表时间 (时间戳 毫秒级)
*/
private Long publishedTime;
}

23
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/BelongGridNameFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询所属网格
* @CreateTime 2020/5/11 9:36
*/
@Data
public class BelongGridNameFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格id
*/
private String gridId;
}

21
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 议题Id
* @Author zxc
* @Date 2020/5/11 9:30
*/
@Data
public class IssueIdFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214503489L;
@NotBlank(message = "议题id不能为空")
private String issueId;
}

4
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java

@ -15,9 +15,9 @@ public class IssueInitiatorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
* userId 用户id
*/
private String topicId;
private String userId;
}

23
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/TopicInfoFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询话题信息
* @CreateTime 2020/5/11 9:36
*/
@Data
public class TopicInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
*/
private String topicId;
}

23
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/BelongGridNameResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询所属网格
* @CreateTime 2020/5/11 9:36
*/
@Data
public class BelongGridNameResultDTO implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 所属网格名称 eg:所属网格(网格所属机关单位名称-网格名称)
*/
private String belongsGridName;
}

48
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 议题详情回参
* @CreateTime 2020/5/11 9:31
*/
@Data
public class IssueResultDTO implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 议题标题
*/
private String issueTitle;
/**
* 议题状态(voting 已转项目shift_project 已关闭closed)
*/
private String issueStatus;
/**
* 议题建议
*/
private String issueSuggestion;
/**
* 网格Id
*/
private String gridId;
/**
* 用户id
*/
private String userId;
/**
* 话题Id
*/
private String topicId;
}

38
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingTrendResultDTO.java

@ -0,0 +1,38 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 议题表决折线图
* @CreateTime 2020/5/11 9:36
*/
@Data
public class VotingTrendResultDTO implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 应表决数量
*/
private Integer shouldVoteCount;
/**
* 实际表决数量
*/
private Integer realityVoteCount;
/**
* 截至今日赞成票总数
*/
private Integer supportAmount;
/**
* 截至今日反对票总数
*/
private Integer oppositionAmount;
}

5
epmet-module/resi-hall/resi-hall-server/pom.xml

@ -19,11 +19,6 @@
<artifactId>resi-hall-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-mybatis</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

7
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java

@ -31,10 +31,15 @@ public class IssueController {
* @date 2020/5/11 9:42
*/
@PostMapping(value = "/detail")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL)
// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL)
public Result<IssueDetailResultDTO> detail(@RequestBody IssueDetailFormDTO issueDetail){
return new Result<IssueDetailResultDTO>().ok(issueService.detail(issueDetail));
}
/*@PostMapping(value = "votingtrend")
public Result<> votingTrend(){
return
}*/
}

2
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @dscription
* @date 2020/5/11 10:32
*/
//url = "8087"
//url = "localhost:8087"
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class)
public interface EpmetUserFeignClient {

29
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java

@ -0,0 +1,29 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.result.IssueResultDTO;
import com.epmet.feign.fallback.GovIssueFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Description Feign调用gov-issue-server模块
* @ClassName GovIssueFeignFallBack
* url = "localhost:8101"
*/
@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueFeignClientFallBack.class)
public interface GovIssueFeignClient {
/**
* @Description 议题详情
* @param issueDetail
* @author zxc
* @date 2020/5/11 16:50
*/
@PostMapping("/gov/issue/issue/issuedetail")
Result<IssueResultDTO> issueDetail(@RequestBody IssueDetailFormDTO issueDetail);
}

24
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -0,0 +1,24 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.result.BelongGridNameResultDTO;
import com.epmet.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Description Feign调用gov-org-server模块
* @ClassName GovOrgFeginFallBack
* url = "localhost:8092"
*/
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
public interface GovOrgFeignClient {
@PostMapping("/gov/org/customergrid/getgridnamebygridid")
Result<BelongGridNameResultDTO> getGridNameByGridId(@RequestBody BelongGridNameFormDTO formDTO);
}

28
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java

@ -0,0 +1,28 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.TopicInfoDTO;
import com.epmet.dto.form.TopicInfoFormDTO;
import com.epmet.feign.fallback.ResiGroupFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @author zxc
* url = "localhost:8095"
*/
@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class)
public interface ResiGroupFeignClient {
/**
* @Description 获取话题详情
* @param formDTO
* @author zxc
* @date 2020/5/11 15:42
*/
@PostMapping("/resi/group/topic/selectdetail")
Result<TopicInfoDTO> selectDetail(TopicInfoFormDTO formDTO);
}

22
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java

@ -0,0 +1,22 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.result.IssueResultDTO;
import com.epmet.feign.GovIssueFeignClient;
import org.springframework.stereotype.Component;
/**
* @Description Feign
* @ClassName GovIssueFeginFallBack
*/
@Component
public class GovIssueFeignClientFallBack implements GovIssueFeignClient {
@Override
public Result<IssueResultDTO> issueDetail(IssueDetailFormDTO issueDetail) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "issueDetail", issueDetail);
}
}

23
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -0,0 +1,23 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.result.BelongGridNameResultDTO;
import com.epmet.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
/**
* @Description Feign
* @ClassName GovOrgFeginFallBack
*/
@Component
public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
@Override
public Result<BelongGridNameResultDTO> getGridNameByGridId(BelongGridNameFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridNameByGridId", formDTO);
}
}

21
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java

@ -0,0 +1,21 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.TopicInfoDTO;
import com.epmet.dto.form.TopicInfoFormDTO;
import com.epmet.feign.ResiGroupFeignClient;
import org.springframework.stereotype.Component;
/**
* @author zxc
*/
@Component
public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient {
@Override
public Result<TopicInfoDTO> selectDetail(TopicInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectDetail", formDTO);
}
}

4
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java

@ -1,15 +1,13 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.result.IssueDetailResultDTO;
import com.epmet.entity.IssueEntity;
/**
* @Author zxc
* @CreateTime 2020/5/11 9:44
*/
public interface IssueService extends BaseService<IssueEntity> {
public interface IssueService {
/**
* @Description 议题详情

51
epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -1,11 +1,21 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IssueDao;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.TopicInfoDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.TopicInfoFormDTO;
import com.epmet.dto.result.BelongGridNameResultDTO;
import com.epmet.dto.result.IssueDetailResultDTO;
import com.epmet.entity.IssueEntity;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.IssueResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovIssueFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.service.IssueService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,10 +24,16 @@ import org.springframework.stereotype.Service;
* @CreateTime 2020/5/11 9:46
*/
@Service
public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> implements IssueService {
public class IssueServiceImpl implements IssueService {
@Autowired
private IssueDao issueDao;
private EpmetUserFeignClient userFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private ResiGroupFeignClient resiGroupFeignClient;
@Autowired
private GovIssueFeignClient govIssueFeignClient;
/**
* @Description 议题详情
@ -27,8 +43,29 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
*/
@Override
public IssueDetailResultDTO detail(IssueDetailFormDTO issueDetail) {
IssueDetailResultDTO issueDetailResult = issueDao.issueDetail(issueDetail);
IssueDetailResultDTO issueDetailResult = new IssueDetailResultDTO();
//议题信息
Result<IssueResultDTO> issueResultDTOResult = govIssueFeignClient.issueDetail(issueDetail);
IssueResultDTO issueResult = issueResultDTOResult.getData();
if (issueResult==null){
return issueDetailResult;
}
BeanUtils.copyProperties(issueResult,issueDetailResult);
//话题发起人
IssueInitiatorFormDTO initiatorFormDTO = new IssueInitiatorFormDTO();
initiatorFormDTO.setUserId(issueResult.getUserId());
Result<IssueInitiatorResultDTO> initiatorResult = userFeignClient.selectIssueInitiator(initiatorFormDTO);
issueDetailResult.setIssueInitiator(initiatorResult.getData().getIssueInitiator());
//网格名称
BelongGridNameFormDTO belongGridName = new BelongGridNameFormDTO();
belongGridName.setGridId(issueResult.getGridId());
Result<BelongGridNameResultDTO> belongGridNameResult = govOrgFeignClient.getGridNameByGridId(belongGridName);
issueDetailResult.setBelongsGridName(belongGridNameResult.getData().getBelongsGridName());
//话题信息
TopicInfoFormDTO topicInfoFormDTO = new TopicInfoFormDTO();
topicInfoFormDTO.setTopicId(issueResult.getTopicId());
Result<TopicInfoDTO> topicInfoDTOResult = resiGroupFeignClient.selectDetail(topicInfoFormDTO);
issueDetailResult.setTopicInfo(topicInfoDTOResult.getData());
return issueDetailResult;
}
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IssueInitiatorFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 查询议题发起人dto
* @CreateTime 2020/5/11 9:36
*/
@Data
public class IssueInitiatorFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 话题id
*/
private String userId;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IssueInitiatorResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* 返回议题发起人dto eg山东路178号刘女士
* @CreateTime 2020/5/11 10:49
*/
@Data
public class IssueInitiatorResultDTO implements Serializable {
/**
* 议题发起人山东路168-尹女士
*/
private String issueInitiator;
}

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

@ -26,9 +26,11 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.excel.UserResiInfoExcel;
import com.epmet.service.UserResiInfoService;
@ -150,4 +152,14 @@ public class UserResiInfoController {
return userResiInfoService.saveResiInfo(userResiInfoDTO);
}
/**
* @Description 根据userId查询议题发起人 eg:山东路168号刘女士
* @param formDTO
* @author zxc
*/
@PostMapping("selectissueinitiator")
public Result<IssueInitiatorResultDTO> selectIssueInitiator(@RequestBody IssueInitiatorFormDTO formDTO){
return new Result<IssueInitiatorResultDTO>().ok(userResiInfoService.selectIssueInitiator(formDTO));
}
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java

@ -19,7 +19,9 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.entity.UserResiInfoEntity;
import org.apache.ibatis.annotations.Mapper;
@ -59,4 +61,12 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
* @Date 2020/4/7 18:26
**/
List<UserResiInfoResultDTO> selectListUserResiInfoDTO(@Param("userIdList") List<String> userIdList);
/**
* @Description 根据userId查询议题发起人
* @param formDTO
* @author zxc
* @date 2020/5/11 11:18
*/
IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO);
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java

@ -21,9 +21,11 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.entity.UserResiInfoEntity;
@ -141,4 +143,12 @@ public interface UserResiInfoService extends BaseService<UserResiInfoEntity> {
* @Date 2020/4/7 18:21
**/
Result<List<UserResiInfoResultDTO>> getUserResiInfoList(UserResiInfoListFormDTO userResiInfoListFormDTO);
/**
* @Description 根据userId查询议题发起人
* @param formDTO
* @author zxc
* @date 2020/5/11 10:59
*/
IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO);
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -31,9 +31,11 @@ import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.UserResiInfoDao;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.entity.UserResiInfoEntity;
import com.epmet.feign.MessageFeignClient;
@ -272,4 +274,15 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
return bl;
}
/**
* @Description 根据userId查询议题发起人
* @param formDTO
* @author zxc
* @date 2020/5/11 11:00
*/
@Override
public IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO) {
return userResiInfoDao.selectIssueInitiator(formDTO);
}
}

24
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -108,4 +108,28 @@
#{userId}
</foreach>
</select>
<!-- 根据userId查询议题发起人 -->
<select id="selectIssueInitiator" parameterType="com.epmet.dto.form.IssueInitiatorFormDTO" resultType="com.epmet.dto.result.IssueInitiatorResultDTO">
SELECT
CONCAT(
uri.street,
'-',
uri.surname,
CASE
WHEN uw.sex = '1' THEN
'先生'
WHEN uw.sex = '2' THEN
'女士'
ELSE '某某'
END
) AS issueInitiator
FROM
user_resi_info uri
LEFT JOIN user_wechat uw ON uw.user_id = uri.user_id
WHERE
uri.user_id = #{userId}
AND uri.del_flag = 0
AND uw.del_flag = 0
</select>
</mapper>

Loading…
Cancel
Save