|
|
@ -1,5 +1,4 @@
|
|
|
|
using Furion.DatabaseAccessor;
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
using Furion.EventBus;
|
|
|
|
using Furion.EventBus;
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
using Furion.FriendlyException;
|
|
|
@ -10,8 +9,7 @@ using Myshipping.Application.Entity;
|
|
|
|
using Myshipping.Application.Service.Fee.Dto;
|
|
|
|
using Myshipping.Application.Service.Fee.Dto;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
using SqlSugar;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
@ -45,6 +43,9 @@ namespace Myshipping.Application
|
|
|
|
_repCustTemplete = repCustTemplete;
|
|
|
|
_repCustTemplete = repCustTemplete;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 分页查询往来单位固定费用列表
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
[HttpGet("/FeeCustTemplate/Page")]
|
|
|
|
[HttpGet("/FeeCustTemplate/Page")]
|
|
|
|
public async Task<dynamic> Page(FeeCustTemplatePageInput input)
|
|
|
|
public async Task<dynamic> Page(FeeCustTemplatePageInput input)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -69,9 +70,13 @@ namespace Myshipping.Application
|
|
|
|
return detail?.Adapt<FeeCustTemplateDto>();
|
|
|
|
return detail?.Adapt<FeeCustTemplateDto>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 往来单位固定费用保存
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/FeeCustTemplate/Save")]
|
|
|
|
[HttpPost("/FeeCustTemplate/Save")]
|
|
|
|
public async Task Save(FeeCustTemplateDto input)
|
|
|
|
public async Task Save(FeeCustTemplateDto input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var entity = input.Adapt<FeeCustTemplateDetail>();
|
|
|
|
if (input.Id == 0)
|
|
|
|
if (input.Id == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 判断是否已经存在同单位、同费用的记录
|
|
|
|
// 判断是否已经存在同单位、同费用的记录
|
|
|
@ -79,7 +84,7 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Bah("此往来单位下已存在此费用项");
|
|
|
|
throw Oops.Bah("此往来单位下已存在此费用项");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await _repCustTemplete.InsertAsync(input);
|
|
|
|
await _repCustTemplete.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -88,13 +93,23 @@ namespace Myshipping.Application
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Bah("此往来单位下已存在此费用项");
|
|
|
|
throw Oops.Bah("此往来单位下已存在此费用项");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await _repCustTemplete.AsUpdateable(input).IgnoreColumns(c => new { c.TenantId, c.TenantName }).ExecuteCommandAsync();
|
|
|
|
await _repCustTemplete.AsUpdateable(entity).IgnoreColumns(c => new { c.TenantId, c.TenantName }).ExecuteCommandAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//[HttpPost("/FeeCustTemplate/Delete")]
|
|
|
|
/// <summary>
|
|
|
|
//public async Task Delete()
|
|
|
|
/// 往来单位固定费用删除
|
|
|
|
//{
|
|
|
|
/// </summary>
|
|
|
|
//}
|
|
|
|
[HttpPost("/FeeCustTemplate/Delete")]
|
|
|
|
|
|
|
|
public async Task Delete([FromBody] long[] ids)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await _repCustTemplete.UpdateAsync(c => ids.Contains(c.Id), c => new FeeCustTemplateDetail
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IsDeleted = true,
|
|
|
|
|
|
|
|
UpdatedTime = DateTime.Now,
|
|
|
|
|
|
|
|
UpdatedUserId = UserManager.UserId,
|
|
|
|
|
|
|
|
UpdatedUserName = UserManager.Name
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|