diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java index 1e44b924c2..5b56e64b1a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/ResultDataResolver.java +++ b/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 */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/UserEventLogoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/UserEventLogoResultDTO.java new file mode 100644 index 0000000000..290845787b --- /dev/null +++ b/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; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 6c2a9d38c6..184e00a313 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -75,6 +75,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 79e5e624d8..43057689ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/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 + * @author yinzuomei + * @date 2021/8/3 15:07 + */ + @PostMapping("mentionme") + public Result mentionMeEvent(@LoginUser TokenDto tokenDto){ + return new Result().ok(epmetUserService.mentionMeEvent(tokenDto.getUserId())); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java index 7d8765b542..cc12c17271 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java +++ b/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 selectUserByBadge(@Param("userId")String userId, @Param("badgeKey")String badgeKey); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java index cc3f3d9e7e..4697a0f267 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java +++ b/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 { List selectDepartmentNameList(ProjectDTO project); List selectList(@Param("customerId") String customerId,@Param("list")List issueIds); + + int countRedDot(String userId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 10f164c6a9..e1941c1c08 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/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 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); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 281f24cc6d..58ea59a3ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/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; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java index 38192cd035..35b0096790 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java +++ b/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 queryProjectDistribution(ProjectDistributionFormDTO formDTO); + + /** + * 查询resi_event_mention + * + * @param userId + * @return int + * @author yinzuomei + * @date 2021/8/3 15:27 + */ + int countRedDot(String userId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index d48c31f2d7..2063b3f83d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/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); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml index ba7b99c850..40e651d1e9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml @@ -3,4 +3,17 @@ + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index d376938904..1e144e3420 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -144,4 +144,15 @@ order by p.CREATED_TIME desc + + \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 4914a71cfc..4fc64984c9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/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 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); + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrgLevelEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrgLevelEnums.java new file mode 100644 index 0000000000..00107ec8f5 --- /dev/null +++ b/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; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java new file mode 100644 index 0000000000..b8de802fe0 --- /dev/null +++ b/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 = ""; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ChooseResolveFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ChooseResolveFormDTO.java new file mode 100644 index 0000000000..f52f9622fe --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java new file mode 100644 index 0000000000..1d2972d0c3 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventListFormDTO.java new file mode 100644 index 0000000000..699c6ada63 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportedFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportedFormDTO.java new file mode 100644 index 0000000000..a1cdd9d389 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReCallEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReCallEventFormDTO.java new file mode 100644 index 0000000000..a52f89d02a --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java new file mode 100644 index 0000000000..20575626fd --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java new file mode 100644 index 0000000000..83d96502ae --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 我要报事-提交(尹) + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/3 10:46 + */ +@Data +public class ResiEventFormDTO implements Serializable { + private static final long serialVersionUID = -778643059131036832L; + + public interface AddUserInternalGroup { + } + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java new file mode 100644 index 0000000000..c2ca21208e --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java new file mode 100644 index 0000000000..85e0a0a9b2 --- /dev/null +++ b/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; + + /** + * 是否办结【是:true,否:false】 + */ + private Boolean isClosed; + + /** + * 是否解决【是:true,否:false】 + */ + private Boolean isResolve; + + /** + * 是否可以撤回【true:是,false:否】 + */ + private Boolean isRollback; + + /** + * 报事图片 + */ + private List eventImgs; + + /** + * 报事提到的人 + */ + private List 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(); + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java new file mode 100644 index 0000000000..94853b80d1 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventListResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/8/3 10:41 上午 + * @DESC + */ +@Data +public class EventListResultDTO implements Serializable { + + private static final long serialVersionUID = -8550265282744924930L; + + /** + * 报事标题 + */ + private String eventTitle; + + /** + * 报事时间 + */ + private String eventTime; + + /** + * 报事ID + */ + private String eventId; + + /** + * 是否立项【true:是,false:否】 + */ + private Boolean isProject; + + /** + * 红点显示【true:显示,false:不显示】 + */ + private Boolean redDot; + + /** + * 报事图片 + */ + private List eventImgs; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java new file mode 100644 index 0000000000..32209d0249 --- /dev/null +++ b/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 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; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java new file mode 100644 index 0000000000..f5b744289e --- /dev/null +++ b/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; + + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventIdDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventIdDTO.java new file mode 100644 index 0000000000..22282ce4ca --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java new file mode 100644 index 0000000000..8a63bba97b --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java @@ -0,0 +1,17 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/8/3 2:45 下午 + * @DESC + */ +public interface EventConstant { + + /** + * 【处理中:processed 待处理:undisposed 已办结:transferred】 + */ + String EVENT_PROCESSED = "processed"; + String EVENT_UN_DISPOSED = "undisposed"; + String EVENT_TRANSFERRED = "transferred"; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/EventController.java new file mode 100644 index 0000000000..02f58c15ca --- /dev/null +++ b/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; + + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java new file mode 100644 index 0000000000..4622d74927 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -0,0 +1,158 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.*; +import com.epmet.dto.result.EventDetailResultDTO; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.result.EventListResultDTO; +import com.epmet.dto.result.MyReportedResultDTO; +import com.epmet.dto.result.ResiEventIdDTO; +import com.epmet.service.ResiEventService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@RestController +@RequestMapping("resievent") +public class ResiEventController { + + @Autowired + private ResiEventService resiEventService; + + /** + * @Description 报事详情-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 1:47 下午 + */ + @PostMapping("eventdetail") + public Result eventDetail(@RequestBody EventDetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(resiEventService.eventDetail(formDTO)); + } + /** + * 我要报事-提交(尹) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/3 10:46 + */ + public Result report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + //校验参数 + //todo + return new Result().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> + * @author yinzuomei + * @date 2021/8/3 14:27 + */ + @PostMapping("myreported") + public Result> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,MyReportedFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiEventService.queryMyReported(formDTO)); + } + + /** + * @Description 群众直报(待处理、处理中、已办结)列表 + * @Param formDTO + * @author zxc + * @date 2021/8/3 10:53 上午 + */ + @PostMapping("eventlist") + public Result> eventList(@RequestBody EventListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class); + return new Result>().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(); + } +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java new file mode 100644 index 0000000000..6a1eac37ef --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> replyList(@RequestBody ReplyListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ReplyListFormDTO.ReplyListForm.class); + return new Result>().ok(resiEventReplyService.replyList(formDTO)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventAttachmentDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventAttachmentDao.java new file mode 100644 index 0000000000..1202c3dc22 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java new file mode 100644 index 0000000000..c1312cb0d9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ResiEventEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java new file mode 100644 index 0000000000..270500ae05 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ResiEventMentionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 事件被@人表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventMentionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java new file mode 100644 index 0000000000..6432b2dbb6 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java new file mode 100644 index 0000000000..38cbf1467d --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java new file mode 100644 index 0000000000..b8d9776cab --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java new file mode 100644 index 0000000000..255c7c465c --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java new file mode 100644 index 0000000000..34ae10cd86 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_event") +public class ResiEventEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 居民端用户所在网格id + */ + private String gridId; + + /** + * 居民端用户所在网格的所属组织 + */ + private String agencyId; + + /** + * 居民端用户所在网格的所有上级组织,包含AGENCY_ID + */ + private String pids; + + /** + * 报事的人 + */ + private String reportUserId; + + /** + * 1:党员;0:不是党员;默认0 + */ + private String isParty; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 1:已转项目;0:未转项目;默认0 + */ + private Boolean shiftProject; + + /** + * 项目id;shift_project=1时,此列有值 + */ + private String projectId; + + /** + * 1:已撤回;0:未撤回正常展示;默认0 + */ + private Boolean recallFlag; + + /** + * 撤回时间 + */ + private Date recallTime; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Boolean readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/办结更新为1; + */ + private Boolean redDot; + + /** + * 最近一次操作时间(回复、立项、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明可放这。 + */ + private String closeRemark; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java new file mode 100644 index 0000000000..2a6a2abe05 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventOperationLogEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventOperationLogEntity.java new file mode 100644 index 0000000000..e2c34cc30e --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +3、复:reply; +4、立项:shift_project; +5、办结:close_case; +6、选择是否已解决:choose_resolve; +7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中; + + */ + private String actionCode; + + /** + * 1、发布事件:publish; +2、撤回事件:recall; +3、复:reply; +4、立项:shift_project; +5、办结:close_case; +6、选择是否已解决:choose_resolve; +7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中; + */ + private String actionDesc; + + /** + * 操作时间 + */ + private Date operateTime; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReplyEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReplyEntity.java new file mode 100644 index 0000000000..2d597fd6e3 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReportOrgEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventReportOrgEntity.java new file mode 100644 index 0000000000..20f4bfad3f --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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的上级组织id,org_id是跟组织,此列为0 + */ + private String orgPid; + + /** + * org_id的所有上级组织id,org_id是跟组织,此列为0 + */ + private String orgPids; + + /** + * 含义:已读read,未读:un_read;组织下的工作人员从待处理=>处理中,点击查看详情前更新为已读; + */ + private String orgRead; + + /** + * (1)含义:1:展示红点;0:不展示;(2)注意:发布事件插入数据时为1,(3)何时更新?:人大代表回复or报事人回复or工作人员回复、立项、办结更新为1; + */ + private Boolean redDot; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java new file mode 100644 index 0000000000..5065a9eb79 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * @Description 报事详情-回复列表-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 11:11 上午 + */ + List replyList(ReplyListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java new file mode 100644 index 0000000000..82dabf69fc --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java @@ -0,0 +1,84 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.*; +import com.epmet.dto.result.EventDetailResultDTO; +import com.epmet.dto.result.EventListResultDTO; +import com.epmet.entity.ResiEventEntity; +import com.epmet.dto.result.MyReportedResultDTO; +import com.epmet.dto.result.ResiEventIdDTO; + +import java.util.List; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +public interface ResiEventService extends BaseService { + + /** + * @Description 群众直报(待处理、处理中、已办结)列表 + * @Param formDTO + * @author zxc + * @date 2021/8/3 10:53 上午 + */ + List 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 + * @author yinzuomei + * @date 2021/8/3 14:28 + */ + List queryMyReported(MyReportedFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java new file mode 100644 index 0000000000..4b003cf048 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements ResiEventReplyService { + + /** + * @Description 报事详情-回复列表-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 11:11 上午 + */ + @Override + public List replyList(ReplyListFormDTO formDTO) { + return null; + } +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java new file mode 100644 index 0000000000..321decec81 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.EventConstant; +import com.epmet.dao.ResiEventDao; +import com.epmet.dto.form.EventDetailFormDTO; +import com.epmet.dto.form.EventListFormDTO; +import com.epmet.dto.form.UpdateViewTimeFormDTO; +import com.epmet.dto.result.EventDetailResultDTO; +import com.epmet.dto.result.EventListResultDTO; +import com.epmet.dto.form.ChooseResolveFormDTO; +import com.epmet.dto.form.MyReportedFormDTO; +import com.epmet.dto.form.ReCallEventFormDTO; +import com.epmet.dto.form.ResiEventFormDTO; +import com.epmet.dto.result.MyReportedResultDTO; +import com.epmet.dto.result.ResiEventIdDTO; +import com.epmet.entity.ResiEventEntity; +import com.epmet.service.ResiEventService; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Service +public class ResiEventServiceImpl extends BaseServiceImpl implements ResiEventService { + + /** + * @Description 群众直报(待处理、处理中、已办结)列表 + * 未处理:按照创建时间正序; + * 处理中:按照最新操作时间由近到远排序; + * 已办结:按照办结时间由近到远排序; + * @Param formDTO + * @author zxc + * @date 2021/8/3 10:53 上午 + */ + @Override + public List eventList(EventListFormDTO formDTO) { + // 处理中 + if (formDTO.getEventType().equals(EventConstant.EVENT_PROCESSED)){ + + // 待处理 + }else if (formDTO.getEventType().equals(EventConstant.EVENT_UN_DISPOSED)){ + + // 已办结 + }else if (formDTO.getEventType().equals(EventConstant.EVENT_TRANSFERRED)){ + + } + return new ArrayList<>(); + } + + /** + * @Description 查看报事时,更新时间操作 + * @Param formDTO + * @author zxc + * @date 2021/8/3 11:01 上午 + */ + @Override + public void updateViewTime(UpdateViewTimeFormDTO formDTO) { + + } + + /** + * @Description 报事详情-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 1:47 下午 + */ + @Override + public EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO) { + return null; + } + /** + * 我要报事-提交(尹) + * + * @param formDTO + * @return com.epmet.dto.result.ResiEventResultDTO + * @author yinzuomei + * @date 2021/8/3 10:51 + */ + @Override + public ResiEventIdDTO report(ResiEventFormDTO formDTO) { + //todo + + + + + + return null; + } + + /** + * 撤回事件 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/3 13:45 + */ + @Override + public void reCall(ReCallEventFormDTO formDTO) { + // todo + + + + } + + /** + * 选择已解决,未解决 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/3 13:58 + */ + @Override + public void chooseResolve(ChooseResolveFormDTO formDTO) { + // todo + + + + + + + } + + /** + * 我的报事列表查询 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/8/3 14:28 + */ + @Override + public List queryMyReported(MyReportedFormDTO formDTO) { + // todo + + + + + return null; + } +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql new file mode 100644 index 0000000000..f753c01e22 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql @@ -0,0 +1,126 @@ +CREATE TABLE `resi_event` ( + `ID` varchar(64) NOT NULL COMMENT '主键,事件id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格的所属组织', + `PIDS` varchar(64) NOT NULL COMMENT '居民端用户所在网格的所有上级组织,包含AGENCY_ID', + `REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人', + `IS_PARTY` varchar(1) NOT NULL DEFAULT '0' COMMENT '1:党员;0:不是党员;默认0', + `EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `STATUS` varchar(32) NOT NULL COMMENT '处理中:processing;已办结:closed_case', + `SHIFT_PROJECT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已转项目;0:未转项目;默认0', + `PROJECT_ID` varchar(64) DEFAULT NULL COMMENT '项目id;shift_project=1时,此列有值', + `RECALL_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已撤回;0:未撤回正常展示;默认0', + `RECALL_TIME` datetime DEFAULT NULL COMMENT '撤回时间', + `READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/办结更新为1; ', + `LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、办结更新此列)', + `RESOLVE_STATUS` varchar(32) DEFAULT NULL COMMENT '是否解决:已解决 resolved,未解决 un_solved', + `CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明可放这。', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='居民报事表'; + +CREATE TABLE `resi_event_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id', + `ATTACHMENT_NAME` varchar(64) NOT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) NOT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + + +CREATE TABLE `resi_event_mention` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `USER_TYPE` varchar(32) NOT NULL COMMENT '人大代表:npc_user', + `USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '居民注册网格ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '居民所属社区,就是grid_id的所属组织', + `PIDS` varchar(255) NOT NULL COMMENT '居民注册网格的所有上级', + `READ_FLAG` varchar(10) NOT NULL DEFAULT 'un_read' COMMENT '含义:已读read,未读:un_read;人大代表从未读=>已读,点击查看详情前更新为已读;', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '1' COMMENT '(1)含义:1:展示红点;0:不展示;(2)注意:发布事件插入数据时为1,(3)何时更新?:报事人回复or工作人员回复、立项、办结更新为1;', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件被@人表'; + + +CREATE TABLE `resi_event_report_org` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '报给?:\r\n网格:grid;\r\n社区:community;\r\n乡(镇、街道)级:street;\r\n区县级: district;\r\n市级: city;\r\n省级:province。', + `ORG_ID` varchar(64) NOT NULL COMMENT '报给的组织或者网格id', + `ORG_PID` varchar(64) NOT NULL COMMENT 'org_id的上级组织id,org_id是跟组织,此列为0', + `ORG_PIDS` varchar(255) NOT NULL COMMENT 'org_id的所有上级组织id,org_id是跟组织,此列为0', + `ORG_READ` varchar(10) NOT NULL DEFAULT 'un_read' COMMENT '含义:已读read,未读:un_read;组织下的工作人员从待处理=>处理中,点击查看详情前更新为已读;', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '1' COMMENT '(1)含义:1:展示红点;0:不展示;(2)注意:发布事件插入数据时为1,(3)何时更新?:人大代表回复or报事人回复or工作人员回复、立项、办结更新为1;', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件相关组织表'; + + + +CREATE TABLE `resi_event_reply` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id', + `FROM_USER_ID` varchar(64) NOT NULL COMMENT '回复人用户Id', + `CONTENT` varchar(255) NOT NULL COMMENT '内容', + `USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '报事人:xxx路尹女士;人大:人大代表-张三;组织:组织名:阜新路社区', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件回复表'; + + +CREATE TABLE `resi_event_operation_log` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `USER_ID` varchar(64) NOT NULL COMMENT '用户id', + `USER_IDENTITY` varchar(32) NOT NULL COMMENT '居民端用户:resi_user;工作人员:staff;报事人:report_user', + `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;\r\n', + `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;', + `OPERATE_TIME` datetime NOT NULL COMMENT '操作时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件操作日志表'; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventAttachmentDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventAttachmentDao.xml new file mode 100644 index 0000000000..6bb3be938d --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventAttachmentDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml new file mode 100644 index 0000000000..21c7a902d7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml new file mode 100644 index 0000000000..98064a416f --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml new file mode 100644 index 0000000000..12d1f0ce48 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml new file mode 100644 index 0000000000..5e01548862 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml new file mode 100644 index 0000000000..7c8b96db9e --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java new file mode 100644 index 0000000000..97b856a8e6 --- /dev/null +++ b/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; +} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventTargetLevelFormDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventTargetLevelFormDTO.java new file mode 100644 index 0000000000..62dfcf4327 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java new file mode 100644 index 0000000000..4208f28751 --- /dev/null +++ b/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; +} diff --git a/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventTargetLevelResultDTO.java b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventTargetLevelResultDTO.java new file mode 100644 index 0000000000..7a2b3ce29b --- /dev/null +++ b/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()); + } +} diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index fe0abc9e81..0f52029838 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -68,6 +68,16 @@ 2.0.0 compile + + com.epmet + gov-org-client + 2.0.0 + + + com.epmet + epmet-user-client + 2.0.0 + diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java new file mode 100644 index 0000000000..b594e42921 --- /dev/null +++ b/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>> listNpc(@RequestBody ResiEventNpcListFormDTO input) { + ValidatorUtils.validateEntity(input); + String gridId = input.getGridId(); + List npcs = resiEventService.listNpcByGrid(gridId); + + HashMap> wrapper = new HashMap<>(); + wrapper.put("reportTargets", npcs); + return new Result>>().ok(wrapper); + } + + /** + * @return + * @Description 查询上报目标列表 + * @author wxz + * @date 2021.08.03 13:47 + */ + @PostMapping("/report-target-level-list") + public Result listReportTargetLevels(@RequestBody ResiEventTargetLevelFormDTO input) { + ValidatorUtils.validateEntity(input); + String gridId = input.getGridId(); + TreeSet targetList = resiEventService.listReportTargetLevels(gridId); + + HashMap> warpper = new HashMap<>(); + warpper.put("reportTargets", targetList); + + return new Result().ok(warpper); + } + +} diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java new file mode 100644 index 0000000000..b23d04a476 --- /dev/null +++ b/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 listNpcByGrid(String gridId); + + /** + * @Description 查询上报目标列表 + * @return + * @author wxz + * @date 2021.08.03 13:50 + */ + TreeSet listReportTargetLevels(String gridId); +} diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java new file mode 100644 index 0000000000..713d821588 --- /dev/null +++ b/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 listNpcByGrid(String gridId) { + + // 查询网格所属的组织信息 + Result 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> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm); + List npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null); + + List 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 listReportTargetLevels(String gridId) { + TreeSet targetLevels = new TreeSet<>(); + + Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId); + GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + String pidsPath = gridInfoData.getPids(); + List parentOrgIds = Arrays.asList(pidsPath.split(":")); + // 翻转列表 + Collections.reverse(parentOrgIds); + + // 一.网格信息(只有一条,但是为了适应接口,组装成了列表) + List currentGridId = Arrays.asList(gridId); + Result> currentGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, currentGridId)); + List 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> parentOrgInfoResult = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.AGENCY, parentOrgIds)); + List 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; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 3be3ce02c3..c8b52524f2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/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"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java new file mode 100644 index 0000000000..8d616bacf3 --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ListUserByBadgeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ListUserByBadgeResultDTO.java new file mode 100644 index 0000000000..24139d4161 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e111a8fb6c..059ced9e35 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/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> listUsersByBadge(ListUserByBadgeFormDTO input); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 7398ecb56c..31c82beb05 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/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> listUsersByBadge(ListUserByBadgeFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listUsersByBadge", input); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index a5d13c581f..192fc3c5d3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/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> userBadges(@RequestBody UserBadgesFormDTO formDTO){ return new Result>().ok(badgeService.userBadges(formDTO)); } + + /** + * @Description + * @return + * @author wxz + * @date 2021.08.02 10:27 + */ + @PostMapping("list-users-by-badge") + public Result> listUsersByBadge(@RequestBody ListUserByBadgeFormDTO input) { + ValidatorUtils.validateEntity(input); + + String gridId = input.getGridId(); + String badgeKey = input.getBadgeKey(); + + List users = badgeService.listUsersByBadge(gridId, badgeKey); + return new Result>().ok(users); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index a9dc7ee49a..5c4aab8dcb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -196,4 +196,12 @@ public interface BadgeDao extends BaseDao { * @date 2020/11/19 10:18 上午 */ int selectNextSort(@Param("customerId") String customerId); + + /** + * @Description 根据徽章查询人列表 + * @return + * @author wxz + * @date 2021.08.02 10:40 + */ + List listUsersByBadge(@Param("gridId") String gridId, @Param("badgeKey") String badgeKey); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index f89f180458..fad619e87b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -192,4 +192,12 @@ public interface BadgeService extends BaseService { * @date 2021/4/22 下午4:17 */ List userBadges(UserBadgesFormDTO formDTO); + + /** + * @Description 根据徽章查询用户列表 + * @return + * @author wxz + * @date 2021.08.02 10:39 + */ + List listUsersByBadge(String gridId, String badgeKey); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index dcdd39d4f1..985dd00c46 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -480,4 +480,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp return result; } + @Override + public List listUsersByBadge(String gridId, String badgeKey) { + return baseDao.listUsersByBadge(gridId, badgeKey); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index c9be676412..560867c932 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -310,4 +310,24 @@ ORDER BY CREATED_TIME DESC LIMIT 1 + + + \ No newline at end of file