Browse Source

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

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

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -95,6 +95,9 @@ public enum EpmetErrorCode {
IMG_SCAN_FAILED(8504,"图片审核失败,请重新上传"),
PROJECT_IS_CLOSED(8601,"项目已结案"),
VOTE_ISSUE_PLEASE(8602,"请先选择支持或反对,再发表您的想法"),
RESI_EVENT_READ(8603,"当前事件正在处理中,不能撤回"),
RESI_EVENT_NOT_MY_REPORTED(8604,"当前事件不是您发布的,无权操作"),
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),
// 活动报名失败,弹窗:志愿者认证

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
*/

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java

@ -21,6 +21,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -70,7 +71,7 @@ public class LogMsgSendFilter extends LevelFilter {
stringBuilder.append("\n");
}
stringBuilder.append("故障时间:").append(DateUtils.formatTimestamp(event.getTimeStamp(),DateUtils.DATE_TIME_PATTERN));
stringBuilder.append("故障时间:").append(DateUtils.format(new Date(event.getTimeStamp()),DateUtils.DATE_TIME_PATTERN));
stringBuilder.append("\n");
stringBuilder.append("TraceId:").append(Thread.currentThread().getName());
stringBuilder.append("\n");

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>

21
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/HealthCheckController.java

@ -1,21 +0,0 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("healthcheck")
public class HealthCheckController {
/**
* http健康检查
* @return
*/
@PostMapping("http")
public Result httpHealthCheck() {
return new Result();
}
}

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;
}

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

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 被艾特的人
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 15:51
*/
@Data
public class MentionUserFormDTO implements Serializable {
/**
* 人大代表用户id
*/
private String userId;
/**
* 人大代表注册网格id
*/
private String gridId;
/**
* 人大代表注册网格所属社区id
*/
private String agencyId;
/**
* 注册网格的所有上级
*/
private String pids;
}

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/ReportOrgFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 报给谁
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 15:51
*/
@Data
public class ReportOrgFormDTO implements Serializable {
/**
* 报给 网格grid 社区community 街道:street 区县级: district 市级: city 省级:province
*/
private String orgLevel;
/**
* 报给的组织或者网格id
*/
private String orgId;
/**
* org_id的上级组织idorg_id是跟组织此列为0
*/
private String orgPid;
/**
* org_id的所有上级组织idorg_id是跟组织此列为0
*/
private String orgPids;
}

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

@ -0,0 +1,85 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 我要报事-提交
*
* @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 {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 用户所在网格id
*/
@NotBlank(message = "不能为空",groups = AddUserInternalGroup.class)
private String gridId;
/**
* 事件内容最多1000
*/
@Length(min = 1, max = 1000, message = "请填写内容,最多输入1000字", groups = AddUserShowGroup.class)
private String eventContent;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 地址
*/
@NotBlank(message = "地址不能为空",groups = AddUserShowGroup.class)
private String address;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
/**
* @的人
*/
private List<MentionUserFormDTO> npcUserList;
/**
* 报给谁
*/
@NotEmpty(message = "不能为空",groups = AddUserInternalGroup.class)
private List<ReportOrgFormDTO> orgList;
//以下参数从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;
}

44
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UserMentionFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 我要报事-人大代表未读/已读列表入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/4 9:34
*/
@Data
public class UserMentionFormDTO implements Serializable {
private static final long serialVersionUID = 7548058964554418080L;
public interface AddUserInternalGroup {
}
/**
* 未读un_read;已读read
*/
@NotBlank(message = "readFlag不能为空", groups = AddUserInternalGroup.class)
private String readFlag;
@NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class)
private Integer pageSize;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

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 eventContent;
/**
* 报事时间
*/
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;
}

55
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.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/4 9:44
*/
@Data
public class UserMentionResultDTO implements Serializable {
private static final long serialVersionUID = 8171079006237395425L;
/**
* 事件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;
}

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

@ -0,0 +1,46 @@
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";
/**
* 事件状态resi_event.status:处理中processing已办结closed_case
*/
String EVENT_STATUS_PROCESSING="processing";
String EVENT_STATUS_CLOSED_CASE="closed_case";
String READ="read";
String UN_READ="un_read";
/**
* 事件@人员表用户身份
* resi_event_mention.user_type
*/
String NPC_USER="npc_user";
/**
* 操作日志表用户来源resi_event_operation_log.userIdentity
* 居民端用户:resi_user工作人员:staff报事人:report_user
*/
String RESI_USER="resi_user";
String STAFF="staff";
String REPORT_USER="report_user";
/**
* 事件是否解决已解决 resolved未解决 un_solved
*/
String RESOLVED="resolved";
String UN_SOLVED="un_solved";
}

