zhangxiaofeng 4 months ago
commit 317ae49794

@ -900,20 +900,28 @@ namespace DS.WMS.Core.Op.EDI
}
if (InttrEdi.UseForWarderCode)
if (bill.CARRIEREDICODE == "ANNU" || bill.CARRIEREDICODE == "CMDU" || bill.CARRIEREDICODE == "CHNL")
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
icount = icount + 1;
}
else
{
if (bill.ORDERNO.Trim() != "")
if (InttrEdi.UseForWarderCode)
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
}
else
{
if (bill.ORDERNO.Trim() != "")
{
r.WriteLine("RFF+FF:" + bill.ORDERNO.Trim() + "'");
r.WriteLine("RFF+ON:" + bill.ORDERNO.Trim() + "'");
icount = icount + 2;
}
}
}
if (bill.CARRIEREDICODE != "COSU")

@ -39,7 +39,7 @@ namespace DS.WMS.Core.Sys.Method
{
var currVal =_redisService.GetValue<List<T>>($"{cacheCategory.ToString()}_{systemKey}");
_redisService.Dispose();
//_redisService.Dispose();
if (currVal == null)
return DataResult<List<T>>.FailedData(new List<T>());
@ -61,7 +61,7 @@ namespace DS.WMS.Core.Sys.Method
_redisService.SetValue($"{cacheCategory.ToString()}_{systemKey}", JsonConvert.SerializeObject(cacheObj));
_redisService.Dispose();
//_redisService.Dispose();
return DataResult<string>.Success(string.Empty);
}
@ -76,7 +76,7 @@ namespace DS.WMS.Core.Sys.Method
{
_redisService.DeleteKey($"{cacheCategory.ToString()}_{systemKey}");
_redisService.Dispose();
//_redisService.Dispose();
return DataResult.Successed(MultiLanguageConst.RemoveCacheSucc);
}

@ -0,0 +1,85 @@
using System.Reflection;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.WMS.Core.Check.Entity;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.BookingSlot;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.TaskPlat.Entity;
using Mapster;
using Masuit.Tools.Strings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Owin.BuilderProperties;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
using SqlSugar.IOC;
using Xunit;
namespace Ds.WMS.Test;
public class SaasDBUpdateTest
{
private readonly IServiceProvider _serviceProvider;
private readonly SqlSugarScope db;
private readonly ISaasDbService saasService;
public SaasDBUpdateTest(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 主库初始化单表
/// </summary>
[Fact]
public void MasterInitTableTest()
{
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
db.CodeFirst.InitTables(typeof(SysPrintTemplate));
Assert.True(true);
}
/// <summary>
/// 初始化单表 多表
/// 注意 海运出口 SeaExport 得手动数据库更新
/// </summary>
[Fact]
public void InitSaasTableTestByCjy()
{
var tenantList = db.Queryable<DS.Module.SqlSugar.SysTenantLink>().ToList();
var ass = Assembly.Load("DS.WMS.Core");
//var types = ass.GetTypes().Where(it => it.FullName?.Contains("DS.WMS.Core.TaskPlat.Entity") == true).ToArray();
foreach (var item in tenantList)
{
var tenantDb = saasService.GetBizDbScopeById(item.TenantId).CopyNew();
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci"; //较高版本支持
//tenantDb.CodeFirst.InitTables(types); //指定表空间下的实体
tenantDb.CodeFirst.InitTables(typeof(OpLetterYard));//指定更新特定实体
}
Assert.True(true);
}
/// <summary>
/// 初始化单表
/// </summary>
[Fact]
public void InitTableTestZXF()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
var ass = Assembly.Load("DS.WMS.Core");
var types = ass.GetTypes().Where(it => it.FullName?.Contains("DS.WMS.Core.TaskPlat.Entity") == true).ToArray();
tenantDb.CodeFirst.InitTables(types);
//tenantDb.CodeFirst.InitTables(typeof(TaskFlowLog));
//tenantDb.CodeFirst.InitTables(typeof(TaskFlowLogDetail));
Assert.True(true);
}
}
Loading…
Cancel
Save