| | |
| | | package com.ruoyi.doublePrevention.service.baseService.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure; |
| | | import com.ruoyi.doublePrevention.enums.E; |
| | | import com.ruoyi.doublePrevention.exception.AusinessException; |
| | | import com.ruoyi.doublePrevention.repository.PreventRiskControlMeasureRepository; |
| | | import com.ruoyi.doublePrevention.repository.param.HandlerReportParam; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskControlMeasureService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("PreventRiskControlMeasureService") |
| | | public class PreventRiskControlMeasureServiceImpl implements PreventRiskControlMeasureService { |
| | | |
| | | @Autowired |
| | | private PreventRiskControlMeasureRepository preventRiskControlMeasureRepository; |
| | | |
| | | /** |
| | | * @description 新增风险控制措施 |
| | | */ |
| | | @Override |
| | | public int savePreventRiskControlMeasure(PreventRiskControlMeasure preventRiskControlMeasure) { |
| | | return preventRiskControlMeasureRepository.savePreventRiskControlMeasure(preventRiskControlMeasure); |
| | | } |
| | | |
| | | /** |
| | | * @description 根据主键id查询风险控制措施 |
| | | */ |
| | | @Override |
| | | public PreventRiskControlMeasure getPreventRiskControlMeasureById(Long id) { |
| | | return preventRiskControlMeasureRepository.getPreventRiskControlMeasureById(id); |
| | | } |
| | | |
| | | /** |
| | | * @description 根据主键id删除风险控制措施 |
| | | */ |
| | | @Override |
| | | public int deletePreventRiskControlMeasureById(PreventRiskControlMeasure preventRiskControlMeasure) { |
| | | int deleteResult = preventRiskControlMeasureRepository.deletePreventRiskControlMeasureById(preventRiskControlMeasure); |
| | | return deleteResult; |
| | | } |
| | | |
| | | /** |
| | | * @description 根据主键id对风险控制措施进行修改 |
| | | */ |
| | | @Override |
| | | public int updatePreventRiskControlMeasureById(PreventRiskControlMeasure preventRiskControlMeasure) { |
| | | int updateResult = preventRiskControlMeasureRepository.updatePreventRiskControlMeasureById(preventRiskControlMeasure); |
| | | return updateResult; |
| | | } |
| | | |
| | | /** |
| | | * @description 根据控制措施编号查询风险控制措施 |
| | | */ |
| | | @Override |
| | | public PreventRiskControlMeasure getPreventRiskControlMeasureByControlMeasureCode(String controlMeasureCode) { |
| | | return preventRiskControlMeasureRepository.getPreventRiskControlMeasureByControlMeasureCode(controlMeasureCode); |
| | | } |
| | | |
| | | /** |
| | | * @description 分页获取风险管控措施 |
| | | */ |
| | | @Override |
| | | public List<PreventRiskControlMeasure> listRiskControlMeasureByCondition(Byte controlType, Long riskEventId) { |
| | | return preventRiskControlMeasureRepository.listRiskControlMeasureByCondition(controlType,riskEventId); |
| | | } |
| | | |
| | | /** |
| | | * 管控措施-不分页查询 |
| | | */ |
| | | @Override |
| | | public List<PreventRiskControlMeasure> listRiskControlMeasure() { |
| | | return preventRiskControlMeasureRepository.listRiskControlMeasure(); |
| | | } |
| | | |
| | | @Override |
| | | public PreventRiskControlMeasure getPreventRiskControlMeasureByUuid(String riskMeasureId) { |
| | | return preventRiskControlMeasureRepository.getPreventRiskControlMeasureByUuid(riskMeasureId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 检索需要上报的风险管控措施 |
| | | */ |
| | | @Override |
| | | public List<PreventRiskControlMeasure> listReportMeasure() { |
| | | return preventRiskControlMeasureRepository.listReportMeasure(); |
| | | } |
| | | /** |
| | | * 修改上报的风险管控措施状态 |
| | | */ |
| | | @Override |
| | | public void updateMeasureReportStatus(HandlerReportParam handlerReportParam) { |
| | | int result = preventRiskControlMeasureRepository.updateMeasureReportStatus(handlerReportParam); |
| | | if (result < 1){ |
| | | throw new AusinessException(E.ADD_FAIL.getCode(), "修改管控措施状态失败"); |
| | | } |
| | | } |
| | | } |