package com.gkhy.safePlatform.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.gkhy.safePlatform.commons.enums.E; import com.gkhy.safePlatform.commons.exception.AusinessException; import com.gkhy.safePlatform.doublePrevention.entity.PreventReportRiskEvent; import com.gkhy.safePlatform.doublePrevention.entity.dto.report.req.PreReportRiskEventQueryReqDTO; import com.gkhy.safePlatform.doublePrevention.repository.PreventReportRiskEventRepository; import com.gkhy.safePlatform.doublePrevention.repository.param.HandlerReportParam; import com.gkhy.safePlatform.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 implements PreventReportRiskEventService { @Autowired private PreventReportRiskEventRepository preventReportRiskEventRepository; /** * 分页查询 * */ @Override public IPage getReportRiskEventPage(Page objectPage, PreReportRiskEventQueryReqDTO queryReqDTO) { return preventReportRiskEventRepository.getReportRiskEventPage(objectPage, queryReqDTO); } /** * 插入 * */ @Override public int insertEventLists(PreventReportRiskEvent event) { int result = preventReportRiskEventRepository.insert(event); if (result < 1){ throw new AusinessException(E.ADD_FAIL, "保存风险单元失败"); } return result; } /** * 上报数据-查询待上报数据 * */ @Override public List listReportEventDate() { return preventReportRiskEventRepository.listReportEventDate(); } /** * 修改上报状态 * */ @Override public int updateEventReportStatus(HandlerReportParam handlerReportParam) { int result = preventReportRiskEventRepository.updateEventReportStatus(handlerReportParam); if (result < 1){ throw new AusinessException(E.ADD_FAIL, "修改上报-事件状态失败"); } return result; } }