双重预防项目-国泰新华二开定制版
16639036659
2024-06-12 a178e841dce630b39e6fada786df51b50b4c9506
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
package com.ruoyi.project.tr.specialCheck.controller;
 
import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure;
import com.ruoyi.doublePrevention.entity.dto.req.PreventRiskControlMeasureDeleteReqDTO;
import com.ruoyi.doublePrevention.vo.ResultVO;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.tr.riskList.domain.RiskList;
import com.ruoyi.project.tr.riskList.service.IRiskListService;
import com.ruoyi.project.tr.specialCheck.domin.BO.TbBaseCheckTaskBO;
import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckTaskLogBO;
import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckTaskLogUpdateBO;
import com.ruoyi.project.tr.specialCheck.domin.DTO.TbSpecialCheckTaskLogDTO;
import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckTask;
import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog;
import com.ruoyi.project.tr.specialCheck.service.SpecialCheckTaskService;
import com.ruoyi.project.tr.specialCheck.service.TbBaseCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 隐患列表Controller
 *
 * @date 2020-05-08
 */
@Controller
@RequestMapping("/tr/specialCheckTaskLog")
public class TBSpecialCheckTaskLogController extends BaseController
{
    private String prefix = "tr/specialCheckTaskLog";
 
    @Autowired
    private SpecialCheckTaskService specialCheckTaskService;
 
    @Autowired
    private IRiskListService riskListService;
 
    @Autowired
    private TbBaseCheckService tbBaseCheckService;
 
 
 
    @GetMapping()
    public String selectTbBaseCheckTaskPage(ModelMap mmap)
    {
        return prefix + "/specialCheckTaskLog";
    }
 
 
 
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo selectSpecialCheckTaskLogPage(@RequestBody TbSpecialCheckTaskLogBO specialCheckTaskLogBO)
    {
 
        ResultVO<List<TbSpecialCheckTaskLog>> resultVO = specialCheckTaskService.selectSpecialCheckTaskLogPage(specialCheckTaskLogBO);
        List<TbSpecialCheckTaskLogDTO> data = (List<TbSpecialCheckTaskLogDTO>) resultVO.getData();
        TableDataInfo dataTable = getDataTable(data);
        dataTable.setTotal(resultVO.getCount());
 
        return dataTable;
    }
 
    /**
     * 新增任务
     */
    @GetMapping("/add")
    public String add(ModelMap mmap)
    {
        ResultVO<List<RiskList>> resultVO = riskListService.listHazardSource();
        Object data = resultVO.getData();
        mmap.put("hazardList", data);
        return prefix + "/add";
    }
 
 
    /**
     * 新增任务保存
     */
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSpecialTask(@RequestBody TbSpecialCheckTaskLog tbSpecialCheckTaskLog){
 
        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.addSpecialTask(tbSpecialCheckTaskLog);
        String code = resultVO.getCode();
        if ("200".equals(code)){
            return toAjax(1);
        }else {
            return AjaxResult.error(resultVO.getMsg());
        }
    }
 
    @GetMapping("/edit/{id}")
    public String edit(@PathVariable("indexId") Long indexId, ModelMap mmap)
    {
        TbSpecialCheckTaskLog specialCheckTaskLogByIndexId = specialCheckTaskService.getSpecialCheckTaskLogByIndexId(indexId);
        mmap.put("specialCheckTaskLog",specialCheckTaskLogByIndexId);
 
        TbBaseCheckTaskBO tbBaseCheckTaskBO = new TbBaseCheckTaskBO();
        ResultVO<List<TbBaseCheckTask>> listResultVO = tbBaseCheckService.selectTbBaseCheckTaskPage(tbBaseCheckTaskBO);
        Object data = listResultVO.getData();
        mmap.put("tbBaseCheckTask", data);
        return prefix + "/edit";
    }
 
    /**
     * 修改保存
     */
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(@RequestBody TbSpecialCheckTaskLogUpdateBO updateBO)
    {
        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.updateSpecialCheckTaskLog(updateBO);
        String code = resultVO.getCode();
        if ("200".equals(code)){
            return toAjax(1);
        }else {
            return AjaxResult.error(resultVO.getMsg());
        }
    }
 
 
    @PostMapping("/remove")
    @ResponseBody
    public AjaxResult remove(@RequestBody TbSpecialCheckTaskLogUpdateBO updateBO){
        ResultVO<TbSpecialCheckTaskLog> resultVO = specialCheckTaskService.deleteTbSpecialCheckTaskLog(updateBO);
        String code = resultVO.getCode();
        if ("200".equals(code)){
            return toAjax(1);
        }else {
            return AjaxResult.error(resultVO.getMsg());
        }
    }
 
}