jianghaiqing 3 months ago
commit 88a4bab957

@ -115,4 +115,28 @@ namespace DS.Module.Core.Enums
[Description("未提货提醒")]
UndeliveredGoodsReminder = 1 << 12
}
/// <summary>
/// 往来单位特性
/// </summary>
[Flags]
public enum ClientAttribute
{
/// <summary>
/// 未设置
/// </summary>
None = 0,
/// <summary>
/// 客户
/// </summary>
[Description("客户")]
Customer = 1 << 0,
/// <summary>
/// 供应商
/// </summary>
[Description("供应商")]
Supplier = 1 << 1
}
}

@ -51,7 +51,7 @@
<PackageReference Include="Snowflake.Core" Version="2.0.0" />
<PackageReference Include="Snowflake.Data" Version="2.2.0" />
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.166" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.7.0" />

@ -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);

@ -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
{
/// <summary>
/// 数据权限模板请求
/// </summary>
public class CodeDataRuleTemplateReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string TemplateName { get; set; }
/// <summary>
/// 资源标识权限ID
/// </summary>
public long PermissionId { get; set; }
/// <summary>
/// 权限实体
/// </summary>
public string PermissionEntity { get; set; }
/// <summary>
/// 中文视图名
/// </summary>
public string ColumnView { get; set; }
/// <summary>
/// 权限规则
/// </summary>
public string DataRules { get; set; }
/// <summary>
/// 数据权限描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 状态
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 排序号
/// </summary>
public int OrderNo { get; set; }
}
}

@ -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
{
/// <summary>
/// 数据权限模板返回
/// </summary>
public class CodeDataRuleTemplateRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模板名称
/// </summary>
public string TemplateName { get; set; }
/// <summary>
/// 资源标识权限ID
/// </summary>
public long PermissionId { get; set; }
/// <summary>
/// 权限实体
/// </summary>
public string PermissionEntity { get; set; }
/// <summary>
/// 中文视图名
/// </summary>
public string ColumnView { get; set; }
/// <summary>
/// 权限规则
/// </summary>
public string DataRules { get; set; }
/// <summary>
/// 数据权限描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 状态
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 排序号
/// </summary>
public int OrderNo { get; set; }
}
}

@ -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
/// <summary>
/// 数据权限
/// </summary>
[SqlSugar.SugarTable("code_data_rule", "数据权限")]
internal class CodeDataRule : BaseModel<long>
{
/// <summary>
/// 模板ID
/// </summary>
[SugarColumn(ColumnDescription = "模板ID")]
public long TemplateId { get; set; }
/// <summary>
/// 模板名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "模板名称", IsNullable = false, Length = 200)]
public string TemplateName { get; set; }
/// <summary>
/// 资源标识权限ID
/// </summary>
[SugarColumn(ColumnDescription = "资源标识权限ID")]
public long PermissionId { get; set; }
/// <summary>
/// 权限实体
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "权限实体", IsNullable = false, Length = 100)]
public string PermissionEntity { get; set; }
/// <summary>
/// 中文视图名
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "中文视图名", IsNullable = true, Length = 50)]
public string ColumnView { get; set; }
/// <summary>
/// 权限规则
/// </summary>
[SugarColumn(ColumnDescription = "权限规则", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string DataRules { get; set; }
/// <summary>
/// 数据权限描述
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "数据权限描述", IsNullable = true, Length = 200)]
public string Description { get; set; }
/// <summary>
/// 用户Id
/// </summary>
[SugarColumn(ColumnDescription = "用户Id")]
public long UserId { get; set; }
/// <summary>
/// 用户名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "用户名称", IsNullable = true, Length = 100)]
public string UserName { get; set; }
/// <summary>
/// 状态
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 排序号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "排序号", IsNullable = true, DefaultValue = "100")]
public int OrderNo { get; set; }
}
}

@ -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
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<CodeDataRuleTemplateRes>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DataResult EditDataRuleTemplate(CodeDataRuleTemplateReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<CodeDataRuleTemplateRes> GetDataRuleTemplateInfo(string id);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelDataRuleTemplate(IdModel req);
/// <summary>
/// 根据权限id获取数据权限模板
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<List<CodeDataRuleTemplateRes>> GetDataRuleTemplateSelectList(string id);
}

@ -33,10 +33,6 @@
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="Op\Templates\订舱委托.cshtml">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Finance\Dtos\" />

