zhuguifei
2026-03-10 58402bd5e762361363a0f7d7907153c77dbb819f
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
package com.shlanbao.tzsc.pms.qm.self.controller;
 
import java.util.ArrayList;
import java.util.List;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
 
import com.shlanbao.tzsc.base.mapping.QmOutward;
import com.shlanbao.tzsc.utils.tools.LogAnno;
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.alibaba.fastjson.JSON;
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.base.model.PageParams;
import com.shlanbao.tzsc.base.model.SessionInfo;
import com.shlanbao.tzsc.pms.qm.self.beans.QmAppearanceDataBean;
import com.shlanbao.tzsc.pms.qm.self.beans.QmOutWandBean;
import com.shlanbao.tzsc.pms.qm.self.beans.QmSelfCheckStripBean;
import com.shlanbao.tzsc.pms.qm.self.service.QmOutWandService;
import com.shlanbao.tzsc.pms.qm.self.service.QmSelfCheckStripService;
import com.shlanbao.tzsc.utils.tools.StringUtil;
import com.shlanbao.tzsc.utils.tools.WebContextUtil;
 
/**
 * 外观质量检验记录控制器
 * <li>@author luther.zhang
 * <li>@create 2015-01-05
 */
@Controller
@RequestMapping("/pms/selfCheckStrip")
public class QmSelfCheckStripController extends BaseController{
    @Autowired
    private QmSelfCheckStripService service;
    @Autowired
    private QmOutWandService qmWardService;
    /** 查询*/
    @ResponseBody
    @RequestMapping("/getList")
    public DataGrid getList(QmSelfCheckStripBean bean,PageParams pageParams){
        try {
            DataGrid grid = service.queryList(bean,pageParams);
            return grid;
        } catch (Exception e) {
            log.error(message, e);
        }
        return null;
    }
 
    /**
     * 查询外观检测记录
     * @param bean
     * @param pageParams
     * @return
     */
    @ResponseBody
    @RequestMapping("/getOutWandList")
    public DataGrid getOutWandList(HttpSession session, QmOutWandBean bean,PageParams pageParams){
        try {
            /**
             * sts: 0 质检员数据
             * sts:1 班长数据
             * sts:2 已反馈MES数据
             *
             *   班长可以看到所有用户数据
             *   质检员只能看到自己数据
             * */
            SessionInfo loginBean = (SessionInfo) session.getAttribute("sessionInfo");
            if(StringUtil.notEmpty(bean.getSts())){ // sts 不为空 表示外观巡检查询
                if("0".equals(bean.getSts()) && !"1".equals(loginBean.getUser().getId())){
                    //通过登录用户ID过滤
 
                    if(loginBean!=null){
                        bean.setUid(loginBean.getUser().getId());
                        DataGrid grid = qmWardService.queryList(bean,pageParams);
                        return grid;
                    }
                }else{
                    bean.setSts(null);
                    //无需过滤
                    DataGrid grid = qmWardService.queryList(bean,pageParams);
                    return grid;
                }
            }else{
                //表示查询外观自检查询
                DataGrid grid = qmWardService.queryList(bean,pageParams);
                return grid;
            }
        } catch (Exception e) {
            log.error(message, e);
        }
        return null;
    }
 
    /**
     * 删除自检数据
     * @author  sunzhen
     *
     */
    @ResponseBody
    @RequestMapping("/deleteOutWand")
    public Json deleteOutWand(String id,HttpServletRequest request){
        Json json=new Json();
        try {
            String result = qmWardService.deleteOutWand(id,request);
            json.setSuccess(true);
            json.setMsg(result);
        } catch (Exception e) {
            json.setMsg(message);
        }
        return json;
    }
 
    /**
     * 批量删除自检数据
     * @author  sunzhen
     *
     */
    @ResponseBody
    @RequestMapping("/beatchDeleteOutWand")
    public Json beatchDeleteOutWand(String id,HttpServletRequest request){
        Json json=new Json();
        try {
            String result = qmWardService.beatchDeleteOutWand(id,request);
            json.setSuccess(true);
            json.setMsg(result);
        } catch (Exception e) {
            json.setMsg(message);
        }
        return json;
    }
 
    /**
     * 外观巡检 修改状态
     *
     *    反馈班长:修改状态1
     *    班长回退:修改状态0
     * @param ids
     * @param sts
     * @return
     */
    @ResponseBody
    @RequestMapping("/updateQmOutWardByIds")
    public Json updateQmOutWardByIds(String ids,String sts){
        Json json=new Json();
        try {
            qmWardService.updateQmOutWardByIds(ids,sts);
            json.setSuccess(true);
            json.setMsg("反馈成功!");
        } catch (Exception e) {
            json.setMsg("反馈失败!!!");
        }
        return json;
    }
 
