#
18516761980
2022-07-25 2c37b04bc0e5e2eae772166f514ff67113668f17
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
package com.slcf.controller;
 
import java.util.List;
import java.util.Map;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
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.slcf.pojo.UserBean;
import com.slcf.bean.WaitPakInLogCondition;
import com.slcf.pojo.WaitPakInLogBean;
import com.slcf.pojo.SysLogBean;
import com.slcf.service.WaitPakInLogService;
import com.slcf.util.AuthorityCode;
import com.slcf.service.RoleService;
import com.slcf.service.SysLogService;
 
/**
 * 入库通知历史档控制器层
 * @author admin
 * @date 2018年11月20日
 */
@Controller
@RequestMapping("/work")
public class WaitPakInLogController {
 
    @Resource
    WaitPakInLogService waitPakInLogService;
    @Autowired
    SysLogService sysLogService;
    @Autowired
    RoleService roleService;
 
    @RequestMapping("/goWaitPakInLog.action")
    public String goWaitPakInLogPage(HttpServletRequest request){
        try {
            String rid = request.getSession().getAttribute("ROLEID").toString();
            String authCode = roleService.getAuthListByRoleMenu(Integer.parseInt(rid),
                    AuthorityCode.WaitPakInLogCode);
            request.getSession().setAttribute("AUTHCODE",authCode);
            // 插入日志
            UserBean user = (UserBean) request.getSession().getAttribute("USER");
            SysLogBean sysLog = new SysLogBean();
            sysLog.setLogin_no(user.getUser_account());
            sysLog.setMachine_ip(request.getRemoteAddr());
            sysLog.setForm_no("goWaitPakInLog.action");
            sysLog.setTts_keyname("访问:入库通知历史档");
            sysLog.setModi_user(user.getUser_account());
            sysLogService.insertSysLog(sysLog);
        }catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return "waitPakInLog";
    }
 
    /**
     * 分页查询所有
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/waitPakInLogList.action")
    public Map<String,Object> queryWaitPakInLogListByPages(WaitPakInLogCondition waitPakInLogCon){
        Map<String,Object>map=waitPakInLogService.queryWaitPakInLogList(waitPakInLogCon);
        return map;
    }
 
    /**
     * 查询所有
     * @return
     */
    @ResponseBody
    @RequestMapping("/getWaitPakInLog.action")
    public List<WaitPakInLogBean> getWaitPakInLog(){
        try {
            return waitPakInLogService.getWaitPakInLogList();
        }catch(Exception e) {
            System.out.println(e.getMessage());
            return null;
        }
    }
 
    /**
     * 导出所有
     * @param response
     */
    @RequestMapping("/exportWaitPakInLog.action")
    public void ExportExcel(WaitPakInLogCondition waitPakInLogCondition, HttpServletResponse response, HttpServletRequest request){
        try {
            waitPakInLogService.ExportWaitPakInLogList(waitPakInLogCondition,response);
 
            // 插入日志
            UserBean user = (UserBean) request.getSession().getAttribute("USER");
            SysLogBean sysLog = new SysLogBean();
            sysLog.setLogin_no(user.getUser_account());
            sysLog.setMachine_ip(request.getRemoteAddr());
            sysLog.setForm_no("exportWaitPakInLog.action");
            sysLog.setTts_keyname("导出入库通知历史档到EXCEL");
            sysLog.setModi_user(user.getUser_account());
            sysLogService.insertSysLog(sysLog);
        }catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
 
}