@ -10,12 +10,12 @@ namespace DS.WMS.Core.Fee.Dtos
public class FeeStatItem
{
/// <summary>
/// 应收款总计
/// 应收款总计(人民币合计)
/// </summary>
public decimal ReceivableTotal { get; set; }
/// <summary>
/// 应付款总计
/// 应付款总计(人民币合计)
/// </summary>
public decimal PayableTotal { get; set; }
@ -25,7 +25,7 @@ namespace DS.WMS.Core.Fee.Dtos
public decimal ProfitTotal { get { return ReceivableTotal - PayableTotal; } }
/// <summary>
/// 利润率
/// 利润率(利润/应付)
/// </summary>
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), "%");
}
}
@ -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
{

@ -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
{

@ -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;
/// <summary>
/// 汇率服务
/// </summary>
public interface IFeeCurrencyExchangeService
{
/// <summary>
@ -34,4 +36,5 @@ public interface IFeeCurrencyExchangeService
/// <param name="exchange">币别信息</param>
/// <returns></returns>
Task<DataResult<ExchangeRate>> GetExchangeRateAsync(ExchangeRate exchange);
}

@ -465,7 +465,7 @@ namespace DS.WMS.Core.Fee.Method
}
/// <summary>
/// 获取业务相关联的费用统计
/// 获取业务费用统计
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>

@ -205,7 +205,7 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns>
protected internal async Task FetchExchangeRateAsync(IEnumerable<FeeRecord> 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<FeeCurrency>().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;
// }
// }
//}
}
}

@ -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
/// 服务项目代码
/// </summary>
public string[]? ServiceItemCodes { get; set; }
/// <summary>
/// 推送设置
/// </summary>
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;
}
}
/// <summary>
/// 客户等级A/B/C/D
/// </summary>
public string? Grade { get; set; }
/// <summary>
/// 注册资金
/// </summary>
public decimal? RegisteredCapital { get; set; }
/// <summary>
/// 注册时间
/// </summary>
public DateTime? RegistrationTime { get; set; }
}
/// <summary>

@ -98,112 +98,6 @@ public class ClientInfoRes
/// </summary>
public bool IsStop { get; set; }
///// <summary>
///// Desc:发票抬头1
///// </summary>
//public string BillRises1 { get; set; }
///// <summary>
///// Desc:发票抬头2
///// </summary>
//public string BillRises2 { get; set; }
///// <summary>
///// Desc:美元支票抬头
///// </summary>
//public string USDBillRises { get; set; }
///// <summary>
///// Desc:人民币支票抬头
///// </summary>
//public string RMBBillRises { get; set; }
///// <summary>
///// Desc:人民币开户银行
///// </summary>
//public string RMBBank { get; set; }
///// <summary>
///// Desc:人民币账号
///// </summary>
//public string RMBAccount { get; set; }
///// <summary>
///// Desc:人民币联机行号
///// </summary>
//public string RMBOnlineNO { get; set; }
///// <summary>
///// Desc:美元开户银行
///// </summary>
//public string USDBank { get; set; }
///// <summary>
///// Desc:美元账号
///// </summary>
//public string USDAccount { get; set; }
///// <summary>
///// Desc:美元联机行号
///// </summary>
//public string USDOnlineNO { get; set; }
///// <summary>
///// Desc:自定义属性1
///// </summary>
//public string CustomAttributes1 { get; set; }
///// <summary>
///// Desc:自定义属性2
///// </summary>
//public string CustomAttributes2 { get; set; }
///// <summary>
///// Desc:美元信用最大金额
///// </summary>
//public decimal? USDMaxAmountCredit { get; set; } = 0;
///// <summary>
///// Desc:人民币信用最大金额
///// </summary>
//public decimal? RMBMaxAmountCredit { get; set; } = 0;
///// <summary>
///// Desc:信用最大金额RMB+USD
///// </summary>
//public decimal? MaxAmountCredit { get; set; } = 0;
///// <summary>
///// Desc:结算方式编码
///// </summary>
//public string StlName { get; set; }
///// <summary>
///// Desc:美金汇率
///// </summary>
//public decimal? USDExchangeRate { get; set; }
///// <summary>
///// Desc:月结算时间
///// </summary>
//public string StlDate { get; set; }
///// <summary>
///// Desc:上半月结算时间
///// </summary>
//public string StlFirstHalfDate { get; set; }
///// <summary>
///// Desc:下半月结算时间
///// </summary>
//public string StlMiddleDate { get; set; }
///// <summary>
///// Desc:票结结算时间
///// </summary>
//public string InvoiceStlDate { get; set; }
/// <summary>
/// Desc:等级
/// </summary>
@ -513,4 +407,47 @@ public class ClientInfoRes
/// 服务项目代码
/// </summary>
public string[]? ServiceItemCodes { get; set; }
[IgnoreDataMember]
public ClientAttribute Attribute { get; set; }
/// <summary>
/// 推送设置
/// </summary>
public ClientAttribute[]? Attributes
{
get
{
if (Attribute == ClientAttribute.None)
return [];
return Attribute.Split().Where(x => x != ClientAttribute.None).ToArray();
}
}
/// <summary>
/// 客户等级A/B/C/D
/// </summary>
public string? Grade { get; set; }
/// <summary>
/// 注册资金
/// </summary>
public decimal? RegisteredCapital { get; set; }
/// <summary>
/// 注册时间
/// </summary>
public DateTime? RegistrationTime { get; set; }
/// <summary>
/// 默认联系人
/// </summary>
public ClientContactRes? DefaultContact { get; set; }
/// <summary>
/// 最新账期
/// </summary>
public ClientAccountDateRes? LastAccountDate { get; set; }
}

