批量删除修改

master
ZR20090193-陈敬勇 7 months ago
parent 984730989e
commit ff07e44b52

@ -14,4 +14,5 @@ public class IdModel
/// 主键ids
/// </summary>
public long[] Ids { get; set; }
}

@ -8,6 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DS.Module.SqlSugar;
using DS.Module.Core;
namespace DS.Module.CrawlerData
{
@ -29,5 +30,8 @@ namespace DS.Module.CrawlerData
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
//public DataResult<string> GetYardData(string url) { }
}
}

@ -13,4 +13,8 @@
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="新文件夹\" />
</ItemGroup>
</Project>

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.System.Dtos;
@ -37,7 +38,7 @@ public interface IFeeTemplateDetailService
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelFeeTemplateDetail(List<long> Ids);
public DataResult BatchDelFeeTemplateDetail(IdModel req);
}

@ -11,6 +11,7 @@ using Mapster;
using DS.Module.Core.Extensions;
using Masuit.Tools.Strings;
using DS.WMS.Core.Op.Entity;
using DS.Module.Core.Data;
namespace DS.WMS.Core.Fee.Method
{
@ -118,12 +119,12 @@ namespace DS.WMS.Core.Fee.Method
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelFeeTemplateDetail(List<long> Ids)
public DataResult BatchDelFeeTemplateDetail(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<FeeTemplateDetail>().Where(x => Ids.Contains(x.Id)).ToList();
var list = tenantDb.Queryable<FeeTemplateDetail>().Where(x => req.Ids.Contains(x.Id)).ToList();
;
if (list.Count>0)
{

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Op.Dtos;
using System;
@ -45,8 +46,8 @@ namespace DS.WMS.Core.Op.Interface
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelOpCtn(List<long> Ids);
public DataResult BatchDelOpCtn(IdModel req);
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos;
namespace DS.WMS.Core.Op.Interface;
@ -44,9 +45,9 @@ public interface ISeaExportService
/// <summary>
/// 业务单据删除
/// </summary>
/// <param name="Ids">业务Ids</param>
/// <param name="req">业务Ids</param>
/// <returns></returns>
public DataResult SeaExportBatchDel(List<long> Ids);
public DataResult SeaExportBatchDel(IdModel req);
/// <summary>
/// 业务锁定

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -108,12 +109,12 @@ namespace DS.WMS.Core.Op.Method
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelOpCtn(List<long> Ids)
public DataResult BatchDelOpCtn(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<OpCtn>().Where(x => Ids.Contains(x.Id)).ToList();
var list = tenantDb.Queryable<OpCtn>().Where(x => req.Ids.Contains(x.Id)).ToList();
;
if (list.Count > 0)
{

@ -1,5 +1,6 @@
using AngleSharp.Dom;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -318,39 +319,39 @@ public class SeaExportService : ISeaExportService
/// <summary>
/// 业务单据删除
/// </summary>
/// <param name="Ids">业务Ids</param>
/// <param name="req">业务Ids</param>
/// <returns></returns>
public DataResult SeaExportBatchDel(List<long> Ids)
public DataResult SeaExportBatchDel(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (Ids.Count == 0)
if (req.Ids.Length == 0)
{
return DataResult.Failed("海运出口批量操作未勾选!", MultiLanguageConst.SeaExportBatchOpNoSelect);
}
if (tenantDb.Queryable<SeaExport>().Where(x => Ids.Contains(x.Id)).Any().IsNull())
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id)).Any().IsNull())
{
return DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist);
}
if (tenantDb.Queryable<SeaExport>().Where(x => Ids.Contains(x.Id) && x.IsBusinessLocking == true).Any())
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id) && x.IsBusinessLocking == true).Any())
{
return DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock);
}
if (tenantDb.Queryable<SeaExport>().Where(x => Ids.Contains(x.Id) && x.IsFeeLocking == true).Any())
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id) && x.IsFeeLocking == true).Any())
{
return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock);
}
if (tenantDb.Queryable<SeaExport>().Where(x => Ids.Contains(x.ParentId)).Any())
if (tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.ParentId)).Any())
{
return DataResult.Failed("海运出口存在分票信息,不能删除!", MultiLanguageConst.SeaExportPartExist);
}
if (tenantDb.Queryable<FeeRecord>().Where(x => Ids.Contains(x.BusinessId)).Any())
if (tenantDb.Queryable<FeeRecord>().Where(x => req.Ids.Contains(x.BusinessId)).Any())
{
return DataResult.Failed("海运出口存在费用信息,不能删除!", MultiLanguageConst.SeaExportFeeExist);
}
var list = tenantDb.Queryable<SeaExport>().Where(x => Ids.Contains(x.Id)).ToList();
var list = tenantDb.Queryable<SeaExport>().Where(x => req.Ids.Contains(x.Id)).ToList();
//tenantDb.Deleteable(list).IsLogic().ExecuteCommand("Deleted");
//tenantDb.Deleteable<SeaExport>(list).IsLogic().ExecuteCommand("Deleted");

@ -1,10 +1,12 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Ocsp;
namespace DS.WMS.FeeApi.Controllers
{
@ -80,13 +82,13 @@ namespace DS.WMS.FeeApi.Controllers
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
[Route("BatchDelFeeTemplateDetail")]
public DataResult BatchDelFeeTemplateDetail([FromQuery] List<long> Ids)
public DataResult BatchDelFeeTemplateDetail([FromBody]IdModel req)
{
var res = _invokeService.BatchDelFeeTemplateDetail(Ids);
var res = _invokeService.BatchDelFeeTemplateDetail(req);
return res;
}
}

@ -77,13 +77,13 @@ public class OpCtnController : ApiController
/// <summary>
/// 批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
[Route("BatchDelOpCtn")]
public DataResult BatchDelOpCtn([FromQuery] List<long> Ids)
public DataResult BatchDelOpCtn([FromBody] IdModel req)
{
var res = _invokeService.BatchDelOpCtn(Ids);
var res = _invokeService.BatchDelOpCtn(req);
return res;
}
}

@ -1,4 +1,5 @@
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.Op.Dtos;
@ -92,13 +93,13 @@ public class SeaExportController : ApiController
/// <summary>
/// 业务单据批量删除
/// </summary>
/// <param name="Ids"></param>
/// <param name="req"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
[Route("SeaExportBatchDel")]
public DataResult SeaExportBatchDel([FromQuery] List<long> Ids)
public DataResult SeaExportBatchDel([FromBody] IdModel req)
{
var res = _invokeService.SeaExportBatchDel(Ids);
var res = _invokeService.SeaExportBatchDel(req);
return res;
}

Loading…
Cancel
Save