Browse Source

Merge branch 'dev_resi_event' into develop

# Conflicts:
#	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
dev_shibei_match
wxz 4 years ago
parent
commit
9a97cf6dd9
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java
  2. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/UserEventLogoResultDTO.java
  3. 6
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  4. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  5. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  7. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  8. 36
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  9. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java
  10. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  11. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml
  12. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  13. 28
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  14. 66
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrgLevelEnums.java
  15. 43
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java
  16. 42
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ChooseResolveFormDTO.java
  17. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java
  18. 29
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventListFormDTO.java
  19. 42
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportedFormDTO.java
  20. 34
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReCallEventFormDTO.java
  21. 23
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java
  22. 34
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java
  23. 29
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java
  24. 82
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
  25. 48
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java
  26. 55
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java
  27. 18
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java
  28. 24
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventIdDTO.java
  29. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java
  30. 30
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java
  31. 158
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java
  32. 59
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  33. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventAttachmentDao.java
  34. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java
  35. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java
  36. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java
  37. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java
  38. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java
  39. 76
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java
  40. 141
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java
  41. 83
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java
  42. 89
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventOperationLogEntity.java
  43. 66
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReplyEntity.java
  44. 84
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReportOrgEntity.java
  45. 44
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java
  46. 84
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java
  47. 49
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  48. 166
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  49. 126
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql
  50. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventAttachmentDao.xml
  51. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  52. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml
  53. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml
  54. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml
  55. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml
  56. 13
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java
  57. 18
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventTargetLevelFormDTO.java
  58. 30
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java
  59. 31
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventTargetLevelResultDTO.java
  60. 10
      epmet-module/resi-home/resi-home-server/pom.xml
  61. 68
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java
  62. 30
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java
  63. 102
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  64. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java
  65. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java
  66. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ListUserByBadgeResultDTO.java
  67. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  68. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  69. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
  70. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  71. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
  72. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  73. 20
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java

@ -30,8 +30,11 @@ public interface ResultDataResolver {
//}
/**
* @Description 获取Result种的data如果失败(返回result为null或者result.success为false)那么抛出异常
* @Description
* @return
* @param targetServiceName 目标service名称
* @param errorCode 错误码可以为空为空则使用上游服务抛出的错误码
* @param errorInternalMsg 错误信息可以为空为空则使用上游服务抛出的异常信息
* @author wxz
* @date 2021.06.07 22:45
*/

28
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/UserEventLogoResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import java.io.Serializable;
/**
* 人大代表个人中心是否显示@me
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 15:01
*/
@Data
public class UserEventLogoResultDTO implements Serializable {
private static final long serialVersionUID = 3232361347890014097L;
/**
* true:人大代表false不是人大代表此列用来判断是否显示@我
*/
private Boolean isNpc;
/**
* 展示红点true隐藏false
*/
private Boolean redDot;
public UserEventLogoResultDTO(){
this.isNpc=false;
this.redDot=false;
}
}

6
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -75,6 +75,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

19
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -13,11 +13,7 @@ import com.epmet.dataaggre.dto.epmetuser.form.OpenStaffDetailFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolDateListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolRecordListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.OpenStaffDetailResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDateListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolRecordListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PersonalPatrolListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
@ -201,4 +197,17 @@ public class EpmetUserController {
}
/**
* 我要报事-人大代表个人中心 是否显示@我是否显示红点
*
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.epmetuser.result.UserEventLogoResultDTO>
* @author yinzuomei
* @date 2021/8/3 15:07
*/
@PostMapping("mentionme")
public Result<UserEventLogoResultDTO> mentionMeEvent(@LoginUser TokenDto tokenDto){
return new Result<UserEventLogoResultDTO>().ok(epmetUserService.mentionMeEvent(tokenDto.getUserId()));
}
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java

@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 用户徽章关系表
@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiUserBadgeDao extends BaseDao<ResiUserBadgeEntity> {
ResiUserBadgeEntity selectUserByBadge(@Param("userId")String userId, @Param("badgeKey")String badgeKey);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java

@ -68,4 +68,6 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<String> selectDepartmentNameList(ProjectDTO project);
List<ProjectDistributionResultDTO> selectList(@Param("customerId") String customerId,@Param("list")List<String> issueIds);
int countRedDot(String userId);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -86,4 +86,14 @@ public interface EpmetUserService {
* @Author sun
**/
List<StaffRoleListResultDTO> getStaffRoleList(String customerId, String userId);
/**
* 我要报事-人大代表个人中心 是否显示@我是否显示红点
*
* @param userId
* @return com.epmet.dataaggre.dto.epmetuser.result.UserEventLogoResultDTO
* @author yinzuomei
* @date 2021/8/3 15:09
*/
UserEventLogoResultDTO mentionMeEvent(String userId);
}

36
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -3,11 +3,9 @@ package com.epmet.dataaggre.service.epmetuser.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetuser.CustomerStaffDao;
import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao;
import com.epmet.dataaggre.dao.epmetuser.StaffRoleDao;
import com.epmet.dataaggre.dao.epmetuser.UserBaseInfoDao;
import com.epmet.dataaggre.dao.epmetuser.*;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO;
@ -19,17 +17,18 @@ import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -57,6 +56,10 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private StaffRoleDao staffRoleDao;
@Resource
private CustomerStaffDao customerStaffDao;
@Autowired
private ResiUserBadgeDao resiUserBadgeDao;
@Autowired
private GovProjectService govProjectService;
/**
* @Description 根据UserIds查询
@ -374,5 +377,28 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return staffRoleDao.selectStaffRoleList(customerId, userId);
}
/**
* 我要报事-人大代表个人中心 是否显示@我是否显示红点
*
* @param userId
* @return com.epmet.dataaggre.dto.epmetuser.result.UserEventLogoResultDTO
* @author yinzuomei
* @date 2021/8/3 15:09
*/
@Override
public UserEventLogoResultDTO mentionMeEvent(String userId) {
UserEventLogoResultDTO resultDTO = new UserEventLogoResultDTO();
ResiUserBadgeEntity resiUserBadgeEntity = resiUserBadgeDao.selectUserByBadge(userId, BadgeConstant.BADGE_KEY_NPC);
//是否是人大代表
if (null != resiUserBadgeEntity) {
resultDTO.setIsNpc(true);
}
//展示红点:true;隐藏:false
if(govProjectService.countRedDot(userId)>0){
resultDTO.setRedDot(true);
};
return resultDTO;
}
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java

@ -41,4 +41,14 @@ public interface GovProjectService {
List<ProjectDistributionResultDTO> queryProjectDistribution(ProjectDistributionFormDTO formDTO);
/**
* 查询resi_event_mention
*
* @param userId
* @return int
* @author yinzuomei
* @date 2021/8/3 15:27
*/
int countRedDot(String userId);
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -233,4 +233,18 @@ public class GovProjectServiceImpl implements GovProjectService {
throw new RenException("计算首次响应时间失败");
}
}
/**
* 查询resi_event_mention
*
* @param userId
* @return int
* @author yinzuomei
* @date 2021/8/3 15:27
*/
@Override
public int countRedDot(String userId) {
return projectDao.countRedDot(userId);
}
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml

@ -3,4 +3,17 @@
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.ResiUserBadgeDao">
<select id="selectUserByBadge" parameterType="map" resultType="com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity">
SELECT
rub.*
FROM
resi_user_badge rub
INNER JOIN badge b ON ( rub.BADGE_ID = b.ID )
WHERE
rub.DEL_FLAG = '0'
AND b.DEL_FLAG = '0'
AND rub.USER_ID = #{userId}
AND b.BADGE_KEY = #{badgeKey}
AND rub.CERTIFICATION_AUTID_STATUS = 'approved'
</select>
</mapper>

11
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -144,4 +144,15 @@
</foreach>
order by p.CREATED_TIME desc
</select>
<select id="countRedDot" parameterType="java.lang.String" resultType="int">
SELECT
count(1) as total
FROM
resi_event_mention rem
WHERE
rem.DEL_FLAG = '0'
AND rem.RED_DOT = '1'
AND rem.USER_ID = #{userId}
</select>
</mapper>

28
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AliyunGroup;
import com.epmet.commons.tools.validator.group.QcloudGroup;
import com.epmet.commons.tools.validator.group.QiniuGroup;
import com.epmet.constants.PrivacyType;
import com.epmet.dto.UploadDTO;
import com.epmet.dto.form.RemoveFileFormDTO;
import com.epmet.dto.result.UploadImgResultDTO;
@ -373,4 +374,31 @@ public class OssController {
return ossService.uploadImgV2(file, null, customerId);
}
/**
* @Description 上传报事文件(目前只有图片)
* @return
* @author wxz
* @date 2021.08.03 16:23
*/
@PostMapping("upload-resi-event-file")
public Result<UploadImgResultDTO> uploadResiEventFile(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId) {
// 体积限制
int sizeMb = 10;
int sizeThreshold = sizeMb * 1024 * 1024; // 大小限制10m
if (file.getSize() > sizeThreshold) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(),
EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg().concat(",限制在").concat(String.valueOf(sizeMb)).concat("M以内"));
}
// 格式限制,只允许png和jpeg
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType())
&& !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
}
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}
}

