From 6b07145af6a204a9149fa646c6989e9b18161c87 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 9 Sep 2024 16:44:34 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B7=BB=E5=8A=A0QQ?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7=E8=88=AA=E7=BA=BF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/Dtos/CodeDataRuleTemplateReq.cs | 57 +++++++++++++++ .../Code/Dtos/CodeDataRuleTemplateRes.cs | 56 +++++++++++++++ .../DS.WMS.Core/Code/Entity/CodeDataRule.cs | 72 ++++++++++++++++++- .../Interface/IDataRuleTemplateService.cs | 46 ++++++++++++ .../DS.WMS.Core/Sys/Dtos/UserReq.cs | 11 +-- .../DS.WMS.Core/Sys/Dtos/UserSelectRes.cs | 7 ++ .../DS.WMS.Core/Sys/Dtos/UserViewModel.cs | 12 ++-- .../DS.WMS.Core/Sys/Entity/SysUser.cs | 6 +- .../DS.WMS.Core/Sys/Method/UserService.cs | 51 +------------ 9 files changed, 259 insertions(+), 59 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateReq.cs create mode 100644 ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateRes.cs create mode 100644 ds-wms-service/DS.WMS.Core/Code/Interface/IDataRuleTemplateService.cs diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateReq.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateReq.cs new file mode 100644 index 00000000..35c447a6 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateReq.cs @@ -0,0 +1,57 @@ +using DS.Module.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Code.Dtos +{ + /// + /// 数据权限模板请求 + /// + public class CodeDataRuleTemplateReq + { + /// + /// 主键Id + /// + public long Id { get; set; } + /// + /// 模板名称 + /// + public string TemplateName { get; set; } + /// + /// 资源标识(权限ID) + /// + public long PermissionId { get; set; } + + /// + /// 权限实体 + /// + public string PermissionEntity { get; set; } + /// + /// 中文视图名 + /// + public string ColumnView { get; set; } + + /// + /// 权限规则 + /// + public string DataRules { get; set; } + + /// + /// 数据权限描述 + /// + public string Description { get; set; } + /// + /// 状态 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + + /// + /// 排序号 + /// + public int OrderNo { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateRes.cs b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateRes.cs new file mode 100644 index 00000000..a915ad3b --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Dtos/CodeDataRuleTemplateRes.cs @@ -0,0 +1,56 @@ +using DS.Module.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Code.Dtos +{ + /// + /// 数据权限模板返回 + /// + public class CodeDataRuleTemplateRes + { + /// + /// 主键Id + /// + public long Id { get; set; } + /// + /// 模板名称 + /// + public string TemplateName { get; set; } + /// + /// 资源标识(权限ID) + /// + public long PermissionId { get; set; } + + /// + /// 权限实体 + /// + public string PermissionEntity { get; set; } + /// + /// 中文视图名 + /// + public string ColumnView { get; set; } + + /// + /// 权限规则 + /// + public string DataRules { get; set; } + + /// + /// 数据权限描述 + /// + public string Description { get; set; } + /// + /// 状态 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + + /// + /// 排序号 + /// + public int OrderNo { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeDataRule.cs b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeDataRule.cs index 41e55610..0d3e5ad5 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Entity/CodeDataRule.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Entity/CodeDataRule.cs @@ -1,4 +1,7 @@ -using System; +using DS.Module.Core; +using DS.Module.Core.Data; +using SqlSugar; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +9,72 @@ using System.Threading.Tasks; namespace DS.WMS.Core.Code.Entity { - internal class CodeDataRule + /// + /// 数据权限 + /// + [SqlSugar.SugarTable("code_data_rule", "数据权限")] + internal class CodeDataRule : BaseModel { + /// + /// 模板ID + /// + [SugarColumn(ColumnDescription = "模板ID")] + public long TemplateId { get; set; } + /// + /// 模板名称 + /// + [SqlSugar.SugarColumn(ColumnDescription = "模板名称", IsNullable = false, Length = 200)] + public string TemplateName { get; set; } + /// + /// 资源标识(权限ID) + /// + [SugarColumn(ColumnDescription = "资源标识(权限ID)")] + public long PermissionId { get; set; } + + /// + /// 权限实体 + /// + [SqlSugar.SugarColumn(ColumnDescription = "权限实体", IsNullable = false, Length = 100)] + public string PermissionEntity { get; set; } + /// + /// 中文视图名 + /// + [SqlSugar.SugarColumn(ColumnDescription = "中文视图名", IsNullable = true, Length = 50)] + public string ColumnView { get; set; } + + /// + /// 权限规则 + /// + [SugarColumn(ColumnDescription = "权限规则", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)] + public string DataRules { get; set; } + + /// + /// 数据权限描述 + /// + [SqlSugar.SugarColumn(ColumnDescription = "数据权限描述", IsNullable = true, Length = 200)] + public string Description { get; set; } + + /// + /// 用户Id + /// + [SugarColumn(ColumnDescription = "用户Id")] + public long UserId { get; set; } + + /// + /// 用户名称 + /// + [SqlSugar.SugarColumn(ColumnDescription = "用户名称", IsNullable = true, Length = 100)] + public string UserName { get; set; } + /// + /// 状态 + /// + [SqlSugar.SugarColumn(ColumnDescription = "状态")] + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + + /// + /// 排序号 + /// + [SqlSugar.SugarColumn(ColumnDescription = "排序号", IsNullable = true, DefaultValue = "100")] + public int OrderNo { get; set; } } } diff --git a/ds-wms-service/DS.WMS.Core/Code/Interface/IDataRuleTemplateService.cs b/ds-wms-service/DS.WMS.Core/Code/Interface/IDataRuleTemplateService.cs new file mode 100644 index 00000000..fe7f8b09 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Code/Interface/IDataRuleTemplateService.cs @@ -0,0 +1,46 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.WMS.Core.Code.Dtos; +using DS.WMS.Core.Sys.Dtos; + +namespace DS.WMS.Core.Code.Interface; + +public interface IDataRuleTemplateService +{ + /// + /// 列表 + /// + /// + /// + DataResult> GetListByPage(PageRequest request); + + + /// + /// 编辑 + /// + /// + /// + DataResult EditDataRuleTemplate(CodeDataRuleTemplateReq model); + + /// + /// 获取详情 + /// + /// + /// + DataResult GetDataRuleTemplateInfo(string id); + + /// + /// 批量删除 + /// + /// + /// + public DataResult BatchDelDataRuleTemplate(IdModel req); + + /// + /// 根据权限id获取数据权限模板 + /// + /// + /// + + DataResult> GetDataRuleTemplateSelectList(string id); +} \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs index ab4fbcb6..4194fb11 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserReq.cs @@ -161,10 +161,7 @@ public class UserReq [Description("英文名称")] public string UserEnName { get; set; } - /// - /// 用戶航线 - /// - public long?[] LaneIds { get; set; } + /// /// 是否航线操作人员 /// @@ -211,6 +208,12 @@ public class UserReq /// [Description("身份证号")] public string IdCardNo { get; set; } + + /// + /// QQ + /// + [Description("QQ")] + public string QQ { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserSelectRes.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserSelectRes.cs index 460ceeb3..a5647d60 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserSelectRes.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserSelectRes.cs @@ -1,3 +1,5 @@ +using System.ComponentModel; + namespace DS.WMS.Core.Sys.Dtos; /// @@ -79,4 +81,9 @@ public class UserSelectRes /// 邮件签名 /// public string SignatureHtml { get; set; } = ""; + /// + /// QQ + /// + [Description("QQ")] + public string QQ { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs index 44d95072..1547076f 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Dtos/UserViewModel.cs @@ -178,10 +178,7 @@ public class UserViewModel [Description("英文名称")] public string UserEnName { get; set; } - /// - /// 用戶航线 - /// - public long?[] LaneIds { get; set; } + /// /// 业务来源Id /// @@ -233,4 +230,11 @@ public class UserViewModel /// 用户角色 /// public string RoleName { get; set; } + + + /// + /// QQ + /// + [Description("QQ")] + public string QQ { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs index 069a92ba..372fa3b2 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Entity/SysUser.cs @@ -106,7 +106,11 @@ public class SysUser : UserTenantModel /// [Description("邮箱")] public string Email { get; set; } - + /// + /// QQ + /// + [Description("QQ")] + public string QQ { get; set; } /// /// 职位 /// diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/UserService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/UserService.cs index 9b7bbcfa..cdddd38f 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/UserService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/UserService.cs @@ -82,8 +82,7 @@ public class UserService : IUserService var roleIds = db.Queryable().Where(x => x.UserId == long.Parse(id)).Select(x => x.RoleId).ToArray(); var orgIds = db.Queryable().Where(x => x.UserId == long.Parse(id)).Select(x => x.OrgId).ToArray(); - var laneIds = db.Queryable().Where(x => x.UserId == long.Parse(id)).Select(x => x.LaneId).ToArray(); - + var data = db.Queryable() .Where(x => x.Id == long.Parse(id)) .Select() @@ -91,7 +90,6 @@ public class UserService : IUserService { it.RoleIds = roleIds; it.OrgIds = orgIds; - it.LaneIds = laneIds; }) .First(); return DataResult.Success(data,MultiLanguageConst.DataQuerySuccess); @@ -169,18 +167,6 @@ public class UserService : IUserService db.Insertable(orgUser).ExecuteCommand(); } } - if (model.LaneIds.IsNotNull() && model.LaneIds.Count() > 0) - { - foreach (var item in model.LaneIds) - { - var laneUser = new SysUserLane - { - LaneId = item, - UserId = entity.Id, - }; - db.Insertable(laneUser).ExecuteCommand(); - } - } return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess); } else @@ -251,35 +237,7 @@ public class UserService : IUserService } } #endregion 处理用户机构 - - #region 处理用户航线 - - var existLanes = db.Queryable().Where(x => x.UserId == userId).Select(n => n.LaneId) - .ToArray(); - - - IEnumerable delLanes = existLanes.AsQueryable().Except(model.LaneIds); - if (delLanes.Count() > 0) - { - db.Deleteable() - .Where(it => it.UserId == userId && delLanes.Contains(it.LaneId)) - .ExecuteCommand(); - } - - IEnumerable addLanes = model.LaneIds.AsQueryable().Except(existLanes); - if (addLanes.Count() > 0) - { - foreach (var item in addLanes) - { - var laneUser = new SysUserLane - { - LaneId = item, - UserId = model.Id, - }; - db.Insertable(laneUser).ExecuteCommand(); - } - } - #endregion 处理用户航线 + return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess); } @@ -308,10 +266,7 @@ public class UserService : IUserService var orgUsers = await db.Queryable().Where(x => x.UserId == item.Id).ToListAsync(); if (orgUsers.Count > 0) await db.Deleteable(orgUsers).ExecuteCommandAsync(); - - var userLanes = await db.Queryable().Where(x => x.UserId == item.Id).ToListAsync(); - if (userLanes.Count > 0) - await db.Deleteable(userLanes).ExecuteCommandAsync(); + } await db.Deleteable(list).RemoveDataCache($"{SqlSugarCacheConst.User}{user.TenantId}").ExecuteCommandAsync(); From 0c3fd95f86fe6799d9b72943f1473c53514d3d6b Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 9 Sep 2024 17:04:44 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8F=BD=E8=B4=A7=E4=BA=BA=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Op/Method/SeaExportService.cs | 4 ++-- .../DS.WMS.Core/Sys/Interface/ICommonService.cs | 2 +- ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index a41cd3d1..eda829fa 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -213,7 +213,7 @@ public partial class SeaExportService : ISeaExportService // return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); //} // - var sequence = await commonService.GetSequenceNextAsync(tenantDb, user); + var sequence = await commonService.GetSequenceNextAsync(tenantDb, user,req.SaleId); if (!sequence.Succeeded) { return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist)); @@ -690,7 +690,7 @@ public partial class SeaExportService : ISeaExportService } //获取表单复制模板 var template = tenantDb.Queryable().Where(x => x.PermissionId == 1772509201441099776).First(); - var sequence = commonService.GetSequenceNextAsync(tenantDb, user).GetAwaiter().GetResult(); + var sequence = commonService.GetSequenceNextAsync(tenantDb, user, info.SaleId).GetAwaiter().GetResult(); if (!sequence.Succeeded) { return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist); diff --git a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs index 67230a84..c804d82c 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Interface/ICommonService.cs @@ -209,7 +209,7 @@ public interface ICommonService /// 获取最新业务单据编码 /// /// - public Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user); + public Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0); /// /// 获取字典明细 diff --git a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs index cb2549cc..4448196e 100644 --- a/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/Sys/Method/CommonService.cs @@ -2050,7 +2050,7 @@ public class CommonService : ICommonService /// 获取最新业务单据编码 /// /// - public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user) + public async Task> GetSequenceNextAsync(SqlSugarScopeProvider tenantDb, IUser user,long saleId = 0) { //生成编号 string sequenceNewNo = ""; @@ -2084,10 +2084,14 @@ public class CommonService : ICommonService case "variable": //变量方式 TODO if (item.RuleValue == "UserNumber") { - var userInfo = await db.Queryable().FirstAsync(x => x.Id == long.Parse(user.UserId)); + if (saleId == 0) + { + return await Task.FromResult(DataResult.Failed("请维护订单揽货人信息!")); + } + var userInfo = await db.Queryable().FirstAsync(x => x.Id == saleId); if (userInfo.UserNumber.IsNull()) { - return await Task.FromResult(DataResult.Failed("该用户编码未维护!")); + return await Task.FromResult(DataResult.Failed("该揽货人用户编码未维护!")); } sequenceNewNo += userInfo.UserNumber; } From 0e25cef38e7d0a0129a42344e554fa56a03bc12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 6 Sep 2024 18:48:47 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=B1=87=E7=8E=87bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Fee/Dtos/FeeStatistics.cs | 10 ++++---- .../DS.WMS.Core/Fee/Entity/FeeRecord.cs | 20 ++++++++++++++-- .../Interface/IFeeCurrencyExchangeService.cs | 5 +++- .../DS.WMS.Core/Fee/Method/FeeAuditService.cs | 2 +- .../DS.WMS.Core/Fee/Method/FeeServiceBase.cs | 23 +------------------ 5 files changed, 29 insertions(+), 31 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs index 8d7296db..4b25ab59 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs @@ -10,12 +10,12 @@ namespace DS.WMS.Core.Fee.Dtos public class FeeStatItem { /// - /// 应收款总计 + /// 应收款总计(人民币合计) /// public decimal ReceivableTotal { get; set; } /// - /// 应付款总计 + /// 应付款总计(人民币合计) /// public decimal PayableTotal { get; set; } @@ -25,7 +25,7 @@ namespace DS.WMS.Core.Fee.Dtos public decimal ProfitTotal { get { return ReceivableTotal - PayableTotal; } } /// - /// 利润率 + /// 利润率(利润/应付) /// public string ProfitMargin { @@ -34,8 +34,8 @@ namespace DS.WMS.Core.Fee.Dtos if (PayableTotal == 0) return string.Empty; - //利润率=利润÷成本×100% - return string.Concat(Math.Round(ReceivableTotal / PayableTotal * 100, 2, MidpointRounding.AwayFromZero), "%"); + //利润率=利润÷应付/应收×100% + return string.Concat(Math.Round(ProfitTotal / PayableTotal * 100, 2, MidpointRounding.AwayFromZero), "%"); } } diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs index 66655ebb..bd312139 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeRecord.cs @@ -400,8 +400,24 @@ namespace DS.WMS.Core.Fee.Entity { if (TaxRate == 0) { - UnitPrice = TaxUnitPrice; - NoTaxAmount = Amount; + if (TaxUnitPrice == 0) + { + TaxUnitPrice = UnitPrice; + } + else if (UnitPrice == 0) + { + UnitPrice = TaxUnitPrice; + } + + if (Amount == 0) + { + Amount = NoTaxAmount; + } + else if (NoTaxAmount == 0) + { + NoTaxAmount = Amount; + } + } else { diff --git a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCurrencyExchangeService.cs b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCurrencyExchangeService.cs index 21d02128..26e1fd32 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCurrencyExchangeService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Interface/IFeeCurrencyExchangeService.cs @@ -1,9 +1,11 @@ using DS.Module.Core; using DS.WMS.Core.Fee.Dtos; -using DS.WMS.Core.Sys.Dtos; namespace DS.WMS.Core.Fee.Interface; +/// +/// 汇率服务 +/// public interface IFeeCurrencyExchangeService { /// @@ -34,4 +36,5 @@ public interface IFeeCurrencyExchangeService /// 币别信息 /// Task> GetExchangeRateAsync(ExchangeRate exchange); + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs index 185b9a77..81fea90b 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeAuditService.cs @@ -465,7 +465,7 @@ namespace DS.WMS.Core.Fee.Method } /// - /// 获取业务相关联的费用统计 + /// 获取业务费用统计 /// /// 业务ID /// 业务类型 diff --git a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs index cf2fd83b..2370f4b6 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Method/FeeServiceBase.cs @@ -205,7 +205,7 @@ namespace DS.WMS.Core.Fee.Method /// protected internal async Task FetchExchangeRateAsync(IEnumerable items) { - var exRecords = items.Where(x => x.ExchangeRate == null && x.Currency != x.LocalCurrency); + var exRecords = items.Where(x => x.Currency != x.LocalCurrency); if (exRecords.Any()) { var exchanges = exRecords.GroupBy(x => new @@ -233,27 +233,6 @@ namespace DS.WMS.Core.Fee.Method item.ExchangeRate = exchangeRates.Find(x => x.CurrencyFrom == item.Currency && x.CurrencyTo == item.LocalCurrency && x.FeeType == item.FeeType)?.Rate; } - - //var codes = exRecords.Select(x => x.Currency).Distinct().ToList(); - //var currencies = await TenantDb.Queryable().Where(x => codes.Contains(x.CodeName)).Includes(x => x.Exchanges).ToListAsync(); - //DateTime dtNow = DateTime.Now; - //foreach (var item in exRecords) - //{ - // var currency = currencies.Find(x => x.CodeName == item.Currency); - // if (currency != null) - // { - // item.ExchangeRate = currency.DefaultRate; - // if (currency.Exchanges != null && currency.Exchanges.Count > 0) - // { - // //取当前时间范围内的最新一条 - // var exchange = currency.Exchanges.FindAll(x => x.Status == StatusEnum.Enable && - // x.StartDate >= dtNow && x.EndDate <= dtNow).OrderByDescending(x => x.UpdateTime).FirstOrDefault(); - - // if (exchange != null) - // item.ExchangeRate = item.FeeType == FeeType.Receivable ? exchange.DRValue : exchange.CRValue; - // } - // } - //} } } From a4970cf0331e3fa108b7a3e44171d76e7000aaaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 6 Sep 2024 19:15:30 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Fee/Dtos/FeeStatistics.cs | 36 +++++++++---------- .../FolderProfile1.pubxml.user | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs index 4b25ab59..2f07c379 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeStatistics.cs @@ -309,18 +309,18 @@ namespace DS.WMS.Core.Fee.Dtos PayableTotal = localPayable + otherPayable;//应付合计 //人民币 - ReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); - PayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); + ReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); + PayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); //美元 - ReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); - PayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); + ReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(); + PayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(); //其他 - ReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); - PayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); + ReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); + PayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); //按客户统计 ByCustomer = (from s in _source @@ -330,12 +330,12 @@ namespace DS.WMS.Core.Fee.Dtos CustomerName = g.Key, ReceivableTotal = g.Where(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount).GetValueOrDefault(), PayableTotal = g.Where(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount).GetValueOrDefault(), - ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), - PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), - ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(), - PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(), - ReceivableOther = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault(), - PayableOther = g.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault() + ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(), + PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(), + ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(), + PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(), + ReceivableOther = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault(), + PayableOther = g.Where(x => x.FeeType == FeeType.Payable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault() }).ToList(); ByCustomer.Add(new ByCustomerStat { @@ -358,12 +358,12 @@ namespace DS.WMS.Core.Fee.Dtos BillNO = g.Key, ReceivableTotal = g.Where(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount).GetValueOrDefault(), PayableTotal = g.Where(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount).GetValueOrDefault(), - ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), - PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), - ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(), - PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(), - ReceivableOther = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault(), - PayableOther = g.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault() + ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(), + PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(), + ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(), + PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == FeeCurrency.USD_CODE).Sum(x => x.Amount).GetValueOrDefault(), + ReceivableOther = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault(), + PayableOther = g.Where(x => x.FeeType == FeeType.Payable && x.Currency != FeeCurrency.USD_CODE && x.Currency != FeeCurrency.RMB_CODE).Sum(x => x.Amount * x.ExchangeRate).GetValueOrDefault() }).ToList(); ByBusiness.Add(new ByBusinessStat { diff --git a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user index 81e2a49c..8705ae82 100644 --- a/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user +++ b/ds-wms-service/DS.WMS.FeeApi/Properties/PublishProfiles/FolderProfile1.pubxml.user @@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. <_PublishTargetUrl>D:\Publish\DS8\FeeApi - True|2024-09-06T09:01:39.6646353Z||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;True|2024-05-22T16:52:42.2166228+08:00||; + True|2024-09-06T10:49:17.9435308Z||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||; \ No newline at end of file From 0098fd8e6059caf50a4ce99224b103d07f20a95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Mon, 9 Sep 2024 17:16:04 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=BE=80=E6=9D=A5=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8B=A5=E5=B9=B2=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Enums/InfoClientEnums.cs | 24 +++ .../DS.Module.Nuget/DS.Module.Nuget.csproj | 2 +- .../Method/ApplicationService`1.cs | 10 +- ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj | 4 - .../DS.WMS.Core/Info/Dtos/ClientInfoReq.cs | 39 ++++- .../DS.WMS.Core/Info/Dtos/ClientInfoRes.cs | 149 +++++------------- .../DS.WMS.Core/Info/Dtos/ClientQuery.cs | 23 +++ .../DS.WMS.Core/Info/Dtos/ClientUsage.cs | 23 +++ .../DS.WMS.Core/Info/Dtos/QueryClientInfo.cs | 8 +- .../DS.WMS.Core/Info/Entity/InfoClient.cs | 49 ++++++ .../Info/Interface/IClientInfoService.cs | 2 +- .../Info/Method/ClientInfoService.cs | 84 +++++++++- .../Booking/EDIActionExecutor.cs | 2 +- .../Op/Templates/订舱委托.cshtml | 107 ------------- .../Op/Templates/订舱委托0906新.cshtml | 122 -------------- .../Op/Templates/订舱委托0909.cshtml | 71 +++++++++ .../Controllers/ClientInfoController.cs | 5 +- 17 files changed, 358 insertions(+), 366 deletions(-) create mode 100644 ds-wms-service/DS.WMS.Core/Info/Dtos/ClientQuery.cs create mode 100644 ds-wms-service/DS.WMS.Core/Info/Dtos/ClientUsage.cs delete mode 100644 ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托.cshtml delete mode 100644 ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0906新.cshtml create mode 100644 ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0909.cshtml diff --git a/ds-wms-service/DS.Module.Core/Enums/InfoClientEnums.cs b/ds-wms-service/DS.Module.Core/Enums/InfoClientEnums.cs index 253b4d99..5747a344 100644 --- a/ds-wms-service/DS.Module.Core/Enums/InfoClientEnums.cs +++ b/ds-wms-service/DS.Module.Core/Enums/InfoClientEnums.cs @@ -115,4 +115,28 @@ namespace DS.Module.Core.Enums [Description("未提货提醒")] UndeliveredGoodsReminder = 1 << 12 } + + /// + /// 往来单位特性 + /// + [Flags] + public enum ClientAttribute + { + /// + /// 未设置 + /// + None = 0, + + /// + /// 客户 + /// + [Description("客户")] + Customer = 1 << 0, + + /// + /// 供应商 + /// + [Description("供应商")] + Supplier = 1 << 1 + } } diff --git a/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj b/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj index 74af21a1..f8d32785 100644 --- a/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj +++ b/ds-wms-service/DS.Module.Nuget/DS.Module.Nuget.csproj @@ -51,7 +51,7 @@ - + diff --git a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs index 0c5d1990..da6f9744 100644 --- a/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs +++ b/ds-wms-service/DS.WMS.Core/Application/Method/ApplicationService`1.cs @@ -11,6 +11,7 @@ using DS.WMS.Core.Flow.Interface; using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Interface.TaskInteraction; using DS.WMS.Core.Sys.Interface; +using Masuit.Tools.Systems; using Microsoft.Extensions.DependencyInjection; using SqlSugar; @@ -406,6 +407,7 @@ namespace DS.WMS.Core.Application.Method .Select((x, y) => new TEntity { Id = x.Id, + ApplicationNO = x.ApplicationNO, Status = x.Status, DetailCount = SqlFunc.AggregateCount(y.Id) }).ToListAsync(); @@ -427,12 +429,14 @@ namespace DS.WMS.Core.Application.Method { if (hasAuthorized) { - for (int i = 0; i < idArray.Length; i++) + for (int i = 0; i < list.Count; i++) { + var item = list[i]; var req = new TaskCreationRequest { - BusinessId = idArray[i], - TaskTypeName = auditType.ToString() + BusinessId = item.Id, + TaskTypeName = auditType.ToString(), + TaskTitle = $"【{auditType.GetDescription()}】{item.ApplicationNO}" }; result = await taskService.CreateTaskAsync(req); diff --git a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj index 4c4c4b73..aa9da9ac 100644 --- a/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj +++ b/ds-wms-service/DS.WMS.Core/DS.WMS.Core.csproj @@ -33,10 +33,6 @@ true PreserveNewest - - true - PreserveNewest - diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs index 6337e2a6..558edede 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoReq.cs @@ -1,9 +1,6 @@ using System.Runtime.Serialization; -using DS.Module.Core; using DS.Module.Core.Enums; -using DS.WMS.Core.Info.Entity; using FluentValidation; -using SqlSugar; namespace DS.WMS.Core.Info.Dtos; @@ -482,6 +479,42 @@ public class ClientInfoReq /// 服务项目代码 /// public string[]? ServiceItemCodes { get; set; } + + /// + /// 推送设置 + /// + public ClientAttribute[]? ClientAttributes { get; set; } + + [IgnoreDataMember] + public ClientAttribute Attribute + { + get + { + if (ClientAttributes == null || ClientAttributes.Length == 0) + return ClientAttribute.None; + + ClientAttribute flags = ClientAttribute.None; + for (int i = 0; i < ClientAttributes.Length; i++) + flags |= ClientAttributes[i]; + + return flags; + } + } + + /// + /// 客户等级:A/B/C/D + /// + public string? Grade { get; set; } + + /// + /// 注册资金 + /// + public decimal? RegisteredCapital { get; set; } + + /// + /// 注册时间 + /// + public DateTime? RegistrationTime { get; set; } } /// diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs index ae8dc609..db41db39 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientInfoRes.cs @@ -98,112 +98,6 @@ public class ClientInfoRes /// public bool IsStop { get; set; } - ///// - ///// Desc:发票抬头1 - ///// - //public string BillRises1 { get; set; } - - ///// - ///// Desc:发票抬头2 - ///// - //public string BillRises2 { get; set; } - - ///// - ///// Desc:美元支票抬头 - ///// - //public string USDBillRises { get; set; } - - ///// - ///// Desc:人民币支票抬头 - ///// - //public string RMBBillRises { get; set; } - - ///// - ///// Desc:人民币开户银行 - ///// - //public string RMBBank { get; set; } - - ///// - ///// Desc:人民币账号 - ///// - //public string RMBAccount { get; set; } - - ///// - ///// Desc:人民币联机行号 - ///// - //public string RMBOnlineNO { get; set; } - - ///// - ///// Desc:美元开户银行 - ///// - //public string USDBank { get; set; } - - ///// - ///// Desc:美元账号 - ///// - //public string USDAccount { get; set; } - - ///// - ///// Desc:美元联机行号 - ///// - //public string USDOnlineNO { get; set; } - - ///// - ///// Desc:自定义属性1 - ///// - //public string CustomAttributes1 { get; set; } - - ///// - ///// Desc:自定义属性2 - ///// - //public string CustomAttributes2 { get; set; } - - ///// - ///// Desc:美元信用最大金额 - ///// - //public decimal? USDMaxAmountCredit { get; set; } = 0; - - ///// - ///// Desc:人民币信用最大金额 - ///// - //public decimal? RMBMaxAmountCredit { get; set; } = 0; - - ///// - ///// Desc:信用最大金额(RMB+USD) - ///// - //public decimal? MaxAmountCredit { get; set; } = 0; - - ///// - ///// Desc:结算方式编码 - ///// - //public string StlName { get; set; } - - - ///// - ///// Desc:美金汇率 - ///// - //public decimal? USDExchangeRate { get; set; } - - ///// - ///// Desc:月结算时间 - ///// - //public string StlDate { get; set; } - - ///// - ///// Desc:上半月结算时间 - ///// - //public string StlFirstHalfDate { get; set; } - - ///// - ///// Desc:下半月结算时间 - ///// - //public string StlMiddleDate { get; set; } - - ///// - ///// Desc:票结结算时间 - ///// - //public string InvoiceStlDate { get; set; } - /// /// Desc:等级 /// @@ -513,4 +407,47 @@ public class ClientInfoRes /// 服务项目代码 /// public string[]? ServiceItemCodes { get; set; } + + [IgnoreDataMember] + public ClientAttribute Attribute { get; set; } + + /// + /// 推送设置 + /// + public ClientAttribute[]? Attributes + { + get + { + if (Attribute == ClientAttribute.None) + return []; + + return Attribute.Split().Where(x => x != ClientAttribute.None).ToArray(); + } + } + + /// + /// 客户等级:A/B/C/D + /// + public string? Grade { get; set; } + + /// + /// 注册资金 + /// + public decimal? RegisteredCapital { get; set; } + + /// + /// 注册时间 + /// + public DateTime? RegistrationTime { get; set; } + + /// + /// 默认联系人 + /// + public ClientContactRes? DefaultContact { get; set; } + + /// + /// 最新账期 + /// + public ClientAccountDateRes? LastAccountDate { get; set; } + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientQuery.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientQuery.cs new file mode 100644 index 00000000..697ec3ce --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientQuery.cs @@ -0,0 +1,23 @@ +namespace DS.WMS.Core.Info.Dtos +{ + /// + /// 往来单位附加查询条件 + /// + public class ClientQuery + { + /// + /// 联系方式:电话/手机/邮箱 + /// + public string? ContactInfo { get; set; } + + /// + /// 是否合同到期 + /// + public bool? IsContractExpired { get; set; } + + /// + /// 客户标记 + /// + public QueryClientInfo? ClientTag { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientUsage.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientUsage.cs new file mode 100644 index 00000000..c27e5f3b --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/ClientUsage.cs @@ -0,0 +1,23 @@ +namespace DS.WMS.Core.Info.Dtos +{ + /// + /// 往来单位使用情况 + /// + public class ClientUsage + { + /// + /// ID + /// + public long Id { get; set; } + + /// + /// 往来单位简称 + /// + public string? Name { get; set; } + + /// + /// 是否已使用 + /// + public bool IsUsed { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Info/Dtos/QueryClientInfo.cs b/ds-wms-service/DS.WMS.Core/Info/Dtos/QueryClientInfo.cs index 6e4488d2..f9535e50 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Dtos/QueryClientInfo.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Dtos/QueryClientInfo.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace DS.WMS.Core.Info.Dtos +namespace DS.WMS.Core.Info.Dtos { /// /// 检索往来单位 diff --git a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs index fc1778c0..f2360eb4 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Entity/InfoClient.cs @@ -406,4 +406,53 @@ public class InfoClient : SharedOrgModel [SugarColumn(ColumnDescription = "服务项目", ColumnDataType = "text", IsNullable = true)] public string? ServiceItem { get; set; } + /// + /// 往来单位属性 + /// + [SugarColumn(ColumnDescription = "往来单位属性")] + public ClientAttribute Attribute { get; set; } + + /// + /// 客户等级:A/B/C/D + /// + [SugarColumn(ColumnDescription = "客户等级", Length = 1, IsNullable = true)] + public string? Grade { get; set; } + + /// + /// 注册资金 + /// + [SugarColumn(ColumnDescription = "注册资金", IsNullable = true)] + public decimal? RegisteredCapital { get; set; } + + /// + /// 注册时间 + /// + [SugarColumn(ColumnDescription = "注册时间", IsNullable = true)] + public DateTime? RegistrationTime { get; set; } + + ///// + ///// 往来单位标记 + ///// + //[Navigate(NavigateType.OneToOne, nameof(InfoClientTag.ClientId))] + //public InfoClientTag? Tag { get; set; } + + ///// + ///// 账期 + ///// + //[Navigate(NavigateType.OneToMany, nameof(InfoClientAccountDate.ClientId))] + //public List? Accounts { get; set; } + + ///// + ///// 联系人 + ///// + //[Navigate(NavigateType.OneToMany, nameof(InfoClientContact.ClientId))] + //public List? Contacts { get; set; } + + ///// + ///// 合同 + ///// + //[Navigate(NavigateType.OneToMany, nameof(InfoClientContract.ClientId))] + //public List? Contracts { get; set; } + + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Info/Interface/IClientInfoService.cs b/ds-wms-service/DS.WMS.Core/Info/Interface/IClientInfoService.cs index 0bd15040..478c7b2e 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Interface/IClientInfoService.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Interface/IClientInfoService.cs @@ -44,7 +44,7 @@ public interface IClientInfoService /// /// /// - DataResult> GetListByPage(PageRequest request); + Task>> GetListAsync(PageRequest request); /// /// 编辑 diff --git a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs index 6d00b9cc..47f500c2 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs @@ -15,6 +15,7 @@ using DS.WMS.Core.Op.Dtos.TaskInteraction; using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Interface.TaskInteraction; using DS.WMS.Core.Sys.Entity; +using Fasterflect; using Mapster; using Masuit.Tools.Systems; using Microsoft.Extensions.DependencyInjection; @@ -42,6 +43,8 @@ public class ClientInfoService : ServiceBase, IClientInfoService taskService = new Lazy(serviceProvider.GetRequiredService()); } + #region 审核 + /// /// 提交审核 /// @@ -246,26 +249,73 @@ public class ClientInfoService : ServiceBase, IClientInfoService return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed)); } + #endregion + /// /// 列表 /// /// /// - public DataResult> GetListByPage(PageRequest request) + public async Task>> GetListAsync(PageRequest request) { //序列化查询条件 var whereList = request.GetConditionalModels(Db); - var result = TenantDb.Queryable() - .Where(whereList) - .Select().ToQueryPage(request.PageCondition); + foreach (var item in whereList) + { + var condition = (ConditionalModel)item; + condition.FieldName = "c." + condition.FieldName.ToUpperCamelCase(); + } + + var query = TenantDb.Queryable() + .LeftJoin((c, c1) => c.Id == c1.ClientId) + .LeftJoin((c, c1, c2) => c.Id == c2.ClientId) + .InnerJoinIF(request.OtherQueryCondition?.ClientTag != null, (c, c1, c2, ct) => c.Id == ct.ClientId); + + if (!string.IsNullOrEmpty(request.OtherQueryCondition?.ContactInfo)) + query = query.Where((c, c1, c2) => c1.Tel.Contains(request.OtherQueryCondition.ContactInfo) || + c1.Mobile.Contains(request.OtherQueryCondition.ContactInfo) || c1.Email.Contains(request.OtherQueryCondition.ContactInfo)); + + if (request.OtherQueryCondition != null && request.OtherQueryCondition.IsContractExpired.GetValueOrDefault()) + query = query.Where((c, c1, c2) => SqlFunc.GetDate() > c2.EndDate); + + if (request.OtherQueryCondition?.ClientTag != null) + { + var props = Array.FindAll(request.OtherQueryCondition.ClientTag.GetType().GetProperties(), x => x.Name.StartsWith("Is") && x.PropertyType == typeof(bool)); + foreach (var prop in props) + { + object val = PropertyInfoExtensions.Get(prop, request.OtherQueryCondition.ClientTag); + if (val != null && val is bool value && value) + { + whereList.Add(new ConditionalModel + { + ConditionalType = ConditionalType.Equal, + FieldName = "ct." + prop.Name, + FieldValue = "1" + }); + } + } + } + + var result = await query.Where(whereList).Select().ToQueryPageAsync(request.PageCondition); if (result.Data?.Count > 0) { - var ids = result.Data.SelectMany(x => x.SaleOrgIdList).Distinct(); - var orgs = Db.Queryable().Where(x => ids.Contains(x.Id)).Select(x => new { x.Id, x.OrgName }).ToList(); + var ids = result.Data.Select(x => x.Id); + var contacts = TenantDb.Queryable().Where(x => ids.Contains(x.ClientId) && x.IsDefault) + .Select().ToList(); + + var accountDates = TenantDb.Queryable().Where(x => ids.Contains(x.ClientId) && x.Id == + SqlFunc.Subqueryable().Where(y => y.Id == x.Id).Select(y => SqlFunc.AggregateMax(y.Id)) + ).Select().ToList(); + + var ids2 = result.Data.SelectMany(x => x.SaleOrgIdList).Distinct(); + var orgs = Db.Queryable().Where(x => ids2.Contains(x.Id)).Select(x => new { x.Id, x.OrgName }).ToList(); foreach (var item in result.Data) { + item.DefaultContact = contacts.Find(x => x.ClientId == item.Id); + item.LastAccountDate = accountDates.Find(x => x.ClientId == item.Id); + var list = orgs.FindAll(x => item.SaleOrgIdList.Contains(x.Id)); item.SaleOrgNames = string.Join(",", list.Select(x => x.OrgName)); } @@ -274,6 +324,26 @@ public class ClientInfoService : ServiceBase, IClientInfoService return result; } + /// + /// 确定往来单位是否已使用 + /// + /// 往来单位ID + /// + public async Task>> GetUsageAsync(params long[] ids) + { + var list = await TenantDb.Queryable() + .Select(c => new ClientUsage + { + Id = c.Id, + Name = c.ShortName, + IsUsed = SqlFunc.Subqueryable().Where(s => c.Id == s.CustomerId || c.Id == s.ForwarderId || c.Id == s.YardId).Any() + }).ToListAsync(); + + var result = DataResult>.Success(list); + result.Count = list.Count; + return result; + } + /// /// 编辑 /// @@ -292,9 +362,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService if (req.Id == 0) { if (TenantDb.Queryable().Where(x => (x.ShortName == req.ShortName.Trim() || x.Description == req.Description.Trim() || x.TaxNo == req.TaxNo.Trim())).Any()) - { return DataResult.Failed("客户信息已存在,请检查客户全称、简称或社会信用代码是否重复!", MultiLanguageConst.ClientInfoExist); - } var tag = req.ClientTag.Adapt(); //助记码 diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs index a1983c0d..203adf74 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/ActionExecutor/Booking/EDIActionExecutor.cs @@ -42,7 +42,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking { await TaskService.SetTaskBaseDescription(context.TaskInfo.BusinessId, TaskBaseTypeEnum.WAIT_BOOKING, MESSAGE); await LogService.WriteLogAsync(context.TaskInfo, MESSAGE + Environment.NewLine + "请求参数:" - + JsonConvert.SerializeObject(req) + Environment.NewLine + "响应参数:" + result.Data); + + JsonConvert.SerializeObject(req) + Environment.NewLine + "响应参数:" + result.Message); return; } diff --git a/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托.cshtml b/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托.cshtml deleted file mode 100644 index 5e812f43..00000000 --- a/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托.cshtml +++ /dev/null @@ -1,107 +0,0 @@ -@* @model DS.WMS.Core.Op.Entity.MailTemplateModel *@ -@{ - var item = Model.Primary; -} - - - -*** Auto Email, please reply to all (delete sender Admin)!If only reply to sender, we will not be able to find and deal with it! *** -
-Dear @Model.Contacts - -
- RE: BOOKING - JOB NO. -
- -请查看附件中的订舱委托,请2小时内先行回复订舱号给我们,并帮忙催促船东尽快放舱,如下信息同订舱委托一致,便于您查阅! - -CARRIER:@item.Carrier -S/Q:XX -ETD : @item.ETD - -POL: @item.LoadPort -POD: @item.DischargePort -FPOD: @item.DeliveryPlace -VOL: XX -Commdity: XX(取中文品名) -HS CODE: @item.HSCode -POD FREE TIME: -REMARK: -(取供应商备注) - - -此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CN NameNameTel No.Mobile/Wechat/QQEmailPosition
邵 芳Candy0532-8068838713375570007 2853083550candy@sunniness.netCooperation
魏涛Wilson0532-8068835313969858993 2853083555ope@sunniness.netOP manager
徐平平Cathy0532-8068835013969662965 2853083551opg@sunniness.netDocument
- -
-
- @* Tks + B’rgds - Candy SHAO 邵芳 (此处用当票操作的信息) - General Manager | SUNNINESS LOGISTICS CO.,LTD. - TEL: +86-0532-80688387 |MB./We chat: +86-18866622731|QQ:2853083553 | Email:candy@sunniness.net *@ -
-
- -@* 此邮件模板是订舱委托推送的邮件模板,在商务订单审核通过后,自动生成,并推送: -1)蓝色是调取系统数据、红色是醒目提醒; -2)订舱委托PDF格式作为附件一起发出 -3)邮件发给订舱代理联系人,抄送我司销售/客服和操作/单证;未勾选推送的订舱代理,仅推送我司干系人! *@ - diff --git a/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0906新.cshtml b/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0906新.cshtml deleted file mode 100644 index 163604ad..00000000 --- a/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0906新.cshtml +++ /dev/null @@ -1,122 +0,0 @@ -@* @model DS.WMS.Core.Op.Entity.MailTemplateModel -@{ - var item = Model.Primary; -} *@ - - - -TO: - -*** Auto Email, please reply to all (delete sender Admin)!If only reply to sender, we will not be able to find and deal with it! *** -
-Dear @Model.Contacts - -
- RE: BOOKING - @Model.Primary.CustomerNo -
-
-请查看附件中的订舱委托,请2小时内先行回复订舱号给我们,并帮忙催促船东尽快放舱,如下信息同订舱委托一致,便于您查阅! -
-CARRIER:@Model.Primary.Carrier -
-S/Q:XX
-ETD : @Model.Primary.ETD -
-
- -POL: @Model.Primary.LoadPort -
-POD: @Model.Primary.DischargePort -
-FPOD: @Model.Primary.DeliveryPlace -
-VOL: @Model.Primary.CntrTotal -
-Commdity: @Model.Primary.GoodsName -
-HS CODE: @Model.Primary.HSCode -
-POD FREE TIME:
-REMARK:@Model.Primary.BookingRemark -
- - - -此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CN NameNameTel No.Mobile/Wechat/QQEmailPosition
@Model.Sales.Name@Model.Sales.EnName@Model.Sales.Tel@Model.Sales.Mobile@Model.Sales.EmailCooperation
@Model.Operator.Name@Model.Operator.EnName@Model.Operator.Tel@Model.Operator.Mobile@Model.Operator.EmailOP manager
@Model.Document.Name@Model.Document.EnName@Model.Document.Tel@Model.Document.Mobile@Model.Document.EmailDocument
- -
-
- -
-
- Tks + B’rgds
- @Model.Document.EnName @Model.Document.Name (此处用当票操作的信息) - General Manager | SUNNINESS LOGISTICS CO.,LTD. - TEL: +86-@Model.Document.Tel |MB./We chat: @Model.Document.Mobile|QQ:2853083553 | Email:@Model.Document.Email -
-
- -@* 此邮件模板是订舱委托推送的邮件模板,在商务订单审核通过后,自动生成,并推送: -1)蓝色是调取系统数据、红色是醒目提醒; -2)订舱委托PDF格式作为附件一起发出 -3)邮件发给订舱代理联系人,抄送我司销售/客服和操作/单证;未勾选推送的订舱代理,仅推送我司干系人! *@ - diff --git a/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0909.cshtml b/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0909.cshtml new file mode 100644 index 00000000..ea84611d --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Templates/订舱委托0909.cshtml @@ -0,0 +1,71 @@ +@* @model DS.WMS.Core.Op.Entity.MailTemplateModel *@ +