61
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java

@ -0,0 +1,61 @@
package com.epmet.constant;
import com.epmet.commons.tools.constant.StrConstant;
/**
* resi_event_operation_log事件操作日志枚举类
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/3 16:38
*/
public enum ResiEventAction {
// 1、发布事件:publish;
// 2、撤回事件:recall;
// 3、复:reply;
// 4、立项:shift_project;
// 5、办结:close_case;
// 6、选择是否已解决:choose_resolve;
// 7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;
PUBLISH ( "publish",""),
RECALL( "recall",""),
REPLY ("reply",""),
SHIFIT_PROJECT ( "shift_project",""),
CLOSE_CASE ( "close_case",""),
CHOOSE_RESOLVE ( "choose_resolve",""),
READ( "read","");
private String code;
private String desc;
ResiEventAction(String code, String desc) {
this.code = code;
this.desc = desc;
}
public static String getDesc(String code) {
ResiEventAction[] businessModeEnums = values();
for (ResiEventAction resiEventAction : businessModeEnums) {
if (resiEventAction.getCode()==code) {
return resiEventAction.getDesc();
}
}
return StrConstant.EPMETY_STR;
}
public String getCode(){
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc(){
return this.desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

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;
}

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

@ -0,0 +1,171 @@
/**
* 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.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
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
*/
@PostMapping("report")
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventFormDTO.AddUserShowGroup.class,ResiEventFormDTO.AddUserInternalGroup.class);
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();
}
/**
* 我要报事-人大代表未读/已读列表
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/4 9:40
*/
@PostMapping("mentionlist")
public Result<List<UserMentionResultDTO>> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,UserMentionFormDTO.AddUserInternalGroup.class);
return new Result<List<UserMentionResultDTO>>().ok(resiEventService.mentionList(formDTO));
}
}

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> {
}

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

@ -0,0 +1,57 @@
/**
* 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.dto.result.EventListResultDTO;
import com.epmet.dto.result.MyReportedResultDTO;
import com.epmet.entity.ResiEventEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventDao extends BaseDao<ResiEventEntity> {
/**
* @Description 查询报事列表
* @Param orgId
* @Param eventType
* @author zxc
* @date 2021/8/3 4:21 下午
*/
List<EventListResultDTO> eventUnDisposedList(@Param("orgId")String orgId,@Param("eventType")String eventType);
/**
* 居民端我的报事列表查询
*
* @param userId 报事人
* @param statusCondition 未处理:un_read处理中processing已办结closed_case
* @return java.util.List<com.epmet.dto.result.MyReportedResultDTO>
* @author yinzuomei
* @date 2021/8/3 23:21
*/
List<MyReportedResultDTO> queryMyReported(@Param("userId") String userId, @Param("statusCondition")String statusCondition);
}

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

@ -0,0 +1,47 @@
/**
* 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.dto.result.UserMentionResultDTO;
import com.epmet.entity.ResiEventMentionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 事件被@人表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Mapper
public interface ResiEventMentionDao extends BaseDao<ResiEventMentionEntity> {
/**
* 人大代表未读已读列表
*
* @param userId
* @param readFlag
* @return java.util.List<com.epmet.dto.result.UserMentionResultDTO>
* @author yinzuomei
* @date 2021/8/4 9:54
*/
List<UserMentionResultDTO> selectMentionList(@Param("userId")String userId, @Param("readFlag")String readFlag);
}

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;
}

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

@ -0,0 +1,146 @@
/**
* 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 Boolean isParty;
/**
* 事件内容
*/
private String eventContent;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 地址
*/
private String address;
/**
* 处理中processing已办结closed_case
*/
private String status;
/**
* 办结时间
*/
private Date closeCaseTime;
/**
* 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);
}

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

@ -0,0 +1,91 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.ResiEventEntity;
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);
/**
* 我要报事-人大代表未读/已读列表
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.UserMentionResultDTO>
* @author yinzuomei
* @date 2021/8/4 9:41
*/
List<UserMentionResultDTO> mentionList(UserMentionFormDTO 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;
}
}

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

