增加服务基类

usertest
嵇文龙 4 months ago
parent d6679f19ac
commit b83efab256

@ -1,13 +1,10 @@
using System.Linq.Expressions;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Op.Entity;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Fee.Method
@ -15,7 +12,7 @@ namespace DS.WMS.Core.Fee.Method
/// <summary>
/// 费用服务基类
/// </summary>
public abstract class FeeServiceBase
public class FeeServiceBase : ServiceBase
{
/// <summary>
/// 人民币代码
@ -27,43 +24,12 @@ namespace DS.WMS.Core.Fee.Method
/// </summary>
public const string USD_CODE = "USD";
/// <summary>
/// 获取用户相关信息
/// </summary>
protected IUser User { get; private set; }
/// <summary>
/// 获取主库访问对象
/// </summary>
protected ISqlSugarClient Db { get; private set; }
/// <summary>
/// 获取业务库访问对象
/// </summary>
protected ISaasDbService SaasService { get; private set; }
SqlSugarScopeProvider? _tenantDb;
/// <summary>
/// 获取业务库访问对象
/// </summary>
protected SqlSugarScopeProvider TenantDb
{
get
{
if (_tenantDb == null)
_tenantDb = SaasService.GetBizDbScopeById(User.TenantId);
return _tenantDb;
}
}
/// <summary>
/// 初始化
/// </summary>
/// <param name="serviceProvider">服务提供程序</param>
protected FeeServiceBase(IServiceProvider serviceProvider)
public FeeServiceBase(IServiceProvider serviceProvider) :base(serviceProvider)
{
User = serviceProvider.GetRequiredService<IUser>();
Db = serviceProvider.GetRequiredService<ISqlSugarClient>();
SaasService = serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
@ -237,16 +203,6 @@ namespace DS.WMS.Core.Fee.Method
}
}
/// <summary>
/// 查找模板
/// </summary>
/// <param name="auditType">审批类型</param>
/// <returns></returns>
protected internal async Task<FlowTemplateTenant> FindTemplateAsync(AuditType auditType)
{
return await Db.Queryable<FlowTemplateTenant>().FirstAsync(x => x.Status == StatusEnum.Enable && x.AuditType == auditType);
}
/// <summary>
/// 获取汇率
/// </summary>

@ -285,10 +285,15 @@ public class ClientInfoReq
/// </summary>
public string OrganizationCode { get; set; }
/// <summary>
/// 所属集团ID
/// </summary>
public long? PcorpId { get; set; }
/// <summary>
/// Desc: 所属集团
/// </summary>
public string PcorpName { get; set; }
public string? PcorpName { get; set; }
/// <summary>
/// Desc:企业商检备案号

@ -0,0 +1,10 @@
namespace DS.WMS.Core.Info.Dtos
{
/// <summary>
/// 客户合并请求参数
/// </summary>
public class ClientMergeRequest
{
}
}

@ -342,11 +342,17 @@ public class InfoClient : BaseOrgModel<long>
[SugarColumn(ColumnDescription = "组织机构代码", Length = 50, IsNullable = true)]
public string OrganizationCode { get; set; }
/// <summary>
/// 所属集团ID
/// </summary>
[SugarColumn(ColumnDescription = "所属集团ID", IsNullable = true)]
public long? PcorpId { get; set; }
/// <summary>
/// Desc: 所属集团
/// </summary>
[SugarColumn(ColumnDescription = "所属集团", Length = 50, IsNullable = true)]
public string PcorpName { get; set; }
public string? PcorpName { get; set; }
/// <summary>
/// Desc:企业商检备案号

