|
@ -112,8 +112,9 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
|
112
|
112
|
resultMap.put("field3", response.getData().getField3()); // 审核意见
|
113
|
113
|
resultMap.put("field4", response.getData().getField4()); // 公司
|
114
|
114
|
|
115
|
|
resultMap.put("pictureUrl",uploadFileService.getFileUrl(response.getData().getField1(), minioConfig.getBucketHeaderImage()));
|
116
|
|
|
|
115
|
resultMap.put("pictureUrl",
|
|
116
|
uploadFileService.getFileUrl(response.getData().getField1(), minioConfig.getBucketHeaderImage()));
|
|
117
|
|
117
|
118
|
String employeePosition = response.getData().getMainJobPosition();
|
118
|
119
|
resultMap.put("employeePosition", employeePosition);
|
119
|
120
|
|
|
@ -128,8 +129,46 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
|
128
|
129
|
return CommonResponse.ok(resultMap);
|
129
|
130
|
}
|
130
|
131
|
|
|
132
|
/**
|
|
133
|
* 是否存在用户编码
|
|
134
|
* @param code
|
|
135
|
* @param id
|
|
136
|
* @return
|
|
137
|
* @return true:存在,false:不存在
|
|
138
|
*/
|
|
139
|
private boolean isExistEmployeeCode(String code, String id) {
|
|
140
|
if (StringUtils.isBlank(code)) {
|
|
141
|
return false;
|
|
142
|
}
|
|
143
|
|
|
144
|
UserDto userDto = new UserDto();
|
|
145
|
userDto.setCode(code);
|
|
146
|
CommonRequest<UserDto> request = new CommonRequest<UserDto>(userDto);
|
|
147
|
CommonResponse<List<Map<String, Object>>> response = userDtoQuery.queryWorkEmployeeByUserCode(request);
|
|
148
|
|
|
149
|
boolean result = false;
|
|
150
|
if (!CollectionUtils.isEmpty(response.getData())) {
|
|
151
|
if (StringUtils.isNotBlank(id)) {
|
|
152
|
for (Map<String, Object> map : response.getData()) {
|
|
153
|
if (code.equals(String.valueOf(map.get("code"))) && !id.equals(String.valueOf(map.get("id")))) {
|
|
154
|
result = true;
|
|
155
|
break;
|
|
156
|
}
|
|
157
|
}
|
|
158
|
} else {
|
|
159
|
result = true;
|
|
160
|
}
|
|
161
|
}
|
|
162
|
|
|
163
|
return result;
|
|
164
|
}
|
|
165
|
|
131
|
166
|
@Override
|
132
|
167
|
public CommonResponse<Void> createEmployee(EmployeeDto employeeDto) throws Exception {
|
|
168
|
if (isExistEmployeeCode(employeeDto.getCode(), null)) {
|
|
169
|
return CommonResponse.fail("501", "编号已存在");
|
|
170
|
}
|
|
171
|
|
133
|
172
|
employeeDto.setField2(EbcConstant.AUDIT_STATUS_INI);
|
134
|
173
|
CommonRequest<EmployeeDto> request = new CommonRequest<EmployeeDto>(employeeDto);
|
135
|
174
|
return employeeService.createWorkEmployee(request);
|
|
@ -137,6 +176,10 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
|
137
|
176
|
|
138
|
177
|
@Override
|
139
|
178
|
public CommonResponse<Void> modifyEmployee(EmployeeDto employeeDto) {
|
|
179
|
if (isExistEmployeeCode(employeeDto.getCode(), String.valueOf(employeeDto.getId()))) {
|
|
180
|
return CommonResponse.fail("501", "编号已存在");
|
|
181
|
}
|
|
182
|
|
140
|
183
|
employeeDto.setField2(EbcConstant.AUDIT_STATUS_INI);
|
141
|
184
|
CommonRequest<EmployeeDto> request = CommonRequest.<EmployeeDto>builder().data(employeeDto).build();
|
142
|
185
|
return employeeService.modifyEmployee(request);
|