@ -0,0 +1,400 @@
/**
* 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.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.dao.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ResiEventService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Slf4j
@Service
public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEventEntity> implements ResiEventService {
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Value("${openapi.scan.method.imgSyncScan}")
private String imgSyncScanMethod;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ResiEventAttachmentDao resiEventAttachmentDao;
@Autowired
private ResiEventReportOrgDao resiEventReportOrgDao;
@Autowired
private ResiEventMentionDao resiEventMentionDao;
@Autowired
private ResiEventOperationLogDao resiEventOperationLogDao;
/**
* @Description 群众直报待处理处理中已办结列表
* 未处理按照创建时间正序
* 处理中按照最新操作时间由近到远排序
* 已办结按照办结时间由近到远排序
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
@Override
public List<EventListResultDTO> eventList(EventListFormDTO formDTO) {
List<EventListResultDTO> result = baseDao.eventUnDisposedList(formDTO.getOrgId(), formDTO.getEventType());
if (!CollectionUtils.isEmpty(result)){
return result;
}
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) {
//1、事件内容审核
//2、图片审核
this.scanContent(formDTO.getEventContent(), formDTO.getAttachmentList());
//3、查询当前所在网格的信息
Result<GridInfoResultDTO> gridInfoRes=govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId());
if(!gridInfoRes.success()||null==gridInfoRes.getData()){
throw new RenException("网格信息查询异常");
}
ResiEventEntity resiEventEntity= ConvertUtils.sourceToTarget(formDTO,ResiEventEntity.class);
resiEventEntity.setAgencyId(gridInfoRes.getData().getParentAgencyId());
resiEventEntity.setPids(gridInfoRes.getData().getPids());
resiEventEntity.setReportUserId(formDTO.getUserId());
Result<Boolean> partyRes=epmetUserOpenFeignClient.selectIsPartyMemberByUserId(formDTO.getUserId());
if(!partyRes.success()||null==partyRes.getData()){
throw new RenException("查询用户是否是党员异常");
}
resiEventEntity.setIsParty(partyRes.getData());
resiEventEntity.setStatus(EventConstant.EVENT_STATUS_PROCESSING);
resiEventEntity.setShiftProject(false);
resiEventEntity.setProjectId(StrConstant.EPMETY_STR);
resiEventEntity.setRecallFlag(false);
resiEventEntity.setReadFlag(false);
resiEventEntity.setRedDot(false);
resiEventEntity.setLatestOperatedTime(new Date());
resiEventEntity.setCreatedTime(resiEventEntity.getLatestOperatedTime());
resiEventEntity.setUpdatedTime(resiEventEntity.getLatestOperatedTime());
//4、插入主表resi_event
baseDao.insert(resiEventEntity);
//5、插入附件表
List<ResiEventAttachmentEntity> attachmentEntityList=getAttList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getAttachmentList());
attachmentEntityList.forEach(attachmentEntity->{
resiEventAttachmentDao.insert(attachmentEntity);
});
//6、插入组织表
List<ResiEventReportOrgEntity> orgEntityList=getOrgList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getOrgList());
orgEntityList.forEach(orgEntity->{
resiEventReportOrgDao.insert(orgEntity);
});
//7、插入艾特人表
List<ResiEventMentionEntity> npcList=getNpcList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getNpcUserList());
npcList.forEach(npc->{
resiEventMentionDao.insert(npc);
});
//8、插入log日志
ResiEventOperationLogEntity publishLog=new ResiEventOperationLogEntity();
publishLog.setCustomerId(formDTO.getCustomerId());
publishLog.setResiEventId(resiEventEntity.getId());
publishLog.setUserId(formDTO.getUserId());
publishLog.setUserIdentity(EventConstant.REPORT_USER);
publishLog.setActionCode(ResiEventAction.PUBLISH.getCode());
publishLog.setActionDesc(ResiEventAction.PUBLISH.getDesc());
publishLog.setOperateTime(resiEventEntity.getCreatedTime());
resiEventOperationLogDao.insert(publishLog);
//9、返回事件id
ResiEventIdDTO resiEventIdDTO=new ResiEventIdDTO();
resiEventIdDTO.setResiEventId(resiEventEntity.getId());
return resiEventIdDTO;
}
private List<ResiEventMentionEntity> getNpcList(String customerId, String resiEventId, List<MentionUserFormDTO> npcUserList) {
List<ResiEventMentionEntity> list=new ArrayList<>();
npcUserList.forEach(npc->{
ResiEventMentionEntity mentionEntity=new ResiEventMentionEntity();
mentionEntity.setCustomerId(customerId);
mentionEntity.setResiEventId(resiEventId);
mentionEntity.setUserType(EventConstant.NPC_USER);
mentionEntity.setUserId(npc.getUserId());
mentionEntity.setGridId(npc.getGridId());
mentionEntity.setAgencyId(npc.getAgencyId());
mentionEntity.setPids(npc.getPids());
mentionEntity.setReadFlag(EventConstant.UN_READ);
mentionEntity.setRedDot(true);
list.add(mentionEntity);
});
return list;
}
private List<ResiEventReportOrgEntity> getOrgList(String customerId, String resiEventId, List<ReportOrgFormDTO> orgList) {
List<ResiEventReportOrgEntity> list=new ArrayList<>();
orgList.forEach(org->{
ResiEventReportOrgEntity entity=ConvertUtils.sourceToTarget(org,ResiEventReportOrgEntity.class);
entity.setCustomerId(customerId);
entity.setResiEventId(resiEventId);
entity.setOrgType(org.getOrgLevel());
//默认是未读
entity.setOrgRead(EventConstant.UN_READ);
entity.setRedDot(true);
list.add(entity);
});
return list;
}
private List<ResiEventAttachmentEntity> getAttList(String customerId,String resiEventId, List<FileCommonDTO> attachmentList) {
List<ResiEventAttachmentEntity> list=new ArrayList<>();
int sort= NumConstant.ONE;
for(FileCommonDTO img:attachmentList){
ResiEventAttachmentEntity entity=new ResiEventAttachmentEntity();
entity.setCustomerId(customerId);
entity.setResiEventId(resiEventId);
entity.setAttachmentName(img.getName());
entity.setAttachmentFormat(img.getFormat());
entity.setAttachmentType(img.getType());
entity.setAttachmentUrl(img.getUrl());
entity.setSort(sort);
sort++;
list.add(entity);
}
return list;
}
private void scanContent(String eventContent, List<FileCommonDTO> attachmentList) {
//事件内容
if (StringUtils.isNotBlank(eventContent)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(eventContent);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
}
List<String> imgList=new ArrayList<>();
for(FileCommonDTO fileCommonDTO:attachmentList){
if("image".equals(fileCommonDTO.getType())){
imgList.add(fileCommonDTO.getUrl());
}
}
//事件图片
if (!CollectionUtils.isEmpty(imgList)) {
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
imgList.forEach(imgUrl -> {
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(UUID.randomUUID().toString().replace("-", ""));
task.setUrl(imgUrl);
imgScanParamDTO.getTasks().add(task);
});
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO);
if (!imgScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!imgScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg());
}
}
}
}
/**
* 撤回事件
*
* 需求描述:未处理状态中可撤回上报事件撤回后不在展示列表内@的人大代表或组织已读后按钮消失
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:45
*/
@Override
public void reCall(ReCallEventFormDTO formDTO) {
ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getResiEventId());
if(null==resiEventEntity){
throw new RenException(String.format("根据事件id没有找到记录",formDTO.getResiEventId()));
}
// 我自己的发布的才可以删除
if(!formDTO.getUserId().equals(resiEventEntity.getReportUserId())){
log.warn("撤回事件入参:"+JSON.toJSONString(formDTO));
throw new RenException(EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getCode(),EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getMsg());
}
// 没有人看到过,才可以删除
if(resiEventEntity.getReadFlag()){
throw new RenException(EpmetErrorCode.RESI_EVENT_READ.getCode(),EpmetErrorCode.RESI_EVENT_READ.getMsg());
}
resiEventEntity.setLatestOperatedTime(new Date());
resiEventEntity.setRecallFlag(true);
resiEventEntity.setRecallTime(resiEventEntity.getLatestOperatedTime());
//1、更新主表标记已撤回
baseDao.updateById(resiEventEntity);
//2、插入log日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(formDTO.getCustomerId());
reCallLog.setResiEventId(resiEventEntity.getId());
reCallLog.setUserId(formDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.REPORT_USER);
reCallLog.setActionCode(ResiEventAction.RECALL.getCode());
reCallLog.setActionDesc(ResiEventAction.RECALL.getDesc());
reCallLog.setOperateTime(resiEventEntity.getLatestOperatedTime());
resiEventOperationLogDao.insert(reCallLog);
}
/**
* 选择已解决未解决
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/3 13:58
*/
@Override
public void chooseResolve(ChooseResolveFormDTO formDTO) {
ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getResiEventId());
if(null==resiEventEntity){
throw new RenException(String.format("根据事件id没有找到记录",formDTO.getResiEventId()));
}
// 我自己的发布的才可以
if(!formDTO.getUserId().equals(resiEventEntity.getReportUserId())){
throw new RenException(EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getCode(),EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getMsg());
}
if(!EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resiEventEntity.getStatus())){
throw new RenException("事件办结后,才可以选择是否解决,当前状态为:"+resiEventEntity.getStatus());
}
resiEventEntity.setResolveStatus(formDTO.getResolveStatus());
resiEventEntity.setUpdatedTime(new Date());
baseDao.updateById(resiEventEntity);
//2、插入log日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(formDTO.getCustomerId());
reCallLog.setResiEventId(resiEventEntity.getId());
reCallLog.setUserId(formDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.REPORT_USER);
reCallLog.setActionCode(ResiEventAction.CHOOSE_RESOLVE.getCode());
reCallLog.setActionDesc(ResiEventAction.CHOOSE_RESOLVE.getDesc());
reCallLog.setOperateTime(resiEventEntity.getUpdatedTime());
resiEventOperationLogDao.insert(reCallLog);
}
/**
* 我的报事列表查询
*
* @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) {
PageInfo<MyReportedResultDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryMyReported(formDTO.getUserId(),
formDTO.getStatusCondition()));
return result.getList();
}
/**
* 我要报事-人大代表未读/已读列表
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.UserMentionResultDTO>
* @author yinzuomei
* @date 2021/8/4 9:41
*/
@Override
public List<UserMentionResultDTO> mentionList(UserMentionFormDTO formDTO) {
PageInfo<UserMentionResultDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> resiEventMentionDao.selectMentionList(formDTO.getUserId(),
formDTO.getReadFlag()));
return result.getList();
}
}

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