    /**
     * 查询详细
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/getOutWandDelList")
    public List<QmOutWandBean> getOutWandList(String id){
        try {
            return qmWardService.queryDel(id);
        } catch (Exception e) {
            log.error(message, e);
        }
        return null;
    }
 
    /**
     * 反馈物理外观缺陷
     * @param id
     * @return
     * shisihai
     */
    @ResponseBody
    @RequestMapping("/sendMsg")
    public Json outWardResult(String id,String param){
        Json json=new Json();
        try {
            qmWardService.sendMsg(id,param);
            json.setSuccess(true);
            json.setMsg("反馈MES成功!");
        } catch (Exception e) {
            json.setMsg(message);
        }
        return json;
    }
    /**
     * 跳转外观质量数据添加界面
     *
     * Rengj
     */
    @RequestMapping("/goToAddQualityDateJsp")
    public String goToAddFixUserJsp(String temp){
        if("bz".equals(temp)){
            return "/pms/quality/self/qualityDateBzAdd";
        }else if("jy".equals(temp)){
            return "/pms/quality/self/qualityDateJyAdd";
        }else if("xz".equals(temp)){
            return "/pms/quality/self/qualityDateXzAdd";
        }else{
            return "/pms/quality/self/qualityDateCxAdd";
        }
    }
 
    /**
     * 根据机台及时间查询工单信息
     * Rengj
     */
    @ResponseBody
    @RequestMapping("/queryOrderNumber")
    public String queryOrderNumber(String eqp,HttpServletRequest request){
        try {
            //Json json=new Json();
            List<QmOutWandBean> list;
            SessionInfo info = (SessionInfo) WebContextUtil.getSessionValue(request.getSession(), WebContextUtil.SESSION_INFO);//用户信息
            if(info!=null){
                list = qmWardService.queryOrderNumber(eqp,info,request);
                return JSON.toJSONString(list);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
 
    /**
     * 跳转缺陷类型添加界面
     *
     * Rengj
     */
    @RequestMapping("/bzDefectItems")
    public String bzDefectItems(){
        return "/pms/quality/self/bzDefectItems";
    }
    /**
     * 跳转缺陷类型添加界面
     *
     * Rengj
     */
    @RequestMapping("/xzDefectItems")
    public String xzDefectItems(){
        return "/pms/quality/self/xzDefectItems";
    }
    /**
     * 跳转缺陷类型添加界面
     *
     * Rengj
     */
    @RequestMapping("/jyDefectItems")
    public String jyDefectItems(){
        return "/pms/quality/self/jyDefectItems";
    }
    /**
     * 跳转缺陷类型添加界面
     *
     * Rengj
     */
    @RequestMapping("/cxDefectItems")
    public String cxDefectItems(){
        return "/pms/quality/self/cxDefectItems";
    }
    /**
     * 保存缺陷
     *
     * Rengj
     */
    @ResponseBody
    @RequestMapping("/saveOutWandDes")
    public Json saveOutWandDes(QmAppearanceDataBean bean, HttpServletRequest request){
        Json json=new Json();
        try {
            qmWardService.saveOutWandDes(bean,request);
            json.setSuccess(true);
            json.setMsg("保存成功");
        } catch (Exception e) {
 
            log.error(message, e);
        }
        return json;
    }
 
    /**
     * 查询缺陷
     * Rengj
     */
    @ResponseBody
    @RequestMapping("/getOutWandDesList")
    public DataGrid getOutWandDesList(QmOutWandBean bean, HttpServletRequest request,PageParams pageParams){
        try {
             return qmWardService.queryOutWandDes(bean, request, pageParams);
        } catch (Exception e) {
            log.error(message, e);
        }
        return null;
    }
 
    /**
     * 跳转更改缺陷检测时间界面
     *
     * Rengj
     */
    @RequestMapping("/goToEditCheckTime")
    public String goToEditCheckTime(String ids,HttpServletRequest request){
        request.getSession().setAttribute("selfIds", ids);
        return "/pms/quality/self/checkTimeEdit";
    }
 
 
    /**
     * 跳转编辑
     * @param id
     * @param request
     * @return
     */
    @RequestMapping("/goToEdit")
    public String goToEdit(String id,HttpServletRequest request){
        QmOutWandBean qmOutward = qmWardService.queryById(id);
        request.setAttribute("qmOutward", qmOutward);
        return "/pms/quality/self/patrolCheckEdit";
    }
 
 
    /**
     * 编辑
     * @return
     */
    @ResponseBody
    @RequestMapping("/edit")
    public Json edit(QmOutWandBean qmOutWandBean,HttpServletRequest request){
        String result ="";
        Json json = new Json();
        try {
            result = qmWardService.edit(qmOutWandBean);
            json.setSuccess(true);
            json.setMsg(result);
        } catch (Exception e) {
            log.error("外观缺陷过品管巡检", e);
            json.setMsg(result);
        }
        return json;
    }
 
    /**
     * 保存修改检测时间
     * @author Rengj
     * @return
     */
    @ResponseBody
    @RequestMapping("/addCheckTime")
    public Json addCheckTime(String stim,String etim,HttpServletRequest request){
         String result ="";
        Json json = new Json();
        try {
            String ids= String.valueOf(request.getSession().getAttribute("selfIds"));
            result = qmWardService.updateCheckTimes(stim, ids);
            json.setSuccess(true);
            json.setMsg(result);
            request.getSession().removeAttribute("selfIds");
        } catch (Exception e) {
            log.error("修改运行时间", e);
            json.setMsg(result);
        }
        return json;
    }
}