66
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrgLevelEnums.java

@ -0,0 +1,66 @@
package com.epmet.enums;
import lombok.extern.slf4j.Slf4j;
import java.util.Optional;
/**
* @Description 入职级别枚举
* @author wxz
* @date 2021.08.03 14:29:01
*/
@Slf4j
public enum OrgLevelEnums {
GRID("grid", "网格"),
COMMUNITY("community", "社区"),
STREET("street", "街道"),
DISTRICT("district", "区"),
CITY("city", "市"),
PROVINCE("province", "省"),
DEPARTMENT("department", "部门"),
;
private String level;
private String levelName;
OrgLevelEnums(String level, String levelName) {
this.level = level;
this.levelName = levelName;
}
/**
* @Description 级别枚举对象
* @return
* @author wxz
* @date 2021.08.03 14:46
*/
public static OrgLevelEnums getLevelObject(String level) {
for (OrgLevelEnums l :OrgLevelEnums.values()) {
if (l.getLevel().equals(level)) {
return l;
}
}
return null;
}
/**
* @Description 级别中文名称
* @return
* @author wxz
* @date 2021.08.03 14:47
*/
public static String getLevelName(String level) {
OrgLevelEnums levelObject = getLevelObject(level);
return levelObject == null ? null : levelObject.getLevelName();
}
public String getLevel() {
return level;
}
public String getLevelName() {
return levelName;
}
}

43
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 1:38 下午
* @DESC
*/
@Data
public class EventProjectInfoDTO implements Serializable {
private static final long serialVersionUID = 5622220354099001615L;
/**
* 项目ID
*/
private String projectId;
/**
* 操作人xxx社区-张三
*/
private String operationName;
/**
* 操作时间
*/
private String operationTime;
/**
* 报事说明
*/
private String projectDeclare;
public EventProjectInfoDTO() {
this.projectId = "";
this.operationName = "";
this.operationTime = "";
this.projectDeclare = "";
}
}

