|
@ -44,8 +44,8 @@ public class EmployeeManagementController {
|
44
|
44
|
*/
|
45
|
45
|
@ResponseBody
|
46
|
46
|
@RequestMapping("/queryEmployeeList")
|
47
|
|
public CommonResponse<PageBean<Map<String, Object>>> queryEmployeeList(@ModelAttribute AttendanceReport attendanceReport)
|
48
|
|
throws Exception {
|
|
47
|
public CommonResponse<PageBean<Map<String, Object>>> queryEmployeeList(
|
|
48
|
@ModelAttribute AttendanceReport attendanceReport) throws Exception {
|
49
|
49
|
// 当前页数
|
50
|
50
|
int pageNumber = attendanceReport.getPageNumber() < 1 ? 1 : attendanceReport.getPageNumber();
|
51
|
51
|
// 每页条数
|
|
@ -84,8 +84,17 @@ public class EmployeeManagementController {
|
84
|
84
|
@ResponseBody
|
85
|
85
|
@RequestMapping("/createEmployee")
|
86
|
86
|
public CommonResponse<Void> createEmployee(@RequestBody EmployeeDto employeeDto) throws Exception {
|
87
|
|
if (employeeDto == null || StringUtils.isEmpty(employeeDto.getName())||StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
|
88
|
|
return CommonResponse.fail("500", "新增失败");
|
|
87
|
if (employeeDto == null) {
|
|
88
|
return CommonResponse.fail("500", "员工信息新增失败,参数为空");
|
|
89
|
}
|
|
90
|
if (StringUtils.isEmpty(employeeDto.getName())) {
|
|
91
|
return CommonResponse.fail("500", "员工信息新增失败,项目为空");
|
|
92
|
}
|
|
93
|
if (StringUtils.isEmpty(employeeDto.getCode())) {
|
|
94
|
return CommonResponse.fail("500", "员工信息新增失败,编号为空");
|
|
95
|
}
|
|
96
|
if (StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
|
|
97
|
return CommonResponse.fail("500", "员工信息新增失败,部门为空");
|
89
|
98
|
}
|
90
|
99
|
|
91
|
100
|
return employeeManagementService.createEmployee(employeeDto);
|
|
@ -100,8 +109,20 @@ public class EmployeeManagementController {
|
100
|
109
|
@ResponseBody
|
101
|
110
|
@RequestMapping("/modifyEmployee")
|
102
|
111
|
public CommonResponse<Void> modifyEmployee(@RequestBody EmployeeDto employeeDto) throws Exception {
|
103
|
|
if (employeeDto == null || employeeDto.getId() == null || StringUtils.isEmpty(employeeDto.getName())) {
|
104
|
|
return CommonResponse.fail("500", "修改失败");
|
|
112
|
if (employeeDto == null) {
|
|
113
|
return CommonResponse.fail("500", "员工信息修改失败,参数为空");
|
|
114
|
}
|
|
115
|
if (employeeDto.getId() == null) {
|
|
116
|
return CommonResponse.fail("500", "员工信息修改失败,主键为空");
|
|
117
|
}
|
|
118
|
if (StringUtils.isEmpty(employeeDto.getName())) {
|
|
119
|
return CommonResponse.fail("500", "员工信息修改失败,项目为空");
|
|
120
|
}
|
|
121
|
if (StringUtils.isEmpty(employeeDto.getCode())) {
|
|
122
|
return CommonResponse.fail("500", "员工信息修改失败,编号为空");
|
|
123
|
}
|
|
124
|
if (StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
|
|
125
|
return CommonResponse.fail("500", "员工信息修改失败,部门为空");
|
105
|
126
|
}
|
106
|
127
|
|
107
|
128
|
return employeeManagementService.modifyEmployee(employeeDto);
|
|
@ -132,9 +153,8 @@ public class EmployeeManagementController {
|
132
|
153
|
*/
|
133
|
154
|
@ResponseBody
|
134
|
155
|
@RequestMapping("/uploadEmployeePicture")
|
135
|
|
public CommonResponse<Map<String, String>> uploadEmployeePicture(
|
136
|
|
@RequestParam(value = "file") MultipartFile meFile, @RequestParam(required = false) String pictureUrl)
|
137
|
|
throws Exception {
|
|
156
|
public CommonResponse<Map<String, String>> uploadEmployeePicture(@RequestParam(value = "file") MultipartFile meFile,
|
|
157
|
@RequestParam(required = false) String pictureUrl) throws Exception {
|
138
|
158
|
if (meFile == null || StringUtils.isEmpty(meFile.getOriginalFilename())) {
|
139
|
159
|
return CommonResponse.fail("500", "上传失败");
|
140
|
160
|
}
|
|
@ -153,11 +173,12 @@ public class EmployeeManagementController {
|
153
|
173
|
@ResponseBody
|
154
|
174
|
@RequestMapping("/auditEmployeePicture")
|
155
|
175
|
public CommonResponse<Void> auditEmployeePicture(@RequestBody EmployeeDto employeeDto) throws Exception {
|
156
|
|
if (employeeDto.getId()==null||employeeDto.getId()<0||StringUtils.isEmpty(employeeDto.getField2())) {
|
|
176
|
if (employeeDto.getId() == null || employeeDto.getId() < 0 || StringUtils.isEmpty(employeeDto.getField2())) {
|
157
|
177
|
return CommonResponse.fail("500", "审核失败");
|
158
|
178
|
}
|
159
|
179
|
|
160
|
|
return employeeManagementService.auditEmployeePicture(employeeDto.getId(),employeeDto.getField2(),employeeDto.getField3());
|
|
180
|
return employeeManagementService.auditEmployeePicture(employeeDto.getId(), employeeDto.getField2(),
|
|
181
|
employeeDto.getField3());
|
161
|
182
|
}
|
162
|
183
|
|
163
|
184
|
/**
|