jianghaiqing 3 months ago
commit 1d1fe337af

@ -60,5 +60,11 @@ namespace DS.Module.Core.Constants
/// SqlSugar二级缓存 机构信息
/// </summary>
public const string Org = "sys_sqlSugar:Org";
/// <summary>
/// SqlSugar二级缓存 约号信息
/// </summary>
public const string ContractNo = "sys_sqlSugar:ContractNo";
}
}

@ -72,6 +72,11 @@ namespace DS.WMS.Core.Op.Dtos
/// 包装 t_code_package
/// </summary>
public string KindPkgsName { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string HSCode { get; set; }
}
}

@ -72,6 +72,11 @@ namespace DS.WMS.Core.Op.Dtos
/// 包装 t_code_package
/// </summary>
public string KindPkgsName { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string HSCode { get; set; }
}
}

@ -81,5 +81,11 @@ namespace DS.WMS.Core.Op.Entity
/// </summary>
[SugarColumn(ColumnDescription = "包装", IsNullable = true, Length = 20)]
public string KindPkgsName { get; set; }
/// <summary>
/// 海关代码
/// </summary>
[SugarColumn(ColumnDescription = "海关代码", Length = 50, IsNullable = true)]
public string HSCode { get; set; }
}
}

@ -19,6 +19,7 @@ using Microsoft.AspNetCore.Identity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Map.Dtos;
using DS.WMS.Core.Map.Interface;
using DS.Module.Core.Constants;
namespace DS.WMS.Core.Op.Method
{
@ -93,7 +94,7 @@ namespace DS.WMS.Core.Op.Method
info.UpdateBy = long.Parse(user.UserId);
info.UpdateUserName = user.UserName;
await tenantDb.Updateable<BookingContractNoManage>(info).IgnoreColumns(it => new
await tenantDb.Updateable<BookingContractNoManage>(info).RemoveDataCache($"{SqlSugarCacheConst.ContractNo}{user.TenantId}").IgnoreColumns(it => new
{
it.CreateTime,
it.CreateBy,
@ -104,7 +105,7 @@ namespace DS.WMS.Core.Op.Method
{
info = model.Adapt<BookingContractNoManage>();
await tenantDb.Insertable<BookingContractNoManage>(info).ExecuteReturnEntityAsync();
await tenantDb.Insertable<BookingContractNoManage>(info).RemoveDataCache($"{SqlSugarCacheConst.ContractNo}{user.TenantId}").ExecuteReturnEntityAsync();
}
}
catch (Exception ex)
@ -249,7 +250,7 @@ namespace DS.WMS.Core.Op.Method
entity.DeleteBy = long.Parse(user.UserId);
//entity.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<BookingContractNoManage>().IgnoreColumns(it => new
await tenantDb.Updateable<BookingContractNoManage>().RemoveDataCache($"{SqlSugarCacheConst.ContractNo}{user.TenantId}").IgnoreColumns(it => new
{
it.CreateTime,
it.CreateBy,

@ -343,9 +343,21 @@ namespace DS.WMS.Core.Op.Method
it.BusinessId,
}).ExecuteCommandAsync();
if (item.CtnInfo.IsNotNull() && item.CtnInfo.Count > 0)
var ctnList = await tenantDb.Queryable<SeaExportShippingBillCtn>().Where(x => x.Pid == item.Id).ToListAsync();
if (item.CtnInfo.IsNull())
{
if (ctnList.Count>0)
await tenantDb.Deleteable(ctnList).ExecuteCommandAsync();
}
else if (item.CtnInfo.IsNotNull() && item.CtnInfo.Count > 0)
{
var ctnList = tenantDb.Queryable<SeaExportShippingBillCtn>().Where(x => x.Pid == item.Id).ToList();
var ctnIds = ctnList.Select(x => x.Id).ToArray();
var currentIds = item.CtnInfo.Where(x=>x.Id!=0).Select(x=>x.Id).ToArray();
var delCtns = ctnIds.AsQueryable().Except(currentIds);
if (delCtns.Count() > 0)
{
tenantDb.Deleteable<SeaExportShippingBillCtn>().Where(it => delCtns.Contains(it.Id)).ExecuteCommand();
}
foreach (var item1 in item.CtnInfo)
{
if (item1.Id == 0)

@ -120,7 +120,7 @@ public class ClientCommonService : IClientCommonService
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.ContractNo.Contains(queryKey) || a.ContractName.Contains(queryKey))
.Select<BookingContractNoSelectRes>()
.Take(20)
.WithCache()
.WithCache($"{SqlSugarCacheConst.ContractNo}{user.TenantId}")
.ToListAsync();
return await Task.FromResult(DataResult<List<BookingContractNoSelectRes>>.Success("获取数据成功!", list));
}

Loading…
Cancel
Save