|
|
@ -1,6 +1,5 @@
|
|
|
|
using DS.Module.Core;
|
|
|
|
using DS.Module.Core;
|
|
|
|
using DS.Module.Core.Condition;
|
|
|
|
using DS.Module.Core.Condition;
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
|
using DS.WMS.Core.Fee.Dtos;
|
|
|
@ -593,7 +592,7 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="list"></param>
|
|
|
|
/// <param name="list"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult> BulkEditAsync(List<FeeCustTemplate> list)
|
|
|
|
public async Task<DataResult> BulkEditAsync(List<FeeCustTemplate> list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int rows = await TenantDb.Updateable(list).UpdateColumns(x => new
|
|
|
|
int rows = await TenantDb.Updateable(list).UpdateColumns(x => new
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -674,14 +673,50 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 复制模板
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="ids"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public async Task<DataResult> CopyAsync(params long[] ids)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
|
|
|
|
DateTime dt = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = await TenantDb.Queryable<FeeCustTemplate>().Where(x => ids.Contains(x.Id))
|
|
|
|
|
|
|
|
.Includes(x => x.Details).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.Id = 0;
|
|
|
|
|
|
|
|
item.CreateTime = dt;
|
|
|
|
|
|
|
|
item.CreateBy = userId;
|
|
|
|
|
|
|
|
item.UpdateBy = null;
|
|
|
|
|
|
|
|
item.UpdateTime = null;
|
|
|
|
|
|
|
|
item.Name += "-Copy";
|
|
|
|
|
|
|
|
item.DeptOrgId ??= User.OrgId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var detail in item.Details)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
detail.Id = 0;
|
|
|
|
|
|
|
|
detail.TemplateId = 0;
|
|
|
|
|
|
|
|
detail.CreateBy = userId;
|
|
|
|
|
|
|
|
detail.CreateTime = dt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var boolValue = await TenantDb.InsertNav(list).Include(x => x.Details).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
return boolValue ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 根据ID批量删除
|
|
|
|
/// 根据ID批量删除
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="model"></param>
|
|
|
|
/// <param name="ids"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<DataResult> DeleteAsync(IdModel model)
|
|
|
|
public async Task<DataResult> DeleteAsync(params long[] ids)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool flag = await TenantDb.DeleteNav<FeeCustTemplate>(x => model.Ids.Contains(x.Id))
|
|
|
|
bool flag = await TenantDb.DeleteNav<FeeCustTemplate>(x => ids.Contains(x.Id))
|
|
|
|
.Include(x => x.Details).ExecuteCommandAsync();
|
|
|
|
.Include(x => x.Details).ExecuteCommandAsync();
|
|
|
|
return flag ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
return flag ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
}
|
|
|
|
}
|
|
|
|