@ -0,0 +1,23 @@
namespace DS.WMS.Core.Info.Dtos
{
/// <summary>
/// 往来单位附加查询条件
/// </summary>
public class ClientQuery
{
/// <summary>
/// 联系方式:电话/手机/邮箱
/// </summary>
public string? ContactInfo { get; set; }
/// <summary>
/// 是否合同到期
/// </summary>
public bool? IsContractExpired { get; set; }
/// <summary>
/// 客户标记
/// </summary>
public QueryClientInfo? ClientTag { get; set; }
}
}

@ -0,0 +1,23 @@
namespace DS.WMS.Core.Info.Dtos
{
/// <summary>
/// 往来单位使用情况
/// </summary>
public class ClientUsage
{
/// <summary>
/// ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 往来单位简称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 是否已使用
/// </summary>
public bool IsUsed { get; set; }
}
}

@ -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
{
/// <summary>
/// 检索往来单位

@ -406,4 +406,53 @@ public class InfoClient : SharedOrgModel<long>
[SugarColumn(ColumnDescription = "服务项目", ColumnDataType = "text", IsNullable = true)]
public string? ServiceItem { get; set; }
/// <summary>
/// 往来单位属性
/// </summary>
[SugarColumn(ColumnDescription = "往来单位属性")]
public ClientAttribute Attribute { get; set; }
/// <summary>
/// 客户等级A/B/C/D
/// </summary>
[SugarColumn(ColumnDescription = "客户等级", Length = 1, IsNullable = true)]
public string? Grade { get; set; }
/// <summary>
/// 注册资金
/// </summary>
[SugarColumn(ColumnDescription = "注册资金", IsNullable = true)]
public decimal? RegisteredCapital { get; set; }
/// <summary>
/// 注册时间
/// </summary>
[SugarColumn(ColumnDescription = "注册时间", IsNullable = true)]
public DateTime? RegistrationTime { get; set; }
///// <summary>
///// 往来单位标记
///// </summary>
//[Navigate(NavigateType.OneToOne, nameof(InfoClientTag.ClientId))]
//public InfoClientTag? Tag { get; set; }
///// <summary>
///// 账期
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientAccountDate.ClientId))]
//public List<InfoClientAccountDate>? Accounts { get; set; }
///// <summary>
///// 联系人
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientContact.ClientId))]
//public List<InfoClientContact>? Contacts { get; set; }
///// <summary>
///// 合同
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientContract.ClientId))]
//public List<InfoClientContract>? Contracts { get; set; }
}

@ -44,7 +44,7 @@ public interface IClientInfoService
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<ClientInfoRes>> GetListByPage(PageRequest request);
Task<DataResult<List<ClientInfoRes>>> GetListAsync(PageRequest<ClientQuery> request);
/// <summary>
/// 编辑