42
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ChooseResolveFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form;
import com.epmet.dto.result.ResiEventIdDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 选择已解决未解决
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 13:53
*/
@Data
public class ChooseResolveFormDTO extends ResiEventIdDTO implements Serializable {
private static final long serialVersionUID = 7888566055415227282L;
public interface AddUserInternalGroup {
}
/**
* 是否解决已解决 resolved未解决 un_solved
*/
@NotBlank(message = "resolveStatus不能为空",groups = AddUserInternalGroup.class)
private String resolveStatus;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

22
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 1:27 下午
* @DESC
*/
@Data
public class EventDetailFormDTO implements Serializable {
private static final long serialVersionUID = -297495947153154171L;
public interface EventDetailForm{}
@NotBlank(message = "报事ID不能为空",groups = EventDetailForm.class)
private String eventId;
}

29
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 10:43 上午
* @DESC
*/
@Data
public class EventListFormDTO implements Serializable {
private static final long serialVersionUID = 5882062169112022561L;
public interface EventListForm{}
/**
* 报事列表类型处理中processed 待处理undisposed 已办结transferred
*/
@NotBlank(message = "报事列表类型不能为空",groups = EventListForm.class)
private String eventType;
@NotBlank(message = "",groups = EventListForm.class)
private String orgId;
}

42
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportedFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 我的报事列表查询
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 14:07
*/
@Data
public class MyReportedFormDTO implements Serializable {
private static final long serialVersionUID = 8426911903236849796L;
public interface AddUserInternalGroup {
}
/**
* 未处理:un_read处理中processing已办结closed_case
*/
@NotBlank(message = "statusCondition不能为空",groups = AddUserInternalGroup.class)
private String statusCondition;
private Integer pageNo;
private Integer pageSize;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

34
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReCallEventFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import com.epmet.dto.result.ResiEventIdDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 撤回事件入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 11:28
*/
@Data
public class ReCallEventFormDTO extends ResiEventIdDTO implements Serializable {
private static final long serialVersionUID = 2127663703852717437L;
public interface AddUserInternalGroup {
}
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

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

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 11:07 上午
* @DESC
*/
@Data
public class ReplyListFormDTO implements Serializable {
private static final long serialVersionUID = 3875624725235229558L;
public interface ReplyListForm{}
@NotBlank(message = "报事ID不能为空",groups = ReplyListForm.class)
private String resiEventId;
}

34
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 我要报事-提交
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 10:46
*/
@Data
public class ResiEventFormDTO implements Serializable {
private static final long serialVersionUID = -778643059131036832L;
public interface AddUserInternalGroup {
}
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

29
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 10:55 上午
* @DESC
*/
@Data
public class UpdateViewTimeFormDTO implements Serializable {
private static final long serialVersionUID = 7104400078458366322L;
public interface UpdateViewTimeForm{}
/**
* 居民端用户:resi_user工作人员:staff
*/
@NotBlank(message = "viewType不能为空",groups = UpdateViewTimeForm.class)
private String viewType;
@NotBlank(message = "事件ID不能为空",groups = UpdateViewTimeForm.class)
private String eventId;
}

82
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java

@ -0,0 +1,82 @@
package com.epmet.dto.result;
import com.epmet.dto.EventProjectInfoDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/8/3 1:30 下午
* @DESC
*/
@Data
public class EventDetailResultDTO implements Serializable {
private static final long serialVersionUID = 3905105043326445613L;
/**
* 报事时间
*/
private String eventTime;
/**
* 报事内容
*/
private String eventContent;
/**
* 报事地址
*/
private String eventAddress;
/**
* 所属网格xx社区-xx网格
*/
private String gridName;
/**
* 是否办结truefalse
*/
private Boolean isClosed;
/**
* 是否解决truefalse
*/
private Boolean isResolve;
/**
* 是否可以撤回truefalse
*/
private Boolean isRollback;
/**
* 报事图片
*/
private List<String> eventImgs;
/**
* 报事提到的人
*/
private List<String> eventPerson;
/**
* 项目信息
*/
private EventProjectInfoDTO projectInfo;
public EventDetailResultDTO() {
this.eventTime = "";
this.eventContent = "";
this.eventAddress = "";
this.gridName = "";
this.isClosed = false;
this.isResolve = false;
this.isRollback = false;
this.eventImgs = new ArrayList<>();
this.eventPerson = new ArrayList<>();
this.projectInfo = new EventProjectInfoDTO();
}
}

48
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/8/3 10:41 上午
* @DESC
*/
@Data
public class EventListResultDTO implements Serializable {
private static final long serialVersionUID = -8550265282744924930L;
/**
* 报事标题
*/
private String eventTitle;
/**
* 报事时间
*/
private String eventTime;
/**
* 报事ID
*/
private String eventId;
/**
* 是否立项truefalse
*/
private Boolean isProject;
/**
* 红点显示true显示false不显示
*/
private Boolean redDot;
/**
* 报事图片
*/
private List<String> eventImgs;
}

55
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java

@ -0,0 +1,55 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 报事列表
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 14:11
*/
@Data
public class MyReportedResultDTO implements Serializable {
private static final long serialVersionUID = -7372245830000262134L;
/**
* 事件id
*/
private String resiEventId;
/**
* 事件内容
*/
private String eventContent;
/**
* 图片列表可为空
*/
private List<String> imgList;
/**
* true展示false不展示
*/
private Boolean redDot;
/**
* 处理中processing已办结closed_case
*/
private String status;
/**
* true:已转项目false未立项
*/
private Boolean shiftProject;
/**
* 列表显示时间用此列yyyy-MM-dd HH:mm:ss处理中上报事件时间处理中最新一次处理事件已办结办结时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date showTime;
}

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

@ -0,0 +1,18 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 11:07 上午
* @DESC
*/
@Data
public class ReplyListResultDTO implements Serializable {
private static final long serialVersionUID = 4875335642497226847L;
}

24
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventIdDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.result;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 事件id
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 10:48
*/
@Data
public class ResiEventIdDTO implements Serializable {
private static final long serialVersionUID = 1553798655658549134L;
public interface ResiEventIdGroup {
}
/**
* 居民端报的事件id
*/
@NotBlank(message = "事件id不能为空",groups = ResiEventIdGroup.class)
private String resiEventId;
}

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java

@ -0,0 +1,17 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2021/8/3 2:45 下午
* @DESC
*/
public interface EventConstant {
/**
* 处理中processed 待处理undisposed 已办结transferred
*/
String EVENT_PROCESSED = "processed";
String EVENT_UN_DISPOSED = "undisposed";
String EVENT_TRANSFERRED = "transferred";
}

30
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java

@ -0,0 +1,30 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.EventListFormDTO;
import com.epmet.dto.form.UpdateViewTimeFormDTO;
import com.epmet.dto.result.EventListResultDTO;
import com.epmet.service.ResiEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@RestController
@RequestMapping("event")
public class EventController {
@Autowired
private ResiEventService resiEventService;
}

158
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -0,0 +1,158 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.EventDetailResultDTO;
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.result.EventListResultDTO;
import com.epmet.dto.result.MyReportedResultDTO;
import com.epmet.dto.result.ResiEventIdDTO;
import com.epmet.service.ResiEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@RestController
@RequestMapping("resievent")
public class ResiEventController {
@Autowired
private ResiEventService resiEventService;
/**
* @Description 报事详情-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 1:47 下午
*/
@PostMapping("eventdetail")
public Result<EventDetailResultDTO> eventDetail(@RequestBody EventDetailFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<EventDetailResultDTO>().ok(resiEventService.eventDetail(formDTO));
}
/**
* 我要报事-提交
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 10:46
*/
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
//校验参数
//todo
return new Result<ResiEventIdDTO>().ok(resiEventService.report(formDTO));
}
/**
* 我要报事-撤回
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 10:54
*/
@PostMapping("recall")
public Result recall(@LoginUser TokenDto tokenDto,@RequestBody ReCallEventFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventIdDTO.ResiEventIdGroup.class,ReCallEventFormDTO.AddUserInternalGroup.class);
resiEventService.reCall(formDTO);
return new Result();
}
/**
* 选择已解决未解决
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 13:57
*/
@PostMapping("chooseresolve")
public Result chooseResolve(@LoginUser TokenDto tokenDto,@RequestBody ChooseResolveFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventIdDTO.ResiEventIdGroup.class,ChooseResolveFormDTO.AddUserInternalGroup.class);
resiEventService.chooseResolve(formDTO);
return new Result();
}
/**
* 我的报事列表查询
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/3 14:27
*/
@PostMapping("myreported")
public Result<List<MyReportedResultDTO>> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,MyReportedFormDTO.AddUserInternalGroup.class);
return new Result<List<MyReportedResultDTO>>().ok(resiEventService.queryMyReported(formDTO));
}
/**
* @Description 群众直报待处理处理中已办结列表
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
@PostMapping("eventlist")
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class);
return new Result<List<EventListResultDTO>>().ok(resiEventService.eventList(formDTO));
}
/**
* @Description 查看报事时,更新时间操作
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
*/
@PostMapping("updateviewtime")
public Result updateViewTime(@RequestBody UpdateViewTimeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.UpdateViewTimeForm.class);
resiEventService.updateViewTime(formDTO);
return new Result();
}
}

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

