16639036659
2023-06-26 28f6c716269ce5435b103137dd7ec1f1f9ab19ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.ruoyi.doublePrevention.service.baseService.impl;
 
import com.ruoyi.doublePrevention.entity.PreventRiskDangerCheckLog;
import com.ruoyi.doublePrevention.enums.E;
import com.ruoyi.doublePrevention.exception.AusinessException;
import com.ruoyi.doublePrevention.repository.PreventRiskDangerCheckLogRepository;
import com.ruoyi.doublePrevention.repository.param.HandlerReportParam;
import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerCheckLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("PreventRiskDangerCheckLogService")
public class PreventRiskDangerCheckLogServiceImpl implements PreventRiskDangerCheckLogService {
 
    @Autowired
    private PreventRiskDangerCheckLogRepository preventRiskDangerCheckLogRepository;
    /**
     * 定时生成排查任务记录时,
     * 插入排查记录附属表
     */
    @Override
    public int insertDangerCheckLog(PreventRiskDangerCheckLog dangerCheck) {
        return preventRiskDangerCheckLogRepository.insertDangerCheckLog(dangerCheck);
    }
    /**
     * 删除定时核查任务
     * */
    @Override
    public int deleteDangerCheck(Long checkId) {
        return  preventRiskDangerCheckLogRepository.deleteDangerCheck(checkId);
    }
 
 
    /**
     * 检索需要上报的任务记录
     * */
    @Override
    public List<PreventRiskDangerCheckLog> listReportTask() {
        return preventRiskDangerCheckLogRepository.listReportTask();
    }
    /**
     * 修改上报的数据状态
     * */
    @Override
    public int updateTaskReportStatus(HandlerReportParam handlerReportParam) {
        int result = preventRiskDangerCheckLogRepository.updateEventReportStatus(handlerReportParam);
        if (result < 1){
            throw new AusinessException(E.UPDATE_FAIL.getCode(), "安全风险事件-更新上报状态失败");
        }
        return result;
    }
    /**
     * 查询by checkId
     * */
    @Override
    public PreventRiskDangerCheckLog getByDangerCheckByCheckId(Long checkId) {
        return preventRiskDangerCheckLogRepository.getByDangerCheckByCheckId(checkId);
    }
 
    @Override
    public PreventRiskDangerCheckLog getByDangerCheckByJobId(Long jobId) {
        return preventRiskDangerCheckLogRepository.getByDangerCheckByJobId(jobId);
    }
 
    @Override
    public int updateCheckLog(Long checkId, Long mobileCode) {
        return preventRiskDangerCheckLogRepository.updateCheckLog(checkId, mobileCode);
    }
}