@ -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<ITaskService>(serviceProvider.GetRequiredService<ITaskService>());
}
#region 审核
/// <summary>
/// 提交审核
/// </summary>
@ -246,26 +249,73 @@ public class ClientInfoService : ServiceBase, IClientInfoService
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
#endregion
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<ClientInfoRes>> GetListByPage(PageRequest request)
public async Task<DataResult<List<ClientInfoRes>>> GetListAsync(PageRequest<ClientQuery> request)
{
//序列化查询条件
var whereList = request.GetConditionalModels(Db);
var result = TenantDb.Queryable<InfoClient>()
.Where(whereList)
.Select<ClientInfoRes>().ToQueryPage(request.PageCondition);
foreach (var item in whereList)
{
var condition = (ConditionalModel)item;
condition.FieldName = "c." + condition.FieldName.ToUpperCamelCase();
}
var query = TenantDb.Queryable<InfoClient>()
.LeftJoin<InfoClientContact>((c, c1) => c.Id == c1.ClientId)
.LeftJoin<InfoClientContract>((c, c1, c2) => c.Id == c2.ClientId)
.InnerJoinIF<InfoClientTag>(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<ClientInfoRes>().ToQueryPageAsync(request.PageCondition);
if (result.Data?.Count > 0)
{
var ids = result.Data.SelectMany(x => x.SaleOrgIdList).Distinct();
var orgs = Db.Queryable<SysOrg>().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<InfoClientContact>().Where(x => ids.Contains(x.ClientId) && x.IsDefault)
.Select<ClientContactRes>().ToList();
var accountDates = TenantDb.Queryable<InfoClientAccountDate>().Where(x => ids.Contains(x.ClientId) && x.Id ==
SqlFunc.Subqueryable<InfoClientAccountDate>().Where(y => y.Id == x.Id).Select(y => SqlFunc.AggregateMax(y.Id))
).Select<ClientAccountDateRes>().ToList();
var ids2 = result.Data.SelectMany(x => x.SaleOrgIdList).Distinct();
var orgs = Db.Queryable<SysOrg>().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;
}
/// <summary>
/// 确定往来单位是否已使用
/// </summary>
/// <param name="ids">往来单位ID</param>
/// <returns></returns>
public async Task<DataResult<List<ClientUsage>>> GetUsageAsync(params long[] ids)
{
var list = await TenantDb.Queryable<InfoClient>()
.Select(c => new ClientUsage
{
Id = c.Id,
Name = c.ShortName,
IsUsed = SqlFunc.Subqueryable<SeaExport>().Where(s => c.Id == s.CustomerId || c.Id == s.ForwarderId || c.Id == s.YardId).Any()
}).ToListAsync();
var result = DataResult<List<ClientUsage>>.Success(list);
result.Count = list.Count;
return result;
}
/// <summary>
/// 编辑
/// </summary>
@ -292,9 +362,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
if (req.Id == 0)
{
if (TenantDb.Queryable<InfoClient>().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<InfoClientTag>();
//助记码
@ -319,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)

@ -221,7 +221,7 @@ public partial class SeaExportService : ISeaExportService
// return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
//}
//
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user);
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user,req.SaleId);
if (!sequence.Succeeded)
{
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
@ -589,6 +589,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<InfoClientContact>().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)
@ -698,7 +726,7 @@ public partial class SeaExportService : ISeaExportService
}
//获取表单复制模板
var template = tenantDb.Queryable<CodeFormCopy>().Where(x => x.PermissionId == 1772509201441099776).First();
var sequence = commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user).GetAwaiter().GetResult();
var sequence = commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user, info.SaleId).GetAwaiter().GetResult();
if (!sequence.Succeeded)
{
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);

@ -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;
}

