双重预防项目-国泰新华二开定制版
马宇豪
2024-06-13 bce5ddaccb8cb6107c1fe039dfa42c3a62ea2a66
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
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";
//    }
    @GetMapping("{id}")
    public String specialCheckTaskLog(@PathVariable("id")String id,ModelMap modelMap)
    {
        modelMap.put("id",id);
        return prefix + "/specialCheckTaskLog";
    }
 
 
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo selectSpecialCheckTaskLogPage(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)
    {
        List<RiskList> riskList = riskListService.listHazardSource();
        mmap.put("hazardList", riskList);
        return prefix + "/add";
    }
 
 
    /**
     * 新增任务保存
     */
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSpecialTask(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/{indexId}")
    public String edit(@PathVariable("indexId") Long indexId, ModelMap mmap)
    {
        TbSpecialCheckTaskLog specialCheckTaskLogByIndexId = specialCheckTaskService.getSpecialCheckTaskLogByIndexId(indexId);
        mmap.put("specialCheckTaskLog",specialCheckTaskLogByIndexId);
 
        List<TbBaseCheckTask> listResult = tbBaseCheckService.listTbBaseCheckTask();
        mmap.put("tbBaseCheckTask", listResult);
        return prefix + "/edit";
    }
 
    /**
     * 修改保存
     */
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(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(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());
        }
    }
 
}