@ -0,0 +1,59 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.service.ResiEventReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 事件回复表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@RestController
@RequestMapping("resieventreply")
public class ResiEventReplyController {
@Autowired
private ResiEventReplyService resiEventReplyService;
/**
* @Description 报事详情-回复列表-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:11 上午
*/
@PostMapping("list")
public Result<List<ReplyListResultDTO>> replyList(@RequestBody ReplyListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ReplyListFormDTO.ReplyListForm.class);
return new Result<List<ReplyListResultDTO>>().ok(resiEventReplyService.replyList(formDTO));
}
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventAttachmentDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventAttachmentDao extends BaseDao<ResiEventAttachmentEntity> {
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventDao extends BaseDao<ResiEventEntity> {
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventMentionEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件被@人表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventMentionDao extends BaseDao<ResiEventMentionEntity> {
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventOperationLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件操作日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventOperationLogDao extends BaseDao<ResiEventOperationLogEntity> {
}

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

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventReplyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件回复表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventReplyDao extends BaseDao<ResiEventReplyEntity> {
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventReportOrgEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件相关组织表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventReportOrgDao extends BaseDao<ResiEventReportOrgEntity> {
}

76
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java

@ -0,0 +1,76 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 事件附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event_attachment")
public class ResiEventAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 事件Id关联resi_event的id
*/
private String resiEventId;
/**
* 附件名
*/
private String attachmentName;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 排序字段
*/
private Integer sort;
}

141
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java

@ -0,0 +1,141 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event")
public class ResiEventEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 居民端用户所在网格id
*/
private String gridId;
/**
* 居民端用户所在网格的所属组织
*/
private String agencyId;
/**
* 居民端用户所在网格的所有上级组织包含AGENCY_ID
*/
private String pids;
/**
* 报事的人
*/
private String reportUserId;
/**
* 1党员0不是党员默认0
*/
private String isParty;
/**
* 事件内容
*/
private String eventContent;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 地址
*/
private String address;
/**
* 处理中processing已办结closed_case
*/
private String status;
/**
* 1已转项目0未转项目默认0
*/
private Boolean shiftProject;
/**
* 项目id;shift_project=1时此列有值
*/
private String projectId;
/**
* 1:已撤回0未撤回正常展示默认0
*/
private Boolean recallFlag;
/**
* 撤回时间
*/
private Date recallTime;
/**
* 事件是否被阅读过;1已读针对报事人待处理列表
*/
private Boolean readFlag;
/**
* 报事人的红点:展示1不展示0人大代表回复工作人员回复/立项/办结更新为1;
*/
private Boolean redDot;
/**
* 最近一次操作时间回复立项办结更新此列
*/
private Date latestOperatedTime;
/**
* 是否解决已解决 resolved未解决 un_solved
*/
private String resolveStatus;
/**
* 结案说明可放这
*/
private String closeRemark;
}

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

@ -0,0 +1,83 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 事件被@人表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event_mention")
public class ResiEventMentionEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 事件id
*/
private String resiEventId;
/**
* 人大代表:npc_user
*/
private String userType;
/**
* 居民端用户id
*/
private String userId;
/**
* 居民注册网格ID
*/
private String gridId;
/**
* 居民所属社区就是grid_id的所属组织
*/
private String agencyId;
/**
* 居民注册网格的所有上级
*/
private String pids;
/**
* 含义已读read未读un_read人大代表从未读=>已读点击查看详情前更新为已读
*/
private String readFlag;
/**
* (1)含义1:展示红点0不展示(2)注意发布事件插入数据时为1(3)何时更新报事人回复or工作人员回复立项办结更新为1
*/
private Boolean redDot;
}

89
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventOperationLogEntity.java

@ -0,0 +1,89 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 事件操作日志表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event_operation_log")
public class ResiEventOperationLogEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 事件id
*/
private String resiEventId;
/**
* 用户id
*/
private String userId;
/**
* 居民端用户:resi_user工作人员:staff报事人:report_user
*/
private String userIdentity;
/**
* 1发布事件publish
2撤回事件recall
3reply
4立项shift_project
5办结close_case;
6选择是否已解决choose_resolve;
7查看阅读事件read人大代表未读=>已读工作人员待处理=>处理中
*/
private String actionCode;
/**
* 1发布事件publish
2撤回事件recall
3reply
4立项shift_project
5办结close_case;
6选择是否已解决choose_resolve;
7查看阅读事件read人大代表未读=>已读工作人员待处理=>处理中
*/
private String actionDesc;
/**
* 操作时间
*/
private Date operateTime;
}

