Browse Source

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

master
yinzuomei 4 years ago
parent
commit
4107c759a9
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 29
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java
  3. 73
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java
  4. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java
  5. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  6. 45
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

1
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, "您还未进入指定的签到范围~"),

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

73
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<EventDetailResultDTO> eventDetail(@LoginUser TokenDto tokenDto ,@RequestBody EventDetailFormDTO formDTO){
public Result<EventDetailResultDTO> eventDetail(@LoginUser TokenDto tokenDto, @RequestBody EventDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<EventDetailResultDTO>().ok(resiEventService.eventDetail(formDTO,tokenDto));
return new Result<EventDetailResultDTO>().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<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO){
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventFormDTO.AddUserShowGroup.class,ResiEventFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiEventFormDTO.AddUserShowGroup.class, ResiEventFormDTO.AddUserInternalGroup.class);
return new Result<ResiEventIdDTO>().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<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/3 14:27
*/
@PostMapping("myreported")
public Result<List<MyReportedResultDTO>> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO){
public Result<List<MyReportedResultDTO>> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,MyReportedFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, MyReportedFormDTO.AddUserInternalGroup.class);
return new Result<List<MyReportedResultDTO>>().ok(resiEventService.queryMyReported(formDTO));
}
/**
* @Description 群众直报待处理处理中已办结列表
* @Description 群众直报待处理处理中已办结列表
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
@PostMapping("eventlist")
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO){
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class);
return new Result<List<EventListResultDTO>>().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,27 +163,43 @@ public class ResiEventController {
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/4 9:40
*/
@PostMapping("mentionlist")
public Result<List<UserMentionResultDTO>> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO){
public Result<List<UserMentionResultDTO>> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,UserMentionFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, UserMentionFormDTO.AddUserInternalGroup.class);
return new Result<List<UserMentionResultDTO>>().ok(resiEventService.mentionList(formDTO));
}
/**
* @Description 最新直报
* @Description 最新直报
* @Param userId
* @author zxc
* @date 2021/8/5 9:55 上午
*/
@PostMapping("newevents")
public Result<List<NewEventsResultDTO>> newEvents(@LoginUser TokenDto tokenDto){
public Result<List<NewEventsResultDTO>> newEvents(@LoginUser TokenDto tokenDto) {
return new Result<List<NewEventsResultDTO>>().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();
}
}

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

@ -97,4 +97,15 @@ public interface ResiEventService extends BaseService<ResiEventEntity> {
* @date 2021/8/5 9:55 上午
*/
List<NewEventsResultDTO> newEvents(String userId);
/**
* 报事办结
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/5 10:48
*/
void closeResiEvent(CloseResiEventFormDTO formDTO);
}

9
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<ResiEventReplyDao
resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),null);
// 2、更新报事人的红点置为显示
eventEntity.setRedDot(true);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId
// 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId todo
}
private ResiEventEntity queryResiEntity(String resiEventId) {
@ -184,6 +186,9 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
resiEventReplyEntity.setUserShowName(userResult.getData().get(0).getShowName());
resiEventReplyEntity.setCreatedTime(new Date());
baseDao.insert(resiEventReplyEntity);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 记录操作日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(eventEntity.getCustomerId());
@ -244,6 +249,8 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),replyFormDTO.getUserId());
// 2、更新报事人的红点置为显示
eventEntity.setRedDot(true);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 3、组织改为显示
resiEventReportOrgDao.updateRedDotShow(replyFormDTO.getResiEventId());

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

@ -87,6 +87,8 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
private ResiEventOperationLogDao resiEventOperationLogDao;
@Autowired
private ProjectDao projectDao;
@Autowired
private ResiEventReplyDao resiEventReplyDao;
/**
* @Description 群众直报待处理处理中已办结列表
@ -513,5 +515,48 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
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<ReplyListResultDTO> 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
}
}
Loading…
Cancel
Save