package com.gk.hotwork.doublePrevention.service.baseService.impl;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.gk.hotwork.Domain.Exception.E;
|
import com.gk.hotwork.Domain.Exception.BusinessException;
|
import com.gk.hotwork.doublePrevention.entity.PreventReportRiskEvent;
|
import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO;
|
import com.gk.hotwork.doublePrevention.repository.PreventReportRiskEventRepository;
|
import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam;
|
import com.gk.hotwork.doublePrevention.service.baseService.PreventReportRiskEventService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service("PreventReportRiskEventService")
|
public class PreventReportRiskEventServiceImpl
|
extends ServiceImpl<PreventReportRiskEventRepository, PreventReportRiskEvent> implements PreventReportRiskEventService {
|
|
@Autowired
|
private PreventReportRiskEventRepository preventReportRiskEventRepository;
|
|
/**
|
* 批量插入
|
* */
|
@Override
|
public int insert(List<PreventReportRiskEvent> eventLists) {
|
return preventReportRiskEventRepository.saveList(eventLists);
|
}
|
|
/**
|
* 分页查询
|
* */
|
@Override
|
public IPage<PreventReportRiskEvent> getReportRiskEventPage(Page<Object> objectPage, PreReportRiskEventQueryReqDTO queryReqDTO) {
|
return preventReportRiskEventRepository.getReportRiskEventPage(objectPage, queryReqDTO);
|
}
|
|
/**
|
* 插入
|
* */
|
@Override
|
public int insertEventLists(PreventReportRiskEvent event) {
|
int result = preventReportRiskEventRepository.insert(event);
|
if (result < 1){
|
throw new BusinessException(E.ADD_FAIL, "保存风险单元失败");
|
}
|
return result;
|
}
|
|
/**
|
* 上报数据-查询待上报数据
|
* */
|
@Override
|
public List<PreventReportRiskEvent> listReportEventDate() {
|
return preventReportRiskEventRepository.listReportEventDate();
|
}
|
|
/**
|
* 修改上报状态
|
* */
|
@Override
|
public int updateEventReportStatus(HandlerReportParam handlerReportParam) {
|
int result = preventReportRiskEventRepository.updateEventReportStatus(handlerReportParam);
|
if (result < 1){
|
throw new BusinessException(E.ADD_FAIL, "修改上报-事件状态失败");
|
}
|
return result;
|
}
|
|
@Override
|
public PreventReportRiskEvent getEventById(String id) {
|
return preventReportRiskEventRepository.getEventById(id);
|
}
|
|
@Override
|
public int updateEventById(PreventReportRiskEvent eventList) {
|
int result = preventReportRiskEventRepository.updateEventById(eventList);
|
if (result < 1){
|
throw new BusinessException(E.ADD_FAIL, "修改事件失败");
|
}
|
return result;
|
}
|
}
|