66
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReplyEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 事件回复表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event_reply")
public class ResiEventReplyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 事件Id关联resi_event的id
*/
private String resiEventId;
/**
* 回复人用户Id
*/
private String fromUserId;
/**
* 内容
*/
private String content;
/**
* 报事人xxx路尹女士人大人大代表-张三组织组织名阜新路社区
*/
private String userShowName;
}

84
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReportOrgEntity.java

@ -0,0 +1,84 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 事件相关组织表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_event_report_org")
public class ResiEventReportOrgEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 事件id
*/
private String resiEventId;
/**
* 报给
网格grid
社区community
街道:street
区县级: district
市级: city
省级:province
*/
private String orgType;
/**
* 报给的组织或者网格id
*/
private String orgId;
/**
* org_id的上级组织idorg_id是跟组织此列为0
*/
private String orgPid;
/**
* org_id的所有上级组织idorg_id是跟组织此列为0
*/
private String orgPids;
/**
* 含义已读read未读un_read组织下的工作人员从待处理=>处理中点击查看详情前更新为已读
*/
private String orgRead;
/**
* (1)含义1:展示红点0不展示(2)注意发布事件插入数据时为1(3)何时更新人大代表回复or报事人回复or工作人员回复立项办结更新为1
*/
private Boolean redDot;
}

44
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java

@ -0,0 +1,44 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.entity.ResiEventReplyEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 事件回复表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
public interface ResiEventReplyService extends BaseService<ResiEventReplyEntity> {
/**
* @Description 报事详情-回复列表-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:11 上午
*/
List<ReplyListResultDTO> replyList(ReplyListFormDTO formDTO);
}

84
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java

@ -0,0 +1,84 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.*;
import com.epmet.dto.result.EventDetailResultDTO;
import com.epmet.dto.result.EventListResultDTO;
import com.epmet.entity.ResiEventEntity;
import com.epmet.dto.result.MyReportedResultDTO;
import com.epmet.dto.result.ResiEventIdDTO;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
public interface ResiEventService extends BaseService<ResiEventEntity> {
/**
* @Description 群众直报待处理处理中已办结列表
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
List<EventListResultDTO> eventList(EventListFormDTO formDTO);
/**
* @Description 查看报事时,更新时间操作
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
*/
void updateViewTime(UpdateViewTimeFormDTO formDTO);
/**
* @Description 报事详情-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 1:47 下午
*/
EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO);
/**
* 我要报事-提交
*
* @param formDTO
* @return com.epmet.dto.result.ResiEventResultDTO
* @author yinzuomei
* @date 2021/8/3 10:51
*/
ResiEventIdDTO report(ResiEventFormDTO formDTO);
/**
* 撤回事件
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:45
*/
void reCall(ReCallEventFormDTO formDTO);
/**
* 选择已解决未解决
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:58
*/
void chooseResolve(ChooseResolveFormDTO formDTO);
/**
* 我的报事列表查询
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.MyReportedResultDTO>
* @author yinzuomei
* @date 2021/8/3 14:28
*/
List<MyReportedResultDTO> queryMyReported(MyReportedFormDTO formDTO);
}

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

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.ResiEventReplyDao;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.entity.ResiEventReplyEntity;
import com.epmet.service.ResiEventReplyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 事件回复表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Service
public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao, ResiEventReplyEntity> implements ResiEventReplyService {
/**
* @Description 报事详情-回复列表-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:11 上午
*/
@Override
public List<ReplyListResultDTO> replyList(ReplyListFormDTO formDTO) {
return null;
}
}

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

@ -0,0 +1,166 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.EventConstant;
import com.epmet.dao.ResiEventDao;
import com.epmet.dto.form.EventDetailFormDTO;
import com.epmet.dto.form.EventListFormDTO;
import com.epmet.dto.form.UpdateViewTimeFormDTO;
import com.epmet.dto.result.EventDetailResultDTO;
import com.epmet.dto.result.EventListResultDTO;
import com.epmet.dto.form.ChooseResolveFormDTO;
import com.epmet.dto.form.MyReportedFormDTO;
import com.epmet.dto.form.ReCallEventFormDTO;
import com.epmet.dto.form.ResiEventFormDTO;
import com.epmet.dto.result.MyReportedResultDTO;
import com.epmet.dto.result.ResiEventIdDTO;
import com.epmet.entity.ResiEventEntity;
import com.epmet.service.ResiEventService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Service
public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEventEntity> implements ResiEventService {
/**
* @Description 群众直报待处理处理中已办结列表
* 未处理按照创建时间正序
* 处理中按照最新操作时间由近到远排序
* 已办结按照办结时间由近到远排序
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
@Override
public List<EventListResultDTO> eventList(EventListFormDTO formDTO) {
// 处理中
if (formDTO.getEventType().equals(EventConstant.EVENT_PROCESSED)){
// 待处理
}else if (formDTO.getEventType().equals(EventConstant.EVENT_UN_DISPOSED)){
// 已办结
}else if (formDTO.getEventType().equals(EventConstant.EVENT_TRANSFERRED)){
}
return new ArrayList<>();
}
/**
* @Description 查看报事时,更新时间操作
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
*/
@Override
public void updateViewTime(UpdateViewTimeFormDTO formDTO) {
}
/**
* @Description 报事详情-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 1:47 下午
*/
@Override
public EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO) {
return null;
}
/**
* 我要报事-提交
*
* @param formDTO
* @return com.epmet.dto.result.ResiEventResultDTO
* @author yinzuomei
* @date 2021/8/3 10:51
*/
@Override
public ResiEventIdDTO report(ResiEventFormDTO formDTO) {
//todo
return null;
}
/**
* 撤回事件
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:45
*/
@Override
public void reCall(ReCallEventFormDTO formDTO) {
// todo
}
/**
* 选择已解决未解决
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:58
*/
@Override
public void chooseResolve(ChooseResolveFormDTO formDTO) {
// todo
}
/**
* 我的报事列表查询
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.MyReportedResultDTO>
* @author yinzuomei
* @date 2021/8/3 14:28
*/
@Override
public List<MyReportedResultDTO> queryMyReported(MyReportedFormDTO formDTO) {
// todo
return null;
}
}

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

