EmployeeController.java
1.58 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
package com.bsth.controller.schedule.basicinfo;
import com.bsth.common.ResponseCode;
import com.bsth.controller.schedule.BController;
import com.bsth.entity.Personnel;
import com.bsth.service.schedule.EmployeeService;
import com.bsth.service.schedule.ScheduleException;
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 java.util.HashMap;
import java.util.Map;
/**
* 人员基础信息Controller
*/
@RestController
@RequestMapping("ee")
public class EmployeeController extends BController<Personnel, Integer> {
@Autowired
private EmployeeService employeeService;
@RequestMapping(value = "/validate_gh", method = RequestMethod.GET)
public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) {
Map<String, Object> rtn = new HashMap<>();
try {
// 工号验证
Personnel personnel = new Personnel(
param.get("id_eq"),
param.get("companyCode_eq"),
param.get("jobCode_eq")
);
employeeService.validate_gh(personnel);
rtn.put("status", ResponseCode.SUCCESS);
} catch (ScheduleException exp) {
rtn.put("status", ResponseCode.ERROR);
rtn.put("msg", exp.getMessage());
}
return rtn;
}
}