Browse Source

报事当事人回复

dev_shibei_match
yinzuomei 4 years ago
parent
commit
83b4c55555
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  3. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java
  4. 74
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java

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

@ -97,7 +97,8 @@ public enum EpmetErrorCode {
VOTE_ISSUE_PLEASE(8602,"请先选择支持或反对,再发表您的想法"), VOTE_ISSUE_PLEASE(8602,"请先选择支持或反对,再发表您的想法"),
RESI_EVENT_READ(8603,"当前事件正在处理中,不能撤回"), RESI_EVENT_READ(8603,"当前事件正在处理中,不能撤回"),
RESI_EVENT_NOT_MY_REPORTED(8604,"当前事件不是您发布的,无权操作"), RESI_EVENT_NOT_MY_REPORTED(8604,"当前事件不是您发布的,无权操作"),
CAN_NOT_REPLY_RESI_EVENT(8605,"办结、立项处理后不可回复"), CAN_NOT_REPLY_RESI_EVENT_GOV(8605,"办结、立项处理后不可回复"),
CAN_NOT_REPLY_RESI_EVENT_SELF(8606,"当前事件待处理,不可回复"),
// 爱心互助 居民端 // 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java

@ -76,4 +76,21 @@ public class ResiEventReplyController {
resiEventReplyService.govReply(replyFormDTO); resiEventReplyService.govReply(replyFormDTO);
return new Result(); 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();
}
} }

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java

@ -50,4 +50,14 @@ public interface ResiEventReplyService extends BaseService<ResiEventReplyEntity>
* @date 2021/8/4 14:20 * @date 2021/8/4 14:20
*/ */
void govReply(ReplyFormDTO replyFormDTO); void govReply(ReplyFormDTO replyFormDTO);
/**
* 报事当事人回复
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 14:39
*/
void selfReply(ReplyFormDTO formDTO);
} }

74
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java

@ -34,9 +34,11 @@ import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.ReplyFormDTO; import com.epmet.dto.form.ReplyFormDTO;
import com.epmet.dto.form.ReplyListFormDTO; import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO; import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.ResiEventEntity; import com.epmet.entity.ResiEventEntity;
import com.epmet.entity.ResiEventOperationLogEntity; import com.epmet.entity.ResiEventOperationLogEntity;
import com.epmet.entity.ResiEventReplyEntity; import com.epmet.entity.ResiEventReplyEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ResiEventReplyService; import com.epmet.service.ResiEventReplyService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -44,7 +46,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -63,6 +67,9 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
private ResiEventOperationLogDao resiEventOperationLogDao; private ResiEventOperationLogDao resiEventOperationLogDao;
@Autowired @Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient; private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Value("${openapi.scan.server.url}") @Value("${openapi.scan.server.url}")
private String scanApiUrl; private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}") @Value("${openapi.scan.method.textSyncScan}")
@ -96,11 +103,7 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void govReply(ReplyFormDTO replyFormDTO) { public void govReply(ReplyFormDTO replyFormDTO) {
ResiEventEntity eventEntity=resiEventDao.selectById(replyFormDTO.getResiEventId()); ResiEventEntity eventEntity=queryResiEntity(replyFormDTO.getResiEventId());
// 办结、立项处理后不可回复
if(EventConstant.EVENT_STATUS_CLOSED_CASE.equals(eventEntity.getStatus())||eventEntity.getShiftProject()){
throw new RenException(EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT.getCode(),EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT.getMsg());
}
// 回复内容走审核 // 回复内容走审核
scanReplyContent(replyFormDTO.getContent()); scanReplyContent(replyFormDTO.getContent());
//查询工作人员所属组织 //查询工作人员所属组织
@ -130,6 +133,63 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
resiEventOperationLogDao.insert(reCallLog); resiEventOperationLogDao.insert(reCallLog);
} }
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());
// 查询当前用户的显示昵称
List<String> userIdList =new ArrayList<>();
userIdList.add(formDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> 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).getShowName());
resiEventReplyEntity.setCreatedTime(new Date());
baseDao.insert(resiEventReplyEntity);
// 记录操作日志
//2、插入log日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(eventEntity.getCustomerId());
reCallLog.setResiEventId(eventEntity.getId());
reCallLog.setUserId(formDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.RESI_USER);
reCallLog.setActionCode(ResiEventAction.REPLY.getCode());
reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc());
reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime());
resiEventOperationLogDao.insert(reCallLog);
}
private void scanReplyContent(String content) { private void scanReplyContent(String content) {
if (StringUtils.isNotBlank(content)) { if (StringUtils.isNotBlank(content)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
@ -147,4 +207,8 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
} }
} }
} }
} }
Loading…
Cancel
Save