diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 831913de5e..17b7c21b99 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -187,7 +187,13 @@ public enum RequirePermissionEnum { /** * 基层治理-巡查 */ - WORK_GRASSROOT_GOVERN_PATROL("work_grassroot_govern_patrol","基层治理:巡查","巡查"); + WORK_GRASSROOT_GOVERN_PATROL("work_grassroot_govern_patrol","基层治理:巡查","巡查"), + + + /** + * 基层治理-群众直报 功能入口 + */ + RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报"); private String key; private String name; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 3a213b5191..96558433fc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -95,6 +95,13 @@ public enum EpmetErrorCode { IMG_SCAN_FAILED(8504,"图片审核失败,请重新上传"), PROJECT_IS_CLOSED(8601,"项目已结案"), VOTE_ISSUE_PLEASE(8602,"请先选择支持或反对,再发表您的想法"), + RESI_EVENT_READ(8603,"当前事件正在处理中,不能撤回"), + RESI_EVENT_NOT_MY_REPORTED(8604,"当前事件不是您发布的,无权操作"), + CAN_NOT_REPLY_RESI_EVENT_GOV(8605,"办结、立项处理后不可回复"), + CAN_NOT_REPLY_RESI_EVENT_SELF(8606,"当前事件待处理,不可回复"), + RESI_EVENT_CAN_NOT_CLOSE_CASE(8607,"事件尚未处理,请处理完成后进行办结"), + RESI_EVENT_SHIFT_PROJECT(8608,"事件已立项,请勿重复操作"), + // 爱心互助 居民端 NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), // 活动报名失败,弹窗:志愿者认证 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 0f216610be..b9bb88e7a9 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 359ec365d9..7433f7e83d 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 @@ -8,15 +8,10 @@ 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.dataaggre.dto.epmetuser.form.OpenStaffDetailFormDTO; -import com.epmet.dataaggre.dto.epmetuser.form.GridMemberStatsFormDTO; 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 +196,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 4e2453104a..4496dadd72 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,10 +17,12 @@ 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.apache.commons.lang3.StringUtils; @@ -57,6 +57,10 @@ public class EpmetUserServiceImpl implements EpmetUserService { private StaffRoleDao staffRoleDao; @Resource private CustomerStaffDao customerStaffDao; + @Autowired + private ResiUserBadgeDao resiUserBadgeDao; + @Autowired + private GovProjectService govProjectService; /** * @Description 根据UserIds查询 @@ -395,5 +399,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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ResiEventDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ResiEventDTO.java new file mode 100644 index 0000000000..d0e2efaf01 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ResiEventDTO.java @@ -0,0 +1,85 @@ +/** + * 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.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Data +public class ResiEventDTO implements Serializable { + + 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; + + private String projectId; + + private String createdBy; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index b714ce2210..af4ef095f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -81,4 +81,5 @@ public interface ProjectConstant { * 项目来源于 工作端立项 */ String PROJECT_ORIGIN_AGENCY="agency"; + String PROJECT_ORIGIN_EVENT="resi_event"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 704aa3ee26..a0f70a5591 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -19,10 +19,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; -import com.epmet.dto.project.ProjectAgencyDTO; -import com.epmet.dto.project.ProjectCategoryDTO; -import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectPointDTO; +import com.epmet.dto.project.*; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; @@ -194,4 +191,11 @@ public interface ProjectDao extends BaseDao { List selectClosedProjectIds(@Param("customerId")String customerId, @Param("origin")String origin, @Param("projectStatus")String projectStatus); + + /** + * 获取已转项目事件事件 + * @param customerId + * @return + */ + List getEventList(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index f96f3babc7..f766873cea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -206,24 +206,54 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.RESOLVED, OrgTypeConstant.AGENCY); + Map eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + ProjectConstant.PROJECT_ORIGIN_EVENT); if (!projectResolvedTotal.isEmpty()) { agencyGovernDailyList.forEach(item -> { OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId()); + int sum = item.getApprovalProjectResolvedCount(); + if (null != dto) { + sum = sum + dto.getSum(); + } + item.setApprovalProjectResolvedCount(sum); + }); + } + if (!eventProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId()); + int sum = item.getApprovalProjectResolvedCount(); if (null != dto) { - item.setApprovalProjectResolvedCount(dto.getSum()); + sum = sum + dto.getSum(); } + item.setApprovalProjectResolvedCount(sum); }); } // 当前组织内:来源于议题的项目:结案无需解决数 Map projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.UNRESOLVED, OrgTypeConstant.AGENCY); + Map eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + ProjectConstant.PROJECT_ORIGIN_EVENT); if (!projectUnResolvedTotal.isEmpty()) { agencyGovernDailyList.forEach(item -> { OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId()); + int sum = item.getApprovalProjectUnResolvedCount(); + if (null != dto) { + sum = sum + dto.getSum(); + } + item.setApprovalProjectUnResolvedCount(sum); + }); + } + if (!eventProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId()); + int sum = item.getApprovalProjectUnResolvedCount(); if (null != dto) { - item.setApprovalProjectUnResolvedCount(dto.getSum()); + sum = sum + dto.getSum(); } + item.setApprovalProjectUnResolvedCount(sum); }); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 56346813b5..a5bb954bef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -108,6 +108,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED); Map approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED); Map approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); + Map eventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.RESOLVED); + Map eventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.UNRESOLVED); Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); @@ -142,14 +144,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl projectList = projectService.getProjectInfo(customerId, dateString); factOriginProjectMainDailyService.deleteByDate(customerId, dateString); if (!CollectionUtils.isEmpty(projectList)) { + Map projectEventMap = projectService.getEventList(customerId); //提取议题ID List issueIds = projectList.stream().filter(item -> ProjectConstant.ISSUE.equals(item.getOrigin())).map(ProjectDTO::getOriginId).collect(Collectors.toList()); @@ -154,11 +153,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setMonthId(dimId.getMonthId()); entity.setWeekId(dimId.getWeekId()); entity.setDateId(dimId.getDateId()); - if (ProjectConstant.ISSUE.equals(project.getOrigin())) { - entity.setIssueId(project.getOriginId()); - } else { - entity.setIssueId(""); - } entity.setProjectStatus(project.getStatus()); entity.setIsResolved(project.getClosedStatus()); entity.setCreatedTime(project.getCreatedTime()); @@ -168,6 +162,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setTopicId(""); entity.setTopicCreatorId(""); entity.setGridId(""); + if (ProjectConstant.ISSUE.equals(project.getOrigin())) { + entity.setIssueId(project.getOriginId()); + } else if (ProjectConstant.PROJECT_ORIGIN_EVENT.equals(project.getOrigin())){ + entity.setIssueId(""); + ResiEventDTO eventDTO = projectEventMap.get(project.getId()); + if (null != eventDTO) { + if (ProjectConstant.PUBLISHER_TYPE_GRID.equals(eventDTO.getOrgType())) { + entity.setGridId(eventDTO.getOrgId()); + entity.setTopicCreatorId(eventDTO.getCreatedBy()); + } + } + } else { + entity.setIssueId(""); + } String[] pIds = project.getOrgIdPath().split(StrConstant.COLON); if (pIds.length > 1) { entity.setPid(pIds[pIds.length - 2]); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index c359035647..4c587f9694 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -270,7 +270,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { //已结案项目统计 List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); //已结案项目增量 - List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + List closedProjectIncList = projectService.getGridClosedProjectInc(customerId, dateString); Map resolveMap= new HashMap<>(); Map unResolveMap = new HashMap<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index e826c9f9e7..f4283979b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -22,6 +22,7 @@ import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ResiEventDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; @@ -191,4 +192,11 @@ public interface ProjectService extends BaseService { * @return */ List selectClosedProjectIds(String customerId,String origin ,String projectStatus); + + /** + * 获取事件信息 + * @param customerId + * @return + */ + Map getEventList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index f67bff807c..095a0ec901 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -23,10 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; -import com.epmet.dto.project.ProjectAgencyDTO; -import com.epmet.dto.project.ProjectCategoryDTO; -import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectPointDTO; +import com.epmet.dto.project.*; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; @@ -37,6 +34,7 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -239,5 +237,14 @@ public class ProjectServiceImpl extends BaseServiceImpl getEventList(String customerId) { + List list = baseDao.getEventList(customerId); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(ResiEventDTO::getProjectId, Function.identity())); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.23__resi_event.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.23__resi_event.sql new file mode 100644 index 0000000000..57f4883dee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.23__resi_event.sql @@ -0,0 +1,3 @@ +ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` + MODIFY COLUMN `ORIGIN` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目来源 来源:议题issue 组织agency,事件resi_event' AFTER `PIDS`, + MODIFY COLUMN `ORIGIN_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目来源ID:议题id ;or组织id,事件ID' AFTER `ORIGIN`; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 280de575cf..92dd3ee38a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -707,7 +707,8 @@ ) a ON fm.GRID_ID = a.orgId WHERE PROJECT_STATUS = 'closed' - AND ORIGIN = "issue" + AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event') + AND GRID_ID != '' AND CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} GROUP BY diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 11ce137aab..fdf90af1f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -1083,7 +1083,7 @@ FROM fact_origin_project_main_daily WHERE - ORIGIN = 'agency' + (ORIGIN = 'agency' OR ORIGIN = 'resi_event') AND CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} @@ -1101,7 +1101,7 @@ FROM fact_origin_project_main_daily WHERE - ORIGIN = 'agency' + (ORIGIN = 'agency' OR ORIGIN = 'resi_event') AND CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 0b60e3efd5..476ae619c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -55,7 +55,7 @@ FROM project WHERE DEL_FLAG = '0' - AND ORIGIN = 'issue' + AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event') AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') #{date} @@ -69,7 +69,7 @@ FROM project WHERE DEL_FLAG = '0' - AND ORIGIN = 'issue' + AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event') AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date} @@ -220,4 +220,19 @@ AND p.ORIGIN =#{origin} + + 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-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java index be67ff5a33..aa4906e7ee 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java @@ -25,5 +25,10 @@ public class RedDotFormDTO implements Serializable { */ //@NotBlank(message = "网格id不能为空") private String gridId; + + /** + * 当前工作人员所属的组织id + */ + private String agencyId; } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java index 772990f98d..fb077deb46 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java @@ -32,6 +32,9 @@ public class WorkGrassRootsFunctionConstant { */ public static final String WORK_GRASSROOTS_BADGE="work_grassroots_badge"; - + /** + * 基层治理-群众直报 功能入口 + */ + public static final String RESI_EVENT_MANAGE="resi_event_manage"; } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java index a2916ee01c..bb57c4f241 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -44,6 +44,8 @@ public class RemindServiceImpl implements RemindService { @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; @Override public RedDotResultDTO queryGridRedDot(RedDotFormDTO formDTO) { @@ -217,12 +219,11 @@ public class RemindServiceImpl implements RemindService { RedDotResultDTO redDotResultDTO = new RedDotResultDTO(); redDotResultDTO.setOtherGridRedDot(false); redDotResultDTO.setFunctionList(Collections.EMPTY_LIST); - + List functionList = new ArrayList<>(); + List details = new ArrayList<>(); Result> govOrgResult = govOrgFeignClient.getMyGrids(formDTO.getStaffId()); if (govOrgResult.success() && !CollectionUtils.isEmpty(govOrgResult.getData())) { - List functionList = new ArrayList<>(); - List details = new ArrayList<>(); List gridIdList = govOrgResult.getData().stream().map(CustomerGridByUserIdResultDTO::getGridId).collect(Collectors.toList()); //1、群组管理(待审核的小组申请、变更小组申请) @@ -335,11 +336,20 @@ public class RemindServiceImpl implements RemindService { } }); } - redDotResultDTO.setFunctionList(functionList); - redDotResultDTO.setDetails(details); } else { logger.warn(String.format("基层治理红点查询,获取工作人员所属网格失败,当前staffId=%s", formDTO.getStaffId())); } + + // 群众直报:当前工作人员所属的组织存在待处理(未读的)、有新的回复的(相当于处理中有红点的)记录就显示红点 + if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getAgencyId())){ + Result projectRes=govProjectOpenFeignClient.queryResiEventManageRedDot(formDTO.getAgencyId()); + if(projectRes.success()&&null !=projectRes.getData()&&projectRes.getData().getTotalCount()>0){ + functionList.add(WorkGrassRootsFunctionConstant.RESI_EVENT_MANAGE); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.RESI_EVENT_MANAGE, projectRes.getData().getTotalCount().longValue())); + } + } + redDotResultDTO.setFunctionList(functionList); + redDotResultDTO.setDetails(details); return redDotResultDTO; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EventTitleOrgResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EventTitleOrgResultDTO.java new file mode 100644 index 0000000000..50b05afb6c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/EventTitleOrgResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/8/5 5:23 下午 + * @DESC + */ +@Data +public class EventTitleOrgResultDTO implements Serializable { + + private static final long serialVersionUID = -517506506008916648L; + + private String agencyId; + private String gridId; + private String gridName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java new file mode 100644 index 0000000000..dd5aa27458 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/8/4 5:48 下午 + * @DESC + */ +@Data +public class OrgNameByTypeResultDTO implements Serializable { + + private static final long serialVersionUID = -6544341694748437312L; + + private String orgId; + + private String orgType; + + private String orgName; +} 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-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index bf6df86b7b..7237abcc5b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -370,4 +370,41 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/staff/mine") Result queryStaffProfile(@RequestBody StaffInfoFromDTO fromDTO); + + /** + * @Description 查询工作人员名字 【xx组织-章三】 + * @Param userId + * @author zxc + * @date 2021/8/4 4:23 下午 + */ + @PostMapping("/gov/org/staff/staffname") + Result staffName(@RequestParam("userId")String userId); + + /** + * @Description 查询网格名字 + * @Param gridName + * @author zxc + * @date 2021/8/4 4:26 下午 + */ + @PostMapping("/gov/org/customergrid/selectgridname") + Result gridName(@RequestParam("gridId")String gridId); + + /** + * @Description 根据类型查询组织名称 + * @Param formList + * @author zxc + * @date 2021/8/4 6:14 下午 + */ + @PostMapping("/gov/org/customergrid/selectorgnamebytype") + Result> selectOrgNameByType(@RequestBody List formList); + + /** + * @Description 根据人查询所在组织 + * @Param userId + * @author zxc + * @date 2021/8/5 10:08 上午 + */ + @PostMapping("/gov/org/customergrid/selectorgsbyuserid") + Result> selectOrgsByUserId(@RequestParam("userId")String userId); + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c384f302aa..91f9052c84 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -215,6 +215,26 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "mine", fromDTO); } + @Override + public Result staffName(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffName", userId); + } + + @Override + public Result gridName(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridName", gridId); + } + + @Override + public Result> selectOrgNameByType(List formList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgNameByType", formList); + } + + @Override + public Result> selectOrgsByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgsByUserId", userId); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index bb06477812..c765a58962 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -252,4 +252,38 @@ public class CustomerGridController { public Result selectPidsByGridId(@RequestParam("gridId") String gridId){ return new Result().ok(customerGridService.selectPidsByGridId(gridId)); } + + /** + * @Description 查询网格名字 + * @Param gridId + * @author zxc + * @date 2021/8/4 4:26 下午 + */ + @PostMapping("selectgridname") + Result gridName(@RequestParam("gridId")String gridId){ + return new Result().ok(customerGridService.gridName(gridId)); + } + + /** + * @Description 根据类型查询组织名称 + * @Param formList + * @author zxc + * @date 2021/8/4 6:14 下午 + */ + @PostMapping("selectorgnamebytype") + public Result> selectOrgNameByType(@RequestBody List formList){ + return new Result>().ok(customerGridService.selectOrgNameByType(formList)); + } + + /** + * @Description 根据人查询所在组织 + * @Param userId + * @author zxc + * @date 2021/8/5 10:08 上午 + */ + @PostMapping("/selectorgsbyuserid") + public Result> selectOrgsByUserId(@RequestParam("userId")String userId){ + return new Result>().ok(customerGridService.selectOrgsByUserId(userId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index 53e6330d06..cba514d051 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -29,6 +31,7 @@ import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.excel.CustomerStaffGridExcel; import com.epmet.service.CustomerStaffGridService; @@ -131,4 +134,15 @@ public class CustomerStaffGridController { public Result> selectGridStaffByGridIds(@RequestBody List gridIds){ return new Result>().ok(customerStaffGridService.selectGridStaffByGridIds(gridIds)); } + + /** + * @Description 查询ORG + * @Param userId + * @author zxc + * @date 2021/8/5 5:36 下午 + */ + @PostMapping("eventorg") + public Result> eventOrg(@LoginUser TokenDto tokenDto){ + return new Result>().ok(customerStaffGridService.eventOrg(tokenDto.getUserId())); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 88ee0bd046..834cd56869 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -12,10 +12,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.StaffService; 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 java.util.List; @@ -157,4 +154,15 @@ public class StaffController { ValidatorUtils.validateEntity(fromDTO, StaffBasicInfoFromDTO.AddUserInternalGroup.class); return staffService.staffBasicInfo(fromDTO); } + + /** + * @Description 查询工作人员名字 + * @Param userId + * @author zxc + * @date 2021/8/4 3:38 下午 + */ + @PostMapping("staffname") + public Result staffName(@RequestParam("userId")String userId){ + return new Result().ok(staffService.staffName(userId)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index ec16bf0dcd..fae6640a7d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -276,4 +276,28 @@ public interface CustomerGridDao extends BaseDao { * @date 2021/7/16 9:52 上午 */ String selectPidsByGridId(@Param("gridId")String gridId); + + /** + * @Description 查询网格名字 + * @Param gridId + * @author zxc + * @date 2021/8/4 4:30 下午 + */ + String gridName(String gridId); + + /** + * @Description 查询组织名字 + * @Param orgIds + * @author zxc + * @date 2021/8/4 6:25 下午 + */ + List selectOrgNameByType(@Param("orgIds") List orgIds); + + /** + * @Description 根据人查询所在组织 + * @Param userId + * @author zxc + * @date 2021/8/5 10:08 上午 + */ + List selectOrgsByUserId(@Param("userId") String userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index ffc46fa725..864603ee07 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -108,4 +108,12 @@ public interface CustomerStaffAgencyDao extends BaseDao getAgencyStaffList(@Param("agencyId")String agencyId); + + /** + * @Description 查询工作人员所属组织名字 + * @Param staffId + * @author zxc + * @date 2021/8/4 3:54 下午 + */ + String selectStaffBelongAgency(@Param("staffId")String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index d9ce1b0e61..426a0e6b3a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffDepartmentDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -106,4 +107,12 @@ public interface CustomerStaffGridDao extends BaseDao { * @date 2021/6/8 3:36 下午 */ List selectGridStaffByGridIds(@Param("gridIds") List gridIds); + + /** + * @Description 查询ORG + * @Param userId + * @author zxc + * @date 2021/8/5 5:36 下午 + */ + List eventOrg(@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index b892fa84f8..78221d8fa8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -295,4 +295,28 @@ public interface CustomerGridService extends BaseService { * @date 2021/7/16 9:52 上午 */ String selectPidsByGridId(String gridId); + + /** + * @Description 查询网格名字 + * @Param gridId + * @author zxc + * @date 2021/8/4 4:26 下午 + */ + String gridName(String gridId); + + /** + * @Description 根据类型查询组织名称 + * @Param formList + * @author zxc + * @date 2021/8/4 6:14 下午 + */ + List selectOrgNameByType(List formList); + + /** + * @Description 根据人查询所在组织 + * @Param userId + * @author zxc + * @date 2021/8/5 10:08 上午 + */ + List selectOrgsByUserId(String userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 0cf4041cce..1e78f3725b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; @@ -126,4 +127,12 @@ public interface CustomerStaffGridService extends BaseService selectGridStaffByGridIds(List gridIds); + + /** + * @Description 查询ORG + * @Param userId + * @author zxc + * @date 2021/8/5 5:36 下午 + */ + List eventOrg(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index f23330fa24..5ac3ac549a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -105,4 +105,12 @@ public interface StaffService { * @author sun */ Result staffBasicInfo(StaffBasicInfoFromDTO fromDTO); + + /** + * @Description 查询工作人员名字 + * @Param userId + * @author zxc + * @date 2021/8/4 3:38 下午 + */ + String staffName(String userId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 007aabd4b9..23de67608c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -721,4 +721,37 @@ public class CustomerGridServiceImpl extends BaseServiceImpl selectOrgNameByType(List formList) { + return baseDao.selectOrgNameByType(formList); + } + + /** + * @Description 根据人查询所在组织 + * @Param userId + * @author zxc + * @date 2021/8/5 10:08 上午 + */ + @Override + public List selectOrgsByUserId(String userId) { + return baseDao.selectOrgsByUserId(userId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index ac8abc82fc..27d3da6576 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -181,4 +182,15 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl eventOrg(String userId) { + return baseDao.eventOrg(userId); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index a77dd1c449..ec8ea004aa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -14,6 +15,7 @@ import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; import com.epmet.feign.*; import com.epmet.service.*; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +53,8 @@ public class StaffServiceImpl implements StaffService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private RedisUtils redisUtils; + @Autowired + private CustomerStaffAgencyDao customerStaffAgencyDao; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -274,4 +278,27 @@ public class StaffServiceImpl implements StaffService { public Result staffBasicInfo(StaffBasicInfoFromDTO fromDTO) { return epmetUserOpenFeignClient.getStaffBasicInfo(fromDTO); } + + /** + * @Description 查询工作人员名字 + * @Param userId + * @author zxc + * @date 2021/8/4 3:38 下午 + */ + @Override + public String staffName(String userId) { + // 查询所属组织名字 + String agencyName = customerStaffAgencyDao.selectStaffBelongAgency(userId); + if (StringUtils.isEmpty(agencyName)){ + throw new RenException("查询工作人员所属组织名称为空"); + } + StaffBasicInfoFromDTO formDTO = new StaffBasicInfoFromDTO(); + formDTO.setStaffId(userId); + Result staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(formDTO); + if (!staffBasicInfo.success()){ + throw new RenException("查询工作人员姓名失败"); + } + String result = agencyName.concat(staffBasicInfo.getData().getRealName()); + return result; + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 6c348a0489..0667d009c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -584,4 +584,38 @@ + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 3df433a5b6..b7559668a8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -152,4 +152,14 @@ del_flag = '0' AND agency_id = #{agencyId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 5e08a59b97..1d11a957b2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -102,6 +102,27 @@ ) + + + insert into customer_staff_grid 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..f3866f0a13 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +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; + + @JsonIgnore + private String userId; + + /** + * 报事说明 + */ + 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/CloseResiEventFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java new file mode 100644 index 0000000000..bf3cdcc62c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报事-办结 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/5 10:44 + */ +@Data +public class CloseResiEventFormDTO implements Serializable { + private static final long serialVersionUID = -3621650590714057648L; + + public interface AddUserInternalGroup { + } + @NotBlank(message = "eventId不能为空", groups = AddUserInternalGroup.class) + private String eventId; + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; +} 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..65a4143f9d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java @@ -0,0 +1,24 @@ +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; + + private String orgId; +} 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..e4632b7f33 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventListFormDTO.java @@ -0,0 +1,32 @@ +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; + + private Integer pageNo; + private Integer pageSize; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventShiftProjectDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventShiftProjectDTO.java new file mode 100644 index 0000000000..b5ef015258 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventShiftProjectDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 事件立项,入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/5 16:15 + */ +@Data +public class EventShiftProjectDTO implements Serializable { + private static final long serialVersionUID = 5519721673862754305L; + //转项目的人 + private String userId; + private String eventId; + private String projectId; + private Date shiftProjectTime; + private String userAgencyId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java new file mode 100644 index 0000000000..560ebfe2d8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 事件-里项目 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/5 15:19 + */ +@Data +public class EventToProjectFormDTO implements Serializable { + private static final long serialVersionUID = 3392008990676159012L; + + public interface AddUserInternalGroup { + } + + public interface ApprovalCategory extends CustomerClientShowGroup { + } + + /** + * 事件id + */ + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String eventId; + + /** + * 项目方案 1000 + */ + @Length(min = 1, max = 1000, message = "项目方案1000字", groups = {ApprovalCategory.class}) + private String publicReply; + /** + * 内部备注 1000 + * 21.08.09 直接立项的内部备注是必填的,然后议题转项目和我要直报转项目的都是非必填的 + */ + //@Length(min = 1, max = 1000, message = "内部备注1000字", groups = {ApprovalCategory.class}) + private String internalRemark; + + /** + * 吹哨勾选的工作人员信息集合,不可为空 + */ + @Valid + private List staffList; + /** + * 项目所选分类集合,不可为空 + */ + @Valid + private List categoryList; + /** + * 项目所选标签集合 + */ + private List tagList; + + @Length(min = 1, max = 20, message = "项目标题不能超过20位", groups = {ApprovalCategory.class}) + private String title; + + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; + + //定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + private String locateAddress; + //定位经度 + private String locateLongitude; + //定位纬度 + private String locateDimension; + + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String app; + private String client; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java new file mode 100644 index 0000000000..52c37f1563 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 被艾特的人 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/3 15:51 + */ +@Data +public class MentionUserFormDTO implements Serializable { + + /** + * 人大代表用户id + */ + private String userId; + + /** + * 人大代表注册网格id + */ + private String gridId; + + /** + * 人大代表注册网格所属社区id + */ + private String agencyId; + + /** + * 注册网格的所有上级 + */ + private String pids; + + /** + * 人大代表姓名 + */ + private String userShowName; + +} 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/ReplyFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java new file mode 100644 index 0000000000..a6729ff46f --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 回复通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/4 14:16 + */ +@Data +public class ReplyFormDTO implements Serializable { + private static final long serialVersionUID = 1653042839040178697L; + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "事件id不能为空",groups = AddUserInternalGroup.class) + private String resiEventId; + @Length(min = 1, max = 200, message = "请填写回复内容,最多输入200字", groups = AddUserShowGroup.class) + private String content; + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + private String userId; +} 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..ed9bb74e21 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java @@ -0,0 +1,26 @@ +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; + + @NotBlank(message = "当前用户id不能为空",groups = ReplyListForm.class) + private String currentUserId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReportOrgFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReportOrgFormDTO.java new file mode 100644 index 0000000000..56b6184fd2 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReportOrgFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 报给谁? + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/3 15:51 + */ +@Data +public class ReportOrgFormDTO implements Serializable { + /** + * 报给?: 网格:grid; 社区:community; 乡(镇、街道)级:street; 区县级: district; 市级: city; 省级:province。 + */ + private String orgLevel; + + /** + * 报给的组织或者网格id + */ + private String orgId; + + /** + * org_id的上级组织id,org_id是跟组织,此列为0 + */ + private String orgPid; + + /** + * org_id的所有上级组织id,org_id是跟组织,此列为0 + */ + private String orgPids; +} 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..b0d1f4ff99 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventFormDTO.java @@ -0,0 +1,85 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * 我要报事-提交(尹) + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/3 10:46 + */ +@Data +public class ResiEventFormDTO implements Serializable { + private static final long serialVersionUID = -778643059131036832L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 用户所在网格id + */ + @NotBlank(message = "不能为空",groups = AddUserInternalGroup.class) + private String gridId; + + /** + * 事件内容,最多1000 + */ + @Length(min = 1, max = 1000, message = "请填写内容,最多输入1000字", groups = AddUserShowGroup.class) + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + @NotBlank(message = "地址不能为空",groups = AddUserShowGroup.class) + private String address; + + /** + * 附件列表 + */ + private List attachmentList; + /** + * @的人 + */ + private List npcUserList; + + /** + * 报给谁? + */ + @NotEmpty(message = "不能为空",groups = AddUserInternalGroup.class) + private List orgList; + + + + //以下参数从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..c397dc8d08 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java @@ -0,0 +1,43 @@ +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 AddUserInternalGroup { + } + public interface GovInternalGroup { + } + + // 居民端:resi_user;工作端:staff + @NotBlank(message = "viewType不能为空", groups = AddUserInternalGroup.class) + private String viewType; + @NotBlank(message = "eventId不能为空", groups = AddUserInternalGroup.class) + private String eventId; + @NotBlank(message = "orgId不能为空", groups = GovInternalGroup.class) + private String orgId; + + //以下参数从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/UserMentionFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UserMentionFormDTO.java new file mode 100644 index 0000000000..861abebb95 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UserMentionFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 我要报事-人大代表未读/已读列表入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/4 9:34 + */ +@Data +public class UserMentionFormDTO implements Serializable { + private static final long serialVersionUID = 7548058964554418080L; + + public interface AddUserInternalGroup { + } + + /** + * 未读:un_read;已读:read; + */ + @NotBlank(message = "readFlag不能为空", groups = AddUserInternalGroup.class) + private String readFlag; + @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) + private Integer pageNo; + @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) + private Integer pageSize; + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} 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..18295391c5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java @@ -0,0 +1,108 @@ +package com.epmet.dto.result; + +import com.epmet.dto.EventProjectInfoDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +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; + + @JsonIgnore + private String gridId; + + /** + * 是否办结【是:true,否:false】 + */ + private Boolean isClosed; + + /** + * 是否解决【是:true,否:false】 + */ + private Boolean isResolve; + + /** + * 是否可以撤回【true:是,false:否】 + */ + private Boolean isRollback; + + /** + * 报事图片 + */ + private List eventImgs; + + /** + * 报事提到的人 + */ + private List eventPerson; + + /** + * 被提到的组织 + */ + private List eventOrg; + + /** + * 报事人名字 + */ + private String eventPeopleName; + + @JsonIgnore + private String eventUserId; + + /** + * 项目信息 + */ + private EventProjectInfoDTO projectInfo; + + @JsonIgnore + private List orgNameList; + + @JsonIgnore + private String projectId; + + @JsonIgnore + private Boolean isProject; + + 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..23ecd11982 --- /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 eventContent; + + /** + * 报事时间 + */ + 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/EventToProjectResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventToProjectResultDTO.java new file mode 100644 index 0000000000..f17f2e6f34 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventToProjectResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/5 15:36 + */ +@Data +public class EventToProjectResultDTO implements Serializable { + private static final long serialVersionUID = -7544325891712303124L; + private String projectId; +} 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..d2df7d7a66 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java @@ -0,0 +1,65 @@ +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; + + /** + * true:显示回复;false:不显示回复按钮 + */ + private String replyButtonFlag; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Boolean readFlag; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java new file mode 100644 index 0000000000..8035108f6a --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/8/5 9:51 上午 + * @DESC + */ +@Data +public class NewEventsResultDTO implements Serializable { + + private static final long serialVersionUID = 2151884734349908080L; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件时间 + */ + private String eventTime; + + /** + * 事件图片 + */ + private List eventImgs; + + private String eventId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java new file mode 100644 index 0000000000..dd5aa27458 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/8/4 5:48 下午 + * @DESC + */ +@Data +public class OrgNameByTypeResultDTO implements Serializable { + + private static final long serialVersionUID = -6544341694748437312L; + + private String orgId; + + private String orgType; + + private String orgName; +} 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..4ffa078aaf --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2021/8/3 11:07 上午 + * @DESC + */ +@Data +public class ReplyListResultDTO implements Serializable { + + private static final long serialVersionUID = 4875335642497226847L; + + /** + * 回复人的昵称,比如:南宁路社区,人大代表-李四,山东路-尹女士 + * */ + private String replyName; + + /** + * 回复时间 + * */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone="GMT+8") + private Date replyTime; + + /** + * 回复的内容 + * */ + private String replyContent; + + @JsonIgnore + private String replyUserId; +} 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-client/src/main/java/com/epmet/dto/result/ResiEventManageRedDotRes.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventManageRedDotRes.java new file mode 100644 index 0000000000..87af6124be --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventManageRedDotRes.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/6 13:54 + */ +@Data +public class ResiEventManageRedDotRes implements Serializable { + /** + * 待处理(未读)的事件数 + * */ + private Integer unReadCount; + + /** + * 已经度过,但是又有新的回复、立项、结案 + * */ + private Integer redDotCount; + + /** + * 总数 + * */ + private Integer totalCount; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java new file mode 100644 index 0000000000..48bb9583ba --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 我要报事-人大代表未读/已读列表返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/4 9:44 + */ +@Data +public class UserMentionResultDTO implements Serializable { + + private static final long serialVersionUID = 8171079006237395425L; + /** + * 事件id + */ + private String resiEventId; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 图片列表,可为空 + */ + private List 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; + + /** + * true:显示回复;false:不显示回复按钮 + */ + private String replyButtonFlag; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 7b0c1a7bd9..7824ba71ee 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -6,7 +6,6 @@ import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; import com.epmet.feign.fallback.GovProjectOpenFeignClientFallbackFactory; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -124,4 +123,15 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/unresolvedlist") Result> getUnResolvedList(@RequestBody ShiftProjectListFromDTO formDTO); + + /** + * 群众直报:当前工作人员所属的组织存在待处理(未读的)、有新的回复的(相当于处理中有红点的)记录就显示红点 + * + * @param agencyId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/6 14:07 + */ + @PostMapping("gov/project/resievent/queryResiEventManageRedDot/{agencyId}") + Result queryResiEventManageRedDot(@PathVariable("agencyId") String agencyId); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 44ea0d1e63..41f41664c1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -119,4 +119,17 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> getUnResolvedList(ShiftProjectListFromDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getUnResolvedList", formDTO); } + + /** + * 群众直报:当前工作人员所属的组织存在待处理(未读的)、有新的回复的(相当于处理中有红点的)记录就显示红点 + * + * @param agencyId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/6 14:08 + */ + @Override + public Result queryResiEventManageRedDot(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryResiEventManageRedDot", agencyId); + } } 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..7daf809615 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java @@ -0,0 +1,52 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/8/3 2:45 下午 + * @DESC + */ +public interface EventConstant { + + /** + * 【处理中:processed 待处理:undisposed 已办结:transferred】 + */ + String EVENT_PROCESSED = "processed"; + String EVENT_UN_DISPOSED = "undisposed"; + String EVENT_TRANSFERRED = "transferred"; + + + /** + * 事件状态resi_event.status:处理中:processing;已办结:closed_case + */ + String EVENT_STATUS_PROCESSING="processing"; + String EVENT_STATUS_CLOSED_CASE="closed_case"; + + String READ="read"; + String UN_READ="un_read"; + + /** + * 事件@人员表,用户身份 + * resi_event_mention.user_type + */ + String NPC_USER="npc_user"; + + /** + * 操作日志表用户来源:resi_event_operation_log.userIdentity + * 居民端用户:resi_user;工作人员:staff;报事人:report_user + */ + String RESI_USER="resi_user"; + String STAFF="staff"; + String REPORT_USER="report_user"; + + /** + * 事件是否解决:已解决 resolved,未解决 un_solved + */ + String RESOLVED="resolved"; + String UN_SOLVED="un_solved"; + + /** + * 小程序类型 + */ + String TYPE_GOV = "gov"; + String TYPE_RESI = "resi"; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index 43c87b57b5..b5acf5b2e7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -14,6 +14,8 @@ public interface ProjectConstant { * 项目来源-组织(项目立项) */ String AGENCY = "agency"; + + String RESI_EVENT="resi_event"; /** * 状态-待处理 */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java new file mode 100644 index 0000000000..b7e1faa0ff --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java @@ -0,0 +1,61 @@ +package com.epmet.constant; + +import com.epmet.commons.tools.constant.StrConstant; + +/** + * resi_event_operation_log事件操作日志枚举类 + * + * @author yinzuomei@elink-cn.com + * @date 2021/8/3 16:38 + */ +public enum ResiEventAction { + // 1、发布事件:publish; + // 2、撤回事件:recall; + // 3、复:reply; + // 4、立项:shift_project; + // 5、办结:close_case; + // 6、选择是否已解决:choose_resolve; + // 7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中; + PUBLISH ( "publish","发布事件"), + RECALL( "recall","撤回事件"), + REPLY ("reply","回复"), + SHIFIT_PROJECT ( "shift_project","立项"), + CLOSE_CASE ( "close_case","办结"), + CHOOSE_RESOLVE ( "choose_resolve","选择是否解决"), + READ_FIRST( "read_first","首次查看事件"); + + + private String code; + private String desc; + + ResiEventAction(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static String getDesc(String code) { + ResiEventAction[] businessModeEnums = values(); + for (ResiEventAction resiEventAction : businessModeEnums) { + if (resiEventAction.getCode()==code) { + return resiEventAction.getDesc(); + } + } + return StrConstant.EPMETY_STR; + } + + public String getCode(){ + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc(){ + return this.desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} 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/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index a91cc3513b..b3053bbd93 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java @@ -362,5 +362,23 @@ public class ProjectTraceController { return new Result(); } + /** + * 事件-立项 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/5 15:37 + */ + @PostMapping("eventToProject") + public Result eventToProject(@LoginUser TokenDto tokenDto,@RequestBody EventToProjectFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); + formDTO.setClient(tokenDto.getClient()); + ValidatorUtils.validateEntity(formDTO,EventToProjectFormDTO.ApprovalCategory.class,EventToProjectFormDTO.AddUserInternalGroup.class); + return new Result().ok(projectTraceService.eventToProject(formDTO)); + } } 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..1b69e0b039 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -0,0 +1,216 @@ +/** + * 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.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.constant.EventConstant; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.ResiEventService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +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(@LoginUser TokenDto tokenDto, @RequestBody EventDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(resiEventService.eventDetail(formDTO, tokenDto)); + } + + /** + * 我要报事-提交(尹) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/3 10:46 + */ + @PostMapping("report") + public Result report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ResiEventFormDTO.AddUserShowGroup.class, ResiEventFormDTO.AddUserInternalGroup.class); + return new Result().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(@LoginUser TokenDto tokenDto, @RequestBody UpdateViewTimeFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.AddUserInternalGroup.class); + if (EventConstant.STAFF.equals(formDTO.getViewType())) { + ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.GovInternalGroup.class); + } + resiEventService.updateViewTime(formDTO); + return new Result(); + } + + /** + * 我要报事-人大代表未读/已读列表 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/8/4 9:40 + */ + @PostMapping("mentionlist") + public Result> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, UserMentionFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiEventService.mentionList(formDTO)); + } + + /** + * @Description 最新直报 + * @Param userId + * @author zxc + * @date 2021/8/5 9:55 上午 + */ + @PostMapping("newevents") + public Result> newEvents(@LoginUser TokenDto tokenDto) { + return new Result>().ok(resiEventService.newEvents(tokenDto.getUserId())); + } + + /** + * 报事办结 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/5 10:47 + */ + @PostMapping("close") + public Result closeResiEvent(@LoginUser TokenDto tokenDto, @RequestBody CloseResiEventFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, CloseResiEventFormDTO.AddUserInternalGroup.class); + resiEventService.closeResiEvent(formDTO); + return new Result(); + } + + + /** + * 工作台,最新直报是否显示红点? + * + * @param agencyId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/6 13:57 + */ + @PostMapping("queryResiEventManageRedDot/{agencyId}") + Result queryResiEventManageRedDot(@PathVariable("agencyId") String agencyId) { + return new Result().ok(resiEventService.queryResiEventManageRedDot(agencyId)); + } +} \ 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..0d7f93a2d8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java @@ -0,0 +1,113 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.ReplyFormDTO; +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(@LoginUser TokenDto tokenDto, @RequestBody ReplyListFormDTO formDTO){ + formDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ReplyListFormDTO.ReplyListForm.class); + return new Result>().ok(resiEventReplyService.replyList(formDTO)); + } + + /** + * 报事-工作人员回复 + * + * @param tokenDto + * @param replyFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/4 14:19 + */ + @PostMapping("govReply") + public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){ + replyFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(replyFormDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class); + resiEventReplyService.govReply(replyFormDTO); + return new Result(); + } + + /** + * 报事当事人回复 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/4 14:37 + */ + @PostMapping("selfReply") + public Result selfReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class); + resiEventReplyService.selfReply(formDTO); + return new Result(); + } + + /** + * 艾特的人回复 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/8/4 15:06 + */ + @PostMapping("atReply") + public Result atReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class); + resiEventReplyService.atReply(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/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index d5c2dbab5d..0040584f81 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.EventProjectInfoDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.LatestListFormDTO; @@ -206,4 +207,14 @@ public interface ProjectDao extends BaseDao { * @return java.util.List */ List selectUnResolvedListByGrid(@Param("gridId")String gridId); + + /** + * @Description 查询报事转项目详情 + * @Param projectId + * @author zxc + * @date 2021/8/4 2:43 下午 + */ + EventProjectInfoDTO selectEventProjectInfo(@Param("projectId")String projectId); + + List selectByOriginId(String originId); } \ 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..6275a0d821 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java @@ -0,0 +1,91 @@ +/** + * 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.dto.result.EventDetailResultDTO; +import com.epmet.dto.result.EventListResultDTO; +import com.epmet.dto.result.MyReportedResultDTO; +import com.epmet.dto.result.NewEventsResultDTO; +import com.epmet.entity.ResiEventEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventDao extends BaseDao { + + /** + * @Description 查询报事列表 + * @Param orgId + * @Param eventType + * @author zxc + * @date 2021/8/3 4:21 下午 + */ + List eventUnDisposedList(@Param("orgId")String orgId,@Param("eventType")String eventType); + + /** + * 居民端我的报事列表查询 + * + * @param userId 报事人 + * @param statusCondition 未处理:un_read;处理中:processing;已办结:closed_case + * @return java.util.List + * @author yinzuomei + * @date 2021/8/3 23:21 + */ + List queryMyReported(@Param("userId") String userId, @Param("statusCondition")String statusCondition); + + /** + * @Description 查询报事详情 + * @Param eventId + * @author zxc + * @date 2021/8/4 2:16 下午 + */ + EventDetailResultDTO selectEventDetail(@Param("eventId")String eventId); + + /** + * @Description 更新报事人红点状态 + * @Param userId + * @author zxc + * @date 2021/8/4 5:30 下午 + */ + void updateResiEvent(@Param("userId") String userId,@Param("eventId")String eventId); + + /** + * @Description 更新人大代表红点状态 + * @Param userId + * @author zxc + * @date 2021/8/4 5:32 下午 + */ + void updateEventMention(@Param("userId") String userId,@Param("eventId")String eventId); + + /** + * @Description 最新直报 + * @Param orgIds + * @author zxc + * @date 2021/8/5 10:42 上午 + */ + List newEvents(@Param("orgIds")List orgIds); +} \ 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..76aaeb9162 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java @@ -0,0 +1,70 @@ +/** + * 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.dto.result.UserMentionResultDTO; +import com.epmet.entity.ResiEventMentionEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事件被@人表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventMentionDao extends BaseDao { + + /** + * 人大代表未读、已读列表 + * + * @param userId + * @param readFlag + * @return java.util.List + * @author yinzuomei + * @date 2021/8/4 9:54 + */ + List selectMentionList(@Param("userId")String userId, @Param("readFlag")String readFlag); + + /** + * 人大代表从未读-》已读,首次查看事件 + * + * @param eventId + * @param userId + * @return int + * @author yinzuomei + * @date 2021/8/4 16:37 + */ + int updateReadFlag(@Param("eventId") String eventId, @Param("userId")String userId); + + /** + * 展示红点 + * + * @param resiEventId + * @return int + * @author yinzuomei + * @date 2021/8/4 17:41 + */ + int updateRedDotShow(@Param("resiEventId") String resiEventId,@Param("excludeUserId")String excludeUserId); + + ResiEventMentionEntity selectUser(@Param("eventId") String eventId, @Param("userId")String userId); +} \ 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..d6e16450a0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java @@ -0,0 +1,47 @@ +/** + * 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; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事件操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventOperationLogDao extends BaseDao { + + /** + * 查询事件操作日志 + * + * @param eventId + * @param userId + * @param actionCode + * @return com.epmet.entity.ResiEventOperationLogEntity + * @author yinzuomei + * @date 2021/8/4 16:44 + */ + List selectByUserAction(@Param("eventId") String eventId, @Param("userId")String userId, @Param("actionCode")String actionCode); +} \ 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..603c1eefc9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java @@ -0,0 +1,45 @@ +/** + * 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.dto.result.ReplyListResultDTO; +import com.epmet.entity.ResiEventReplyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventReplyDao extends BaseDao { + + /** + * 查询事件的回复列表 + * + * @param resiEventId + * @return java.util.List + * @author yinzuomei + * @date 2021/8/4 13:22 + */ + List selectReplyList(String resiEventId); +} \ 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..0668eb78f7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java @@ -0,0 +1,67 @@ +/** + * 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; +import org.apache.ibatis.annotations.Param; + +/** + * 事件相关组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Mapper +public interface ResiEventReportOrgDao extends BaseDao { + + /** + * 工作人员从待处理=》处理中 + * + * @param eventId + * @param orgId + * @return int + * @author yinzuomei + * @date 2021/8/4 16:40 + */ + int updateReadFlag(@Param("eventId") String eventId, @Param("orgId") String orgId,@Param("userId") String userId); + + /** + * @Description 更新组织的红点显示状态 + * @Param eventId + * @Param orgId + * @author zxc + * @date 2021/8/4 5:42 下午 + */ + void updateEventOrg(@Param("eventId") String eventId, @Param("orgId") String orgId); + + /** + * 展示红点 + * + * @param resiEventId + * @return int + * @author yinzuomei + * @date 2021/8/4 17:41 + */ + int updateRedDotShow(String resiEventId); + + Integer selectUnReadCount(String agencyId); + + Integer selectRedCount(String agencyId); +} \ 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..f00dab5a06 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventEntity.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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 Boolean isParty; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; + + /** + * 地址 + */ + private String address; + + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 办结时间 + */ + private Date closeCaseTime; + + /** + * 1:已转项目;0:未转项目;默认0 + */ + private Boolean shiftProject; + + /** + * 项目id;shift_project=1时,此列有值 + */ + private String projectId; + + /** + * 1:已撤回;0:未撤回正常展示;默认0 + */ + private Boolean recallFlag; + + /** + * 撤回时间 + */ + private Date recallTime; + + /** + * 事件是否被阅读过;1已读;针对报事人待处理列表 + */ + private Boolean readFlag; + + /** + * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/办结更新为1; + */ + private Boolean redDot; + + /** + * 最近一次操作时间(回复、立项、办结更新此列) + */ + private Date latestOperatedTime; + + /** + * 是否解决:已解决 resolved,未解决 un_solved + */ + private String resolveStatus; + + /** + * 结案说明可放这。 + */ + private String closeRemark; + +} 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..a2c5702485 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java @@ -0,0 +1,88 @@ +/** + * 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; + + /** + * 人大代表目前显示姓名 + */ + private String userShowName; + + /** + * 居民端用户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/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 7a5ac21888..1f0fd17a0d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -19,7 +19,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -330,4 +329,6 @@ public interface ProjectService extends BaseService { * @return java.util.List */ List getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO); + + List getByOriginId(String eventId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index d3d2cc3f3b..620f9577fc 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -173,4 +173,14 @@ public interface ProjectTraceService { * @Description 项目立项 **/ void projectApproval(ProjectApprovalFormDTO formDTO); + + /** + * 事件立项 + * + * @param formDTO + * @return com.epmet.dto.result.EventToProjectResultDTO + * @author yinzuomei + * @date 2021/8/5 15:38 + */ + EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO); } 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..4ad83c6e04 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java @@ -0,0 +1,73 @@ +/** + * 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.ReplyFormDTO; +import com.epmet.dto.form.ReplyListFormDTO; +import com.epmet.dto.result.ReplyListResultDTO; +import com.epmet.entity.ResiEventReplyEntity; + +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); + + /** + * 报事-工作人员回复 + * + * @param replyFormDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 14:20 + */ + void govReply(ReplyFormDTO replyFormDTO); + + /** + * 报事当事人回复 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 14:39 + */ + void selfReply(ReplyFormDTO formDTO); + + /** + * 艾特的人回复 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 15:06 + */ + void atReply(ReplyFormDTO 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..38d4916acc --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java @@ -0,0 +1,132 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.ResiEventEntity; + +import java.util.List; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +public interface ResiEventService extends BaseService { + + /** + * @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, TokenDto tokenDto); + + /** + * 我要报事-提交(尹) + * + * @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); + + /** + * 我要报事-人大代表未读/已读列表 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/8/4 9:41 + */ + List mentionList(UserMentionFormDTO formDTO); + + /** + * @Description 最新直报 + * @Param userId + * @author zxc + * @date 2021/8/5 9:55 上午 + */ + List newEvents(String userId); + + /** + * 报事办结 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/5 10:48 + */ + void closeResiEvent(CloseResiEventFormDTO formDTO); + + /** + * 事件立项:更新立项标志、增加操作日志、更新(报事人、被艾特的人)红点 + * + * @param eventShiftProjectDTO + * @return void + * @author yinzuomei + * @date 2021/8/5 16:17 + */ + void shiftProject(EventShiftProjectDTO eventShiftProjectDTO); + + ResiEventEntity getById(String eventId); + + /** + * 工作台,最新直报是否显示红点? + * + * @param agencyId + * @return com.epmet.dto.result.ResiEventManageRedDotRes + * @author yinzuomei + * @date 2021/8/6 13:57 + */ + ResiEventManageRedDotRes queryResiEventManageRedDot(String agencyId); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index f15a2a7c24..bc6a2616c7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2753,4 +2753,9 @@ public class ProjectServiceImpl extends BaseServiceImpl getByOriginId(String originId) { + return baseDao.selectByOriginId(originId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 0d1c537388..1e4a1b64b4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -22,7 +22,6 @@ import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectProcessAttachmentDao; import com.epmet.dao.ProjectProcessDao; -import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.IssueProjectTagDictDTO; import com.epmet.dto.ProjectStaffDTO; @@ -93,6 +92,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceS private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private LoginUserUtil loginUserUtil; + @Autowired + private ResiEventService resiEventService; @Override public List getPendProjectList(TokenDto tokenDto, ProjectListFromDTO fromDTO) { @@ -615,5 +616,358 @@ public class ProjectTraceServiceImpl implements ProjectTraceS return epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); } + /** + * 事件立项 + * + * @param formDTO + * @return com.epmet.dto.result.EventToProjectResultDTO + * @author yinzuomei + * @date 2021/8/5 15:38 + */ + @Override + public EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO) { + //事件已经立项,不能重复操作 + ResiEventEntity resiEventEntity=resiEventService.getById(formDTO.getEventId()); + if(null==resiEventEntity||resiEventEntity.getShiftProject()){ + throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(),EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); + } + List projectEntityList = projectService.getByOriginId(formDTO.getEventId()); + if (!CollectionUtils.isEmpty(projectEntityList)) { + throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); + } + List staffList = formDTO.getStaffList(); + //1.文字内容安全校验 + List list = new ArrayList<>(); + list.add(formDTO.getTitle());list.add(formDTO.getPublicReply());list.add(formDTO.getPublicReply());list.add(formDTO.getInternalRemark()); + safetyCheck(list); + //2.数据准备 + //2-1获取当前工作人员基本信息 + LoginUserDetailsResultDTO loginUser=queryLoginUserInfo(formDTO); + + //2-2.调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用 + AgencyDeptGridResultDTO agencyDeptGrid = getAgencyDeptGridRes(formDTO.getStaffList(),loginUser.getAgencyId()); + + //2-3.调用issue服务,查询分类、标签数据信息 + CategoryTagResultDTO categoryTagResultDTO=queryCategoryTagRes(formDTO); + List categoryList = categoryTagResultDTO.getCategoryList(); + List tagList = categoryTagResultDTO.getTagList(); + + //2-4.批量查询被勾选工作人员基础信息 + List staffInfoList=queryStaffListRes(formDTO.getStaffList(),formDTO.getUserId()); + + //3.封装保存业务数据 + //3-1.项目主表新增数据 + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(formDTO.getCustomerId()); + // 立项人的所属组织id + projectEntity.setAgencyId(loginUser.getAgencyId()); + // 项目来源新增:resi_event + projectEntity.setOrigin(ProjectConstant.RESI_EVENT); + projectEntity.setOriginId(formDTO.getEventId()); + projectEntity.setTitle(formDTO.getTitle()); + projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setStatus(ProjectConstant.PENDING); + projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); + projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); + projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude()); + projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension()); + projectService.insert(projectEntity); + //3-2.项目进展表新增第一个节点数据 + ProjectProcessEntity processEntity = new ProjectProcessEntity(); + processEntity.setProjectId(projectEntity.getId()); + processEntity.setCustomerId(formDTO.getCustomerId()); + processEntity.setStaffId(formDTO.getUserId()); + processEntity.setOperation(ProjectConstant.OPERATION_CREATED); + processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); + processEntity.setPublicReply(formDTO.getPublicReply()); + processEntity.setInternalRemark(formDTO.getInternalRemark()); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (loginUser.getAgencyId().equals(agency.getId())) { + processEntity.setDepartmentName(agency.getOrganizationName()); + processEntity.setAgencyId(agency.getId()); + if(org.apache.commons.lang3.StringUtils.isBlank(agency.getPids()) || org.apache.commons.lang3.StringUtils.equals(NumConstant.ZERO_STR,agency.getPids().trim()) || "".equals(agency.getPids().trim())){ + processEntity.setOrgIdPath(agency.getId()); + }else{ + processEntity.setOrgIdPath(agency.getPids().concat(":").concat(agency.getId())); + } + } + }); + projectProcessService.insert(processEntity); + + //3-3.项目人员表批量新增数据 + List entityList = new ArrayList<>(); + staffList.forEach(ts -> { + ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class); + entity.setOrgId(ts.getAgencyId()); + entity.setProjectId(projectEntity.getId()); + entity.setProcessId(processEntity.getId()); + entity.setIsHandle(ProjectConstant.UNHANDLED); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (ts.getAgencyId().equals(agency.getId())) { + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId()); + entity.setDepartmentName(agency.getOrganizationName()); + } + }); + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getDepartmentId())) { + agencyDeptGrid.getDeptList().forEach(dept -> { + if (ts.getDepartmentId().equals(dept.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName()); + } + }); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getGridId())) { + agencyDeptGrid.getGridList().forEach(grid -> { + if (ts.getGridId().equals(grid.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName()); + } + }); + } + entityList.add(entity); + }); + projectStaffService.insertBatch(entityList); + + //3-4.项目附件表新增数据 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), formDTO.getCustomerId(), projectEntity.getId(), processEntity.getId()); + } + + //3-5.项目分类表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + List categoryEntityList = new ArrayList<>(); + formDTO.getCategoryList().forEach(item -> { + categoryList.forEach(ca->{ + if(item.getId().equals(ca.getId())){ + ProjectCategoryEntity entity = new ProjectCategoryEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setCategoryId(item.getId()); + entity.setCategoryPids(ca.getPids()); + entity.setCategoryCode(ca.getCategoryCode()); + categoryEntityList.add(entity); + } + }); + }); + projectCategoryService.insertBatch(categoryEntityList); + } + + //3-6.项目标签表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getTagList())) { + List tagEntityList = new ArrayList<>(); + formDTO.getTagList().forEach(item -> { + tagList.forEach(ta->{ + if(item.getId().equals(ta.getId())){ + ProjectTagsEntity entity = new ProjectTagsEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setTagId(item.getId()); + entity.setTagName(ta.getTagName()); + tagEntityList.add(entity); + } + }); + }); + projectTagsService.insertBatch(tagEntityList); + } + + //3-7:初始化机关-项目时间关联数据 + Date current = new Date(); + List projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); + if(!org.apache.commons.collections4.CollectionUtils.isEmpty(projectStaffIds)){ + List container = new LinkedList<>(); + projectStaffIds.forEach(o -> { + ProjectOrgRelationEntity period = new ProjectOrgRelationEntity(); + period.setProjectStaffId(o); + period.setInformedDate(current); + period.setSourceOperation(ProjectConstant.OPERATION_CREATED); + period.setCreatedBy(formDTO.getUserId()); + container.add(period); + }); + relationDao.insertBatch(container); + } + + //4.推送站内信、微信、短信消息 + //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 + if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) { + throw new RenException("事件转为项目,推送站内信失败"); + } + + //4-2.以及政府端调用epmet-message服务,给工作端工作人员推送微信订阅消息 + if (!wxmpShiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) { + logger.error("事件转为项目,推送微信订阅消息失败!"); + } + + //4-3.吹哨短信消息 + List smsList = new ArrayList<>(); + staffList.forEach(staff -> { + staffInfoList.forEach(st->{ + if(staff.getStaffId().equals(st.getStaffId())){ + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(st.getCustomerId()); + sms.setMobile(st.getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result)); + } + + //项目实时统计消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); + ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, + projectEntity.getId(), + formDTO.getUserId(), + new Date(), + mqMsgBrief, + IpUtils.getIpAddr(request), + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient()); + boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); + if (!msgResult) { + log.error("项目实时统计消息发送失败"); + } + + // 报事人、被艾特的人显示红点 + EventShiftProjectDTO eventShiftProjectDTO=new EventShiftProjectDTO(); + eventShiftProjectDTO.setEventId(formDTO.getEventId()); + eventShiftProjectDTO.setProjectId(projectEntity.getId()); + eventShiftProjectDTO.setShiftProjectTime(projectEntity.getCreatedTime()); + eventShiftProjectDTO.setUserId(formDTO.getUserId()); + eventShiftProjectDTO.setUserAgencyId(projectEntity.getAgencyId()); + resiEventService.shiftProject(eventShiftProjectDTO); + EventToProjectResultDTO resultDTO=new EventToProjectResultDTO(); + resultDTO.setProjectId(projectEntity.getId()); + return resultDTO; + } + + private List queryStaffListRes(List staffList,String currentUserId) { + List staffIdList = staffList.stream().map(TickStaffFormDTO::getStaffId).collect(Collectors.toList()); + staffIdList.add(currentUserId); + staffIdList = new ArrayList(new LinkedHashSet<>(staffIdList)); + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaffList(staffIdList); + if (!resultStaff.success() || null == resultStaff.getData()) { + throw new RenException("项目立项,调用user服务获取被勾选工作人员基本信息失败"); + } + return resultStaff.getData().getStaffList(); + } + + private CategoryTagResultDTO queryCategoryTagRes(EventToProjectFormDTO formDTO) { + CategoryTagListFormDTO categoryTag = new CategoryTagListFormDTO(); + List categoryIdList = formDTO.getCategoryList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList()); + List tagIdList = formDTO.getTagList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList()); + categoryTag.setCustomerId(formDTO.getCustomerId()); + categoryTag.setCategoryIdList(categoryIdList); + categoryTag.setTagIdList(tagIdList); + Result resultDTOResult = govIssueOpenFeignClient.getCategoryTagList(categoryTag); + if (!resultDTOResult.success()) { + throw new RenException("项目立项,调用issue服务查询分类、标签基础信息失败"); + } + return resultDTOResult.getData(); + } + + private AgencyDeptGridResultDTO getAgencyDeptGridRes(List staffList, String userAgencyId) { + List agencyIdList = staffList.stream().map(TickStaffFormDTO::getAgencyId).collect(Collectors.toList()); + agencyIdList.add(userAgencyId); + agencyIdList = new ArrayList(new LinkedHashSet<>(agencyIdList)); + agencyIdList.removeAll(Collections.singleton("")); + List deptIdList = staffList.stream().map(TickStaffFormDTO::getDepartmentId).collect(Collectors.toList()); + deptIdList = new ArrayList(new LinkedHashSet<>(deptIdList)); + deptIdList.removeAll(Collections.singleton("")); + List gridIdList = staffList.stream().map(TickStaffFormDTO::getGridId).collect(Collectors.toList()); + gridIdList = new ArrayList(new LinkedHashSet<>(gridIdList)); + gridIdList.removeAll(Collections.singleton("")); + AgencyDeptGridFormDTO agencyDeptGridFormDTO = new AgencyDeptGridFormDTO(); + agencyDeptGridFormDTO.setAgencyIdList(agencyIdList); + agencyDeptGridFormDTO.setDeptIdList(deptIdList); + agencyDeptGridFormDTO.setGridIdList(gridIdList); + Result resultDTO = govOrgFeignClient.getAgencyDeptGridList(agencyDeptGridFormDTO); + if (!resultDTO.success() || null == resultDTO.getData()) { + throw new RenException(ProjectConstant.SELECT_GOV_ORG_EXCEPTION); + } + return resultDTO.getData(); + } + + /** + * 获取当前工作人员的基本信息 + * + * @param formDTO + * @return com.epmet.dto.result.LoginUserDetailsResultDTO + * @author yinzuomei + * @date 2021/8/5 15:42 + */ + private LoginUserDetailsResultDTO queryLoginUserInfo(EventToProjectFormDTO formDTO) { + //2.数据准备,查询需要用到的数据 + //2-1.获取token用户所属组织信息 + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + dto.setApp(formDTO.getApp()); + dto.setClient(formDTO.getClient()); + dto.setUserId(formDTO.getUserId()); + Result resultDto = epmetUserOpenFeignClient.getLoginUserDetails(dto); + if (!resultDto.success() || StringUtils.isEmpty(resultDto.getData().getAgencyId())) { + throw new RenException(String.format("事件立项调用user服务查询用户数据失败,userId->", formDTO.getUserId())); + } + return resultDto.getData(); + } + + /** + * @Description 项目立项给勾选的工作人员推送站内信消息 + * @author yinzuomei + */ + private Result shiftProjectMessage(List staffList,String customerId,String title) { + List msgList = new ArrayList<>(); + //1.创建项目工作人员消息对象 + String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title); + //所选人员如果即在部门下又在网格下则只发一条消息 + Map map = new HashMap<>(); + staffList.forEach(staff->{ + if(!map.containsKey(staff.getStaffId())){ + UserMessageFormDTO msg = new UserMessageFormDTO(); + msg.setCustomerId(customerId); + msg.setGridId("*"); + msg.setApp(AppClientConstant.APP_GOV); + msg.setTitle(UserMessageConstant.PROJECT_TITLE); + msg.setMessageContent(projectStaffMessage); + msg.setReadFlag(ReadFlagConstant.UN_READ); + msg.setUserId(staff.getStaffId()); + msgList.add(msg); + map.put(staff.getStaffId(),staff.getStaffId()); + } + }); + return epmetMessageOpenFeignClient.saveUserMessageList(msgList); + } + + + /** + * @Description 项目立项给勾选的工作人员推送微信订阅消息 + * @author yinzuomei + */ + private Result wxmpShiftProjectMessage(List staffList,String customerId,String title) { + List msgList = new ArrayList<>(); + //1.创建项目工作人员消息对象 + String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title); + //所选人员如果即在部门下又在网格下则只发一条消息 + Map map = new HashMap<>(); + staffList.forEach(staff->{ + if(!map.containsKey(staff.getStaffId())){ + WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO(); + msg.setCustomerId(customerId); + msg.setClientType(AppClientConstant.APP_GOV); + msg.setUserId(staff.getStaffId()); + msg.setBehaviorType("项目消息"); + msg.setMessageContent(projectStaffMessage); + msg.setMessageTime(new Date()); + msg.setGridId("*"); + msgList.add(msg); + map.put(staff.getStaffId(),staff.getStaffId()); + } + }); + logger.info("事件立项,推送微信订阅消息"); + return epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); + } } 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..0cc50a69b2 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java @@ -0,0 +1,280 @@ +/** + * 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.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.EventConstant; +import com.epmet.constant.ResiEventAction; +import com.epmet.dao.*; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.ReplyFormDTO; +import com.epmet.dto.form.ReplyListFormDTO; +import com.epmet.dto.result.ReplyListResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.entity.ResiEventEntity; +import com.epmet.entity.ResiEventOperationLogEntity; +import com.epmet.entity.ResiEventReplyEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.ResiEventReplyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * 事件回复表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Service +public class ResiEventReplyServiceImpl extends BaseServiceImpl implements ResiEventReplyService { + @Autowired + private ResiEventDao resiEventDao; + @Autowired + private ResiEventOperationLogDao resiEventOperationLogDao; + @Autowired + private ResiEventMentionDao resiEventMentionDao; + @Autowired + private ResiEventReportOrgDao resiEventReportOrgDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + + /** + * @Description 报事详情-回复列表-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 11:11 上午 + */ + @Override + public List replyList(ReplyListFormDTO formDTO) { + List list=baseDao.selectReplyList(formDTO.getResiEventId()); + list.forEach(dto->{ + if(dto.getReplyUserId().equals(formDTO.getCurrentUserId())){ + dto.setReplyName("我"); + } + }); + return list; + } + + /** + * 报事-工作人员回复:办结、立项处理后不可回复 + * + * @param replyFormDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 14:20 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void govReply(ReplyFormDTO replyFormDTO) { + ResiEventEntity eventEntity=queryResiEntity(replyFormDTO.getResiEventId()); + // 回复内容走审核 + scanReplyContent(replyFormDTO.getContent()); + //查询工作人员所属组织 + Result staffResult = govOrgOpenFeignClient.getAgencyByStaff(replyFormDTO.getUserId()); + if (!staffResult.success() && null == staffResult.getData()) { + throw new RenException("查询当前工作人员信息异常"); + } + // 插入回复表 + ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity(); + resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId()); + resiEventReplyEntity.setResiEventId(replyFormDTO.getResiEventId()); + resiEventReplyEntity.setFromUserId(replyFormDTO.getUserId()); + resiEventReplyEntity.setContent(replyFormDTO.getContent()); + resiEventReplyEntity.setUserShowName(staffResult.getData().getOrganizationName()); + resiEventReplyEntity.setCreatedTime(new Date()); + baseDao.insert(resiEventReplyEntity); + // 记录操作日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(eventEntity.getCustomerId()); + reCallLog.setResiEventId(eventEntity.getId()); + reCallLog.setUserId(replyFormDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.STAFF); + reCallLog.setActionCode(ResiEventAction.REPLY.getCode()); + reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc()); + reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime()); + resiEventOperationLogDao.insert(reCallLog); + // 1、更新被@的人的红点置为显示 + resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),null); + // 2、更新报事人的红点置为显示 + eventEntity.setRedDot(true); + //更新事件最后一次操作时间 + eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime()); + resiEventDao.updateById(eventEntity); + // 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId todo + } + + private ResiEventEntity queryResiEntity(String resiEventId) { + ResiEventEntity eventEntity=resiEventDao.selectById(resiEventId); + // 办结、立项处理后不可回复 + if(EventConstant.EVENT_STATUS_CLOSED_CASE.equals(eventEntity.getStatus())||eventEntity.getShiftProject()){ + throw new RenException(EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_GOV.getCode(),EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_GOV.getMsg()); + } + return eventEntity; + } + + /** + * 报事当事人回复 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 14:39 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void selfReply(ReplyFormDTO formDTO) { + //查询原事件、已办结、已立项不可回复 + ResiEventEntity eventEntity=queryResiEntity(formDTO.getResiEventId()); + // 只有被人读过,才可以回复 + if (!eventEntity.getReadFlag()) { + throw new RenException(EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_SELF.getCode(), EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_SELF.getMsg()); + } + // 回复内容走审核 + scanReplyContent(formDTO.getContent()); + // 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称 + List userIdList =new ArrayList<>(); + userIdList.add(formDTO.getUserId()); + Result> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){ + throw new RenException("查询当前用户信息异常"); + } + // 插入回复表 + ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity(); + resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId()); + resiEventReplyEntity.setResiEventId(formDTO.getResiEventId()); + resiEventReplyEntity.setFromUserId(formDTO.getUserId()); + resiEventReplyEntity.setContent(formDTO.getContent()); + resiEventReplyEntity.setUserShowName(userResult.getData().get(0).getUserShowName()); + resiEventReplyEntity.setCreatedTime(new Date()); + baseDao.insert(resiEventReplyEntity); + //更新事件最后一次操作时间 + eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime()); + resiEventDao.updateById(eventEntity); + // 记录操作日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(eventEntity.getCustomerId()); + reCallLog.setResiEventId(eventEntity.getId()); + reCallLog.setUserId(formDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.REPORT_USER); + reCallLog.setActionCode(ResiEventAction.REPLY.getCode()); + reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc()); + reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime()); + resiEventOperationLogDao.insert(reCallLog); + // 1、更新被@的人的红点置为显示 + resiEventMentionDao.updateRedDotShow(formDTO.getResiEventId(),null); + // 2、更新报事人的红点置为不显示已经在查看详情中操作了 + // 3、组织改为显示 + resiEventReportOrgDao.updateRedDotShow(formDTO.getResiEventId()); + } + + /** + * 艾特的人回复 + * + * @param replyFormDTO + * @return void + * @author yinzuomei + * @date 2021/8/4 15:06 + */ + @Override + public void atReply(ReplyFormDTO replyFormDTO) { + ResiEventEntity eventEntity=queryResiEntity(replyFormDTO.getResiEventId()); + // 回复内容走审核 + scanReplyContent(replyFormDTO.getContent()); + // 查询当前用户的显示昵称 + List userIdList =new ArrayList<>(); + userIdList.add(replyFormDTO.getUserId()); + Result> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){ + throw new RenException("查询当前用户信息异常"); + } + // 插入回复表 + ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity(); + resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId()); + resiEventReplyEntity.setResiEventId(replyFormDTO.getResiEventId()); + resiEventReplyEntity.setFromUserId(replyFormDTO.getUserId()); + resiEventReplyEntity.setContent(replyFormDTO.getContent()); + resiEventReplyEntity.setUserShowName("人大代表-".concat(userResult.getData().get(0).getRealName())); + resiEventReplyEntity.setCreatedTime(new Date()); + baseDao.insert(resiEventReplyEntity); + // 记录操作日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(eventEntity.getCustomerId()); + reCallLog.setResiEventId(eventEntity.getId()); + reCallLog.setUserId(replyFormDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.RESI_USER); + reCallLog.setActionCode(ResiEventAction.REPLY.getCode()); + reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc()); + reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime()); + resiEventOperationLogDao.insert(reCallLog); + // 1、当前被艾特的人红点不展示已经在查看详情接口操作了,其他被@的人的红点置为显示 + resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),replyFormDTO.getUserId()); + // 2、更新报事人的红点置为显示 + eventEntity.setRedDot(true); + //更新事件最后一次操作时间 + eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime()); + resiEventDao.updateById(eventEntity); + // 3、组织改为显示 + resiEventReportOrgDao.updateRedDotShow(replyFormDTO.getResiEventId()); + } + + private void scanReplyContent(String content) { + if (StringUtils.isNotBlank(content)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + } + } + + + + +} \ 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..3adca24761 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -0,0 +1,643 @@ +/** + * 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.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.EventConstant; +import com.epmet.constant.ResiEventAction; +import com.epmet.dao.*; +import com.epmet.dto.EventProjectInfoDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.*; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.ResiEventService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * 居民报事表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-08-03 + */ +@Slf4j +@Service +public class ResiEventServiceImpl extends BaseServiceImpl implements ResiEventService { + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private ResiEventAttachmentDao resiEventAttachmentDao; + @Autowired + private ResiEventReportOrgDao resiEventReportOrgDao; + @Autowired + private ResiEventMentionDao resiEventMentionDao; + @Autowired + private ResiEventOperationLogDao resiEventOperationLogDao; + @Autowired + private ProjectDao projectDao; + @Autowired + private ResiEventReplyDao resiEventReplyDao; + + /** + * @Description 群众直报(待处理、处理中、已办结)列表 + * 未处理:按照创建时间正序; + * 处理中:按照最新操作时间由近到远排序; + * 已办结:按照办结时间由近到远排序; + * @Param formDTO + * @author zxc + * @date 2021/8/3 10:53 上午 + */ + @Override + public List eventList(EventListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List result = baseDao.eventUnDisposedList(formDTO.getOrgId(), formDTO.getEventType()); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 报事-首次查看事件-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 11:01 上午 + */ + @Override + public void updateViewTime(UpdateViewTimeFormDTO formDTO) { + ResiEventEntity eventEntity=baseDao.selectById(formDTO.getEventId()); + if (null == eventEntity) { + throw new RenException(String.format("没有找到事件记录,eventId:%s",formDTO.getEventId())); + } + ResiEventMentionEntity resiEventMentionEntity=resiEventMentionDao.selectUser(formDTO.getEventId(),formDTO.getUserId()); + if (formDTO.getUserId().equals(eventEntity.getReportUserId()) && null == resiEventMentionEntity) { + log.warn("报事人查看详情不需要调用此接口,如果既是报事人又是人大代表,自己艾特了自己,需要更新为已读"); + return; + } + // 这个事件已经被查看了 + eventEntity.setReadFlag(true); + baseDao.updateById(eventEntity); + // 居民端:resi_user;工作端:staff + if(EventConstant.RESI_USER.equals(formDTO.getViewType())){ + //被@的人置为已读 + resiEventMentionDao.updateReadFlag(formDTO.getEventId(),formDTO.getUserId()); + }else if(EventConstant.STAFF.equals(formDTO.getViewType())){ + // 当前组织置为已读 + resiEventReportOrgDao.updateReadFlag(formDTO.getEventId(),formDTO.getOrgId(),formDTO.getUserId()); + } + // 插入首次查看日志 + List logEntityList = resiEventOperationLogDao.selectByUserAction(formDTO.getEventId(), formDTO.getUserId(), ResiEventAction.READ_FIRST.getCode()); + if (CollectionUtils.isEmpty(logEntityList)) { + ResiEventOperationLogEntity publishLog=new ResiEventOperationLogEntity(); + publishLog.setCustomerId(formDTO.getCustomerId()); + publishLog.setResiEventId(formDTO.getEventId()); + publishLog.setUserId(formDTO.getUserId()); + publishLog.setUserIdentity(formDTO.getViewType()); + publishLog.setActionCode(ResiEventAction.READ_FIRST.getCode()); + publishLog.setActionDesc(ResiEventAction.READ_FIRST.getDesc()); + publishLog.setOperateTime(new Date()); + publishLog.setCreatedTime(publishLog.getOperateTime()); + resiEventOperationLogDao.insert(publishLog); + } + } + + /** + * @Description 报事详情-两端通用 + * @Param formDTO + * @author zxc + * @date 2021/8/3 1:47 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO, TokenDto tokenDto) { + EventDetailResultDTO dto = baseDao.selectEventDetail(formDTO.getEventId()); + if (null == dto){ + return new EventDetailResultDTO(); + } + // 已转项目 + if (dto.getIsProject()){ + // 查询项目信息 + EventProjectInfoDTO eventProjectInfo = projectDao.selectEventProjectInfo(dto.getProjectId()); + // 查询操作人的名字 + Result staffName = govOrgOpenFeignClient.staffName(eventProjectInfo.getUserId()); + if (!staffName.success()){ + throw new RenException("查询工作人员名字失败"); + } + eventProjectInfo.setOperationName(staffName.getData()); + dto.setProjectInfo(eventProjectInfo); + } + // 查询报事人名字 + List userIdList = new ArrayList<>(); + userIdList.add(dto.getEventUserId()); + Result> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){ + throw new RenException("查询当前用户信息异常"); + } + userResult.getData().forEach(u -> { + if (u.getUserId().equals(dto.getEventUserId())){ + dto.setEventPeopleName(u.getUserShowName()); + } + }); + // 查询所属网格 + Result gridNameResult = govOrgOpenFeignClient.gridName(dto.getGridId()); + if (!gridNameResult.success()){ + throw new RenException("查询所属网格失败"); + } + dto.setGridName(gridNameResult.getData()); + // 查询报事的org + List orgNameList = dto.getOrgNameList(); + Result> orgResult = govOrgOpenFeignClient.selectOrgNameByType(orgNameList); + if (!orgResult.success()){ + throw new RenException("查询组织名称失败"); + } + List data = orgResult.getData(); + dto.setEventOrg(data); + // 更改已读状态 报事人的红点:resi_event,艾特人的:resi_event_mention,所代表的组织的:resi_event_report_org + if (tokenDto.getApp().equals(EventConstant.TYPE_RESI)){ + baseDao.updateResiEvent(tokenDto.getUserId(),formDTO.getEventId()); + baseDao.updateEventMention(tokenDto.getUserId(),formDTO.getEventId()); + }else if (tokenDto.getApp().equals(EventConstant.TYPE_GOV)){ + resiEventReportOrgDao.updateEventOrg(formDTO.getEventId(), formDTO.getOrgId()); + } + return dto; + } + + /** + * 我要报事-提交(尹) + * + * @param formDTO + * @return com.epmet.dto.result.ResiEventResultDTO + * @author yinzuomei + * @date 2021/8/3 10:51 + */ + @Override + public ResiEventIdDTO report(ResiEventFormDTO formDTO) { + //1、事件内容审核 + //2、图片审核 + this.scanContent(formDTO.getEventContent(), formDTO.getAttachmentList()); + //3、查询当前所在网格的信息 + Result gridInfoRes=govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId()); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("网格信息查询异常"); + } + + ResiEventEntity resiEventEntity= ConvertUtils.sourceToTarget(formDTO,ResiEventEntity.class); + resiEventEntity.setAgencyId(gridInfoRes.getData().getParentAgencyId()); + resiEventEntity.setPids(gridInfoRes.getData().getPids()); + resiEventEntity.setReportUserId(formDTO.getUserId()); + Result partyRes=epmetUserOpenFeignClient.selectIsPartyMemberByUserId(formDTO.getUserId()); + if(!partyRes.success()||null==partyRes.getData()){ + throw new RenException("查询用户是否是党员异常"); + } + resiEventEntity.setIsParty(partyRes.getData()); + resiEventEntity.setStatus(EventConstant.EVENT_STATUS_PROCESSING); + resiEventEntity.setShiftProject(false); + resiEventEntity.setProjectId(StrConstant.EPMETY_STR); + resiEventEntity.setRecallFlag(false); + resiEventEntity.setReadFlag(false); + resiEventEntity.setRedDot(false); + resiEventEntity.setLatestOperatedTime(new Date()); + resiEventEntity.setCreatedTime(resiEventEntity.getLatestOperatedTime()); + resiEventEntity.setUpdatedTime(resiEventEntity.getLatestOperatedTime()); + //4、插入主表resi_event + baseDao.insert(resiEventEntity); + //5、插入附件表 + List attachmentEntityList=getAttList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getAttachmentList()); + attachmentEntityList.forEach(attachmentEntity->{ + resiEventAttachmentDao.insert(attachmentEntity); + }); + //6、插入组织表 + List orgEntityList=getOrgList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getOrgList()); + orgEntityList.forEach(orgEntity->{ + resiEventReportOrgDao.insert(orgEntity); + }); + //7、插入艾特人表 + List npcList=getNpcList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getNpcUserList()); + npcList.forEach(npc->{ + if (StringUtils.isNotBlank(npc.getUserId()) && StringUtils.isNotBlank(npc.getUserShowName())){ + resiEventMentionDao.insert(npc); + } + }); + //8、插入log日志 + ResiEventOperationLogEntity publishLog=new ResiEventOperationLogEntity(); + publishLog.setCustomerId(formDTO.getCustomerId()); + publishLog.setResiEventId(resiEventEntity.getId()); + publishLog.setUserId(formDTO.getUserId()); + publishLog.setUserIdentity(EventConstant.REPORT_USER); + publishLog.setActionCode(ResiEventAction.PUBLISH.getCode()); + publishLog.setActionDesc(ResiEventAction.PUBLISH.getDesc()); + publishLog.setOperateTime(resiEventEntity.getCreatedTime()); + publishLog.setCreatedTime(resiEventEntity.getCreatedTime()); + resiEventOperationLogDao.insert(publishLog); + //9、返回事件id + ResiEventIdDTO resiEventIdDTO=new ResiEventIdDTO(); + resiEventIdDTO.setResiEventId(resiEventEntity.getId()); + return resiEventIdDTO; + } + + private List getNpcList(String customerId, String resiEventId, List npcUserList) { + List list=new ArrayList<>(); + npcUserList.forEach(npc->{ + ResiEventMentionEntity mentionEntity=new ResiEventMentionEntity(); + mentionEntity.setCustomerId(customerId); + mentionEntity.setResiEventId(resiEventId); + mentionEntity.setUserType(EventConstant.NPC_USER); + mentionEntity.setUserShowName(npc.getUserShowName()); + mentionEntity.setUserId(npc.getUserId()); + mentionEntity.setGridId(npc.getGridId()); + mentionEntity.setAgencyId(npc.getAgencyId()); + mentionEntity.setPids(npc.getPids()); + mentionEntity.setReadFlag(EventConstant.UN_READ); + //默认展示,但是此时在未读列表中,个人中心页面应该展示红点 + mentionEntity.setRedDot(true); + list.add(mentionEntity); + }); + return list; + } + + private List getOrgList(String customerId, String resiEventId, List orgList) { + List list=new ArrayList<>(); + orgList.forEach(org->{ + ResiEventReportOrgEntity entity=ConvertUtils.sourceToTarget(org,ResiEventReportOrgEntity.class); + entity.setCustomerId(customerId); + entity.setResiEventId(resiEventId); + entity.setOrgType(org.getOrgLevel()); + //默认是未读 + entity.setOrgRead(EventConstant.UN_READ); + //默认是不展示红点,因为此时在待处理中。 + entity.setRedDot(false); + list.add(entity); + }); + return list; + } + + private List getAttList(String customerId,String resiEventId, List attachmentList) { + List list=new ArrayList<>(); + int sort= NumConstant.ONE; + for(FileCommonDTO img:attachmentList){ + ResiEventAttachmentEntity entity=new ResiEventAttachmentEntity(); + entity.setCustomerId(customerId); + entity.setResiEventId(resiEventId); + entity.setAttachmentName(img.getName()); + entity.setAttachmentFormat(img.getFormat()); + entity.setAttachmentType(img.getType()); + entity.setAttachmentUrl(img.getUrl()); + entity.setSort(sort); + sort++; + list.add(entity); + } + return list; + } + + private void scanContent(String eventContent, List attachmentList) { + //事件内容 + if (StringUtils.isNotBlank(eventContent)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(eventContent); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } + } + } + List imgList=new ArrayList<>(); + for(FileCommonDTO fileCommonDTO:attachmentList){ + if("image".equals(fileCommonDTO.getType())){ + imgList.add(fileCommonDTO.getUrl()); + } + } + //事件图片 + if (!CollectionUtils.isEmpty(imgList)) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgList.forEach(imgUrl -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(imgUrl); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode(), EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + } + } + } + } + + /** + * 撤回事件 + * + * 需求描述:未处理状态中可撤回上报事件,撤回后不在展示列表内、@的人大代表或组织已读后按钮消失 + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/3 13:45 + */ + @Override + public void reCall(ReCallEventFormDTO formDTO) { + ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getResiEventId()); + if(null==resiEventEntity){ + throw new RenException(String.format("根据事件id没有找到记录",formDTO.getResiEventId())); + } + // 我自己的发布的才可以删除 + if(!formDTO.getUserId().equals(resiEventEntity.getReportUserId())){ + log.warn("撤回事件入参:"+JSON.toJSONString(formDTO)); + throw new RenException(EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getCode(),EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getMsg()); + } + // 没有人看到过,才可以删除 + if(resiEventEntity.getReadFlag()){ + throw new RenException(EpmetErrorCode.RESI_EVENT_READ.getCode(),EpmetErrorCode.RESI_EVENT_READ.getMsg()); + } + resiEventEntity.setLatestOperatedTime(new Date()); + resiEventEntity.setRecallFlag(true); + resiEventEntity.setRecallTime(resiEventEntity.getLatestOperatedTime()); + //1、更新主表标记已撤回 + baseDao.updateById(resiEventEntity); + //2、插入log日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(formDTO.getCustomerId()); + reCallLog.setResiEventId(resiEventEntity.getId()); + reCallLog.setUserId(formDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.REPORT_USER); + reCallLog.setActionCode(ResiEventAction.RECALL.getCode()); + reCallLog.setActionDesc(ResiEventAction.RECALL.getDesc()); + reCallLog.setOperateTime(resiEventEntity.getLatestOperatedTime()); + reCallLog.setCreatedTime(resiEventEntity.getLatestOperatedTime()); + resiEventOperationLogDao.insert(reCallLog); + + } + + /** + * 选择已解决,未解决 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/3 13:58 + */ + @Override + public void chooseResolve(ChooseResolveFormDTO formDTO) { + ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getResiEventId()); + if(null==resiEventEntity){ + throw new RenException(String.format("根据事件id没有找到记录",formDTO.getResiEventId())); + } + // 我自己的发布的才可以 + if(!formDTO.getUserId().equals(resiEventEntity.getReportUserId())){ + throw new RenException(EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getCode(),EpmetErrorCode.RESI_EVENT_NOT_MY_REPORTED.getMsg()); + } + if(!EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resiEventEntity.getStatus())){ + throw new RenException("事件办结后,才可以选择是否解决,当前状态为:"+resiEventEntity.getStatus()); + } + resiEventEntity.setResolveStatus(formDTO.getResolveStatus()); + resiEventEntity.setUpdatedTime(new Date()); + baseDao.updateById(resiEventEntity); + //2、插入log日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(formDTO.getCustomerId()); + reCallLog.setResiEventId(resiEventEntity.getId()); + reCallLog.setUserId(formDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.REPORT_USER); + reCallLog.setActionCode(ResiEventAction.CHOOSE_RESOLVE.getCode()); + reCallLog.setActionDesc(ResiEventAction.CHOOSE_RESOLVE.getDesc()); + reCallLog.setOperateTime(resiEventEntity.getUpdatedTime()); + resiEventOperationLogDao.insert(reCallLog); + } + + /** + * 我的报事列表查询 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/8/3 14:28 + */ + @Override + public List queryMyReported(MyReportedFormDTO formDTO) { + // 未处理: 发了没有人看过的时间 + // 处理中: 有人看,正在处理中的 + // 已办结:有人看,已经办结了的 + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryMyReported(formDTO.getUserId(), + formDTO.getStatusCondition())); + result.getList().forEach(resultDTO->{ + if(EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resultDTO.getStatus())||resultDTO.getShiftProject()){ + // 已办结的、立项的不显示回复按钮 + resultDTO.setReplyButtonFlag("false"); + }else{ + // 处理中的事件 + if(resultDTO.getReadFlag()){ + // 被别人看过了就显示回复 + resultDTO.setReplyButtonFlag("true"); + }else{ + //别人没看过 + resultDTO.setReplyButtonFlag("false"); + } + } + }); + return result.getList(); + } + + /** + * 我要报事-人大代表未读/已读列表 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/8/4 9:41 + */ + @Override + public List mentionList(UserMentionFormDTO formDTO) { + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> resiEventMentionDao.selectMentionList(formDTO.getUserId(), + formDTO.getReadFlag())); + result.getList().forEach(dto->{ + if(dto.getShiftProject()||dto.getStatus().equals(EventConstant.EVENT_STATUS_CLOSED_CASE)){ + // 立项和办结了不能回复哈。 + dto.setReplyButtonFlag("false"); + }else{ + dto.setReplyButtonFlag("true"); + } + }); + return result.getList(); + } + + /** + * @Description 最新直报 + * @Param userId + * @author zxc + * @date 2021/8/5 9:55 上午 + */ + @Override + public List newEvents(String userId) { + Result> listResult = govOrgOpenFeignClient.selectOrgsByUserId(userId); + if (!listResult.success()){ + throw new RenException("查询userId:"+userId+",所在org失败"); + } + List orgIds = listResult.getData(); + if (!CollectionUtils.isEmpty(orgIds)){ + List result = baseDao.newEvents(orgIds); + return result; + } + return new ArrayList<>(); + } + + /** + * 报事办结:没有回复或立项不可办结 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/5 10:48 + */ + @Override + public void closeResiEvent(CloseResiEventFormDTO formDTO) { + ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getEventId()); + if(null==resiEventEntity){ + throw new RenException(String.format("根据事件id没有找到记录",formDTO.getEventId())); + } + List replyList=resiEventReplyDao.selectReplyList(formDTO.getEventId()); + //如果未转项目,也没有回复,不允许办结 + if(!resiEventEntity.getShiftProject()&&CollectionUtils.isEmpty(replyList)){ + throw new RenException(EpmetErrorCode.RESI_EVENT_CAN_NOT_CLOSE_CASE.getCode(),EpmetErrorCode.RESI_EVENT_CAN_NOT_CLOSE_CASE.getMsg()); + } + // 1、修改事件状态 + resiEventEntity.setRedDot(true); + resiEventEntity.setStatus(EventConstant.EVENT_STATUS_CLOSED_CASE); + resiEventEntity.setCloseCaseTime(new Date()); + resiEventEntity.setLatestOperatedTime(resiEventEntity.getCloseCaseTime()); + baseDao.updateById(resiEventEntity); + // 2、记录操作日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(resiEventEntity.getCustomerId()); + reCallLog.setResiEventId(resiEventEntity.getId()); + reCallLog.setUserId(formDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.STAFF); + reCallLog.setActionCode(ResiEventAction.CLOSE_CASE.getCode()); + reCallLog.setActionDesc(ResiEventAction.CLOSE_CASE.getDesc()); + reCallLog.setOperateTime(resiEventEntity.getCloseCaseTime()); + resiEventOperationLogDao.insert(reCallLog); + // 3、红点: + // 当前工作人员办结后: + // 3.1、报事人在已办结列表中展示红点:上面已经更新 + // 3.2、人大代表在未读/已读列表中展示红点 + resiEventMentionDao.updateRedDotShow(formDTO.getEventId(),null); + // 3.3、目前Db设计支持报给多个层级(组织或网格),按理说应该更新非当前组织外,其他的组织,显示红点,先不做了吧 todo + } + + /** + * 事件立项:更新立项标志、增加操作日志、更新(报事人、被艾特的人)红点 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/5 16:17 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void shiftProject(EventShiftProjectDTO formDTO) { + // 1、更新立项标志 + ResiEventEntity resiEventEntity=getById(formDTO.getEventId()); + resiEventEntity.setLatestOperatedTime(formDTO.getShiftProjectTime()); + resiEventEntity.setShiftProject(true); + resiEventEntity.setRedDot(true); + resiEventEntity.setProjectId(formDTO.getProjectId()); + baseDao.updateById(resiEventEntity); + // 2、记录操作日志 + ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity(); + reCallLog.setCustomerId(resiEventEntity.getCustomerId()); + reCallLog.setResiEventId(resiEventEntity.getId()); + reCallLog.setUserId(formDTO.getUserId()); + reCallLog.setUserIdentity(EventConstant.STAFF); + reCallLog.setActionCode(ResiEventAction.SHIFIT_PROJECT.getCode()); + reCallLog.setActionDesc(ResiEventAction.SHIFIT_PROJECT.getDesc()); + reCallLog.setOperateTime(resiEventEntity.getLatestOperatedTime()); + resiEventOperationLogDao.insert(reCallLog); + //3、所有被艾特的人应该都通知 + resiEventMentionDao.updateRedDotShow(formDTO.getEventId(),null); + // 4、目前只能报给一个组织,如果后续可以报给多个组织,要去把其他组织的红点改为显示 todo + } + + @Override + public ResiEventEntity getById(String eventId) { + return baseDao.selectById(eventId); + } + + /** + * 工作台,最新直报是否显示红点? + * + * @param agencyId + * @return com.epmet.dto.result.ResiEventManageRedDotRes + * @author yinzuomei + * @date 2021/8/6 13:57 + */ + @Override + public ResiEventManageRedDotRes queryResiEventManageRedDot(String agencyId) { + ResiEventManageRedDotRes res=new ResiEventManageRedDotRes(); + res.setUnReadCount(resiEventReportOrgDao.selectUnReadCount(agencyId)); + res.setRedDotCount(resiEventReportOrgDao.selectRedCount(agencyId)); + res.setTotalCount(res.getUnReadCount()+res.getRedDotCount()); + return res; + } + + +} \ 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..6000c57fd2 --- /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,132 @@ +CREATE TABLE `resi_event` ( + `ID` varchar(64) NOT NULL COMMENT '主键,事件id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '居民端用户所在网格的所属组织', + `PIDS` varchar(255) NOT NULL COMMENT '居民端用户所在网格的所有上级组织,包含AGENCY_ID', + `REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人', + `IS_PARTY` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:党员;0:不是党员;默认0', + `EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容', + `LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `STATUS` varchar(32) NOT NULL COMMENT '处理中:processing;已办结:closed_case', + `close_case_time` datetime DEFAULT NULL COMMENT '办结时间', + `SHIFT_PROJECT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已转项目;0:未转项目;默认0', + `PROJECT_ID` varchar(64) DEFAULT NULL COMMENT '项目id;shift_project=1时,此列有值', + `RECALL_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:已撤回;0:未撤回正常展示;默认0', + `RECALL_TIME` datetime DEFAULT NULL COMMENT '撤回时间', + `READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表', + `RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/办结更新为1; ', + `LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、办结更新此列)', + `RESOLVE_STATUS` varchar(32) DEFAULT NULL COMMENT '是否解决:已解决 resolved,未解决 un_solved', + `CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明可放这。', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='居民报事表'; + +CREATE TABLE `resi_event_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id,关联resi_event的id', + `ATTACHMENT_NAME` varchar(64) NOT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) NOT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + + +CREATE TABLE `resi_event_mention` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id', + `USER_TYPE` varchar(32) NOT NULL COMMENT '人大代表:npc_user', + `USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '人大代表目前显示姓名', + `USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '居民注册网格ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '居民所属社区,就是grid_id的所属组织', + `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_first:人大代表未读=>已读;工作人员待处理=>处理中;\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_first:人大代表未读=>已读;工作人员待处理=>处理中;', + `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='事件操作日志表'; + + +ALTER TABLE `project` + MODIFY COLUMN `ORIGIN` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源:议题issue 项目立项:agency 事件:resi_event' AFTER `AGENCY_ID`; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 5940f47003..ab6c65c8a7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -379,4 +379,22 @@ ORDER BY a.UPDATED_TIME DESC + + + + \ 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..0142b1a3df --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE resi_event + SET RED_DOT = 0, + UPDATED_TIME = NOW() + WHERE DEL_FLAG = '0' + AND ID = #{eventId} + AND REPORT_USER_ID = #{userId} + + + + + UPDATE resi_event_mention + SET RED_DOT = 0, + UPDATED_TIME = NOW() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + AND RESI_EVENT_ID = #{eventId} + + + + + + + + + + + + \ 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..28548eaad9 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + UPDATE resi_event_mention + SET READ_FLAG = 'read', + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE + RESI_EVENT_ID = #{eventId} + AND USER_ID = #{userId} + AND DEL_FLAG = '0' + + + + + UPDATE resi_event_mention + SET RED_DOT = '1', + UPDATED_TIME = NOW() + WHERE + RESI_EVENT_ID = #{resiEventId} + + and user_id !=#{excludeUserId} + + AND DEL_FLAG = '0' + + + + \ 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..29052bcccb --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml @@ -0,0 +1,14 @@ + + + + + + + + \ 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..bc763a71f5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ 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..1838d12f93 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml @@ -0,0 +1,59 @@ + + + + + + + + UPDATE resi_event_report_org + SET ORG_READ = 'read', + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE + RESI_EVENT_ID = #{eventId} + AND ORG_ID = #{orgId} + AND DEL_FLAG = '0' + + + + UPDATE resi_event_report_org + SET RED_DOT = '1', + UPDATED_TIME = NOW() + WHERE + RESI_EVENT_ID = #{resiEventId} + AND DEL_FLAG = '0' + + + + + UPDATE resi_event_report_org + SET RED_DOT = 0, + UPDATED_TIME = NOW() + WHERE DEL_FLAG = '0' + AND ORG_ID = #{orgId} + AND RESI_EVENT_ID = #{eventId} + + + + + + \ 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..8f5921ea8d --- /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 customerId; +} 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..f7ea5861d3 --- /dev/null +++ b/epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java @@ -0,0 +1,38 @@ +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 userShowName; + + 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 5bfd93548c..041357ea74 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..3328277513 --- /dev/null +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +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; + + @Autowired + private LoginUserUtil loginUserUtil; + + /** + * @return + * @Description 查询人大代表列表(客户下的) + * @author wxz + * @date 2021.08.03 09:17 + */ + @PostMapping("/npc-list") + public Result>> listNpc(@RequestBody ResiEventNpcListFormDTO input) { + ValidatorUtils.validateEntity(input); + String customerId = input.getCustomerId(); + List npcs = resiEventService.listNpcByGrid(customerId, loginUserUtil.getLoginUserId()); + + 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..7b26a10ad5 --- /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 customerId, String excludeUserId); + + /** + * @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..bd6a1c4376 --- /dev/null +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -0,0 +1,137 @@ +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 customerId, String excludeUserId) { + + // 查询网格所属的组织信息 + //Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(customerId); + //GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + //String parentAgencyId = gridInfoData.getParentAgencyId(); + //String pids = gridInfoData.getPids(); + + //查询人大代表列表 + ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(customerId, BadgeConstant.BADGE_KEY_NPC); + Result> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm); + List npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null); + + //批量查询人大代表所在的网格信息 + List npcGridIds = npcData.stream().map(d -> d.getGridId()).collect(Collectors.toList()); + OrgInfoFormDTO form = new OrgInfoFormDTO(OrgInfoConstant.GRID, npcGridIds); + Result> npcGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form); + List npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); + + Map npcGridInfoMap = convertNpcGridInfos2Map(npcGridInfos); + + List npcResultList = new ArrayList<>(); + npcData.stream().forEach(npc -> { + if (StringUtils.isBlank(excludeUserId) || !npc.getUserId().equals(excludeUserId)) { + OrgInfoResultDTO gridInfo = npcGridInfoMap.get(npc.getGridId()); + ResiEventNpcResultDTO resiEventNpcInfo = new ResiEventNpcResultDTO( + npc.getUserId(), + npc.getGridId(), + "人大代表-".concat(npc.getRealName()), + npc.getRealName(), + npc.getHeadImgUrl(), + gridInfo != null ? gridInfo.getAgencyId() : null, + gridInfo != null ? gridInfo.getPids().concat(":").concat(gridInfo.getAgencyId()) : null); + npcResultList.add(resiEventNpcInfo); + } + } + ); + + return npcResultList; + } + + /** + * @return + * @Description 将网格信息转化为map + * @author wxz + * @date 2021.08.04 14:25 + */ + private Map convertNpcGridInfos2Map(List npcGridInfos) { + HashMap result = new HashMap<>(); + npcGridInfos.stream().forEach(i -> { + result.put(i.getOrgId(), i); + }); + return result; + } + + /** + * @return + * @Description 此处会调用org上游接口批量获取父级组织信息,由于上游接口排序不可控,因此此处需要使用TreeSet做排序 + * @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..0587b7f163 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java @@ -0,0 +1,19 @@ +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 customerId; + + @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/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java index 2c23abe08b..01741a9275 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -101,4 +101,9 @@ public class UserBaseInfoResultDTO implements Serializable { * 微信基本信息 */ private UserWechatResultDTO userWechatResultDTO; + + /** + * xxx街道-尹女士 + */ + private String userShowName; } 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..503da1bd31 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 customerId = input.getCustomerId(); + String badgeKey = input.getBadgeKey(); + + List users = badgeService.listUsersByBadge(customerId, 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..d2a10f7026 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("customerId") String customerId, @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..fc06714fd9 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 customerId, 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..4734770a3a 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 customerId, String badgeKey) { + return baseDao.listUsersByBadge(customerId, badgeKey); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index c93e6fd99c..1ce80e7e61 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -181,6 +182,21 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl + + + \ No newline at end of file