From d1c3bbf6ddff76900f7fefbcd9fc4446e05ae977 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Thu, 18 Jul 2024 15:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8D=95=E8=AF=81id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/DataSync/DataSyncService.cs | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index fb0a786a..55a1b49a 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -2780,6 +2780,70 @@ namespace Myshipping.Application saveDto.ChangedFields = changeFileds; } + #region 处理操作、单证等人员ID + var sysUserList = await _repUser.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID).ToListAsync(); + + //销售 + if (!string.IsNullOrEmpty(saveDto.SALE)) + { + var sale = sysUserList.FirstOrDefault(x => x.Name == saveDto.SALE); + if (sale != null) + { + saveDto.SALEID = sale.Id.ToString(); + } + } + + //操作 + if (!string.IsNullOrEmpty(saveDto.OP)) + { + var operatorUser = sysUserList.FirstOrDefault(x => x.Name == saveDto.OP); + if (operatorUser != null) + { + saveDto.OPID = operatorUser.Id.ToString(); + } + } + + //客服 + if (!string.IsNullOrEmpty(saveDto.CUSTSERVICE)) + { + var custServiceUser = sysUserList.FirstOrDefault(x => x.Name == saveDto.CUSTSERVICE); + if (custServiceUser != null) + { + saveDto.CUSTSERVICEID = custServiceUser.Id.ToString(); + } + } + + //单证 + if (!string.IsNullOrEmpty(saveDto.DOC)) + { + var docUser = sysUserList.FirstOrDefault(x => x.Name == saveDto.DOC); + if (docUser != null) + { + saveDto.DOCID = docUser.Id.ToString(); + } + } + + //航线操作 + if (!string.IsNullOrEmpty(saveDto.ROUTE)) + { + var routeUser = sysUserList.FirstOrDefault(x => x.Name == saveDto.ROUTE); + if (routeUser != null) + { + saveDto.ROUTEID = routeUser.Id.ToString(); + } + } + + //航线管理 + if (!string.IsNullOrEmpty(saveDto.LineManage)) + { + var lineManageUser = sysUserList.FirstOrDefault(x => x.Name == saveDto.LineManage); + if (lineManageUser != null) + { + saveDto.LineManageID = lineManageUser.Id.ToString(); + } + } + #endregion + await _bookingorderservice.Save(saveDto); } #endregion