任务台查询去掉订单软删除过滤条件

dev
zhangxiaofeng 2 months ago
parent 00f5934f3a
commit 3a29d25c37

@ -15,6 +15,7 @@ using DS.WMS.Core.Map.Dtos;
using DS.WMS.Core.Map.Interface; using DS.WMS.Core.Map.Interface;
using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity; using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface; using DS.WMS.Core.TaskPlat.Interface;
@ -39,6 +40,7 @@ namespace DS.WMS.Core.TaskPlat.Method
private readonly IMappingPortService mappingPortService; private readonly IMappingPortService mappingPortService;
private readonly IMappingCarrierService mappingCarrierService; private readonly IMappingCarrierService mappingCarrierService;
private readonly ICodeCarrierService codeCarrierService; private readonly ICodeCarrierService codeCarrierService;
private readonly ICommonService commonService;
// 按需构建 // 按需构建
//private readonly Lazy<ISeaExportCommonService> seaExportCommonService; //private readonly Lazy<ISeaExportCommonService> seaExportCommonService;
@ -62,13 +64,15 @@ namespace DS.WMS.Core.TaskPlat.Method
ICodePortService codePortService, ICodePortService codePortService,
IMappingPortService mappingPortService, IMappingPortService mappingPortService,
IMappingCarrierService mappingCarrierService, IMappingCarrierService mappingCarrierService,
ICodeCarrierService codeCarrierService) : base(user, logger, saasDbService, serviceProvider, environment) ICodeCarrierService codeCarrierService,
ICommonService commonService) : base(user, logger, saasDbService, serviceProvider, environment)
{ {
this.codeCtnService = codeCtnService; this.codeCtnService = codeCtnService;
this.codePortService = codePortService; this.codePortService = codePortService;
this.mappingPortService = mappingPortService; this.mappingPortService = mappingPortService;
this.mappingCarrierService = mappingCarrierService; this.mappingCarrierService = mappingCarrierService;
this.codeCarrierService = codeCarrierService; this.codeCarrierService = codeCarrierService;
this.commonService = commonService;
//seaExportCommonService = new Lazy<ISeaExportCommonService>(serviceProvider.GetRequiredService<ISeaExportCommonService>); //seaExportCommonService = new Lazy<ISeaExportCommonService>(serviceProvider.GetRequiredService<ISeaExportCommonService>);
} }
@ -312,10 +316,16 @@ namespace DS.WMS.Core.TaskPlat.Method
{ {
throw new Exception(string.Format("{0}文件不存在", info.Main.ModifyFile)); throw new Exception(string.Format("{0}文件不存在", info.Main.ModifyFile));
} }
var sequence = await commonService.GetSequenceNextAsync<TaskBaseInfo>(tenantDb, user);
//if (!sequence.Succeeded || sequence.Data is null)
//{
// return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
//}
taskInfo = new TaskBaseInfo taskInfo = new TaskBaseInfo
{ {
Id = SnowFlakeSingle.Instance.NextId(), Id = SnowFlakeSingle.Instance.NextId(),
TASK_NO = sequence?.Data ?? "",
STATUS = TaskStatusEnum.Create.ToString(), STATUS = TaskStatusEnum.Create.ToString(),
STATUS_NAME = TaskStatusEnum.Create.EnumDescription(), STATUS_NAME = TaskStatusEnum.Create.EnumDescription(),
IS_EXCEPT = 0, IS_EXCEPT = 0,
@ -1731,6 +1741,7 @@ namespace DS.WMS.Core.TaskPlat.Method
public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch) public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch)
{ {
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear();
if (querySearch.OtherQueryCondition == null) if (querySearch.OtherQueryCondition == null)
{ {
@ -1790,8 +1801,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.BC: case TaskBaseTypeEnum.BC:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>() var queryable = tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -1904,8 +1915,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.SI_FEEDBACK: case TaskBaseTypeEnum.SI_FEEDBACK:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -1978,8 +1989,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.INVOICE_BILL_MAIL: case TaskBaseTypeEnum.INVOICE_BILL_MAIL:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID) .LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2021,8 +2032,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.TRUCK_DISPATCH: case TaskBaseTypeEnum.TRUCK_DISPATCH:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2104,8 +2115,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.CUT_MODIFY: case TaskBaseTypeEnum.CUT_MODIFY:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2142,8 +2153,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.ROLLING_NOMINATION: case TaskBaseTypeEnum.ROLLING_NOMINATION:
case TaskBaseTypeEnum.TRANSFER_NOMINATION: case TaskBaseTypeEnum.TRANSFER_NOMINATION:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2185,8 +2196,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.DRAFT: case TaskBaseTypeEnum.DRAFT:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2225,8 +2236,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.POD_DISCHARGE_FULL: case TaskBaseTypeEnum.POD_DISCHARGE_FULL:
case TaskBaseTypeEnum.POD_GATEOUT_FULL: case TaskBaseTypeEnum.POD_GATEOUT_FULL:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2262,8 +2273,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.CAUTION_NOTICE: case TaskBaseTypeEnum.CAUTION_NOTICE:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2312,8 +2323,8 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
case TaskBaseTypeEnum.ROUTE_CUT_CHANGE: case TaskBaseTypeEnum.ROUTE_CUT_CHANGE:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2364,7 +2375,7 @@ namespace DS.WMS.Core.TaskPlat.Method
default: default:
{ {
var queryable = tenantDb.Queryable<TaskBaseInfo>() var queryable = tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id); .LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId); await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2470,7 +2481,7 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
queryable.Where(whereList) queryable.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString()) .Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString() && t.Deleted == false)
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString()) .WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, bc, s) => queryDto.BusinessNo == t.MBL_NO .WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, bc, s) => queryDto.BusinessNo == t.MBL_NO
|| queryDto.BusinessNo == s.MBLNO || queryDto.BusinessNo == s.MBLNO
@ -2506,7 +2517,7 @@ namespace DS.WMS.Core.TaskPlat.Method
} }
queryable.Where(whereList) queryable.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString()) .Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString() && t.Deleted == false)
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString()) .WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, s) => queryDto.BusinessNo == t.MBL_NO .WhereIF(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, s) => queryDto.BusinessNo == t.MBL_NO
|| queryDto.BusinessNo == s.MBLNO || queryDto.BusinessNo == s.MBLNO
@ -2540,7 +2551,7 @@ namespace DS.WMS.Core.TaskPlat.Method
LevelTree = new List<TaskUserStatItemTree>() LevelTree = new List<TaskUserStatItemTree>()
}; };
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId); var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear();
// 人员信息测试用 // 人员信息测试用
//var sql = tenantDb.Queryable<SeaExport>().Where(x => x.Id > 232).ToSqlString(); //var sql = tenantDb.Queryable<SeaExport>().Where(x => x.Id > 232).ToSqlString();
//var a = user.UserId; //var a = user.UserId;
@ -2617,16 +2628,15 @@ namespace DS.WMS.Core.TaskPlat.Method
//var underTaskQueryable = tenantDb.Queryable<TaskBaseInfo>() //var underTaskQueryable = tenantDb.Queryable<TaskBaseInfo>()
// .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId) // .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
// .LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id); // .LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id);
//任务列表分组统计 //任务列表分组统计
var queryable = tenantDb.Queryable<TaskBaseInfo>() var queryable = tenantDb.Queryable<TaskBaseInfo>()
.ClearFilter(typeof(IOrgId)) .LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id) .LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id)
.Where(whereList) .Where(whereList)
.Where((t, a) => t.STATUS != cancelStr) .Where((t, a) => t.STATUS != cancelStr && t.Deleted == false)
.Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId || .Where((t, a) => t.IS_PUBLIC == 1 || (t.IS_PUBLIC == 0 && a.Status != null && (a.UserId == userId))) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo), (t, a, s) => queryDto.OtherQueryCondition.BusinessNo == t.MBL_NO .WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo), (t, a, s) => queryDto.OtherQueryCondition.BusinessNo == t.MBL_NO
|| queryDto.OtherQueryCondition.BusinessNo == s.MBLNO || queryDto.OtherQueryCondition.BusinessNo == s.MBLNO

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.MainApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using DotNetCore.CAP.Internal;
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.SqlSugar; using DS.Module.SqlSugar;
@ -10,12 +11,14 @@ using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.BookingSlot; using DS.WMS.Core.Op.Entity.BookingSlot;
using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.TaskPlat.Entity; using DS.WMS.Core.TaskPlat.Entity;
using LanguageExt.ClassInstances;
using Mapster; using Mapster;
using Masuit.Tools.Strings; using Masuit.Tools.Strings;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Owin.BuilderProperties; using Microsoft.Owin.BuilderProperties;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Serialization; using Newtonsoft.Json.Serialization;
using NPOI.Util;
using Org.BouncyCastle.Ocsp; using Org.BouncyCastle.Ocsp;
using SqlSugar; using SqlSugar;
using SqlSugar.IOC; using SqlSugar.IOC;
@ -35,15 +38,15 @@ public class SaasDBUpdateTest
saasService = _serviceProvider.GetRequiredService<ISaasDbService>(); saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
} }
/// <summary> /// <summary>
/// 主库初始化单表 /// 主库初始化单表
/// </summary> /// </summary>
[Fact] [Fact]
public void MasterInitTableTest() public void MasterInitTableTest()
{ {
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持 StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
db.CodeFirst.InitTables(typeof(CodeCarrier)); db.CodeFirst.InitTables(typeof(CodeCarrier));
Assert.True(true); Assert.True(true);
} }
/// <summary> /// <summary>
@ -86,17 +89,12 @@ public class SaasDBUpdateTest
//tenantDb.CodeFirst.InitTables(types); //tenantDb.CodeFirst.InitTables(types);
// 单表更新 // 单表更新
tenantDb.CodeFirst.InitTables(typeof(TaskBaseAllocation)); //tenantDb.CodeFirst.InitTables(typeof(TaskBaseAllocation));
// SQL更新 // SQL更新
// string sql = @"ALTER TABLE `task_base` string sql = @"UPDATE `task_flow_module` SET `CompletedBusinessStatusCode` = 'YSDAN' WHERE `Id` = 30001";
//DROP COLUMN `PORTLOAD_ID`, // DROP TRIGGER `tr_task_no`;
//DROP COLUMN `PORTLOAD_CODE`, tenantDb.Ado.ExecuteCommand(sql);
//DROP COLUMN `PORTLOAD`,
//DROP COLUMN `PORTDISCHARGE_ID`,
//DROP COLUMN `PORTDISCHARGE_CODE`,
//DROP COLUMN `PORTDISCHARGE`;";
// tenantDb.Ado.ExecuteCommand(sql);
} }
Assert.True(true); Assert.True(true);

Loading…
Cancel
Save