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
package com.shlanbao.tzsc.pms.equ.fix.controller;
 
import javax.servlet.http.HttpServletRequest;
 
import org.apache.log4j.Logger;
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.mapping.EqmFixRec;
import com.shlanbao.tzsc.base.model.DataGrid;
import com.shlanbao.tzsc.base.model.Json;
import com.shlanbao.tzsc.base.model.PageParams;
import com.shlanbao.tzsc.pms.equ.fix.beans.EqmFixRecBean;
import com.shlanbao.tzsc.pms.equ.fix.service.EqmFixRecServiceI;
import com.shlanbao.tzsc.utils.tools.StringUtil;
 
/**
 * 设备维修记录
 * @author yangbo
 *
 */
@Controller
@RequestMapping("/pms/fixrec")
public class EqmFixRecController extends BaseController{
    protected Logger log = Logger.getLogger(this.getClass());
    
    @Autowired
    protected EqmFixRecServiceI eqmFixRecService;
    @RequestMapping("/gotoFixRec")
    public String gotoFixRec(){
        return "/pms/equ/fix/fixrec";
    }
    
    @RequestMapping("/gotoFixRecEdit")
    public String gotoFixRecEdit(String id,HttpServletRequest request){
        try {
            if(StringUtil.notNull(id))
                request.setAttribute("fixRecBean", eqmFixRecService.getFixRecById(id));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "/pms/equ/fix/fixrecEdit";
    }
    @RequestMapping("/gotoFixRecAdd")
    public String gotoFixRecAdd(){
        return "/pms/equ/fix/fixrecAdd";
    }
    
    @ResponseBody
    @RequestMapping("/addFixRec")
    public Json addFixRec(EqmFixRecBean eqmFixRecBean){
        Json json = new Json();
        try {
            eqmFixRecService.addFixRec(eqmFixRecBean);
            json.setMsg("操作成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            e.printStackTrace();
            json.setMsg("操作失败!");
            json.setSuccess(false);
        }
        return json;
    }
    
    @ResponseBody
    @RequestMapping("/queryFixRec")
    public DataGrid queryFixRec(EqmFixRecBean eqmFixRecBean,PageParams pageParams){
        try {
            DataGrid gd = eqmFixRecService.queryFixRec(eqmFixRecBean, pageParams);
            return gd;
        } catch (Exception e) {
            log.error("查询设备维修记录失败!", e);
        }
        return null;
    }
    
    @ResponseBody
    @RequestMapping("/deleteFixRec")
    public Json deleteFixRec(String id){
        Json json = new Json();
        try {
            eqmFixRecService.deleteFixRec(id);
            json.setMsg("操作成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            e.printStackTrace();
            json.setMsg("操作失败!");
            json.setSuccess(false);
        }
        return json;
    }
 
 
    /**
     * 批量删除
     * @param ids
     * @return
     */
    @ResponseBody
    @RequestMapping("/batchDeleteFixRec")
    public Json batchDeleteFixRec(String ids){
        Json json = new Json();
        try {
            eqmFixRecService.batchDeleteFixRec(ids);
            json.setMsg("操作成功!");
            json.setSuccess(true);
        } catch (Exception e) {
            e.printStackTrace();
            json.setMsg("操作失败!");
            json.setSuccess(false);
        }
        return json;
    }
}