暂降事件
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/4 15:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEventUserPOService extends IService<CsEventUserPO>{
|
||||
|
||||
|
||||
Integer queryEventCount(CsEventUserQueryParam csEventUserQueryParam);
|
||||
|
||||
List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
||||
import com.njcn.csharmonic.mapper.CsEventUserPOMapper;
|
||||
import com.njcn.csharmonic.service.impl.CsEventUserPOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/4 15:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, CsEventUserPO> implements CsEventUserPOService{
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
@@ -16,4 +18,7 @@ import java.util.List;
|
||||
public interface EventService {
|
||||
|
||||
List<EntData> queryEvent(EventQueryDTO eventQueryDTO);
|
||||
|
||||
|
||||
List<EventDetailVO> queryEventList(CsEventUserQueryParam csEventUserQueryParam);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csharmonic.mapper.CsEventPOMapper;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||
import com.njcn.csharmonic.service.impl.CsEventPOService;
|
||||
import com.njcn.csharmonic.service.CsEventPOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/4 15:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEventUserPOService extends IService<CsEventUserPO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventUserPO;
|
||||
import com.njcn.csharmonic.mapper.CsEventUserPOMapper;
|
||||
import com.njcn.csharmonic.service.CsEventUserPOService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/4 15:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, CsEventUserPO> implements CsEventUserPOService{
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
@Override
|
||||
public Integer queryEventCount(CsEventUserQueryParam csEventUserQueryParam) {
|
||||
csEventUserQueryParam.setUserId(RequestUtil.getUserIndex());
|
||||
Integer integer = this.getBaseMapper().queryEventCount(csEventUserQueryParam);
|
||||
return integer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventDetailVO> queryUserEventList(CsEventUserQueryParam csEventUserQueryParam) {
|
||||
csEventUserQueryParam.setUserId(RequestUtil.getUserIndex());
|
||||
if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())){
|
||||
/*获取所有暂态事件类型*/
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData();
|
||||
List<String> collect = data.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
csEventUserQueryParam.setTarget(collect);
|
||||
}
|
||||
List<EventDetailVO> list = this.getBaseMapper().queryUserEventList(csEventUserQueryParam);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,30 @@ package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.NjcnBeanUtil;
|
||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||
import com.njcn.csharmonic.service.CsEventUserPOService;
|
||||
import com.njcn.csharmonic.service.EventService;
|
||||
import com.njcn.influx.pojo.dto.EventDataSetDTO;
|
||||
import com.njcn.influx.pojo.dto.EventQueryDTO;
|
||||
import com.njcn.influx.pojo.po.cs.EntData;
|
||||
import com.njcn.influx.service.EvtDataService;
|
||||
import com.njcn.system.api.EleEvtFeignClient;
|
||||
import com.njcn.system.api.EpdFeignClient;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -29,8 +41,11 @@ import java.util.stream.Collectors;
|
||||
public class EventServiceImpl implements EventService {
|
||||
private final EvtDataService evtDataService;
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
private final CsLedgerFeignClient csLedgerFeignClient;
|
||||
|
||||
private final EpdFeignClient epdFeignClient;
|
||||
private final CsEventUserPOService csEventUserPOService;
|
||||
private final EleEvtFeignClient eleEvtFeignClient;
|
||||
|
||||
@Override
|
||||
public List<EntData> queryEvent(EventQueryDTO eventQueryDTO) {
|
||||
@@ -49,4 +64,33 @@ public class EventServiceImpl implements EventService {
|
||||
List<EntData> eventData = evtDataService.getEventData(eventQueryDTO);
|
||||
return eventData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventDetailVO> queryEventList(CsEventUserQueryParam csEventUserQueryParam) {
|
||||
|
||||
List<EventDetailVO> list = csEventUserPOService.queryUserEventList(csEventUserQueryParam);
|
||||
list.forEach(temp->{
|
||||
DevDetailDTO devDetail = csLedgerFeignClient.queryDevDetail(temp.getDeviceId()).getData();
|
||||
temp.setEquipmentName(devDetail.getEquipmentName());
|
||||
temp.setProjectId(devDetail.getProjectId());
|
||||
temp.setProjectName(devDetail.getProjectName());
|
||||
temp.setEngineeringid(devDetail.getEngineeringid());
|
||||
temp.setEngineeringName(devDetail.getEngineeringName());
|
||||
EleEpdPqd data = epdFeignClient.findByName(temp.getTag()).getData();
|
||||
List<EleEvtParm> data1 = eleEvtFeignClient.queryByPid(data.getId()).getData();
|
||||
List<EventDataSetDTO> eventDataSetDTOS = new ArrayList<>();
|
||||
for (EleEvtParm eleEvtParm : data1) {
|
||||
EventDataSetDTO eventDataSetDTO = new EventDataSetDTO();
|
||||
BeanUtils.copyProperties(eleEvtParm,eventDataSetDTO);
|
||||
EventDataSetDTO evtData = evtDataService.getEventDataSet("evt_data", temp.getId(), eleEvtParm.getName());
|
||||
eventDataSetDTO.setValue(evtData.getValue());
|
||||
eventDataSetDTOS.add(eventDataSetDTO);
|
||||
}
|
||||
temp.setDataSet(eventDataSetDTOS);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user