@ -1,107 +0,0 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.Op.Dtos.SeaExportRes> *@
@{
var item = Model.Primary;
}
<style>
.parent {
position: relative;
height: 300px;
width: 300px;
}
.child {
position: absolute;
bottom: 0;
right: 0;
width: 50px;
height: 50px;
}
.title {
background-color: darkblue;
color: whitesmoke;
font-size: 20px;
font-weight: 300;
}
</style>
<span>*** 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! ***</span>
<br />
Dear @Model.Contacts
<div class="title">
RE: BOOKING - JOB NO.
</div>
请查看附件中的订舱委托请2小时内先行回复订舱号给我们并帮忙催促船东尽快放舱如下信息同订舱委托一致便于您查阅
CARRIER@item.Carrier
S/QXX
ETD : @item.ETD
POL: @item.LoadPort
POD: @item.DischargePort
FPOD: @item.DeliveryPlace
VOL: XX
Commdity: XX取中文品名
HS CODE: @item.HSCode
POD FREE TIME
REMARK
(取供应商备注)
此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!
<table>
<thead>
<tr>
<th>CN Name</th>
<th>Name</th>
<th>Tel No.</th>
<th>Mobile/Wechat/QQ</th>
<th>Email</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<tr>
<td>邵 芳</td>
<td>Candy</td>
<td>0532-80688387</td>
<td>13375570007 2853083550</td>
<td>candy@sunniness.net</td>
<td>Cooperation</td>
</tr>
<tr>
<td>魏涛</td>
<td>Wilson</td>
<td>0532-80688353</td>
<td>13969858993 2853083555</td>
<td>ope@sunniness.net</td>
<td>OP manager</td>
</tr>
<tr>
<td>徐平平</td>
<td>Cathy</td>
<td>0532-80688350</td>
<td>13969662965 2853083551</td>
<td>opg@sunniness.net</td>
<td>Document</td>
</tr>
</tbody>
</table>
<div class="parent">
<div id="sign" class="child">
@* Tks + Brgds
Candy SHAO 邵芳 (此处用当票操作的信息)
General Manager | SUNNINESS LOGISTICS CO.,LTD.
TEL: +86-0532-80688387 |MB./We chat: +86-18866622731|QQ:2853083553 | Email:candy@sunniness.net *@
</div>
</div>
@* 此邮件模板是订舱委托推送的邮件模板,在商务订单审核通过后,自动生成,并推送:
1蓝色是调取系统数据、红色是醒目提醒
2订舱委托PDF格式作为附件一起发出
3邮件发给订舱代理联系人抄送我司销售/客服和操作/单证;未勾选推送的订舱代理,仅推送我司干系人! *@

@ -1,122 +0,0 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel
@{
var item = Model.Primary;
} *@
<style>
.parent {
position: relative;
height: 300px;
width: 300px;
}
.child {
position: absolute;
bottom: 0;
right: 0;
width: 50px;
height: 50px;
}
.title {
background-color: darkblue;
color: whitesmoke;
font-size: 20px;
font-weight: 300;
}
</style>
TO:
<span>*** 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! ***</span>
<br />
Dear @Model.Contacts
<div class="title">
RE: BOOKING - @Model.Primary.CustomerNo
</div>
<br />
请查看附件中的订舱委托请2小时内先行回复订舱号给我们并帮忙催促船东尽快放舱如下信息同订舱委托一致便于您查阅
<br />
CARRIER@Model.Primary.Carrier
<br />
S/QXX <br />
ETD : @Model.Primary.ETD
<br />
<br />
POL: @Model.Primary.LoadPort
<br />
POD: @Model.Primary.DischargePort
<br />
FPOD: @Model.Primary.DeliveryPlace
<br />
VOL: @Model.Primary.CntrTotal
<br />
Commdity: @Model.Primary.GoodsName
<br />
HS CODE: @Model.Primary.HSCode
<br />
POD FREE TIME<br />
REMARK@Model.Primary.BookingRemark
<br />
此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!<br />
<table>
<thead>
<tr>
<th>CN Name</th>
<th>Name</th>
<th>Tel No.</th>
<th>Mobile/Wechat/QQ</th>
<th>Email</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Model.Sales.Name</td>
<td>@Model.Sales.EnName</td>
<td>@Model.Sales.Tel</td>
<td>@Model.Sales.Mobile</td>
<td>@Model.Sales.Email</td>
<td>Cooperation</td>
</tr>
<tr>
<td>@Model.Operator.Name</td>
<td>@Model.Operator.EnName</td>
<td>@Model.Operator.Tel</td>
<td>@Model.Operator.Mobile</td>
<td>@Model.Operator.Email</td>
<td>OP manager</td>
</tr>
<tr>
<td>@Model.Document.Name</td>
<td>@Model.Document.EnName</td>
<td>@Model.Document.Tel</td>
<td>@Model.Document.Mobile</td>
<td>@Model.Document.Email</td>
<td>Document</td>
</tr>
</tbody>
</table>
<br />
<br />
<div class="parent">
<div id="sign" class="child">
Tks + Brgds<br />
@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
</div>
</div>
@* 此邮件模板是订舱委托推送的邮件模板,在商务订单审核通过后,自动生成,并推送:
1蓝色是调取系统数据、红色是醒目提醒
2订舱委托PDF格式作为附件一起发出
3邮件发给订舱代理联系人抄送我司销售/客服和操作/单证;未勾选推送的订舱代理,仅推送我司干系人! *@

