代码提交
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.njcn.cssystem.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.cssystem.mapper.CsFeedbackChatMapper;
|
||||
import com.njcn.cssystem.pojo.param.CsFeedbackAuditParm;
|
||||
import com.njcn.cssystem.pojo.param.CsFeedbackChatAddParm;
|
||||
@@ -10,12 +13,15 @@ import com.njcn.cssystem.pojo.po.CsFeedbackChatPO;
|
||||
import com.njcn.cssystem.pojo.po.CsFeedbackPO;
|
||||
import com.njcn.cssystem.service.CsFeedbackChatService;
|
||||
import com.njcn.cssystem.service.CsFeedbackService;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -50,9 +56,17 @@ public class CsFeedbackChatServiceImpl extends ServiceImpl<CsFeedbackChatMapper,
|
||||
public Boolean updateChatStatus(CsFeedbackChatCheckParm csFeedbackChatCheckParm) {
|
||||
UpdateWrapper<CsFeedbackChatPO> updateWrapper = new UpdateWrapper<> ();
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
String userRole = RequestUtil.getUserRole();
|
||||
List<String> strings = JSONArray.parseArray(userRole, String.class);
|
||||
if(CollectionUtils.isEmpty(strings)){
|
||||
throw new BusinessException(AlgorithmResponseEnum.UNKNOW_ROLE);
|
||||
|
||||
}
|
||||
userRole=strings.get(0);
|
||||
CsFeedbackPO one = csFeedbackService.lambdaQuery().eq(CsFeedbackPO::getId, csFeedbackChatCheckParm.getId()).one();
|
||||
/*如何非创建人添加一条聊天记录“反馈已收到,处理中”*/
|
||||
if ((!Objects.equals(one.getCreateBy(),userIndex))&&Objects.equals(one.getStatus(),"1")) {
|
||||
if ((!Objects.equals(one.getCreateBy(),userIndex))&&Objects.equals(one.getStatus(),"1")
|
||||
&&(Objects.equals(userRole, AppRoleEnum.ENGINEERING_USER.getCode())||Objects.equals(userRole, AppRoleEnum.OPERATION_MANAGER.getCode()))) {
|
||||
|
||||
CsFeedbackChatPO csFeedbackChatPO = new CsFeedbackChatPO ();
|
||||
csFeedbackChatPO.setUserId(RequestUtil.getUserIndex());
|
||||
|
||||
Reference in New Issue
Block a user