zhangfeng
2023-07-22 ef406c4432c290f2627fa3742a1489e660dcc239
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
package com.gk.hotwork.Controller;
 
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gk.hotwork.Controller.Base.BaseController;
import com.gk.hotwork.Domain.SafetySelfInspection;
import com.gk.hotwork.Domain.SafetySelfInspectionItem;
import com.gk.hotwork.Domain.Utils.FilterObject;
import com.gk.hotwork.Domain.Utils.Msg;
import com.gk.hotwork.Domain.dto.resp.SafetySelfInspectionRespDTO;
import com.gk.hotwork.Service.SafetySelfInspectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
 
@Api(tags = "安全生产标准化_自查清单")
@RestController
@RequestMapping("/safetySelfInspection")
public class SafetySelfInspectionController extends BaseController {
 
    @Autowired
    private SafetySelfInspectionService safetySelfInspectionService;
 
    @ApiOperation("自排查分页")
    @PostMapping("/page")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageIndex",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页行数"),
            @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"),
            @ApiImplicitParam(name = "inspectorName",value = "检查人名称"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "inspectionStartTime",value = "开始时间"),
            @ApiImplicitParam(name = "inspectionEndTime",value = "结束时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
    })
    public Msg selectPage(@RequestBody FilterObject filterObject) {
        Integer pageIndex = filterObject.getPageIndex();
        Integer pageSize = filterObject.getPageSize();
        IPage page = safetySelfInspectionService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser());
        return success(page);
    }
    @ApiOperation("监管排查分页")
    @PostMapping("/supervise/page")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageIndex",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页行数"),
            @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"),
            @ApiImplicitParam(name = "inspectorName",value = "检查人名称"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "inspectionStartTime",value = "开始时间"),
            @ApiImplicitParam(name = "inspectionEndTime",value = "结束时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
    })
    public Msg selectSupervisePage(@RequestBody FilterObject filterObject) {
        Integer pageIndex = filterObject.getPageIndex();
        Integer pageSize = filterObject.getPageSize();
        IPage page = safetySelfInspectionService.selectSupervisePage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser());
        return success(page);
    }
 
    @ApiOperation("/自查清单详情")
    @PostMapping("/info")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "自查清单id"),
            @ApiImplicitParam(name = "unqualified",value = "不合格筛选"),
    })
    public Msg info(@RequestBody JSONObject jsonObject) {
        Long id = jsonObject.getLong("id");
        String unqualified = jsonObject.getString("unqualified");
        SafetySelfInspectionRespDTO safetySelfInspection= safetySelfInspectionService.infoOne(id,unqualified,getUser());
        return success(safetySelfInspection);
    }
 
    @ApiOperation("/自查清单结单")
    @PostMapping("/finish")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "自查清单id"),
    })
    public Msg finish(@RequestBody JSONObject jsonObject) {
        Long id = jsonObject.getLong("id");
        safetySelfInspectionService.finish(id, getUser());
        return success();
    }
 
 
 
    @ApiOperation("/自查清单详情_检查项详情")
    @PostMapping("/itemInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "自查清单检查项id"),
    })
    public Msg itemInfo(@RequestBody JSONObject jsonObject) {
        Long id = jsonObject.getLong("id");
        SafetySelfInspectionItem safetySelfInspectionItem= safetySelfInspectionService.itemInfoOne(id, getUser());
        return success(safetySelfInspectionItem);
    }
 
 
 
    @ApiOperation("/自查清单详情_检查项评审")
    @PostMapping("/modItemInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "safetyInspectionItemResult",value = "评审结果"),
            @ApiImplicitParam(name = "selfDeductionList",value = "扣分项集合"),
    })
    public Msg modItemInfo(@RequestBody SafetySelfInspectionItem param) {
        safetySelfInspectionService.modItemInfo(param, getUser());
        return success();
    }
    @ApiOperation("/添加专家")
    @PostMapping("/add/item/expert")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
    })
    public Msg addItemExpert(@RequestBody List<SafetySelfInspectionItem> itemList) {
        safetySelfInspectionService.addItemExpert(itemList, getUser());
        return success();
    }
 
 
    @ApiOperation("/新增")
    @PostMapping("/add")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"),
            @ApiImplicitParam(name = "inspector",value = "检查人id"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"),
            @ApiImplicitParam(name = "inspectionTime",value = "检查时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
            @ApiImplicitParam(name = "elementAList",value = "一级要素id"),
    })
    public Msg add(@RequestBody SafetySelfInspection param) {
        safetySelfInspectionService.addOne(param, getUser());
        return success();
    }
    @ApiOperation("/新增监管排查")
    @PostMapping("/add/supervise")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "inspectionName",value = "排查清单名称"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"),
            @ApiImplicitParam(name = "inspectionTime",value = "检查时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
            @ApiImplicitParam(name = "elementAList",value = "一级要素id"),
            @ApiImplicitParam(name = "expertList",value = "专家用户id"),
    })
    public Msg addSupervise(@RequestBody SafetySelfInspection param) {
        safetySelfInspectionService.addSupervise(param, getUser());
        return success();
    }
 
 
    @ApiOperation("/修改")
    @PostMapping("/mod")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "id"),
            @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"),
            @ApiImplicitParam(name = "inspector",value = "检查人id"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"),
            @ApiImplicitParam(name = "inspectionTime",value = "检查时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
    })
    public Msg mod(@RequestBody SafetySelfInspection param) {
        safetySelfInspectionService.modOne(param, getUser());
        return success();
    }
 
    @ApiOperation("/删除")
    @PostMapping("/del")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "id"),
    })
    public Msg mod(@RequestBody JSONObject jsonObject) {
        Long id = jsonObject.getLong("id");
        safetySelfInspectionService.delOne(id, getUser());
        return success();
    }
 
 
 
}