@ -0,0 +1,126 @@
CREATE TABLE `resi_event` (
`ID` varchar(64) NOT NULL COMMENT '主键,事件id',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`GRID_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格的所属组织',
`PIDS` varchar(64) NOT NULL COMMENT '居民端用户所在网格的所有上级组织,包含AGENCY_ID',
`REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人',
`IS_PARTY` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:党员;0:不是党员;默认0',
`EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容',
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度',
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度',
`ADDRESS` varchar(255) NOT NULL COMMENT '地址',
`STATUS` varchar(32) NOT NULL COMMENT '处理中:processing;已办结:closed_case',
`SHIFT_PROJECT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已转项目;0:未转项目;默认0',
`PROJECT_ID` varchar(64) DEFAULT NULL COMMENT '项目id;shift_project=1时,此列有值',
`RECALL_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已撤回;0:未撤回正常展示;默认0',
`RECALL_TIME` datetime DEFAULT NULL COMMENT '撤回时间',
`READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表',
`RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/办结更新为1; ',
`LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、办结更新此列)',
`RESOLVE_STATUS` varchar(32) DEFAULT NULL COMMENT '是否解决:已解决 resolved,未解决 un_solved',
`CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明可放这。',
`DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='居民报事表';
CREATE TABLE `resi_event_attachment` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id',
`ATTACHMENT_NAME` varchar(64) NOT NULL COMMENT '附件名',
`ATTACHMENT_FORMAT` varchar(64) NOT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)',
`ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址',
`SORT` int(1) NOT NULL COMMENT '排序字段',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表';
CREATE TABLE `resi_event_mention` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`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_ID` varchar(64) NOT NULL COMMENT '居民端用户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '居民注册网格ID',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '居民所属社区,就是grid_id的所属组织',
`PIDS` varchar(255) NOT NULL COMMENT '居民注册网格的所有上级',
`READ_FLAG` varchar(10) NOT NULL DEFAULT 'un_read' COMMENT '含义:已读read,未读:un_read;人大代表从未读=>已读,点击查看详情前更新为已读;',
`RED_DOT` tinyint(1) NOT NULL DEFAULT '1' COMMENT '(1)含义:1:展示红点;0:不展示;(2)注意:发布事件插入数据时为1,(3)何时更新?:报事人回复or工作人员回复、立项、办结更新为1;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件被@人表';
CREATE TABLE `resi_event_report_org` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`ORG_TYPE` varchar(32) NOT NULL COMMENT '报给?:\r\n网格:grid;\r\n社区:community;\r\n乡(镇、街道)级:street;\r\n区县级: district;\r\n市级: city;\r\n省级:province。',
`ORG_ID` varchar(64) NOT NULL COMMENT '报给的组织或者网格id',
`ORG_PID` varchar(64) NOT NULL COMMENT 'org_id的上级组织id,org_id是跟组织,此列为0',
`ORG_PIDS` varchar(255) NOT NULL COMMENT 'org_id的所有上级组织id,org_id是跟组织,此列为0',
`ORG_READ` varchar(10) NOT NULL DEFAULT 'un_read' COMMENT '含义:已读read,未读:un_read;组织下的工作人员从待处理=>处理中,点击查看详情前更新为已读;',
`RED_DOT` tinyint(1) NOT NULL DEFAULT '1' COMMENT '(1)含义:1:展示红点;0:不展示;(2)注意:发布事件插入数据时为1,(3)何时更新?:人大代表回复or报事人回复or工作人员回复、立项、办结更新为1;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件相关组织表';
CREATE TABLE `resi_event_reply` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id',
`FROM_USER_ID` varchar(64) NOT NULL COMMENT '回复人用户Id',
`CONTENT` varchar(255) NOT NULL COMMENT '内容',
`USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '报事人:xxx路尹女士;人大:人大代表-张三;组织:组织名:阜新路社区',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件回复表';
CREATE TABLE `resi_event_operation_log` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户id',
`USER_IDENTITY` varchar(32) NOT NULL COMMENT '居民端用户:resi_user;工作人员:staff;报事人:report_user',
`ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;\r\n',
`ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;',
`OPERATE_TIME` datetime NOT NULL COMMENT '操作时间',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件操作日志表';

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventAttachmentDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventAttachmentDao">
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventDao">
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventMentionDao">
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventOperationLogDao">
</mapper>

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

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventReplyDao">
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventReportOrgDao">
</mapper>

13
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.form;
import lombok.Data;
/**
* @Description 我要报事人大代表列表
* @author wxz
* @date 2021.08.03 09:16:59
*/
@Data
public class ResiEventNpcListFormDTO {
private String gridId;
}

18
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventTargetLevelFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description 群众直报-上报目标级别查询
* @author wxz
* @date 2021.08.03 13:47:23
*/
@Data
public class ResiEventTargetLevelFormDTO {
@NotBlank(message = "网格ID不能为空")
private String gridId;
}

