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.enums.ResultCodes; import com.gkhy.safePlatform.commons.exception.AusinessException; import com.gkhy.safePlatform.commons.exception.BusinessException; import com.gkhy.safePlatform.doublePrevention.entity.PreventDangerManage; import com.gkhy.safePlatform.doublePrevention.entity.PreventDangerRectify; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventDangerRectifyQueryReqDTO; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventDangerRectifyUpdateReqDTO; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO; import com.gkhy.safePlatform.doublePrevention.repository.PreventDangerRectifyRepository; import com.gkhy.safePlatform.doublePrevention.repository.param.*; import com.gkhy.safePlatform.doublePrevention.service.baseService.PreventDangerRectifyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("PreventDangerRectifyService") public class PreventDangerRectifyServiceImpl extends ServiceImpl implements PreventDangerRectifyService { @Autowired private PreventDangerRectifyRepository preventDangerRectifyRepository; /** * 隐患整改清单-分页查询 */ @Override public IPage getDangerRectifyPage(Page page, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) { return preventDangerRectifyRepository.getDangerRectifyPage(page, rectifyQueryReqDTO); } /** * 隐患整改清单-已整改-分页查询 */ @Override public IPage getRectifyOverPage(Page objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { return preventDangerRectifyRepository.getRectifyOverPage(objectPage, rectifyOverQueryReqDTO); } /** * 隐患整改清单-新增 */ @Override public int saveDangerRectify(PreventDangerRectify dangerRectify) { int result = preventDangerRectifyRepository.insert(dangerRectify); if (result == 0) { throw new AusinessException(E.ADD_FAIL, "新增失败"); } return result; } /** * 隐患整改清单-修改 */ @Override public int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams) { int result = preventDangerRectifyRepository.updateDangerRectify(updateParams); return result; } /** * 隐患整改清单-删除 */ @Override public int deleteDangerRectify(PreventDeleteParams deleteParams) { int result = preventDangerRectifyRepository.deleteDangerRectify(deleteParams); if (result == 0) { throw new AusinessException(E.NOT_DELETE, "删除失败"); } return result; } /** * 隐患整改清单-整改验收报告 */ @Override public int applyReport(PreventDangerReportRectifyUpdayeParams reportParams) { return preventDangerRectifyRepository.applyReport(reportParams); } /** * 隐患整改清单-验收 */ @Override public int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams) { return preventDangerRectifyRepository.reportRectify(reportParams); } /** * 隐患整改清单-根据隐患单Code查询 */ @Override public PreventDangerRectify getRectifyByCode(String dangerCode) { return preventDangerRectifyRepository.getRectifyByCode(dangerCode); } /** * 隐患整改清单-延期 */ @Override public int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams) { return preventDangerRectifyRepository.updateRectifyTime(updateParams); } /** * 隐患整改清单-根据ID查询 */ @Override public PreventDangerRectify getRectifyById(Long id) { return preventDangerRectifyRepository.getRectifyById(id); } /** * 隐患整改清单-关闭整改单 */ @Override public int closeDanger(CloseDangerParams closeDangerParams) { return preventDangerRectifyRepository.closeDanger(closeDangerParams); } /** * 隐患整改清单-根据ManageID查询 */ @Override public PreventDangerRectify getRectifyByManageId(Long manageId) { return preventDangerRectifyRepository.getRectifyByManageId(manageId); } /** * 隐患整改清单-根据ManageID查询-包含删除数据 */ @Override public PreventDangerRectify getRectifyByManageIdForReport(Long manageId) { return preventDangerRectifyRepository.getRectifyByManageIdForReport(manageId); } /** * 隐患整改清单-变更上报状态 */ @Override public void updateRectifyReportStatus(HandlerReportParam handlerReportParam) { int result = preventDangerRectifyRepository.updateRectifyReportStatus(handlerReportParam); if (result == 0) { throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR); } } @Override public IPage getDangerRectifyPageToOverRectify(Page objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) { return preventDangerRectifyRepository.getDangerRectifyPageToOverRectify(objectPage, rectifyOverQueryReqDTO); } }