Explorar o código

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf hai 10 meses
pai
achega
009aad676b

+ 1 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -680,6 +680,7 @@ namespace OASystem.API.Controllers
 
                 #endregion
 
+
                 _sqlSugar.BeginTran();
                 var _dto = new GroupOperationDto();
                 _dto = _mapper.Map<GroupProcessOperationDto, GroupOperationDto>(dto);

+ 9 - 5
OASystem/OASystem.Infrastructure/Repositories/Groups/TourClientListRepository.cs

@@ -627,16 +627,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                 CreateUserId = _UserId
                             };
 
-                            var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnIdentityAsync();
-                            if (companyAdd < 0)
+                            var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnEntityAsync();
+                            if (companyAdd == null)
                             {
                                 _Msg += string.Format("{0} 公司信息添加失败!请前往客户信息确认!\r\n", clientName);
                             }
-                            companyId = companyAdd;
+                            _CustomerCompanies.Add(companyAdd);
+                            companyId = companyAdd.Id;
                         }
                     }
 
-                    Crm_DeleClient _DeleClient = new Crm_DeleClient() { 
+                    Crm_DeleClient _DeleClient = new Crm_DeleClient() {
+                        CrmCompanyId = companyId,
                         LastName = item.LastName,
                         FirstName = item.FirstName,
                         Pinyin = item.Pinyin,
@@ -651,6 +653,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
                                                                                  new
                                                                                  {
+                                                                                     it.CrmCompanyId,
                                                                                      it.LastName,
                                                                                      it.FirstName,
                                                                                      it.Sex,
@@ -760,7 +763,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         Pinyin = item.Pinyin,
                         Phone = item.Phone,
                         Sex = item.Sex,
-                        BirthDay = item.BirthDay == null ? null : Convert.ToDateTime(item.BirthDay),
+                        BirthDay =  string.IsNullOrEmpty(item.BirthDay) ? null : Convert.ToDateTime(item.BirthDay),
                         Job = item.Job,
                         CreateUserId = userId
                     };
@@ -833,6 +836,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (clientInfo != null)  //该客户存在 修改信息 
                     {
                         clientId = clientInfo.Id;
+                        _DeleClient.CrmCompanyId = crmCompanyId;
                         var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
                                                                                      new
                                                                                      {