@ -0,0 +1,71 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel *@
<p>TO:</p>
<p><span style="color: #e03e2d;"> *** 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! ***</span></p>
<p><br />Dear @Model.Contacts</p>
<div class="title"><span style="font-size: 14pt; background-color: #c2e0f4;"><strong>RE: BOOKING - @Model.Primary.CustomerNo</strong></span></div>
<p style="line-height: 2;"><br />请查看附件中的订舱委托请2小时内先行回复订舱号给我们并帮忙催促船东尽快放舱如下信息同订舱委托一致便于您查阅 <br />CARRIER@Model.Primary.Carrier <br />S/Q@Model.Primary.ContractNo<br />ETD : @Model.Primary.ETD <br /><br />POL: @Model.Primary.LoadPort <br />POD: @Model.Primary.DischargePort <br />FPOD: @Model.Primary.DeliveryPlace <br />VOL: @Model.Primary.CntrTotal <br />Commdity: @Model.Primary.GoodsName <br />HS CODE: @Model.Primary.HSCode <br />POD FREE TIME<br />REMARK@Model.Primary.BookingRemark</p>
<p><br /><strong><span style="color: #34495e;">此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!</span></strong></p>
<table style="border: 2px solid black;">
<thead style="border: 2px solid black;background-color:#C2C2C2;">
<tr>
<th>CN Name</th>
<th>Name</th>
<th>Tel No.</th>
<th>Mobile/Wechat/QQ</th>
<th>Email</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Model.Sales.Name</td>
<td>@Model.Sales.EnName</td>
<td>@Model.Sales.Tel</td>
<td>@Model.Sales.Mobile</td>
<td>@Model.Sales.Email</td>
<td>Cooperation</td>
</tr>
<tr>
<td>@Model.Operator.Name</td>
<td>@Model.Operator.EnName</td>
<td>@Model.Operator.Tel</td>
<td>@Model.Operator.Mobile</td>
<td>@Model.Operator.Email</td>
<td>OPmanager</td>
</tr>
<tr>
<td>@Model.Document.Name</td>
<td>@Model.Document.EnName</td>
<td>@Model.Document.Tel</td>
<td>@Model.Document.Mobile</td>
<td>@Model.Document.Email</td>
<td>Document</td>
</tr>
</tbody>
</table>
<p><br /><br /></p>
<div class="parent">
@* 注意!!id=sign的元素在发送邮件时程序会自动插入当前发件人的用户签名 *@
<div id="sign" class="child">
Tks + B&rsquo;rgds&nbsp;&nbsp;<br />
@Model.Document.EnName&nbsp;@Model.Document.Name&nbsp;
</div>
<div>
@if(Model.Primary.SourceName == "WSL")
{
<span>@Model.Operator.Name</span>
<span>@Model.Operator.EnName</span>
}
else if(Model.Primary.SourceName == "WSL")
{
<span>@Model.Sales.Name</span>
<span>@Model.Sales.EnName</span>
}
</div
<div class="child">General Manager | <span style="color: #e67e23;">SUNNINESS LOGISTICS CO.,LTD.&nbsp;</span> &nbsp;
</div>
<div class="child"><strong>TEL:</strong> @Model.Document.Tel&nbsp; &nbsp;|<strong>MB./We chat: </strong>@Model.Document.Mobile|<strong>QQ:</strong>2853083553 | <strong>Email:</strong>@Model.Document.Email</div>
</div>

@ -161,10 +161,7 @@ public class UserReq
[Description("英文名称")]
public string UserEnName { get; set; }
/// <summary>
/// 用戶航线
/// </summary>
public long?[] LaneIds { get; set; }
/// <summary>
/// 是否航线操作人员
/// </summary>
@ -211,6 +208,12 @@ public class UserReq
/// </summary>
[Description("身份证号")]
public string IdCardNo { get; set; }
/// <summary>
/// QQ
/// </summary>
[Description("QQ")]
public string QQ { get; set; }
}
/// <summary>