30
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
/**
* @Description 我要报事-人大代表列表
* @author wxz
* @date 2021.08.03 09:12:57
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResiEventNpcResultDTO {
private String userId;
private String gridId;
private String displayName;
private String headImgUrl;
private String agencyId;
private String pids;
}

31
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventTargetLevelResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Description 群众直报目标层级Result
* @author wxz
* @date 2021.08.03 13:43:58
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResiEventTargetLevelResultDTO implements Comparable {
private String orgLevel;
private String levelName;
private String orgId;
private String orgPid;
private String orgPids;
//排序索引,用于排序
private Integer index;
@Override
public int compareTo(Object o) {
ResiEventTargetLevelResultDTO df = (ResiEventTargetLevelResultDTO) o;
return this.index.compareTo(df.getIndex());
}
}

10
epmet-module/resi-home/resi-home-server/pom.xml

@ -68,6 +68,16 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>

68
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -0,0 +1,68 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ResiEventNpcListFormDTO;
import com.epmet.dto.form.ResiEventTargetLevelFormDTO;
import com.epmet.dto.result.ResiEventNpcResultDTO;
import com.epmet.dto.result.ResiEventTargetLevelResultDTO;
import com.epmet.service.ResiEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotBlank;
import java.util.HashMap;
import java.util.List;
import java.util.TreeSet;
/**
* @author wxz
* @Description 群众直报/报事controller
* @date 2021.08.02 09:58:40
*/
@RestController
@RequestMapping("resi-event")
public class ResiEventController {
@Autowired
private ResiEventService resiEventService;
/**
* @return
* @Description 查询人大代表列表
* @author wxz
* @date 2021.08.03 09:17
*/
@PostMapping("/npc-list-ingrid")
public Result<HashMap<String, List<ResiEventNpcResultDTO>>> listNpc(@RequestBody ResiEventNpcListFormDTO input) {
ValidatorUtils.validateEntity(input);
String gridId = input.getGridId();
List<ResiEventNpcResultDTO> npcs = resiEventService.listNpcByGrid(gridId);
HashMap<String, List<ResiEventNpcResultDTO>> wrapper = new HashMap<>();
wrapper.put("reportTargets", npcs);
return new Result<HashMap<String, List<ResiEventNpcResultDTO>>>().ok(wrapper);
}
/**
* @return
* @Description 查询上报目标列表
* @author wxz
* @date 2021.08.03 13:47
*/
@PostMapping("/report-target-level-list")
public Result<HashMap> listReportTargetLevels(@RequestBody ResiEventTargetLevelFormDTO input) {
ValidatorUtils.validateEntity(input);
String gridId = input.getGridId();
TreeSet<ResiEventTargetLevelResultDTO> targetList = resiEventService.listReportTargetLevels(gridId);
HashMap<String, TreeSet<ResiEventTargetLevelResultDTO>> warpper = new HashMap<>();
warpper.put("reportTargets", targetList);
return new Result<HashMap>().ok(warpper);
}
}

30
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java

@ -0,0 +1,30 @@
package com.epmet.service;
import com.epmet.dto.result.ResiEventNpcResultDTO;
import com.epmet.dto.result.ResiEventTargetLevelResultDTO;
import java.util.List;
import java.util.TreeSet;
/**
* @Description 报事service
* @author wxz
* @date 2021.08.02 09:59:16
*/
public interface ResiEventService {
/**
* @Description 查询网格的人大代表列表
* @return
* @author wxz
* @date 2021.08.03 09:29
*/
List<ResiEventNpcResultDTO> listNpcByGrid(String gridId);
/**
* @Description 查询上报目标列表
* @return
* @author wxz
* @date 2021.08.03 13:50
*/
TreeSet<ResiEventTargetLevelResultDTO> listReportTargetLevels(String gridId);
}

102
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -0,0 +1,102 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dto.form.ListUserByBadgeFormDTO;
import com.epmet.dto.form.OrgInfoFormDTO;
import com.epmet.dto.result.*;
import com.epmet.enums.OrgLevelEnums;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ResiEventService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author wxz
* @Description 报事service
* @date 2021.08.02 09:59:36
*/
@Service
public class ResiEventServiceImpl implements ResiEventService, ResultDataResolver {
@Autowired
GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public List<ResiEventNpcResultDTO> listNpcByGrid(String gridId) {
// 查询网格所属的组织信息
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId);
GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
String parentAgencyId = gridInfoData.getParentAgencyId();
String pids = gridInfoData.getPids();
//查询人大代表列表
ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(gridId, BadgeConstant.BADGE_KEY_NPC);
Result<List<ListUserByBadgeResultDTO>> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm);
List<ListUserByBadgeResultDTO> npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null);
List<ResiEventNpcResultDTO> npcResultList = npcData.stream()
.map(npc -> new ResiEventNpcResultDTO(npc.getUserId(), gridId, "人大代表-".concat(npc.getRealName()), npc.getHeadImgUrl(), parentAgencyId, pids))
.collect(Collectors.toList());
return npcResultList;
}
/**
* @Description 此处会调用org上游接口批量获取父级组织信息由于上游接口排序不可控因此此处需要使用TreeSet做排序
* @return
* @author wxz
* @date 2021.08.03 15:51
*/
@Override
public TreeSet<ResiEventTargetLevelResultDTO> listReportTargetLevels(String gridId) {
TreeSet<ResiEventTargetLevelResultDTO> targetLevels = new TreeSet<>();
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId);
GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
String pidsPath = gridInfoData.getPids();
List<String> parentOrgIds = Arrays.asList(pidsPath.split(":"));
// 翻转列表
Collections.reverse(parentOrgIds);
// 一.网格信息(只有一条,但是为了适应接口,组装成了列表)
List<String> currentGridId = Arrays.asList(gridId);
Result<List<OrgInfoResultDTO>> currentGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, currentGridId));
List<OrgInfoResultDTO> currentGridInfos = getResultDataOrThrowsException(currentGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
OrgInfoResultDTO currentGridInfo = currentGridInfos.get(0);
// 因为上游接口的值对应问题,这里只好做一个适配,拼接起来,希望上游代码不要再改了...
String pids = currentGridInfo.getPids().concat(":").concat(currentGridInfo.getAgencyId());
// 父ID列表的index排序字段是从0开始,网格要排在他们前面,则网格的index为-1
targetLevels.add(new ResiEventTargetLevelResultDTO(OrgLevelEnums.GRID.getLevel(), OrgLevelEnums.GRID.getLevelName(), currentGridInfo.getOrgId(), currentGridInfo.getAgencyId(), pids, -1));
// 二.父级组织信息
Result<List<OrgInfoResultDTO>> parentOrgInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.AGENCY, parentOrgIds));
List<OrgInfoResultDTO> parentOrgInfos = getResultDataOrThrowsException(parentOrgInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
parentOrgInfos.forEach(porg -> {
String levelName = OrgLevelEnums.getLevelName(porg.getLevel());
if (StringUtils.isBlank(levelName)) {
throw new RenException(String.format("根据级别%s没有找到对应的组织级别枚举", porg.getLevel()));
}
//parentOrgIds.indexOf(porg.getOrgId()为当前orgId在pids中的位置,得到之后,赋值给index字段,treeset会利用这个字段进行排序
ResiEventTargetLevelResultDTO pLevel = new ResiEventTargetLevelResultDTO(porg.getLevel(), levelName, porg.getOrgId(), porg.getPid(), porg.getPids(), parentOrgIds.indexOf(porg.getOrgId()));
targetLevels.add(pLevel);
});
return targetLevels;
}
}