TO:

+

*** Auto Email, please reply to all (delete sender Admin)!If only reply to sender, we will not be able to find and deal with it! ***

+


Dear @Model.Contacts

+
RE: BOOKING - @Model.Primary.CustomerNo
+


请查看附件中的订舱委托,请2小时内先行回复订舱号给我们,并帮忙催促船东尽快放舱,如下信息同订舱委托一致,便于您查阅!
CARRIER:@Model.Primary.Carrier
S/Q:@Model.Primary.ContractNo
ETD : @Model.Primary.ETD

POL: @Model.Primary.LoadPort
POD: @Model.Primary.DischargePort
FPOD: @Model.Primary.DeliveryPlace
VOL: @Model.Primary.CntrTotal
Commdity: @Model.Primary.GoodsName
HS CODE: @Model.Primary.HSCode
POD FREE TIME:
REMARK:@Model.Primary.BookingRemark

+


此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CN NameNameTel No.Mobile/Wechat/QQEmailPosition
@Model.Sales.Name@Model.Sales.EnName@Model.Sales.Tel@Model.Sales.Mobile@Model.Sales.EmailCooperation
@Model.Operator.Name@Model.Operator.EnName@Model.Operator.Tel@Model.Operator.Mobile@Model.Operator.EmailOPmanager
@Model.Document.Name@Model.Document.EnName@Model.Document.Tel@Model.Document.Mobile@Model.Document.EmailDocument
+



