|
@ -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 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |