|
@@ -301,11 +301,9 @@ public class AcsService {
|
|
|
if (msg.contains("下发人脸成功") && msg.contains("但是有异常情况")) {
|
|
|
return "更新人脸失败,请检查照片大小和";
|
|
|
} else {
|
|
|
- if (user != null) {
|
|
|
- user.setPhotoUpdateTime(LocalDateTime.now());
|
|
|
- user.setPhotoUrl(photoUrl);
|
|
|
- userService.updateUser((BeanUtils.toBean(user, UserSaveReqVO.class)));
|
|
|
- }
|
|
|
+ user.setPhotoUpdateTime(LocalDateTime.now());
|
|
|
+ user.setPhotoUrl(photoUrl);
|
|
|
+ userService.updateUser((BeanUtils.toBean(user, UserSaveReqVO.class)));
|
|
|
return "更新人脸成功";
|
|
|
}
|
|
|
} else {//考勤及里面没用户
|
|
@@ -326,11 +324,9 @@ public class AcsService {
|
|
|
String msg = addFaceByUrl(userNumber, photoUrl);
|
|
|
if (msg.contains("下发人脸成功") && msg.contains("但是有异常情况")) {
|
|
|
} else {
|
|
|
- if (user != null) {
|
|
|
- user.setPhotoUpdateTime(LocalDateTime.now());
|
|
|
- user.setPhotoUrl(photoUrl);
|
|
|
- userService.updateUser((BeanUtils.toBean(user, UserSaveReqVO.class)));
|
|
|
- }
|
|
|
+ user.setPhotoUpdateTime(LocalDateTime.now());
|
|
|
+ user.setPhotoUrl(photoUrl);
|
|
|
+ userService.updateUser((BeanUtils.toBean(user, UserSaveReqVO.class)));
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
throw new RuntimeException(e);
|
|
@@ -415,20 +411,21 @@ public class AcsService {
|
|
|
attendanceImportRespVO respVO = attendanceImportRespVO.builder().createUsernames(new ArrayList<>())
|
|
|
.existUsernames(new ArrayList<>()).failureUsernames(new LinkedHashMap<>()).build();
|
|
|
importUsers.forEach(importUser -> {
|
|
|
-
|
|
|
try {
|
|
|
- String result = getUser(importUser.getEmployeeNo());
|
|
|
+ if (importUser.getEmployeeNo()!=null&&importUser.getName()!=null) {
|
|
|
+ String result = getUser(importUser.getEmployeeNo());
|
|
|
Gson gson = new Gson();
|
|
|
- JsonObject jsonObject = gson.fromJson(result, JsonObject.class);
|
|
|
- JsonArray userInfoArray = jsonObject
|
|
|
- .getAsJsonObject("UserInfoSearch")
|
|
|
- .getAsJsonArray("UserInfo");
|
|
|
- if (userInfoArray==null) {//没有userInfo
|
|
|
- UserManage.addUserInfo(lUserID, importUser.getEmployeeNo(), importUser.getName());
|
|
|
- respVO.getCreateUsernames().add(importUser.getName());
|
|
|
- }else{
|
|
|
- respVO.getExistUsernames().add(importUser.getName());
|
|
|
- }
|
|
|
+ JsonObject jsonObject = gson.fromJson(result, JsonObject.class);
|
|
|
+ JsonArray userInfoArray = jsonObject
|
|
|
+ .getAsJsonObject("UserInfoSearch")
|
|
|
+ .getAsJsonArray("UserInfo");
|
|
|
+ if (userInfoArray == null) {//没有userInfo
|
|
|
+ UserManage.addUserInfo(lUserID, importUser.getEmployeeNo(), importUser.getName());
|
|
|
+ respVO.getCreateUsernames().add(importUser.getName());
|
|
|
+ } else {
|
|
|
+ respVO.getExistUsernames().add(importUser.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (UnsupportedEncodingException | InterruptedException | JSONException e) {
|
|
|
throw new RuntimeException("添加用户信息失败: " + e.getMessage(), e);
|
|
|
}
|