sunpengfei
2025-08-14 173a8e6a757e8c7c324d5d00cd1ec90d0f13d281
FlexJobApi.UserServer.Application/EnterpriseEmployees/Commands/EnterpriseEmployeesCommandHandler.cs
@@ -45,6 +45,7 @@
            var enterpriseEmployees = await rep.AsQueryable()
                .Where(it => it.EnterpriseId == logier.EnterpriseId && identities.Contains(it.Identity))
                .ToListAsync();
            var successList = new List<ImportEnterpriseEmployeesCommandModel>();
            foreach (var model in models)
            {
                var errors = new List<string>();
@@ -56,7 +57,7 @@
                {
                    errors.Add("请填写手机号");
                }
                else if (!model.ContactPhoneNumber.TryValidate(EnumValidationTypes.PhoneNumber).IsValid)
                else if (!model.ContactPhoneNumber.TryValidate(EnumValidationTypes.ValidPhoneNumber).IsValid)
                {
                    errors.Add("手机号格式不正确");
                }
@@ -64,11 +65,11 @@
                {
                    errors.Add("请填写身份证号");
                }
                else if (!model.Identity.TryValidate(EnumValidationTypes.Identity).IsValid)
                else if (!model.Identity.TryValidate(EnumValidationTypes.ValiIdentity).IsValid)
                {
                    errors.Add("身份证号格式不正确");
                }
                else if (models.Any(it => it.Identity == model.Identity))
                else if (successList.Any(it => it.Identity == model.Identity))
                {
                    errors.Add("身份证号重复");
                }
@@ -95,6 +96,7 @@
                            Age = model.Age,
                        };
                        await rep.InsertAsync(enterpriseEmployee);
                        successList.Add(model);
                    }
                    else
                    {
@@ -110,6 +112,7 @@
                            enterpriseEmployee.Birthday = model.Birthday;
                            enterpriseEmployee.Age = model.Age;
                            await rep.UpdateAsync(enterpriseEmployee);
                            successList.Add(model);
                        }
                    }
                }