zhuguifei
2026-03-10 2c1fd10c6fbabb8e9f0e9f07fe66fb36c008e883
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
package com.shlanbao.tzsc.pms.md.eqpparam.controller;
 
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import com.shlanbao.tzsc.base.controller.BaseController;
import com.shlanbao.tzsc.base.model.DataGrid;
import com.shlanbao.tzsc.base.model.Json;
import com.shlanbao.tzsc.pms.md.eqpparam.beans.EquipmentParamBean;
import com.shlanbao.tzsc.pms.md.eqpparam.service.EquipmentParamServiceI;
/**
 * 设备滚轴系数控制器
 * @author Leejean
 * @create 2014年11月25日下午1:22:01
 */
@Controller
@RequestMapping("/pms/eqpparam")
public class EquipmentParamController extends BaseController {
    @Autowired
    public EquipmentParamServiceI equipmentParamService;
    /**
     * 获得所有设备滚轴系数
     */
    @ResponseBody
    @RequestMapping("/getAllEquipmentParams")
    public DataGrid getAllEquipmentParams(EquipmentParamBean EquipmentParamBean){
        try {
            return equipmentParamService.getAllEquipmentParams(EquipmentParamBean);
        } catch (Exception e) {
            log.error("查询所有辅料系数异常", e);
        }
        return null;
    }
    /**
     * 跳转到设备滚轴系数新增页面
     */
    @RequestMapping("/goToEquipmentParamAddJsp")
    public String goToEquipmentParamAddJsp(String id){
        return "/pms/md/eqpparam/equipmentParamAdd";
    }
    /**
     * 新增设备滚轴系数
     */
    @ResponseBody
    @RequestMapping("/addEquipmentParam")
    public Json addEquipmentParam(EquipmentParamBean EquipmentParamBean){
        Json json=new Json();
        try {
            equipmentParamService.addEquipmentParam(EquipmentParamBean);
            json.setMsg("新增辅料系数成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            log.error(message, e);
            json.setMsg("新增辅料系数失败!");
            json.setSuccess(false);
        }
        return json;
    }
    /**
     * 跳转到设备滚轴系数编辑页面
     */
    @RequestMapping("/goToEquipmentParamEditJsp")
    public String goToEquipmentParamEditJsp(HttpServletRequest request,String id){
        try {
            request.setAttribute("eqppparam", equipmentParamService.getEquipmentParamById(id));
        } catch (Exception e) {
            log.error("获取ID:"+id+"的辅料系数失败", e);
        }
        return "/pms/md/eqpparam/equipmentParamEdit";
    }
    /**
     * 编辑设备滚轴系数
     */
    @ResponseBody
    @RequestMapping("/editEquipmentParam")
    public Json editEquipmentParam(EquipmentParamBean EquipmentParamBean){
        Json json=new Json();
        try {
            equipmentParamService.editEquipmentParam(EquipmentParamBean);
            json.setMsg("编辑辅料系数成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            log.error(message, e);
            json.setMsg("编辑辅料系数失败!");
        }
        return json;
    }
    /**
     * 删除设备滚轴系数
     */
    @ResponseBody
    @RequestMapping("/deleteEquipmentParam")
    public Json deleteEquipmentParam(String id){
        Json json=new Json();
        try {
            equipmentParamService.deleteEquipmentParam(id);
            json.setMsg("删除辅料系数成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            log.error(message, e);
            json.setMsg("删除辅料系数失败!");
        }
        return json;
    }
 
    /**
     * 批量删除设备滚轴系数
     */
    @ResponseBody
    @RequestMapping("/batchDeleteEquipmentParam")
    public Json batchDeleteEquipmentParam(String ids){
        Json json=new Json();
        try {
            equipmentParamService.batchDeleteEquipmentParam(ids);
            json.setMsg("删除辅料系数成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            log.error(message, e);
            json.setMsg("删除辅料系数失败!");
        }
        return json;
    }
}