|
|
@ -24,7 +24,9 @@ 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.*; |
|
|
|
import com.epmet.constant.EventConstant; |
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
import com.epmet.constant.ResiEventAction; |
|
|
|
import com.epmet.constant.UserMessageTypeConstant; |
|
|
|
import com.epmet.dao.IcEventDao; |
|
|
|
import com.epmet.dto.*; |
|
|
@ -265,6 +267,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
entity.setGridPids(gridInfo.getPids()); |
|
|
|
entity.setLatestOperatedTime(new Date()); |
|
|
|
entity.setAuditStatus(TopicConstant.AUTO_PASSED); |
|
|
|
//新增事件时默认是null; 0:已回复 1:已转项目 2:已转需求
|
|
|
|
entity.setOperationType(null); |
|
|
|
if("closed_case".equals(formDTO.getStatus())){ |
|
|
|
entity.setCloseCaseTime(new Date()); |
|
|
|
} |
|
|
@ -671,6 +675,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
entity.setStatus(formDTO.getStatus()); |
|
|
|
entity.setCloseCaseTime(new Date()); |
|
|
|
} |
|
|
|
entity.setOperationType(NumConstant.ZERO_STR); |
|
|
|
entity.setLatestOperatedTime(new Date()); |
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
|
@ -718,11 +723,11 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
//5.新增操作记录数据
|
|
|
|
Date date = new Date(); |
|
|
|
List<IcEventOperationLogEntity> logList = new ArrayList<>(); |
|
|
|
logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, "reply", "reply")); |
|
|
|
logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, ResiEventAction.REPLY.getCode(), ResiEventAction.REPLY.getDesc())); |
|
|
|
//回复时选择了已完成
|
|
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { |
|
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) { |
|
|
|
date.setTime(date.getTime() + 6000 * 1); |
|
|
|
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case")); |
|
|
|
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getDesc())); |
|
|
|
} |
|
|
|
icEventOperationLogService.insertBatch(logList); |
|
|
|
|
|
|
@ -1235,7 +1240,47 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void resiReply(ResiReplyIcEventFormDTO formDTO) { |
|
|
|
// todo
|
|
|
|
//1.查询事件数据 判断是否允许回复
|
|
|
|
IcEventEntity entity=checkReply(formDTO.getIcEventId()); |
|
|
|
entity.setLatestOperatedTime(new Date()); |
|
|
|
entity.setRedDot(NumConstant.ZERO); |
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
|
|
//2.新增回复数据
|
|
|
|
IcEventReplyEntity replyEntity = new IcEventReplyEntity(); |
|
|
|
replyEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
replyEntity.setIcEventId(formDTO.getIcEventId()); |
|
|
|
replyEntity.setFromUserId(formDTO.getUserId()); |
|
|
|
replyEntity.setContent(formDTO.getContent()); |
|
|
|
// 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称
|
|
|
|
List<String> userIdList =new ArrayList<>(); |
|
|
|
userIdList.add(formDTO.getUserId()); |
|
|
|
Result<List<UserBaseInfoResultDTO>> userResult=userOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())) { |
|
|
|
throw new RenException("查询当前用户信息异常"); |
|
|
|
} |
|
|
|
replyEntity.setUserShowName(userResult.getData().get(NumConstant.ZERO).getUserShowName()); |
|
|
|
icEventReplyService.insert(replyEntity); |
|
|
|
|
|
|
|
//3.新增操作记录数据
|
|
|
|
IcEventOperationLogEntity logEntity =ConvertUtils.sourceToTarget(formDTO,IcEventOperationLogEntity.class); |
|
|
|
logEntity.setUserIdentity(EventConstant.RESI_USER); |
|
|
|
logEntity.setActionCode(ResiEventAction.REPLY.getCode()); |
|
|
|
logEntity.setActionDesc(ResiEventAction.REPLY.getDesc()); |
|
|
|
logEntity.setOperateTime(new Date()); |
|
|
|
icEventOperationLogService.insert(logEntity); |
|
|
|
} |
|
|
|
|
|
|
|
private IcEventEntity checkReply(String icEventId) { |
|
|
|
//:0:已回复 1:已转项目 1:已转需求
|
|
|
|
IcEventEntity entity = baseDao.selectById(icEventId); |
|
|
|
if (null == entity || NumConstant.ONE_STR.equals(entity.getOperationType())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转项目"); |
|
|
|
} |
|
|
|
if (null == entity || NumConstant.TWO_STR.equals(entity.getOperationType())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复", "事件已转需求"); |
|
|
|
} |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|