From 4c7e2cdd5c2fae103b49970498275121b8f5d445 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 5 Aug 2021 11:09:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=A5=E4=BA=8B=E5=8A=9E=E7=BB=93+3?= =?UTF-8?q?=E4=B8=AA=E5=9B=9E=E5=A4=8D=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9A=84=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../epmet/dto/form/CloseResiEventFormDTO.java | 29 ++++++++++++ .../epmet/controller/ResiEventController.java | 16 +++++++ .../com/epmet/service/ResiEventService.java | 10 +++++ .../impl/ResiEventReplyServiceImpl.java | 9 +++- .../service/impl/ResiEventServiceImpl.java | 45 +++++++++++++++++++ 6 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java 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 1a29d62e54..3966217c18 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 @@ -99,6 +99,7 @@ public enum EpmetErrorCode { 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,"事件尚未处理,请处理完成后进行办结"), // 爱心互助 居民端 NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), 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-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 index 0e090ed1b9..79002b9f56 100644 --- 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 @@ -174,4 +174,20 @@ public class ResiEventController { return new Result>().ok(resiEventService.mentionList(formDTO)); } + /** + * 报事办结 + * + * @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(); + } } \ 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 index 65d13d225f..9529c3e005 100644 --- 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 @@ -89,4 +89,14 @@ public interface ResiEventService extends BaseService { * @date 2021/8/4 9:41 */ List mentionList(UserMentionFormDTO formDTO); + + /** + * 报事办结 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/8/5 10:48 + */ + void closeResiEvent(CloseResiEventFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java index 5f1d1ddaee..7d1116c60c 100644 --- 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 @@ -136,8 +136,10 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl 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 + } + } \ No newline at end of file From abdaf5aa90a134ee15dcff6a380424a6761d1613 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 5 Aug 2021 11:12:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ResiEventController.java | 69 ++++++++++--------- .../service/impl/ResiEventServiceImpl.java | 2 +- 2 files changed, 37 insertions(+), 34 deletions(-) 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 index c8eb08e5cd..d984456930 100644 --- 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 @@ -43,34 +43,35 @@ import java.util.List; @RestController @RequestMapping("resievent") public class ResiEventController { - + @Autowired private ResiEventService resiEventService; /** - * @Description 报事详情-两端通用 + * @Description 报事详情-两端通用 * @Param formDTO * @author zxc * @date 2021/8/3 1:47 下午 */ @PostMapping("eventdetail") - public Result eventDetail(@LoginUser TokenDto tokenDto ,@RequestBody EventDetailFormDTO formDTO){ + public Result eventDetail(@LoginUser TokenDto tokenDto, @RequestBody EventDetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return new Result().ok(resiEventService.eventDetail(formDTO,tokenDto)); + return new Result().ok(resiEventService.eventDetail(formDTO, tokenDto)); } + /** * 我要报事-提交(尹) * * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @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){ + 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); + ValidatorUtils.validateEntity(formDTO, ResiEventFormDTO.AddUserShowGroup.class, ResiEventFormDTO.AddUserInternalGroup.class); return new Result().ok(resiEventService.report(formDTO)); } @@ -78,15 +79,15 @@ public class ResiEventController { * 我要报事-撤回(尹) * * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @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){ + 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); + ValidatorUtils.validateEntity(formDTO, ResiEventIdDTO.ResiEventIdGroup.class, ReCallEventFormDTO.AddUserInternalGroup.class); resiEventService.reCall(formDTO); return new Result(); } @@ -96,15 +97,15 @@ public class ResiEventController { * * @param tokenDto * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @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){ + 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); + ValidatorUtils.validateEntity(formDTO, ResiEventIdDTO.ResiEventIdGroup.class, ChooseResolveFormDTO.AddUserInternalGroup.class); resiEventService.chooseResolve(formDTO); return new Result(); } @@ -115,43 +116,43 @@ public class ResiEventController { * * @param tokenDto * @param formDTO - * @return com.epmet.commons.tools.utils.Result> + * @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){ + public Result> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,MyReportedFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, MyReportedFormDTO.AddUserInternalGroup.class); return new Result>().ok(resiEventService.queryMyReported(formDTO)); } /** - * @Description 群众直报(待处理、处理中、已办结)列表 + * @Description 群众直报(待处理、处理中、已办结)列表 * @Param formDTO * @author zxc * @date 2021/8/3 10:53 上午 */ @PostMapping("eventlist") - public Result> eventList(@RequestBody EventListFormDTO formDTO){ + public Result> eventList(@RequestBody EventListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class); return new Result>().ok(resiEventService.eventList(formDTO)); } /** - * @Description 报事-首次查看事件-两端通用 + * @Description 报事-首次查看事件-两端通用 * @Param formDTO * @author zxc * @date 2021/8/3 11:01 上午 */ @PostMapping("updateviewtime") - public Result updateViewTime(@LoginUser TokenDto tokenDto,@RequestBody UpdateViewTimeFormDTO formDTO){ + 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); + ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.AddUserInternalGroup.class); + if (EventConstant.STAFF.equals(formDTO.getViewType())) { + ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.GovInternalGroup.class); } resiEventService.updateViewTime(formDTO); return new Result(); @@ -162,25 +163,26 @@ public class ResiEventController { * * @param tokenDto * @param formDTO - * @return com.epmet.commons.tools.utils.Result> + * @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){ + public Result> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,UserMentionFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, UserMentionFormDTO.AddUserInternalGroup.class); return new Result>().ok(resiEventService.mentionList(formDTO)); - }} + } + /** - * @Description 最新直报 + * @Description 最新直报 * @Param userId * @author zxc * @date 2021/8/5 9:55 上午 */ @PostMapping("newevents") - public Result> newEvents(@LoginUser TokenDto tokenDto){ + public Result> newEvents(@LoginUser TokenDto tokenDto) { return new Result>().ok(resiEventService.newEvents(tokenDto.getUserId())); } @@ -189,14 +191,15 @@ public class ResiEventController { * * @param tokenDto * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @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){ + public Result closeResiEvent(@LoginUser TokenDto tokenDto, @RequestBody CloseResiEventFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,CloseResiEventFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, CloseResiEventFormDTO.AddUserInternalGroup.class); resiEventService.closeResiEvent(formDTO); return new Result(); - } \ No newline at end of file + } +} \ 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 index 50b73bc605..4e2452c6c2 100644 --- 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 @@ -89,7 +89,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl