代码提交
This commit is contained in:
@@ -132,6 +132,14 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
|
|
||||||
DevCountVO devCountVO = new DevCountVO();
|
DevCountVO devCountVO = new DevCountVO();
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
List<String> device = roleEngineerDevService.getDevice();
|
List<String> device = roleEngineerDevService.getDevice();
|
||||||
if(CollectionUtils.isEmpty(device)){
|
if(CollectionUtils.isEmpty(device)){
|
||||||
devCountVO.setOnLineDevCount(0);
|
devCountVO.setOnLineDevCount(0);
|
||||||
@@ -185,6 +193,11 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
List<EventDetailVO> harmonic = data.stream().filter(temp -> temp.getType() == 1).collect(Collectors.toList());
|
List<EventDetailVO> harmonic = data.stream().filter(temp -> temp.getType() == 1).collect(Collectors.toList());
|
||||||
List<EventDetailVO> alarm = data.stream().filter(temp -> temp.getType() == 3).collect(Collectors.toList());
|
List<EventDetailVO> alarm = data.stream().filter(temp -> temp.getType() == 3).collect(Collectors.toList());
|
||||||
List<EventDetailVO> run = data.stream().filter(temp -> temp.getType() == 2).collect(Collectors.toList());
|
List<EventDetailVO> run = data.stream().filter(temp -> temp.getType() == 2).collect(Collectors.toList());
|
||||||
|
if(Objects.equals(userRole,AppRoleEnum.APP_VIP_USER.getCode())||Objects.equals(userRole,AppRoleEnum.TOURIST.getCode())
|
||||||
|
||Objects.equals(userRole,AppRoleEnum.MARKET_USER.getCode())){
|
||||||
|
devCountVO.setFeedBackCount(0);
|
||||||
|
|
||||||
|
}else {
|
||||||
CsFeedbackQueryParm csFeedbackQueryParm = new CsFeedbackQueryParm();
|
CsFeedbackQueryParm csFeedbackQueryParm = new CsFeedbackQueryParm();
|
||||||
csFeedbackQueryParm.setPageNum(1);
|
csFeedbackQueryParm.setPageNum(1);
|
||||||
csFeedbackQueryParm.setPageSize(100000);
|
csFeedbackQueryParm.setPageSize(100000);
|
||||||
@@ -192,6 +205,8 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
Page<CsFeedbackVO> data1 = feedBackFeignClient.queryFeedBackPage(csFeedbackQueryParm).getData();
|
Page<CsFeedbackVO> data1 = feedBackFeignClient.queryFeedBackPage(csFeedbackQueryParm).getData();
|
||||||
List<CsFeedbackVO> collect = data1.getRecords().stream().filter(temp -> !Objects.equals(temp.getUserId(), RequestUtil.getUserIndex())).collect(Collectors.toList());
|
List<CsFeedbackVO> collect = data1.getRecords().stream().filter(temp -> !Objects.equals(temp.getUserId(), RequestUtil.getUserIndex())).collect(Collectors.toList());
|
||||||
devCountVO.setFeedBackCount(collect.size());
|
devCountVO.setFeedBackCount(collect.size());
|
||||||
|
}
|
||||||
|
|
||||||
//todo 后续添加警告数,事件数
|
//todo 后续添加警告数,事件数
|
||||||
devCountVO.setEventCount(event.size());
|
devCountVO.setEventCount(event.size());
|
||||||
devCountVO.setAlarmCount(alarm.size());
|
devCountVO.setAlarmCount(alarm.size());
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.cssystem.service.impl;
|
package com.njcn.cssystem.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.mapper.CsFeedbackChatMapper;
|
||||||
import com.njcn.cssystem.pojo.param.CsFeedbackAuditParm;
|
import com.njcn.cssystem.pojo.param.CsFeedbackAuditParm;
|
||||||
import com.njcn.cssystem.pojo.param.CsFeedbackChatAddParm;
|
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.pojo.po.CsFeedbackPO;
|
||||||
import com.njcn.cssystem.service.CsFeedbackChatService;
|
import com.njcn.cssystem.service.CsFeedbackChatService;
|
||||||
import com.njcn.cssystem.service.CsFeedbackService;
|
import com.njcn.cssystem.service.CsFeedbackService;
|
||||||
|
import com.njcn.user.enums.AppRoleEnum;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
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.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,9 +56,17 @@ public class CsFeedbackChatServiceImpl extends ServiceImpl<CsFeedbackChatMapper,
|
|||||||
public Boolean updateChatStatus(CsFeedbackChatCheckParm csFeedbackChatCheckParm) {
|
public Boolean updateChatStatus(CsFeedbackChatCheckParm csFeedbackChatCheckParm) {
|
||||||
UpdateWrapper<CsFeedbackChatPO> updateWrapper = new UpdateWrapper<> ();
|
UpdateWrapper<CsFeedbackChatPO> updateWrapper = new UpdateWrapper<> ();
|
||||||
String userIndex = RequestUtil.getUserIndex();
|
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();
|
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 csFeedbackChatPO = new CsFeedbackChatPO ();
|
||||||
csFeedbackChatPO.setUserId(RequestUtil.getUserIndex());
|
csFeedbackChatPO.setUserId(RequestUtil.getUserIndex());
|
||||||
|
|||||||
Reference in New Issue
Block a user