3
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java

@ -42,4 +42,7 @@ public interface BadgeConstant {
String DEFAULT = "default";
// 人大代表徽章KEY
String BADGE_KEY_NPC = "NPC";
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ListUserByBadgeFormDTO {
@NotBlank(message = "网格ID不能为空")
private String gridId;
@NotBlank(message = "徽章key不能为空")
private String badgeKey;
}

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

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author wxz
* @Description 根据徽章查询用户结果集
* @date 2021.08.02 10:23:37
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ListUserByBadgeResultDTO {
private String userId;
private String gridId;
private String realName;
private String headImgUrl;
}

9
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -605,4 +605,13 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/staffpatrol/endpatrolJob")
Result endPatrolJob(@RequestBody StartPatrolFormDTO formDTO);
/**
* @Description 根据徽章查询用户列表
* @return
* @author wxz
* @date 2021.08.02 10:27
*/
@PostMapping("/epmetuser/badge/list-users-by-badge")
Result<List<ListUserByBadgeResultDTO>> listUsersByBadge(ListUserByBadgeFormDTO input);
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -422,4 +422,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "endPatrolJob", formDTO);
}
/**
* @Description 根据徽章查询用户列表
* @return
* @author wxz
* @date 2021.08.03 09:03
*/
@Override
public Result<List<ListUserByBadgeResultDTO>> listUsersByBadge(ListUserByBadgeFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listUsersByBadge", input);
}
}

23
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java

@ -10,11 +10,9 @@ import com.epmet.dto.result.*;
import com.epmet.redis.UserBadgeRedis;
import com.epmet.service.BadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
@ -190,4 +188,21 @@ public class BadgeController {
public Result<List<UserBadgesResultDTO>> userBadges(@RequestBody UserBadgesFormDTO formDTO){
return new Result<List<UserBadgesResultDTO>>().ok(badgeService.userBadges(formDTO));
}
/**
* @Description
* @return
* @author wxz
* @date 2021.08.02 10:27
*/
@PostMapping("list-users-by-badge")
public Result<List<ListUserByBadgeResultDTO>> listUsersByBadge(@RequestBody ListUserByBadgeFormDTO input) {
ValidatorUtils.validateEntity(input);
String gridId = input.getGridId();
String badgeKey = input.getBadgeKey();
List<ListUserByBadgeResultDTO> users = badgeService.listUsersByBadge(gridId, badgeKey);
return new Result<List<ListUserByBadgeResultDTO>>().ok(users);
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java

@ -196,4 +196,12 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
* @date 2020/11/19 10:18 上午
*/
int selectNextSort(@Param("customerId") String customerId);
/**
* @Description 根据徽章查询人列表
* @return
* @author wxz
* @date 2021.08.02 10:40
*/
List<ListUserByBadgeResultDTO> listUsersByBadge(@Param("gridId") String gridId, @Param("badgeKey") String badgeKey);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java

@ -192,4 +192,12 @@ public interface BadgeService extends BaseService<BadgeEntity> {
* @date 2021/4/22 下午4:17
*/
List<UserBadgesResultDTO> userBadges(UserBadgesFormDTO formDTO);
/**
* @Description 根据徽章查询用户列表
* @return
* @author wxz
* @date 2021.08.02 10:39
*/
List<ListUserByBadgeResultDTO> listUsersByBadge(String gridId, String badgeKey);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java

@ -480,4 +480,8 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
return result;
}
@Override
public List<ListUserByBadgeResultDTO> listUsersByBadge(String gridId, String badgeKey) {
return baseDao.listUsersByBadge(gridId, badgeKey);
}
}

20
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -310,4 +310,24 @@
ORDER BY CREATED_TIME DESC
LIMIT 1
</select>
<!--根据徽章查询居民列表-->
<select id="listUsersByBadge" resultType="com.epmet.dto.result.ListUserByBadgeResultDTO">
select
resi_user_badge.USER_ID,
resi_user_badge.GRID_ID,
user_base_info.REAL_NAME,
user_base_info.HEAD_IMG_URL
from resi_user_badge
inner join badge on (badge.BADGE_KEY = #{badgeKey}
and resi_user_badge.GRID_ID = #{gridId}
and resi_user_badge.CERTIFICATION_AUTID_STATUS = 'approved'
and resi_user_badge.DEL_FLAG = 0
and resi_user_badge.BADGE_ID = badge.ID
and badge.DEL_FLAG = 0)
inner join user_base_info
on (user_base_info.USER_ID = resi_user_badge.USER_ID
and user_base_info.DEL_FLAG = 0)
</select>
</mapper>
Loading…
Cancel
Save