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.PreventReportDangerInfo; import com.gk.hotwork.doublePrevention.entity.dto.report.req.PreventReportDangerInfoReqDTO; import com.gk.hotwork.doublePrevention.repository.PreventReportDangerInfoRepository; import com.gk.hotwork.doublePrevention.repository.param.HandlerReportParam; import com.gk.hotwork.doublePrevention.service.baseService.PreventReportDangerInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("PreventReportDangerInfoService") public class PreventReportDangerInfoServiceImpl extends ServiceImpl implements PreventReportDangerInfoService { @Autowired private PreventReportDangerInfoRepository preventReportDangerInfoRepository; /** * 插入隐患信息 * */ @Override public int insert(PreventReportDangerInfo danger) { return preventReportDangerInfoRepository.insert(danger); } /** * 上报数据-隐患信息-分页查询 */ @Override public IPage getReportDangerInfoPage(Page objectPage, PreventReportDangerInfoReqDTO queryReqDTO) { return preventReportDangerInfoRepository.getReportDangerInfoPage(objectPage, queryReqDTO); } /** * 上报数据-待上报数据查询 */ @Override public List listReportDangerDate() { return preventReportDangerInfoRepository.listReportDangerDate(); } /** * 上报数据-待上报状态变更 */ @Override public void updateTaskReportStatus(HandlerReportParam handlerReportParam) { int result = preventReportDangerInfoRepository.updateTaskReportStatus(handlerReportParam); if (result < 0){ throw new BusinessException(E.UPDATE_FAIL, "隐患信息状态变更失败"); } } @Override public PreventReportDangerInfo getDangerById(String id) { return preventReportDangerInfoRepository.getDangerById(id); } @Override public int updateDangerById(PreventReportDangerInfo danger) { int result = preventReportDangerInfoRepository.updateDangerById(danger); if (result < 0){ throw new BusinessException(E.UPDATE_FAIL, "隐患信息状态变更失败"); } return result; } }