PersonnelController.java
1.7 KB
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
package com.bsth.controller;
import com.bsth.common.Constants;
import com.bsth.data.pinyin.PersionPinYin;
import com.bsth.data.pinyin.PersionPinYinBuffer;
import com.bsth.entity.Personnel;
import com.bsth.entity.sys.CompanyAuthority;
import com.bsth.service.PersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* Created by xu on 16/6/15.
*/
@RestController
@RequestMapping("personnel")
public class PersonnelController extends BaseController<Personnel, Integer> {
@Autowired
private PersonnelService service;
@Autowired
PersionPinYinBuffer persionPinYinBuffer;
@RequestMapping(value = "/sreachPersonnel", method = RequestMethod.GET)
public List<Map<String, String>> sreachPersonnel(@RequestParam String jobCode) {
return service.sreachPersonnel(jobCode);
}
@RequestMapping(value = "/all_py", method = RequestMethod.GET)
public List<PersionPinYin> findAll_PY(){
persionPinYinBuffer.refresh();
return persionPinYinBuffer.getAll();
}
@RequestMapping(value = "/list_py", method = RequestMethod.GET)
public List<PersionPinYin> findByCurrUser_PY(HttpServletRequest request){
List<CompanyAuthority> auths = (List<CompanyAuthority>) request.getSession().getAttribute(Constants.COMPANY_AUTHORITYS);
return persionPinYinBuffer.getAll(auths);
}
}