@ -1,3 +1,5 @@
using System.ComponentModel;
namespace DS.WMS.Core.Sys.Dtos;
/// <summary>
@ -79,4 +81,9 @@ public class UserSelectRes
/// 邮件签名
/// </summary>
public string SignatureHtml { get; set; } = "";
/// <summary>
/// QQ
/// </summary>
[Description("QQ")]
public string QQ { get; set; }
}

@ -178,10 +178,7 @@ public class UserViewModel
[Description("英文名称")]
public string UserEnName { get; set; }
/// <summary>
/// 用戶航线
/// </summary>
public long?[] LaneIds { get; set; }
/// <summary>
/// 业务来源Id
/// </summary>
@ -233,4 +230,11 @@ public class UserViewModel
/// 用户角色
/// </summary>
public string RoleName { get; set; }
/// <summary>
/// QQ
/// </summary>
[Description("QQ")]
public string QQ { get; set; }
}

@ -106,7 +106,11 @@ public class SysUser : UserTenantModel<long>
/// </summary>
[Description("邮箱")]
public string Email { get; set; }
/// <summary>
/// QQ
/// </summary>
[Description("QQ")]
public string QQ { get; set; }
/// <summary>
/// 职位
/// </summary>

@ -209,7 +209,7 @@ public interface ICommonService
/// 获取最新业务单据编码
/// </summary>
/// <returns></returns>
public Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user);
public Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0);
/// <summary>
/// 获取字典明细

@ -2050,7 +2050,7 @@ public class CommonService : ICommonService
/// 获取最新业务单据编码
/// </summary>
/// <returns></returns>
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user)
public async Task<DataResult<string>> GetSequenceNextAsync<T>(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<SysUser>().FirstAsync(x => x.Id == long.Parse(user.UserId));
if (saleId == 0)
{
return await Task.FromResult(DataResult<string>.Failed("请维护订单揽货人信息!"));
}
var userInfo = await db.Queryable<SysUser>().FirstAsync(x => x.Id == saleId);
if (userInfo.UserNumber.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("该用户编码未维护!"));
return await Task.FromResult(DataResult<string>.Failed("该揽货人用户编码未维护!"));
}
sequenceNewNo += userInfo.UserNumber;
}

@ -82,7 +82,6 @@ public class UserService : IUserService
var roleIds = db.Queryable<SysRoleUser>().Where(x => x.UserId == long.Parse(id)).Select(x => x.RoleId).ToArray();
var orgIds = db.Queryable<SysOrgUser>().Where(x => x.UserId == long.Parse(id)).Select(x => x.OrgId).ToArray();
var laneIds = db.Queryable<SysUserLane>().Where(x => x.UserId == long.Parse(id)).Select(x => x.LaneId).ToArray();
var data = db.Queryable<SysUser>()
.Where(x => x.Id == long.Parse(id))
@ -91,7 +90,6 @@ public class UserService : IUserService
{
it.RoleIds = roleIds;
it.OrgIds = orgIds;
it.LaneIds = laneIds;
})
.First();
return DataResult<UserViewModel>.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
@ -252,34 +238,6 @@ public class UserService : IUserService
}
#endregion 处理用户机构
#region 处理用户航线
var existLanes = db.Queryable<SysUserLane>().Where(x => x.UserId == userId).Select(n => n.LaneId)
.ToArray();
IEnumerable<long?> delLanes = existLanes.AsQueryable().Except(model.LaneIds);
if (delLanes.Count() > 0)
{
db.Deleteable<SysUserLane>()
.Where(it => it.UserId == userId && delLanes.Contains(it.LaneId))
.ExecuteCommand();
}
IEnumerable<long?> 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);
}
@ -309,9 +267,6 @@ public class UserService : IUserService
if (orgUsers.Count > 0)
await db.Deleteable(orgUsers).ExecuteCommandAsync();
var userLanes = await db.Queryable<SysUserLane>().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();

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>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||;</History>
<History>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||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -86,10 +86,9 @@ public class ClientInfoController : ApiController
/// <returns></returns>
[HttpPost]
[Route("GetClientInfoList")]
public DataResult<List<ClientInfoRes>> GetClientInfoList([FromBody] PageRequest request)
public async Task<DataResult<List<ClientInfoRes>>> GetListAsync([FromBody] PageRequest<ClientQuery> request)
{
var res = _invokeService.GetListByPage(request);
return res;
return await _invokeService.GetListAsync(request);
}
/// <summary>

Loading…
Cancel
Save