From 56c84cd7fb04407536eb0135162313029828a81f Mon Sep 17 00:00:00 2001
From: 16639036659 <577530412@qq.com>
Date: 星期一, 11 十二月 2023 10:14:41 +0800
Subject: [PATCH] 暂时提交

---
 src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java |   84 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 82 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java
index 64d1ef1..76d33b8 100644
--- a/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java
+++ b/src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java
@@ -1,15 +1,95 @@
 package com.ruoyi.doublePrevention.service.baseService.impl;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.ruoyi.doublePrevention.entity.PreventRiskEvent;
+import com.ruoyi.doublePrevention.enums.E;
+import com.ruoyi.doublePrevention.enums.StatusEnum;
+import com.ruoyi.doublePrevention.exception.AusinessException;
 import com.ruoyi.doublePrevention.repository.PreventRiskEventRepository;
+import com.ruoyi.doublePrevention.repository.param.HandlerReportParam;
 import com.ruoyi.doublePrevention.service.baseService.PreventRiskEventService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
-//@Service("PreventRiskEventService")
-public class PreventRiskEventServiceImpl extends ServiceImpl<PreventRiskEventRepository, PreventRiskEvent> implements PreventRiskEventService {
+@Service("PreventRiskEventService")
+public class PreventRiskEventServiceImpl implements PreventRiskEventService {
 
+    @Autowired
+    private PreventRiskEventRepository preventRiskEventRepository;
+
+    /**
+     * @description 新增风险控制事件
+     */
+    @Override
+    public int savePreventRiskEvent(PreventRiskEvent preventRiskEvent) {
+        return preventRiskEventRepository.savePreventRiskEvent(preventRiskEvent);
+    }
+
+
+    /**
+     * @description 根据主键id查询风险控制事件
+     */
+    @Override
+    public PreventRiskEvent getPreventRiskEventById(Long id) {
+        return preventRiskEventRepository.getPreventRiskEventById(id);
+    }
+
+    /**
+     * @description 根据时间名查询风险控制事件
+     */
+    @Override
+    public PreventRiskEvent getPreventRiskEventByEventName(String name) {
+        return preventRiskEventRepository.getPreventRiskEventByEventName(name);
+    }
+
+    /**
+     * @description 根据主键id删除风险控制事件
+     */
+    @Override
+    public int deletePreventRiskEventById(PreventRiskEvent preventRiskEvent) {
+        int deleteResult = preventRiskEventRepository.deletePreventRiskEventById(preventRiskEvent);
+        return deleteResult;
+    }
+
+    /**
+     * @description 根据主键id对风险控制事件进行修改
+     */
+    @Override
+    public int updatePreventRiskEventById(PreventRiskEvent preventRiskEvent) {
+        int updateResult = preventRiskEventRepository.updatePreventRiskEventById(preventRiskEvent);
+        return updateResult;
+    }
+
+    /**
+     * @description 根据条件批量获取风险控制事件
+     */
+    @Override
+    public List<PreventRiskEvent> listRiskEvenByCondition(Long riskUnitId, String riskEventName) {
+        return preventRiskEventRepository.listRiskEvenByCondition(riskUnitId,riskEventName);
+    }
+
+
+    /**
+     * 检索需要上报的风险控制事件
+     */
+    @Override
+    public List<PreventRiskEvent> listReportEvent() {
+        return preventRiskEventRepository.listReportEvent();
+    }
+    /**
+     * 安全风险事件-更新上报状态
+     */
+    @Override
+    public void updateEventReportStatus(HandlerReportParam handlerReportParam) {
+        int result = preventRiskEventRepository.updateEventReportStatus(handlerReportParam);
+        if (result < 1){
+            throw new AusinessException(E.UPDATE_FAIL.getCode(), "安全风险事件-更新上报状态失败");
+        }
+    }
 }

--
Gitblit v1.9.2