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.Enum.ResultCodes;
|
import com.gk.hotwork.Domain.Exception.BusinessException;
|
import com.gk.hotwork.Domain.Exception.BusinessException;
|
import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventDangerRectifyQueryReqDTO;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRectifyOverQueryReqDTO;
|
import com.gk.hotwork.doublePrevention.repository.PreventDangerRectifyRepository;
|
import com.gk.hotwork.doublePrevention.repository.param.*;
|
import com.gk.hotwork.doublePrevention.service.baseService.PreventDangerRectifyService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
@Service("PreventDangerRectifyService")
|
public class PreventDangerRectifyServiceImpl
|
extends ServiceImpl<PreventDangerRectifyRepository, PreventDangerRectify> implements PreventDangerRectifyService {
|
|
@Autowired
|
private PreventDangerRectifyRepository preventDangerRectifyRepository;
|
|
/**
|
* 隐患整改清单-分页查询
|
*/
|
@Override
|
public IPage<PreventDangerRectify> getDangerRectifyPage(Page<Object> page, PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) {
|
return preventDangerRectifyRepository.getDangerRectifyPage(page, rectifyQueryReqDTO);
|
}
|
|
/**
|
* 隐患整改清单-已整改-分页查询
|
*/
|
@Override
|
public IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) {
|
return preventDangerRectifyRepository.getRectifyOverPage(objectPage, rectifyOverQueryReqDTO);
|
}
|
|
/**
|
* 隐患整改清单-新增
|
*/
|
@Override
|
public int saveDangerRectify(PreventDangerRectify dangerRectify) {
|
int result = preventDangerRectifyRepository.insert(dangerRectify);
|
if (result == 0) {
|
throw new BusinessException(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 BusinessException(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<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) {
|
return preventDangerRectifyRepository.getDangerRectifyPageToOverRectify(objectPage, rectifyOverQueryReqDTO);
|
}
|
}
|