#
18516761980
2021-08-16 f25c800bca726b67ea74e6ed576b038b1b9561a7
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.slcf.controller;
 
import java.util.List;
import java.util.Map;
 
import javax.annotation.Resource;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import com.slcf.pojo.UserBean;
import com.slcf.pojo.WorkMastLogBean;
import com.slcf.bean.WorkDetailLogCondition;
import com.slcf.bean.WorkMastLogCondition;
import com.slcf.pojo.SysLogBean;
import com.slcf.service.WorkFileLogService;
import com.slcf.util.AuthorityCode;
import com.slcf.service.RoleService;
import com.slcf.service.SysLogService;
 
/**
 * 工作历史档控制器层
 * @author admin
 * @date 2018年11月23日
 */
@Controller
@RequestMapping("/work")
public class WorkFileLogController {
 
    @Resource
    WorkFileLogService workFileLogService;
    @Autowired
    SysLogService sysLogService;
    @Autowired
    RoleService roleService;
    
    @RequestMapping("/goWorkFileLog.action")
    public String goWorkFileLogPage(HttpServletRequest request){
        try {
            String rid = request.getSession().getAttribute("ROLEID").toString();
            String authCode = roleService.getAuthListByRoleMenu(Integer.parseInt(rid), 
                    AuthorityCode.WorkFileLogCode);
            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("goWorkFileLog.action");
            sysLog.setTts_keyname("访问:工作历史档");
            sysLog.setModi_user(user.getUser_account());
            sysLogService.insertSysLog(sysLog);
        }catch (Exception e) {
            System.out.println(e.getMessage());
        }
        return "workFileLog";
    }
    
    /**
     * 分页查询主档
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/workMastLogList.action")
    public Map<String,Object> queryWorkMastLogListByPages(WorkMastLogCondition workMastLogCon){                
        Map<String,Object>map=workFileLogService.queryWorkMastLogList(workMastLogCon);
        return map;
    }
    
    /**
     * 分页查询明细
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/workDetailLogList.action")
    public Map<String,Object> queryWorkDetailLogListByPages(WorkDetailLogCondition workDetailLogCon){
        if(workDetailLogCon.getWrk_no()==null || "".equals(workDetailLogCon.getWrk_no())) {
            return null;
//            locationCon.setLoc_no("1");
        }
        Map<String,Object>map=workFileLogService.queryWorkDetailLogList(workDetailLogCon);
        return map;
    }
    
    
    /**
     * 根据id查询信息
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping("/queryWorkMastLogById.action")
    public WorkMastLogBean queryWorkMastLogById(@RequestParam("did")int id){
        WorkMastLogBean workMast = new WorkMastLogBean();
        try {
            workMast = workFileLogService.queryWorkMastLogById(id);
        }catch(Exception e) {
            System.out.println(e.getMessage());
            return null;
        }
        return workMast;
    }
    
    /**
     * 查询所有
     * @return
     */
    @ResponseBody
    @RequestMapping("/getWorkMastLog.action")
    public List<WorkMastLogBean> getWorkMast(){
        try {
            return workFileLogService.getWorkMastLogList();
        }catch(Exception e) {
            System.out.println(e.getMessage());
            return null;
        }        
    }
    
}