@ -1,10 +1,12 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Sys.Dtos;
namespace DS.WMS.Core.Info.Interface;
/// <summary>
/// 往来单位
/// </summary>
public interface IClientInfoService
{
/// <summary>
@ -29,13 +31,12 @@ public interface IClientInfoService
/// <returns></returns>
DataResult<ClientInfoRes> GetClientInfo(string id);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelClientInfo(IdModel req);
Task<DataResult> DeleteAsync(IdModel req);
/// <summary>
/// 获取往来单位详情(含有联系人列表)

@ -1,8 +1,6 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Check.Entity;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Dtos;
@ -10,29 +8,20 @@ using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Op.Entity;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Info.Method;
/// <summary>
/// 往来单位服务
/// </summary>
public class ClientInfoService : IClientInfoService
public class ClientInfoService : ServiceBase, IClientInfoService
{
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public ClientInfoService(IServiceProvider serviceProvider)
public ClientInfoService(IServiceProvider serviceProvider) : base(serviceProvider)
{
db = serviceProvider.GetRequiredService<ISqlSugarClient>();
user = serviceProvider.GetRequiredService<IUser>();
saasService = serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
@ -42,10 +31,9 @@ public class ClientInfoService : IClientInfoService
/// <returns></returns>
public DataResult<List<ClientInfoRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<InfoClient>()
var whereList = request.GetConditionalModels(Db);
var data = TenantDb.Queryable<InfoClient>()
.Where(whereList)
.Select<ClientInfoRes>().ToQueryPage(request.PageCondition);
return data;
@ -58,10 +46,9 @@ public class ClientInfoService : IClientInfoService
/// <returns></returns>
public DataResult EditClientInfo(ClientInfoReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Id == 0)
{
if (tenantDb.Queryable<InfoClient>().Where(x => x.CodeName == req.CodeName).Any())
if (TenantDb.Queryable<InfoClient>().Where(x => x.CodeName == req.CodeName).Any())
{
return DataResult.Failed("客户信息已存在!", MultiLanguageConst.ClientInfoExist);
}
@ -69,21 +56,21 @@ public class ClientInfoService : IClientInfoService
var data = req.Adapt<InfoClient>();
var tag = req.ClientTag.Adapt<InfoClientTag>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = TenantDb.Insertable(data).ExecuteReturnEntity();
tag.ClientId = entity.Id;
tenantDb.Insertable(tag).ExecuteCommand();
TenantDb.Insertable(tag).ExecuteCommand();
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = tenantDb.Queryable<InfoClient>().Where(x => x.Id == req.Id).First();
var tag = tenantDb.Queryable<InfoClientTag>().Where(x => x.ClientId == req.Id).First();
var info = TenantDb.Queryable<InfoClient>().Where(x => x.Id == req.Id).First();
var tag = TenantDb.Queryable<InfoClientTag>().Where(x => x.ClientId == req.Id).First();
info = req.Adapt(info);
tag = req.ClientTag.Adapt(tag);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
tenantDb.Updateable(tag).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
TenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
TenantDb.Updateable(tag).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
@ -95,10 +82,9 @@ public class ClientInfoService : IClientInfoService
/// <returns></returns>
public DataResult<ClientInfoRes> GetClientInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var tag = tenantDb.Queryable<InfoClientTag>().Select<ClientTagRes>()
var tag = TenantDb.Queryable<InfoClientTag>().Select<ClientTagRes>()
.First(a => a.ClientId == long.Parse(id));
var data = tenantDb.Queryable<InfoClient>()
var data = TenantDb.Queryable<InfoClient>()
.Where(a => a.Id == long.Parse(id))
.Select<ClientInfoRes>()
// .Select(x => new ClientInfoRes()
@ -110,72 +96,99 @@ public class ClientInfoService : IClientInfoService
return DataResult<ClientInfoRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
public DataResult BatchDelClientInfo(IdModel req)
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task<DataResult> DeleteAsync(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<InfoClient>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
await TenantDb.Ado.BeginTranAsync();
try
{
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ShipperId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ShipperId)).Any())
return DataResult.Failed("存在海运出口使用的发货人信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ConsigneeId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ConsigneeId)).Any())
return DataResult.Failed("存在海运出口使用的收货人信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.NotifyPartyId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.NotifyPartyId)).Any())
return DataResult.Failed("存在海运出口使用的通知人信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.AgentId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.AgentId)).Any())
return DataResult.Failed("存在海运出口使用的国外代理人信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ShipAgencyId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.ShipAgencyId)).Any())
return DataResult.Failed("存在海运出口使用的船代I信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.CustomerId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.CustomerId)).Any())
return DataResult.Failed("存在海运出口使用的委托单位信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.YardId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.YardId)).Any())
return DataResult.Failed("存在海运出口使用的场站信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.CarrierId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.CarrierId)).Any())
return DataResult.Failed("存在海运出口使用的船公司信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.ForwarderId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.ForwarderId)).Any())
return DataResult.Failed("存在海运出口使用的货代公司信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.CustomserId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.CustomserId)).Any())
return DataResult.Failed("存在海运出口使用的报关行信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.TruckerId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.TruckerId)).Any())
return DataResult.Failed("存在海运出口使用的承运车队信息!");
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains((long)x.WareHouseId)).Any())
if (TenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.WareHouseId)).Any())
return DataResult.Failed("存在海运出口使用的仓库信息!");
if (tenantDb.Queryable<FeeRecord>().Where(x => req.Ids.Contains((long)x.CustomerId)).Any())
if (TenantDb.Queryable<FeeRecord>().Where(x => req.Ids.Contains(x.CustomerId)).Any())
return DataResult.Failed("存在费用记录使用的费用对象信息!");
if (tenantDb.Queryable<CheckBill>().Where(x => req.Ids.Contains((long)x.CustomerId)).Any())
if (TenantDb.Queryable<CheckBill>().Where(x => req.Ids.Contains(x.CustomerId)).Any())
return DataResult.Failed("存在客户对账使用的对账客户信息!");
if (tenantDb.Queryable<CheckBillAuto>().Where(x => req.Ids.Contains((long)x.CustomerId)).Any())
if (TenantDb.Queryable<CheckBillAuto>().Where(x => req.Ids.Contains(x.CustomerId)).Any())
return DataResult.Failed("存在自动对账使用的对账客户信息!");
//银行信息
var banks = tenantDb.Queryable<InfoClientBank>().Where(x => req.Ids.Contains(x.ClientId)).ToList();
if(banks.Count>0)
tenantDb.Deleteable(banks).ExecuteCommand();
await TenantDb.Deleteable<InfoClientBank>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//联系人
var contacts = tenantDb.Queryable<InfoClientContact>().Where(x => req.Ids.Contains(x.ClientId)).ToList();
if (contacts.Count > 0)
tenantDb.Deleteable(contacts).ExecuteCommand();
await TenantDb.Deleteable<InfoClientContact>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//合同信息
var contracts = tenantDb.Queryable<InfoClientContract>().Where(x => req.Ids.Contains(x.ClientId)).ToList();
if (contracts.Count > 0)
tenantDb.Deleteable(contracts).ExecuteCommand();
await TenantDb.Deleteable<InfoClientContract>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//账期
var accountDates = tenantDb.Queryable<InfoClientAccountDate>().Where(x => req.Ids.Contains(x.ClientId)).ToList();
if (accountDates.Count > 0)
tenantDb.Deleteable(accountDates).ExecuteCommand();
await TenantDb.Deleteable<InfoClientAccountDate>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//收发货人
var clientShippers = tenantDb.Queryable<InfoClientShipper>().Where(x => req.Ids.Contains(x.ClientId)).ToList();
if (clientShippers.Count > 0)
tenantDb.Deleteable(clientShippers).ExecuteCommand();
await TenantDb.Deleteable<InfoClientShipper>().Where(x => req.Ids.Contains(x.ClientId)).ExecuteCommandAsync();
//删除客户信息
tenantDb.Deleteable(list).ExecuteCommand();
await TenantDb.Deleteable<InfoClient>().Where(x => req.Ids.Contains(x.Id)).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
/// <summary>
/// 客户合并
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult> MergeAsync(ClientMergeRequest request)
{
await TenantDb.Ado.BeginTranAsync();
try
{
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
}
#region 获取往来单位详情(含有联系人列表)
/// <summary>
/// 获取往来单位详情(含有联系人列表)
@ -184,11 +197,9 @@ public class ClientInfoService : IClientInfoService
/// <returns>返回往来单位详情</returns>
public async Task<DataResult<ClientInfoRes>> GetClientInfoWithContact(QueryClientInfo query)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<InfoClient>().InnerJoin<InfoClientTag>((c,t)=> c.Id == t.ClientId)
.Where((c,t)=> c.Id == query.ClientId)
.WhereIF(query.IsController,(c,t)=>t.IsController.HasValue && t.IsController.HasValue)
var data = await TenantDb.Queryable<InfoClient>().InnerJoin<InfoClientTag>((c, t) => c.Id == t.ClientId)
.Where((c, t) => c.Id == query.ClientId)
.WhereIF(query.IsController, (c, t) => t.IsController.HasValue && t.IsController.HasValue)
.WhereIF(query.IsSpecialApproval, (c, t) => t.IsSpecialApproval.HasValue && t.IsSpecialApproval.HasValue)
.WhereIF(query.IsCarrier, (c, t) => t.IsCarrier.HasValue && t.IsCarrier.HasValue)
.WhereIF(query.IsBooking, (c, t) => t.IsBooking.HasValue && t.IsBooking.HasValue)
@ -213,14 +224,14 @@ public class ClientInfoService : IClientInfoService
.WhereIF(query.IsShipAgency, (c, t) => t.IsShipAgency.HasValue && t.IsShipAgency.HasValue)
.WhereIF(query.IsEnterprise, (c, t) => t.IsEnterprise.HasValue && t.IsEnterprise.HasValue)
.Select((c,t)=> new { Client = c, tag = t })
.Select((c, t) => new { Client = c, tag = t })
.FirstAsync();
var clientInfo = data.Client.Adapt<ClientInfoRes>();
clientInfo.ClientTag = data.tag.Adapt<ClientTagRes>();
var contactList = tenantDb.Queryable<InfoClientContact>()
var contactList = TenantDb.Queryable<InfoClientContact>()
.Where(a => a.ClientId == clientInfo.Id && a.Status == StatusEnum.Enable).ToList();
if (contactList.Count > 0)

@ -2,7 +2,6 @@
using DS.Module.Core.Extensions;
using DS.Module.Core.Helpers;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Method;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface;
@ -23,7 +22,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
/// <summary>
/// 任务交互服务
/// </summary>
public abstract class TaskService : FeeServiceBase, ITaskService
public abstract class TaskService : ServiceBase, ITaskService
{
const long PERMISSION_ID = 1815294400855674880;

@ -0,0 +1,64 @@
using DS.Module.Core;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Flow.Entity;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core
{
/// <summary>
/// 服务基类
/// </summary>
public abstract class ServiceBase
{
/// <summary>
/// 获取用户相关信息
/// </summary>
protected IUser User { get; private set; }
/// <summary>
/// 获取主库访问对象
/// </summary>
protected ISqlSugarClient Db { get; private set; }
/// <summary>
/// 获取业务库访问对象
/// </summary>
protected ISaasDbService SaasService { get; private set; }
SqlSugarScopeProvider? _tenantDb;
/// <summary>
/// 获取业务库访问对象
/// </summary>
protected SqlSugarScopeProvider TenantDb
{
get
{
if (_tenantDb == null)
_tenantDb = SaasService.GetBizDbScopeById(User.TenantId);
return _tenantDb;
}
}
/// <summary>
/// 初始化
/// </summary>
/// <param name="serviceProvider">服务提供程序</param>
protected ServiceBase(IServiceProvider serviceProvider)
{
User = serviceProvider.GetRequiredService<IUser>();
Db = serviceProvider.GetRequiredService<ISqlSugarClient>();
SaasService = serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 查找审批模板
/// </summary>
/// <param name="auditType">审批类型</param>
/// <returns></returns>
protected internal async Task<FlowTemplateTenant> FindTemplateAsync(AuditType auditType)
{
return await Db.Queryable<FlowTemplateTenant>().FirstAsync(x => x.Status == StatusEnum.Enable && x.AuditType == auditType);
}
}
}

@ -3127,3 +3127,17 @@
2024-07-23 17:37:40.3551 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-23 17:37:40.3551 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-23 17:37:40.3714 Info Configuration initialized.
2024-07-29 14:08:16.9491 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-29 14:08:16.9888 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-29 14:08:16.9929 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-29 14:08:17.0102 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-29 14:08:17.0102 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-29 14:08:17.0102 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-29 14:08:17.0268 Info Configuration initialized.
2024-07-29 14:09:50.4372 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-29 14:09:50.5093 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-29 14:09:50.5093 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-29 14:09:50.5304 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-29 14:09:50.5304 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-29 14:09:50.5412 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-29 14:09:50.5412 Info Configuration initialized.

@ -1,8 +1,7 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
@ -62,6 +61,20 @@ public class ClientInfoController : ApiController
return res;
}
/// <summary>
/// 根据ID删除
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost, Route("Delete")]
public async Task<DataResult> DeleteAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteAsync(model);
}
/// <summary>
/// 获取往来单位详情(含有联系人列表)
/// </summary>

Loading…
Cancel
Save