包装、商品、船名 、航次sqlsugar二次缓存;签单方式修改

usertest
cjy 4 months ago
parent 50466cd3d4
commit 9d6d9c44de

@ -27,8 +27,28 @@ namespace DS.Module.Core.Constants
public const string InfoClient = "sys_sqlSugar:InfoClient";
/// <summary>
/// SqlSugar二级缓存 往来单位信息
/// SqlSugar二级缓存 用户信息
/// </summary>
public const string User = "sys_sqlSugar:User";
/// <summary>
/// SqlSugar二级缓存 包装信息
/// </summary>
public const string Package = "sys_sqlSugar:Package";
/// <summary>
/// SqlSugar二级缓存 船名信息
/// </summary>
public const string Vessel = "sys_sqlSugar:Vessel";
/// <summary>
/// SqlSugar二级缓存 航次信息
/// </summary>
public const string Voyno = "sys_sqlSugar:Voyno";
/// <summary>
/// SqlSugar二级缓存 商品信息
/// </summary>
public const string Goods = "sys_sqlSugar:Goods";
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using SqlSugar;
namespace DS.WMS.Core.Code.Dtos;
@ -27,5 +28,10 @@ public class IssueTypeSelectRes
/// 副本份数
/// </summary>
public string CopyNoBill { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -102,7 +103,7 @@ public class CodeGoodsService:ICodeGoodsService
var data = req.Adapt<CodeGoods>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -112,7 +113,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Goods).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -156,7 +157,7 @@ public class CodeGoodsService:ICodeGoodsService
return DataResult.Failed("存在已导入的商品!",MultiLanguageConst.CodeGoodsImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -179,7 +180,7 @@ public class CodeGoodsService:ICodeGoodsService
var list = tenantDb.Queryable<CodeGoods>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -52,7 +53,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = db.Insertable(data).ExecuteReturnEntity();
var entity = db.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -62,7 +63,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
db.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -100,7 +101,7 @@ public class CodePackageService:ICodePackageService
var data = req.Adapt<CodePackage>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -110,7 +111,7 @@ public class CodePackageService:ICodePackageService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Package).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -153,7 +154,7 @@ public class CodePackageService:ICodePackageService
return DataResult.Failed("存在已导入的包装类型!",MultiLanguageConst.CodePackageImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -175,7 +176,7 @@ public class CodePackageService:ICodePackageService
var list = tenantDb.Queryable<CodePackage>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Package).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -109,7 +110,7 @@ public class CodeVesselService : ICodeVesselService
var data = req.Adapt<CodeVessel>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteReturnEntity();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -121,7 +122,7 @@ public class CodeVesselService : ICodeVesselService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Vessel).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -167,7 +168,7 @@ public class CodeVesselService : ICodeVesselService
return DataResult.Failed("存在已导入的船名信息!", MultiLanguageConst.CodeVesselImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteCommand();
_sysCacheService.RemoveCache(Sys.Method.SysCacheCategoryEnum.CommonCodeVessel, "DS8").GetAwaiter().GetResult();
@ -194,8 +195,8 @@ public class CodeVesselService : ICodeVesselService
{
var voynos = tenantDb.Queryable<CodeVoyno>().Where(x => req.Ids.Contains(x.VesselId)).ToList();
if (voynos.Count > 0)
tenantDb.Deleteable(voynos).ExecuteCommand();
tenantDb.Deleteable(list).ExecuteCommand();
tenantDb.Deleteable(voynos).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Vessel).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Constants;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -102,7 +103,7 @@ public class CodeVoynoService:ICodeVoynoService
var data = req.Adapt<CodeVoyno>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = tenantDb.Insertable(data).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
}
@ -112,7 +113,7 @@ public class CodeVoynoService:ICodeVoynoService
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).RemoveDataCache(SqlSugarCacheConst.Voyno).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
}
}
@ -157,7 +158,7 @@ public class CodeVoynoService:ICodeVoynoService
return DataResult.Failed("存在已导入的航次信息!",MultiLanguageConst.CodeVoynoImportAlready);
}
tenantDb.Insertable(list).ExecuteCommand();
tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess);
}
@ -180,7 +181,7 @@ public class CodeVoynoService:ICodeVoynoService
var list = tenantDb.Queryable<CodeVoyno>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Voyno).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}

