郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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.ResultCodes;
import com.gkhy.safePlatform.commons.exception.BusinessException;
import com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventDangerCheckWorkQueryReqDTO;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventHandReportConfigReqDTO;
import com.gkhy.safePlatform.doublePrevention.repository.PreventDangerCheckWorkRepository;
import com.gkhy.safePlatform.doublePrevention.repository.param.CheckWorkAutoUpdateParams;
import com.gkhy.safePlatform.doublePrevention.repository.param.HandlerReportParam;
import com.gkhy.safePlatform.doublePrevention.repository.param.PreventDangerCheckWorkDeleteParams;
import com.gkhy.safePlatform.doublePrevention.repository.param.PreventDangerCheckWorkUpdateParams;
import com.gkhy.safePlatform.doublePrevention.service.baseService.PreventDangerCheckWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service("preventDangerCheckWorkService")
public class PreventDangerCheckWorkServiceImpl
        extends ServiceImpl<PreventDangerCheckWorkRepository, PreventDangerCheckWork> implements PreventDangerCheckWorkService {
 
    @Autowired
    private PreventDangerCheckWorkRepository preventDangerCheckWorkRepository;
 
    /**
     * 隐患排查作业-分页查询
     */
    @Override
    public IPage<PreventDangerCheckWork> getCheckWorkPage(Page<Object> page, PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) {
 
        return preventDangerCheckWorkRepository.getCheckWorkPage(page, workQueryReqDTO);
    }
    /**
     * 隐患排查作业-新增
     */
    @Override
    public int saveCheckWork(PreventDangerCheckWork checkWorkParams) {
        return preventDangerCheckWorkRepository.insert(checkWorkParams);
    }
 
    /**
     * 隐患排查作业-修改
     */
    @Override
    public int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams) {
        return preventDangerCheckWorkRepository.updateCheckWork(updateParams);
    }
 
    /**
     * 隐患排查作业-删除
     */
    @Override
    public int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams) {
        int deleteResult = preventDangerCheckWorkRepository.deleteCheckWork(deleteParams);
        if (deleteResult == 0){
            throw new BusinessException(ResultCodes.SERVER_DEL_ERROR);
        }
        return deleteResult;
    }
 
    /**
     * 隐患排查作业-根据作业名称查找
     */
    @Override
    public PreventDangerCheckWork getWorkByName(String checkWorkName) {
 
        return preventDangerCheckWorkRepository.getWorkByName(checkWorkName);
    }
 
    /**
     * 隐患排查作业-任务列表
     */
    @Override
    public List<PreventDangerCheckWork> listCheckWork() {
        return preventDangerCheckWorkRepository.listCheckWork();
    }
 
    /**
     * 隐患排查作业-根据任务单元查找
     */
    @Override
    public PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId) {
        return preventDangerCheckWorkRepository.getWorkByTaskUnitId(taskUnitId);
    }
 
    /**
     * 隐患排查作业-根据Id查找
     */
    @Override
    public PreventDangerCheckWork getWorkById(Long workId) {
        return preventDangerCheckWorkRepository.getWorkById(workId);
    }
 
    /**
     * 隐患排查作业  下次调度时间--上传调度时间
     * -根据Id
     */
    @Override
    public int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateWorkParams) {
        int result = preventDangerCheckWorkRepository.updateCheckWorkLastTimeAndNextTime(updateWorkParams);
 
        return result;
    }
 
    /**
     * 隐患排查作业 修改为调度中
     * -根据Id
     */
    @Override
    public void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams) {
        preventDangerCheckWorkRepository.updateCheckWorkStatus(updateParams);
    }
 
    /**
     * 隐患排查作业 重置作业状态
     */
    @Override
    public int resetWorkStatus(Long workId) {
        return preventDangerCheckWorkRepository.resetWorkStatus(workId);
    }
 
    /**
     * 隐患排查作业 查询可调度的列表
     */
    @Override
    public List<PreventDangerCheckWork> listScheduleCheckWork() {
        return preventDangerCheckWorkRepository.listScheduleCheckWork();
    }
    /**
     * 排查作业-手工上报-配置
     */
    @Override
    public int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) {
        return preventDangerCheckWorkRepository.updateCheckWorkReport(preventHandReportConfigReqDTO);
    }
 
 
    /**
     * 上报数据,任务配置检索
     */
    @Override
    public List<PreventDangerCheckWork> listReportWork() {
        return preventDangerCheckWorkRepository.listReportWork();
    }
    /**
     * 上报数据,任务配置上报状态变更
     */
    @Override
    public void updateWorkReportStatus(HandlerReportParam handlerReportParam) {
        int result = preventDangerCheckWorkRepository.updateWorkReportStatus(handlerReportParam);
        if (result == 0) {
            throw new BusinessException(ResultCodes.SERVER_UPDATE_ERROR);
        }
    }
}