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

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.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using DS.WMS.Core.TaskPlat.Interface;
@ -39,6 +40,7 @@ namespace DS.WMS.Core.TaskPlat.Method
private readonly IMappingPortService mappingPortService;
private readonly IMappingCarrierService mappingCarrierService;
private readonly ICodeCarrierService codeCarrierService;
private readonly ICommonService commonService;
// 按需构建
//private readonly Lazy<ISeaExportCommonService> seaExportCommonService;
@ -62,13 +64,15 @@ namespace DS.WMS.Core.TaskPlat.Method
ICodePortService codePortService,
IMappingPortService mappingPortService,
IMappingCarrierService mappingCarrierService,
ICodeCarrierService codeCarrierService) : base(user, logger, saasDbService, serviceProvider, environment)
ICodeCarrierService codeCarrierService,
ICommonService commonService) : base(user, logger, saasDbService, serviceProvider, environment)
{
this.codeCtnService = codeCtnService;
this.codePortService = codePortService;
this.mappingPortService = mappingPortService;
this.mappingCarrierService = mappingCarrierService;
this.codeCarrierService = codeCarrierService;
this.commonService = commonService;
//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));
}
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
{
Id = SnowFlakeSingle.Instance.NextId(),
TASK_NO = sequence?.Data ?? "",
STATUS = TaskStatusEnum.Create.ToString(),
STATUS_NAME = TaskStatusEnum.Create.EnumDescription(),
IS_EXCEPT = 0,
@ -1731,6 +1741,7 @@ namespace DS.WMS.Core.TaskPlat.Method
public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch)
{
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear();
if (querySearch.OtherQueryCondition == null)
{
@ -1790,8 +1801,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.BC:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId && a.Deleted == false)
.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);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -1904,8 +1915,8 @@ namespace DS.WMS.Core.TaskPlat.Method
case TaskBaseTypeEnum.SI_FEEDBACK:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -1978,8 +1989,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.INVOICE_BILL_MAIL:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2021,8 +2032,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.TRUCK_DISPATCH:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2104,8 +2115,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.CUT_MODIFY:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
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.TRANSFER_NOMINATION:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2185,8 +2196,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.DRAFT:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
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_GATEOUT_FULL:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2262,8 +2273,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.CAUTION_NOTICE:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2312,8 +2323,8 @@ namespace DS.WMS.Core.TaskPlat.Method
}
case TaskBaseTypeEnum.ROUTE_CUT_CHANGE:
{
var queryable = tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID)
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 && bc.Deleted == false)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2364,7 +2375,7 @@ namespace DS.WMS.Core.TaskPlat.Method
default:
{
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);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
@ -2470,7 +2481,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
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(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, bc, s) => queryDto.BusinessNo == t.MBL_NO
|| queryDto.BusinessNo == s.MBLNO
@ -2506,7 +2517,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}
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(!string.IsNullOrEmpty(queryDto.BusinessNo), (t, a, s) => queryDto.BusinessNo == t.MBL_NO
|| queryDto.BusinessNo == s.MBLNO
@ -2540,7 +2551,7 @@ namespace DS.WMS.Core.TaskPlat.Method
LevelTree = new List<TaskUserStatItemTree>()
};
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear();
// 人员信息测试用
//var sql = tenantDb.Queryable<SeaExport>().Where(x => x.Id > 232).ToSqlString();
//var a = user.UserId;
@ -2622,11 +2633,10 @@ namespace DS.WMS.Core.TaskPlat.Method
//任务列表分组统计
var queryable = tenantDb.Queryable<TaskBaseInfo>()
.ClearFilter(typeof(IOrgId))
.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)
.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 ||
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo), (t, a, s) => queryDto.OtherQueryCondition.BusinessNo == t.MBL_NO
|| queryDto.OtherQueryCondition.BusinessNo == s.MBLNO

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
</Project>

@ -1,4 +1,5 @@
using System.Reflection;
using DotNetCore.CAP.Internal;
using DS.Module.Core;
using DS.Module.Core.Extensions;
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.Sys.Entity;
using DS.WMS.Core.TaskPlat.Entity;
using LanguageExt.ClassInstances;
using Mapster;
using Masuit.Tools.Strings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Owin.BuilderProperties;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using NPOI.Util;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
using SqlSugar.IOC;
@ -86,17 +89,12 @@ public class SaasDBUpdateTest
//tenantDb.CodeFirst.InitTables(types);
// 单表更新
tenantDb.CodeFirst.InitTables(typeof(TaskBaseAllocation));
//tenantDb.CodeFirst.InitTables(typeof(TaskBaseAllocation));
// SQL更新
// string sql = @"ALTER TABLE `task_base`
//DROP COLUMN `PORTLOAD_ID`,
//DROP COLUMN `PORTLOAD_CODE`,
//DROP COLUMN `PORTLOAD`,
//DROP COLUMN `PORTDISCHARGE_ID`,
//DROP COLUMN `PORTDISCHARGE_CODE`,
//DROP COLUMN `PORTDISCHARGE`;";
// tenantDb.Ado.ExecuteCommand(sql);
string sql = @"UPDATE `task_flow_module` SET `CompletedBusinessStatusCode` = 'YSDAN' WHERE `Id` = 30001";
// DROP TRIGGER `tr_task_no`;
tenantDb.Ado.ExecuteCommand(sql);
}
Assert.True(true);

Loading…
Cancel
Save