@ -18,7 +18,7 @@ public interface IClientCommonService
/// 获取商品下拉列表-客户端
/// </summary>
/// <returns></returns>
public Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string code = "");
public Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey = "");
/// <summary>
/// 根据id获取往来单位参数信息
/// </summary>
@ -286,19 +286,19 @@ public interface IClientCommonService
/// 获取包装类型下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList();
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey = "");
/// <summary>
/// 获取船名下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList();
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList(string queryKey = "");
/// <summary>
/// 获取航次下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList();
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList(string queryKey = "");
/// <summary>
/// 获取运输条款下拉列表

@ -53,12 +53,14 @@ public class ClientCommonService : IClientCommonService
/// 获取商品下拉列表-客户端
/// </summary>
/// <returns></returns>
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string code ="")
public async Task<DataResult<List<CodeGoodsSelectRes>>> GetClientGoodsList(string queryKey ="")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = await tenantDb.Queryable<CodeGoods>()
.WhereIF(!string.IsNullOrEmpty(code), a => a.GoodsCode.Contains(code))
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.GoodsCode.Contains(queryKey) || a.GoodName.Contains(queryKey))
.Select<CodeGoodsSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Goods)
.ToListAsync();
return await Task.FromResult(DataResult<List<CodeGoodsSelectRes>>.Success("获取数据成功!", list));
}
@ -1562,36 +1564,48 @@ public class ClientCommonService : IClientCommonService
/// 获取包装类型下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList(string queryKey ="")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodePackage>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodePackageSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.PackageName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodePackageSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Package)
.ToList();
return DataResult<List<CodePackageSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 获取船名下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList()
public DataResult<List<CodeVesselSelectRes>> GetVesselSelectList(string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeVessel>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodeVesselSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VesselName.Contains(queryKey) || a.EdiCode.Contains(queryKey))
.Select<CodeVesselSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Vessel)
.ToList();
return DataResult<List<CodeVesselSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 获取航次下拉列表
/// </summary>
/// <returns></returns>
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList()
public DataResult<List<CodeVoynoSelectRes>> GetVoynoSelectList(string queryKey = "")
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeVoyno>()
.Where(a => a.Status == StatusEnum.Enable)
.Select<CodeVoynoSelectRes>().ToList();
.WhereIF(!string.IsNullOrEmpty(queryKey), a => a.VoyNo.Contains(queryKey))
.Select<CodeVoynoSelectRes>()
.Take(20)
.WithCache(SqlSugarCacheConst.Voyno)
.ToList();
return DataResult<List<CodeVoynoSelectRes>>.Success("获取数据成功!", data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>

@ -562,9 +562,9 @@ public class ClientCommonController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetPackageSelectList")]
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList()
public DataResult<List<CodePackageSelectRes>> GetPackageSelectList([FromQuery]string queryKey = "")
{
var res = _invokeService.GetPackageSelectList();
var res = _invokeService.GetPackageSelectList(queryKey);
return res;
}

@ -322,10 +322,19 @@ namespace DS.WMS.PrintApi.Service
FastReport.Report report = new FastReport.Report();
report.Load(printFile);
var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection;
report.Dictionary.Connections.Clear();
//var dataSource = report.Dictionary.Connections[0] as JsonDataSourceConnection;
var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder();
str.Json = JsonConvert.SerializeObject(data);
dataSource.ConnectionString = str.ConnectionString;
//dataSource.ConnectionString = str.ConnectionString;
//重置数据源
report.Dictionary.Connections.Add(new JsonDataSourceConnection()
{
ConnectionString = str.ConnectionString,
Alias = "JSON"
});
//report.Dictionary.Connections[0].ConnectionString = str.ConnectionString;
report.Prepare();
var printName = string.Empty;

Loading…
Cancel
Save