浏览代码

工时管家 资源分配 出差 请假

yurk 3 年之前
父节点
当前提交
20e0bff2e0

+ 8 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -597,8 +597,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                                 .setDepartmentId(departmentId == null ? 0 : departmentId)
                                 .setDepartmentCascade(departmentId == null ?
                                         convertDepartmentIdToCascade(0) :
-                                        convertDepartmentIdToCascade(departmentId))
-                                .setInductionDate(LocalDate.parse(inductionDate,dtf));
+                                        convertDepartmentIdToCascade(departmentId));
+                        if(inductionDate!=null&&inductionDate!=""){
+                            user.setInductionDate(LocalDate.parse(inductionDate,dtf));
+                        }
                         if (userMapper.insert(user) == 0) {
                             httpRespMsg.setError("操作失败");
                         } else {
@@ -632,6 +634,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
 
                 String oldCostApplyDate = oldUser.getCostApplyDate();
+                if(inductionDate!=null&&inductionDate!=""){
+                    oldUser.setInductionDate(LocalDate.parse(inductionDate,dtf));
+                }
                 userMapper.updateById(oldUser
                         .setName(name)
                         .setPhone(phone)
@@ -645,8 +650,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                         .setDepartmentId(departmentId == null ? 0 : departmentId)
                         .setDepartmentCascade(departmentId == null ?
                                 convertDepartmentIdToCascade(0) :
-                                convertDepartmentIdToCascade(departmentId))
-                        .setInductionDate(LocalDate.parse(inductionDate,dtf)));
+                                convertDepartmentIdToCascade(departmentId)));
                 if (salaryChange) {
                     UserSalary userSalary = UserSalary.copyFromUser(oldUser);
                     userSalaryMapper.insert(userSalary);