@ -0,0 +1,127 @@
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(255) NOT NULL COMMENT '居民端用户所在网格的所有上级组织,包含AGENCY_ID',
`REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人',
`IS_PARTY` tinyint(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',
`close_case_time` datetime DEFAULT NULL COMMENT '办结时间',
`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>

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

@ -0,0 +1,90 @@
<?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">
<!-- 查询报事列表 -->
<resultMap id="eventUnDisposedListMap" type="com.epmet.dto.result.EventListResultDTO">
<result property="eventContent" column="eventContent"/>
<result property="eventId" column="eventId"/>
<result property="eventTime" column="eventTime"/>
<result property="isProject" column="isProject"/>
<result property="redDot" column="redDot"/>
<collection property="eventImgs" ofType="java.lang.String">
<result column="img"/>
</collection>
</resultMap>
<select id="eventUnDisposedList" resultMap="eventUnDisposedListMap">
SELECT IFNULL(rea.ATTACHMENT_URL,'') AS img,t.* FROM
(SELECT
re.EVENT_CONTENT AS eventContent,
IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i:%s'),'') AS eventTime,
re.ID AS eventId,
(CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject,
(CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot
FROM resi_event_report_org ro
INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0')
AND ro.DEL_FLAG = '0'
<if test='eventType == "undisposed" '>
AND ro.ORG_READ = 'un_read'
ORDER BY re.CREATED_TIME
</if>
<if test='eventType == "processed" '>
AND ro.ORG_READ = 'read'
AND re.`STATUS` = 'processing'
ORDER BY re.LATEST_OPERATED_TIME
</if>
<if test='eventType == "transferred" '>
AND ro.ORG_READ = 'read'
AND re.`STATUS` = 'closed_case'
ORDER BY re.CLOSE_CASE_TIME
</if>
)t
LEFT JOIN resi_event_attachment rea ON (rea.RESI_EVENT_ID = t.eventId AND rea.DEL_FLAG = '0' AND rea.ATTACHMENT_TYPE = 'image' AND (rea.SORT = 0 OR rea.SORT = 1 OR rea.SORT = 2))
</select>
<resultMap id="MyReportedResultDTOMap" type="com.epmet.dto.result.MyReportedResultDTO">
<id property="resiEventId" column="id"/>
<result property="eventContent" column="EVENT_CONTENT"/>
<result property="redDot" column="RED_DOT" />
<result property="status" column="STATUS" />
<result property="shiftProject" column="SHIFT_PROJECT" />
<result property="showTime" column="LATEST_OPERATED_TIME" />
<collection property="imgList" ofType="java.lang.String">
<constructor>
<arg column="img_url"/>
</constructor>
</collection>
</resultMap>
<select id="queryMyReported" parameterType="map" resultMap="MyReportedResultDTOMap">
select
re.id,
re.EVENT_CONTENT,
(
case when #{statusCondition} ='un_read' then '0'
else re.RED_DOT
end
)as RED_DOT,
re.`STATUS`,
re.SHIFT_PROJECT,
re.LATEST_OPERATED_TIME,
rea.ATTACHMENT_URL as img_url
from resi_event re
left join resi_event_attachment rea
on(re.id=rea.RESI_EVENT_ID
and rea.DEL_FLAG='0'
and rea.ATTACHMENT_TYPE='image')
where re.DEL_FLAG='0'
and re.RECALL_FLAG='0'
and re.REPORT_USER_ID=#{userId}
<if test='statusCondition == "un_read" '>
and re.READ_FLAG='0'
</if>
<if test='statusCondition != "un_read" '>
and re.`STATUS`=#{statusCondition}
</if>
order by re.LATEST_OPERATED_TIME desc
</select>
</mapper>

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

@ -0,0 +1,57 @@
<?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">
<resultMap id="UserMentionResultDTOMap" type="com.epmet.dto.result.UserMentionResultDTO">
<id property="resiEventId" column="RESI_EVENT_ID"/>
<result property="eventContent" column="EVENT_CONTENT"/>
<result property="redDot" column="RED_DOT" />
<result property="status" column="STATUS" />
<result property="shiftProject" column="SHIFT_PROJECT" />
<result property="showTime" column="LATEST_OPERATED_TIME" />
<collection property="imgList" ofType="java.lang.String">
<constructor>
<arg column="img_url"/>
</constructor>
</collection>
</resultMap>
<select id="selectMentionList" parameterType="map" resultMap="UserMentionResultDTOMap">
SELECT
rem.RESI_EVENT_ID,
re.EVENT_CONTENT,
(
case when #{readFlag} ='un_read' then '0'
else rem.RED_DOT
end
)as RED_DOT,
re.`STATUS`,
re.SHIFT_PROJECT,
re.LATEST_OPERATED_TIME,
rea.ATTACHMENT_URL as img_url
FROM
resi_event_mention rem
LEFT JOIN resi_event re
ON ( rem.RESI_EVENT_ID = re.id )
LEFT JOIN resi_event_attachment rea
ON ( re.id = rea.RESI_EVENT_ID
AND rea.DEL_FLAG = '0'
AND rea.ATTACHMENT_TYPE = 'image')
WHERE
rem.DEL_FLAG = '0'
AND re.DEL_FLAG = '0'
AND re.RECALL_FLAG = '0'
AND rem.USER_ID = #{userId}
AND rem.READ_FLAG =#{readFlag}
<if test='readFlag == "un_read" '>
ORDER BY
re.CREATED_TIME ASC
</if>
<if test='readFlag == "read" '>
ORDER BY
re.LATEST_OPERATED_TIME DESC
</if>
</select>
</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;
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -583,7 +583,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
Result result = epmetUserFeignClient.saveResiInfo(userResiInfoDTO);
log.info("isResiRegister epmetUserFeignClient.saveResiInfo result:{}",JSON.toJSONString(result));
if (!result.success()){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg());
throw new RenException(result.getCode(),result.getMsg());
}
}else{
log.info("isResiRegister partyMember have registered resi,userId:{}",partyMemberInfoDTO.getUserId());

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/dao/UserInvitationDao.java

@ -23,6 +23,8 @@ import com.epmet.entity.UserInvitationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 人员邀请关系表 记录user之间的邀请关系
*
@ -41,7 +43,7 @@ public interface UserInvitationDao extends BaseDao<UserInvitationEntity> {
* @Description 根据被邀请人id邀请链接id邀请场景查询人员邀请记录
* @Date 2020/4/10 0:36
**/
UserInvitationDTO selectUserInvitation(@Param("inviteeUserId") String inviteeUserId,
@Param("inviteSourceId") String inviteSourceId,
@Param("inviteSource") String inviteSource);
List<UserInvitationDTO> selectUserInvitation(@Param("inviteeUserId") String inviteeUserId,
@Param("inviteSourceId") String inviteSourceId,
@Param("inviteSource") String inviteSource);
}

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);
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserInvitationServiceImpl.java

@ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.Date;
@ -106,10 +107,10 @@ public class UserInvitationServiceImpl extends BaseServiceImpl<UserInvitationDao
@Override
public Result saveUserInvitation(UserInvitationFormDTO formDTO) {
UserInvitationDTO userInvitationDTO = baseDao.selectUserInvitation(formDTO.getInviteeUserId(),
List<UserInvitationDTO> userInvitationDTOList = baseDao.selectUserInvitation(formDTO.getInviteeUserId(),
formDTO.getInviteSourceId(),
formDTO.getInviteSource());
if (null == userInvitationDTO) {
if (CollectionUtils.isEmpty(userInvitationDTOList)) {
UserInvitationDTO insertUserInvitationDTO = new UserInvitationDTO();
insertUserInvitationDTO.setCustomerId(formDTO.getCustomerId());
insertUserInvitationDTO.setGridId(formDTO.getGridId());
@ -120,8 +121,10 @@ public class UserInvitationServiceImpl extends BaseServiceImpl<UserInvitationDao
insertUserInvitationDTO.setInviteSourceId(formDTO.getInviteSourceId());
this.save(insertUserInvitationDTO);
} else {
userInvitationDTO.setInvitationTime(new Date());
this.update(userInvitationDTO);
userInvitationDTOList.forEach(userInvitationDTO->{
userInvitationDTO.setInvitationTime(new Date());
this.update(userInvitationDTO);
});
}
return new Result();
}

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

@ -310,8 +310,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
//更新该用户在该客户下的注册状态
userCustomerDao.updateRegistered(userResiInfoDTO.getCustomerId(), userResiInfoDTO.getUserId());
}else{
log.error("手机号客户内不可用,没有更新用户信息,param:{}", JSON.toJSONString(userResiInfoDTO));
throw new RenException(EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getCode());
log.warn("手机号客户内不可用,没有更新用户信息,param:{}", JSON.toJSONString(userResiInfoDTO));
throw new RenException(EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getCode(),EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getMsg());
}
return result;

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>

3
epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml

@ -7,7 +7,6 @@
<select id="selectLL" resultType="com.epmet.dto.result.GridManagerUserListResultDTO">
SELECT t.* FROM
(SELECT
distinct(pr.ID) AS ID,
pr.GRID AS gridId,
pr.STAFF_ID,
pr.`STATUS`,
@ -15,7 +14,7 @@
pd.LONGITUDE,
pd.SERIAL_NUM
FROM staff_patrol_record pr
LEFT JOIN staff_patrol_detail pd ON pd.STAFF_PATROL_REC_ID = pr.ID AND pd.DEL_FLAG = 0
INNER JOIN (SELECT MAX(pd.CREATED_TIME) , pd.STAFF_PATROL_REC_ID, pd.LATITUDE, pd.LONGITUDE,pd.SERIAL_NUM FROM staff_patrol_detail pd WHERE pd.DEL_FLAG = '0' GROUP BY pd.STAFF_PATROL_REC_ID) pd ON(pd.STAFF_PATROL_REC_ID = pr.ID)
WHERE pr.DEL_FLAG = 0
AND (
<foreach collection="userIds" item="userId" separator=" OR ">

Loading…
Cancel
Save