+
+@* 注意!!id=sign的元素,在发送邮件时,程序会自动插入当前发件人的用户签名 *@ +
+Tks + B’rgds  
+@Model.Document.EnName @Model.Document.Name  +
+ +
+ @if(Model.Primary.SourceName == "WSL") + { + @Model.Operator.Name + @Model.Operator.EnName + } + else if(Model.Primary.SourceName == "WSL") + { + @Model.Sales.Name + @Model.Sales.EnName + } +
General Manager | SUNNINESS LOGISTICS CO.,LTD.    +
+ +
TEL: @Model.Document.Tel   |MB./We chat: @Model.Document.Mobile|QQ:2853083553 | Email:@Model.Document.Email
+ \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientInfoController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientInfoController.cs index 5904d2e9..32511f0a 100644 --- a/ds-wms-service/DS.WMS.MainApi/Controllers/ClientInfoController.cs +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/ClientInfoController.cs @@ -86,10 +86,9 @@ public class ClientInfoController : ApiController /// [HttpPost] [Route("GetClientInfoList")] - public DataResult> GetClientInfoList([FromBody] PageRequest request) + public async Task>> GetListAsync([FromBody] PageRequest request) { - var res = _invokeService.GetListByPage(request); - return res; + return await _invokeService.GetListAsync(request); } /// From 8e490d395a6834de43bf4d6dcfcd2f8a42586c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Mon, 9 Sep 2024 17:16:48 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8A=A9=E8=AE=B0=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs index 47f500c2..c216f12c 100644 --- a/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs +++ b/ds-wms-service/DS.WMS.Core/Info/Method/ClientInfoService.cs @@ -387,10 +387,8 @@ public class ClientInfoService : ServiceBase, IClientInfoService { return DataResult.Failed("请检查客户全称、简称或社会信用代码是否重复!", MultiLanguageConst.ClientInfoExist); } - //助记码 - data.CodeName = PinYinUtil.GetFristLetter(data.ShortName); - tag = req.ClientTag.Adapt(tag); + tag = req.ClientTag.Adapt(tag); data.ServiceItem = data.ServiceItem ?? string.Empty; TenantDb.Updateable(data).RemoveDataCache($"{SqlSugarCacheConst.InfoClient}{User.TenantId}") .IgnoreColumns(ignoreAllNullColumns: true) From a59921842cecf78024f5bf687193cc62fbc22e20 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 9 Sep 2024 17:25:21 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=A2=E5=8D=95=E8=81=94=E7=B3=BB=E4=BA=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BD=E5=86=85=E5=8F=91=E8=B4=A7=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Op/Method/SeaExportService.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index eda829fa..c3a9ebb9 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -581,6 +581,34 @@ public partial class SeaExportService : ISeaExportService } } } + if (seaExport.ShipperCnId != 0) + { + var delShipperCns = contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "shippercn" && x.CustomerId != seaExport.ShipperCnId).ToList(); + if (delShipperCns.Count > 0) + { + delList.AddRange(delShipperCns); + } + var defaultContact = sqlSugarScope.Queryable().Where(x => x.ClientId == seaExport.ShipperCnId && x.IsDefault == true).First(); + if (defaultContact.IsNotNull()) + { + if (!contactLists.Where(x => x.BusinessType == BusinessType.OceanShippingExport && x.CustomerType == "shippercn" && x.Name == defaultContact.Name).Any()) + { + addList.Add(new BusinessOrderContact() + { + BusinessId = seaExport.Id, + CustomerId = (long)seaExport.ShipperCnId, + CustomerName = seaExport.ShipperCn, + CustomerType = "shippercn", + CustomerTypeName = "国内发货人", + Name = defaultContact.Name, + Mobile = defaultContact.Mobile, + Tel = defaultContact.Tel, + Email = defaultContact.Email, + CustomerContactId = defaultContact.Id + }); + } + } + } if (addList.Count > 0) sqlSugarScope.Insertable(addList).ExecuteCommand(); if (delList.Count > 0)