Pu Zhibing
8 天以前 41d7465a87e2a52740936a5969c5b182e5eb09b3
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
package com.stylefeng.guns.modular.system.controller.checkCar;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.shiro.ShiroKit;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.beans.factory.annotation.Autowired;
import com.stylefeng.guns.core.log.LogObjectHolder;
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.TCheckCarExplain;
import com.stylefeng.guns.modular.system.service.ITCheckCarExplainService;
 
/**
 * 代检车说明内容管理控制器
 *
 * @author fengshuonan
 * @Date 2025-07-27 22:45:42
 */
@Controller
@RequestMapping("/tCheckCarExplain")
public class TCheckCarExplainController extends BaseController {
 
    private String PREFIX = "/system/tCheckCarExplain/";
 
    @Autowired
    private ITCheckCarExplainService tCheckCarExplainService;
 
    /**
     * 跳转到代检车说明内容管理首页
     */
    @RequestMapping("")
    public String index(Model model) {
        Integer branchOfficeId = -1;
        if (!ShiroKit.isAdmin()) {
            branchOfficeId = ShiroKit.getUser().getObjectId();
        }
        TCheckCarExplain tCheckCarExplain = tCheckCarExplainService.selectOne(new EntityWrapper<TCheckCarExplain>()
                .eq("branchOfficeId", branchOfficeId).last("limit 1"));
        model.addAttribute("item", tCheckCarExplain);
        return PREFIX + "tCheckCarExplain.html";
    }
 
    /**
     * 跳转到添加代检车说明内容管理
     */
    @RequestMapping("/tCheckCarExplain_add")
    public String tCheckCarExplainAdd() {
        return PREFIX + "tCheckCarExplain.html";
    }
 
    /**
     * 跳转到修改代检车说明内容管理
     */
    @RequestMapping("/tCheckCarExplain_update/{tCheckCarExplainId}")
    public String tCheckCarExplainUpdate(@PathVariable Integer tCheckCarExplainId, Model model) {
        TCheckCarExplain tCheckCarExplain = tCheckCarExplainService.selectById(tCheckCarExplainId);
        model.addAttribute("item",tCheckCarExplain);
        LogObjectHolder.me().set(tCheckCarExplain);
        return PREFIX + "tCheckCarExplain_edit.html";
    }
 
    /**
     * 获取代检车说明内容管理列表
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String condition) {
        return tCheckCarExplainService.selectList(null);
    }
    /**
     * 保存代检车说明内容管理
     */
    @RequestMapping(value = "/save")
    @ResponseBody
    public Object save(TCheckCarExplain tCheckCarExplain) {
        tCheckCarExplainService.saveOrUpdate(tCheckCarExplain);
        return SUCCESS_TIP;
    }
    /**
     * 新增代检车说明内容管理
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object add(TCheckCarExplain tCheckCarExplain) {
        tCheckCarExplainService.insert(tCheckCarExplain);
        return SUCCESS_TIP;
    }
 
    /**
     * 删除代检车说明内容管理
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete(@RequestParam Integer tCheckCarExplainId) {
        tCheckCarExplainService.deleteById(tCheckCarExplainId);
        return SUCCESS_TIP;
    }
 
    /**
     * 修改代检车说明内容管理
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update(TCheckCarExplain tCheckCarExplain) {
        tCheckCarExplainService.updateById(tCheckCarExplain);
        return SUCCESS_TIP;
    }
 
    /**
     * 代检车说明内容管理详情
     */
    @RequestMapping(value = "/detail/{tCheckCarExplainId}")
    @ResponseBody
    public Object detail(@PathVariable("tCheckCarExplainId") Integer tCheckCarExplainId) {
        return tCheckCarExplainService.selectById(tCheckCarExplainId);
    }
}