包装、商品、船名 、航次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"; public const string InfoClient = "sys_sqlSugar:InfoClient";
/// <summary> /// <summary>
/// SqlSugar二级缓存 往来单位信息 /// SqlSugar二级缓存 用户信息
/// </summary> /// </summary>
public const string User = "sys_sqlSugar:User"; 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 DS.Module.Core;
using SqlSugar;
namespace DS.WMS.Core.Code.Dtos; namespace DS.WMS.Core.Code.Dtos;
@ -28,4 +29,9 @@ public class IssueTypeSelectRes
/// </summary> /// </summary>
public string CopyNoBill { get; set; } 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;
using DS.Module.Core.Constants;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.SqlSugar; using DS.Module.SqlSugar;
@ -102,7 +103,7 @@ public class CodeGoodsService:ICodeGoodsService
var data = req.Adapt<CodeGoods>(); 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); return DataResult.Successed("添加成功!", entity.Id,MultiLanguageConst.DataCreateSuccess);
} }
@ -112,7 +113,7 @@ public class CodeGoodsService:ICodeGoodsService
info = req.Adapt(info); 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); return DataResult.Successed("更新成功!",MultiLanguageConst.DataUpdateSuccess);
} }
} }
@ -156,7 +157,7 @@ public class CodeGoodsService:ICodeGoodsService
return DataResult.Failed("存在已导入的商品!",MultiLanguageConst.CodeGoodsImportAlready); return DataResult.Failed("存在已导入的商品!",MultiLanguageConst.CodeGoodsImportAlready);
} }
tenantDb.Insertable(list).ExecuteCommand(); tenantDb.Insertable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
return DataResult.Successed("引入成功!",MultiLanguageConst.DataImportSuccess); 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(); var list = tenantDb.Queryable<CodeGoods>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0) if (list.Count > 0)
{ {
tenantDb.Deleteable(list).ExecuteCommand(); tenantDb.Deleteable(list).RemoveDataCache(SqlSugarCacheConst.Goods).ExecuteCommand();
} }
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
} }

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

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

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

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

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

@ -562,9 +562,9 @@ public class ClientCommonController : ApiController
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[Route("GetPackageSelectList")] [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; return res;
} }

@ -322,10 +322,19 @@ namespace DS.WMS.PrintApi.Service
FastReport.Report report = new FastReport.Report(); FastReport.Report report = new FastReport.Report();
report.Load(printFile); 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(); var str = new FastReport.Data.JsonConnection.JsonDataSourceConnectionStringBuilder();
str.Json = JsonConvert.SerializeObject(data); 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(); report.Prepare();
var printName = string.Empty; var printName = string.Empty;

Loading…
Cancel
Save