cjy 2 months ago
commit 5ae607af2e

@ -260,16 +260,11 @@ public class ClientInfoService : ServiceBase, IClientInfoService
{
//序列化查询条件
var whereList = request.GetConditionalModels(Db);
foreach (var item in whereList)
{
var condition = (ConditionalModel)item;
condition.FieldName = "c." + condition.FieldName.ToUpperCamelCase();
}
var query = TenantDb.Queryable<InfoClient>()
.LeftJoin<InfoClientContact>((c, c1) => c.Id == c1.ClientId)
.LeftJoin<InfoClientContract>((c, c1, c2) => c.Id == c2.ClientId)
.InnerJoinIF<InfoClientTag>(request.OtherQueryCondition?.ClientTag != null, (c, c1, c2, ct) => c.Id == ct.ClientId);
.InnerJoinIF<InfoClientTag>(request.OtherQueryCondition?.ClientTag != null, (c, c1, c2, ct) => c.Id == ct.ClientId)
.GroupBy((c, c1, c2) => c.Id);
if (!string.IsNullOrEmpty(request.OtherQueryCondition?.ContactInfo))
query = query.Where((c, c1, c2) => c1.Tel.Contains(request.OtherQueryCondition.ContactInfo) ||
@ -296,7 +291,14 @@ public class ClientInfoService : ServiceBase, IClientInfoService
}
}
var result = await query.Where(whereList).Select<ClientInfoRes>().ToQueryPageAsync(request.PageCondition);
var result = await query.Select((c, c1, c2, ct) => new ClientInfoRes
{
CodeName = c.CodeName,
Name = c.Name,
ShortName = c.ShortName,
EnShortName = c.EnShortName,
EnFullName = c.EnFullName
}, true).MergeTable().Where(whereList).ToQueryPageAsync(request.PageCondition);
if (result.Data?.Count > 0)
{

@ -63,6 +63,19 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
x.Vessel,
x.Voyno,
x.ETD,
x.DischargePortId,
x.DischargePortCode,
x.DischargePort,
x.LoadPortId,
x.LoadPortCode,
x.LoadPort,
x.CarrierId,
x.Carrier,
//x.BookingNo,
//x.HBLNO,
//x.CustomerNum,
}).FirstAsync(x => x.Id == first.BusinessId);
var taskList = new List<BusinessTask>();
@ -100,8 +113,24 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
};
info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}";
info.Main.CUSTOMER_NO = biz?.CustomerNo;
info.Main.CustomerNo = biz?.CustomerNo;
info.Main.MBlNo = biz?.MBLNO;
info.Main.ETD = biz?.ETD;
info.Main.PortDischarge = biz?.DischargePort;
info.Main.PortDischargeCode = biz?.DischargePortCode;
info.Main.PortDischargeId = biz?.DischargePortId;
info.Main.PortLoad = biz?.LoadPort;
info.Main.PortLoadId = biz?.LoadPortId;
info.Main.PortLoadCode = biz?.LoadPortCode;
info.Main.CarrierId = biz?.Carrier;
info.Main.CarrierPK = biz?.CarrierId;
//info.Main.HBLNO = biz?.HBLNO;
//info.Main.BookingNo = biz?.BookingNo;
//info.Main.CustomsNum = biz?.CustomerNum;
var result = await ManagerService.InitTaskJob(info);
if (!result.Succeeded)

@ -269,11 +269,40 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
x.Vessel,
x.Voyno,
x.ETD,
x.DischargePortId,
x.DischargePortCode,
x.DischargePort,
x.LoadPortId,
x.LoadPortCode,
x.LoadPort,
x.CarrierId,
x.Carrier,
//x.BookingNo,
//x.HBLNO,
//x.CustomerNum,
}).FirstAsync(x => x.Id == request.BusinessId);
info.Main.TaskTitle = $"【{request.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}";
info.Main.CustomerNo = biz?.CustomerNo;
info.Main.MBlNo = biz?.MBLNO;
info.Main.CUSTOMER_NO = biz?.CustomerNo;
info.Main.ETD = biz?.ETD;
info.Main.PortDischarge = biz?.DischargePort;
info.Main.PortDischargeCode = biz?.DischargePortCode;
info.Main.PortDischargeId = biz?.DischargePortId;
info.Main.PortLoad = biz?.LoadPort;
info.Main.PortLoadId = biz?.LoadPortId;
info.Main.PortLoadCode = biz?.LoadPortCode;
info.Main.CarrierId = biz?.Carrier;
info.Main.CarrierPK = biz?.CarrierId;
//info.Main.HBLNO = biz?.HBLNO;
//info.Main.BookingNo = biz?.BookingNo;
//info.Main.CustomsNum = biz?.CustomerNum;
}
info.Main.TaskDesp = info.Main.TaskDesp ?? info.Main.TaskTitle;

@ -6,7 +6,7 @@
public sealed class QueryTaskManageDto
{
/// <summary>
/// 业务编号(提单号或委托编号)
/// 业务编号(委托编号/订舱编号/客户编号/提单号/分单号)
/// </summary>
public string BusinessNo { get; set; }
@ -79,5 +79,19 @@
/// 大简云用户Id
/// </summary>
public string DJYUserId { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public string? PortLoadCode { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string? PortDischargeCode { get; set; }
}
}

@ -7,10 +7,24 @@
/// </summary>
public string QueryCondition { get; set; } = string.Empty;
public QueryTaskManageDto OtherQueryCondition { get; set; }
/// <summary>
/// 业务编号(提单号或委托编号)
/// </summary>
public string BusinessNo { get; set; }
///// <summary>
///// 业务编号(提单号或委托编号)
///// </summary>
//public string BusinessNo { get; set; }
///// <summary>
///// 装货港代码
///// </summary>
//public string? PortLoadCode { get; set; }
///// <summary>
///// 卸货港代码
///// </summary>
//public string? PortDischargeCode { get; set; }
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using SqlSugar;
using System.ComponentModel.DataAnnotations;
namespace DS.WMS.Core.TaskPlat.Dtos
@ -63,7 +64,7 @@ namespace DS.WMS.Core.TaskPlat.Dtos
/// <summary>
/// 委托编号
/// </summary>
public string? CUSTOMER_NO { get; set; }
public string? CustomerNo { get; set; }
/// <summary>
/// 反馈结果
@ -311,9 +312,56 @@ namespace DS.WMS.Core.TaskPlat.Dtos
///// 单票账单的解析
///// </summary>
//public perbill perbillInfo { get; set; }
/// <summary>
/// 任务批次号
/// </summary>
public string TaskBatchNo { get; set; }
///// <summary>
///// 客户编号
///// </summary>
//public string? CustomsNum { get; set; }
///// <summary>
///// 分提单号
///// </summary>
//public string? HBLNO { get; set; }
///// <summary>
///// 订舱编号
///// </summary>
//public string? BookingNo { get; set; }
/// <summary>
/// 装货港主键
/// </summary>
public long? PortLoadId { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public string? PortLoadCode { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string? PortLoad { get; set; }
/// <summary>
/// 卸货港主键
/// </summary>
public long? PortDischargeId { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public string? PortDischargeCode { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string? PortDischarge { get; set; }
}
}

@ -116,12 +116,30 @@ namespace DS.WMS.Core.TaskPlat.Entity
[SugarColumn(ColumnDescription = "主单号", IsNullable = true, Length = 64)]
public string? MBL_NO { get; set; }
///// <summary>
///// 分单号
///// </summary>
//[SugarColumn(ColumnDescription = "分单号", IsNullable = true, Length = 30)]
//public string? HBL_NO { get; set; }
///// <summary>
///// 订舱编号
///// </summary>
//[SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 20)]
//public string? BOOKING_NO { get; set; }
/// <summary>
/// 委托编号
/// </summary>
[SugarColumn(ColumnDescription = "委托编号", IsNullable = true, Length = 30)]
public string? CUSTOMER_NO { get; set; }
///// <summary>
///// 客户编号
///// </summary>
//[SugarColumn(ColumnDescription = "客户编号", IsNullable = true, Length = 50)]
//public string? CUSTOMER_NUM { get; set; }
/// <summary>
/// 备注
/// </summary>
@ -290,7 +308,41 @@ namespace DS.WMS.Core.TaskPlat.Entity
//[SugarColumn(ColumnDescription = "大简云userid", IsNullable = true, Length = 50)]
//public string? DJYUserId { get; set; }
///// <summary>
///// 装货港主键
///// </summary>
//[SugarColumn(ColumnDescription = "装货港主键", IsNullable = true)]
//public long? PORTLOAD_ID { get; set; }
///// <summary>
///// 装货港代码
///// </summary>
//[SugarColumn(ColumnDescription = "装货港代码", IsNullable = true, Length = 10)]
//public string? PORTLOAD_CODE { get; set; }
///// <summary>
///// 装货港
///// </summary>
//[SugarColumn(ColumnDescription = "装货港", IsNullable = true, Length = 120)]
//public string? PORTLOAD { get; set; }
///// <summary>
///// 卸货港主键
///// </summary>
//[SugarColumn(ColumnDescription = "卸货港主键", IsNullable = true)]
//public long? PORTDISCHARGE_ID { get; set; }
///// <summary>
///// 卸货港代码
///// </summary>
//[SugarColumn(ColumnDescription = "卸货港代码", IsNullable = true, Length = 10)]
//public string? PORTDISCHARGE_CODE { get; set; }
///// <summary>
///// 卸货港
///// </summary>
//[SugarColumn(ColumnDescription = "卸货港", IsNullable = true, Length = 120)]
//public string? PORTDISCHARGE { get; set; }
}
}

@ -9,6 +9,7 @@ using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Map.Dtos;
using DS.WMS.Core.Map.Interface;
@ -37,6 +38,7 @@ namespace DS.WMS.Core.TaskPlat.Method
private readonly ICodePortService codePortService;
private readonly IMappingPortService mappingPortService;
private readonly IMappingCarrierService mappingCarrierService;
private readonly ICodeCarrierService codeCarrierService;
// 按需构建
//private readonly Lazy<ISeaExportCommonService> seaExportCommonService;
@ -46,6 +48,11 @@ namespace DS.WMS.Core.TaskPlat.Method
/// </summary>
public static DateTime LastMatchTaskTime = DateTime.Now;
/// <summary>
/// 需要查海运出口表的小写字段名
/// </summary>
static string[] seaExportFields = ["customerid", "saleid", "customerservice", "operatorid"]; //, "portload_code", "portdischarge_code"
public TaskManageService(IUser user,
ILogger<TaskManageService> logger,
ISaasDbService saasDbService,
@ -54,12 +61,14 @@ namespace DS.WMS.Core.TaskPlat.Method
ICodeCtnService codeCtnService,
ICodePortService codePortService,
IMappingPortService mappingPortService,
IMappingCarrierService mappingCarrierService) : base(user, logger, saasDbService, serviceProvider, environment)
IMappingCarrierService mappingCarrierService,
ICodeCarrierService codeCarrierService) : base(user, logger, saasDbService, serviceProvider, environment)
{
this.codeCtnService = codeCtnService;
this.codePortService = codePortService;
this.mappingPortService = mappingPortService;
this.mappingCarrierService = mappingCarrierService;
this.codeCarrierService = codeCarrierService;
//seaExportCommonService = new Lazy<ISeaExportCommonService>(serviceProvider.GetRequiredService<ISeaExportCommonService>);
}
@ -325,7 +334,22 @@ namespace DS.WMS.Core.TaskPlat.Method
BATCH_STATIC = info.Main.BatchStatic,
//DJYUserId = info.Head.DJYUserId,
OUT_BS_NO = info.Head.BSNO,
CUSTOMER_NO = info.Main.CUSTOMER_NO,
CUSTOMER_NO = info.Main.CustomerNo,
//CUSTOMER_NUM = info.Main.CustomsNum,
//HBL_NO = info.Main.HBLNO,
//BOOKING_NO = info.Main.BookingNo,
//PORTDISCHARGE = info.Main.PortDischarge,
//PORTDISCHARGE_CODE = info.Main.PortDischargeCode,
//PORTDISCHARGE_ID = info.Main.PortDischargeId,
//PORTLOAD = info.Main.PortLoad,
//PORTLOAD_ID = info.Main.PortLoadId,
//PORTLOAD_CODE = info.Main.PortLoadCode,
CARRIER_ID = info.Main.CarrierPK,
CARRIER_CODE = info.Main.CarrierId,
CARRIER_NAME = info.Main.CarrierName,
CreateTime = DateTime.Now,
};
if (Enum.TryParse(typeof(TaskBaseTypeEnum), taskInfo.TASK_TYPE, out object? taskTypeTemp))
@ -333,24 +357,29 @@ namespace DS.WMS.Core.TaskPlat.Method
taskInfo.TASK_TYPE_NAME = ((TaskBaseTypeEnum)taskTypeTemp).EnumDescription();
}
// 如果船公司主键不为空则直接保存船公司主键、Code、Name等信息
if (info.Main.CarrierPK != null)
// 如果船公司主键不为空则直接保存船公司主键、Code、Name等信息如果Name为空查询一下再赋值
if (taskInfo.CARRIER_ID != null)
{
taskInfo.CARRIER_ID = info.Main.CarrierPK;
taskInfo.CARRIER_CODE = info.Main.CarrierId;
taskInfo.CARRIER_NAME = info.Main.CarrierName;
if (string.IsNullOrEmpty(taskInfo.CARRIER_NAME))
{
var carrierShortName = await tenantDb.Queryable<CodeCarrier>().Where(x => x.Id == taskInfo.CARRIER_ID).Select(x => x.CnShortName).FirstAsync();
taskInfo.CARRIER_NAME = carrierShortName;
}
}
// 如果船公司主键为空但是Code不为空则通过映射查出船公司信息并保存
else if (!string.IsNullOrEmpty(info.Main.CarrierId))
else
{
// 船公司转换
var allMapCarrierList = (await mappingCarrierService.GetAllList())?.Data ?? new List<MappingCarrierRes>();
MappingCarrierRes? carrierInfo = allMapCarrierList.Where(t => t.MapCode.Equals(info.Main.CarrierId, StringComparison.OrdinalIgnoreCase) && t.Module == MappingModuleConst.CONST_MAPPING_CARRIER_MODULE).FirstOrDefault();
if (carrierInfo != null)
// 如果船公司主键为空但是Code不为空则通过映射查出船公司信息并保存
if (!string.IsNullOrEmpty(taskInfo.CARRIER_CODE))
{
taskInfo.CARRIER_ID = carrierInfo.LinkId;
taskInfo.CARRIER_CODE = carrierInfo.MapCode;
taskInfo.CARRIER_NAME = carrierInfo.MapName;
// 船公司转换
var allMapCarrierList = (await mappingCarrierService.GetAllList())?.Data ?? new List<MappingCarrierRes>();
MappingCarrierRes? carrierInfo = allMapCarrierList.Where(t => t.MapCode.Equals(taskInfo.CARRIER_CODE, StringComparison.OrdinalIgnoreCase) && t.Module == MappingModuleConst.CONST_MAPPING_CARRIER_MODULE).FirstOrDefault();
if (carrierInfo != null)
{
taskInfo.CARRIER_ID = carrierInfo.LinkId;
taskInfo.CARRIER_CODE = carrierInfo.MapCode;
taskInfo.CARRIER_NAME = carrierInfo.MapName;
}
}
}
@ -1703,7 +1732,12 @@ namespace DS.WMS.Core.TaskPlat.Method
{
if (item is ConditionalModel model)
{
if (!model.FieldName.StartsWith("t."))
string lowerFieldName = model.FieldName.ToLower();
if (seaExportFields.Contains(lowerFieldName))
{
model.FieldName = "s." + model.FieldName;
}
else
{
model.FieldName = "t." + model.FieldName;
}
@ -1735,17 +1769,41 @@ namespace DS.WMS.Core.TaskPlat.Method
{
switch (taskType)
{
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<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
// POL、POD关联查询
queryable.WhereIF(!string.IsNullOrEmpty(querySearch.OtherQueryCondition.PortLoadCode), (t, a, bc, s) => querySearch.OtherQueryCondition.PortLoadCode == bc.PORTLOAD_CODE || querySearch.OtherQueryCondition.PortLoadCode == bc.PORTLOAD_CODE);
queryable.WhereIF(!string.IsNullOrEmpty(querySearch.OtherQueryCondition.PortDischargeCode), (t, a, bc, s) => querySearch.OtherQueryCondition.PortDischargeCode == bc.PORTDISCHARGE_CODE || querySearch.OtherQueryCondition.PortDischargeCode == bc.PORTDISCHARGE_CODE);
result = await queryable.Select<dynamic>((t, a, bc) => new
var queryableTemp = queryable.Select<dynamic>((t, a, bc, s) => new
{
Id = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.BUSI_TYPE,
bc.SHIPPER,
bc.CONSIGNEE,
@ -1820,22 +1878,41 @@ namespace DS.WMS.Core.TaskPlat.Method
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.PRICE_CALCULATION_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
}).Distinct();
var sql = queryableTemp.ToSqlString();
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
//var sql = queryable.ToSqlString();
return result;
}
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);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
var queryableTemp = queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.CARRIER,
//bc.MBL_NO,
bc.TAKE_ISSUETYPE_NAME,
@ -1876,20 +1953,41 @@ namespace DS.WMS.Core.TaskPlat.Method
bc.DIFF_NUM,
bc.IS_UPDATE_BOOKING,
bc.UPDATE_BOOKING_DATE
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
}).Distinct();
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
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);
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
var queryableTemp = queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_PKID,
//bc.MBL_NO,
bc.INVOICE_NO,
@ -1900,20 +1998,38 @@ namespace DS.WMS.Core.TaskPlat.Method
bc.DONGSH_RECV_TIME,
bc.DONGSH_RESULT_TIME,
bc.DONGSH_RECV_REASON
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
}).Distinct();
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
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);
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
var queryableTemp = queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
//s.CntrTotal,
bc.TASK_ID,
bc.BookingTruckId,
bc.BookingId,
@ -1965,20 +2081,38 @@ namespace DS.WMS.Core.TaskPlat.Method
bc.MBLNo,
bc.CntrTotal,
bc.FactoryAddr
})
.Distinct().ToQueryPageAsync(querySearch.PageCondition);
}).Distinct();
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
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);
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.CARRIER,
bc.VESSEL,
@ -1992,13 +2126,31 @@ namespace DS.WMS.Core.TaskPlat.Method
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);
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.PLAN_TYPE,
bc.BATCH_NO,
@ -2017,13 +2169,31 @@ 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);
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.CARRIER,
//bc.MBL_NO,
@ -2039,13 +2209,31 @@ namespace DS.WMS.Core.TaskPlat.Method
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);
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.CARRIER,
bc.NOTICE_TYPE,
@ -2058,13 +2246,32 @@ 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);
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.SOURCE_SYSTEM,
bc.SOURCE_BUSI_TYPE,
@ -2089,13 +2296,31 @@ 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);
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID)
.LeftJoin<SeaExport>((t, a, bc, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a, bc) => new
result = await queryable.Select<dynamic>((t, a, bc, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
bc.TASK_ID,
bc.VESSEL,
bc.VOYNO,
@ -2118,19 +2343,43 @@ namespace DS.WMS.Core.TaskPlat.Method
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
return result;
}
default:
{
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)
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id);
SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
await SetCondition(queryable, whereList, taskType, taskStatLevel, querySearch.OtherQueryCondition, userId);
result = await queryable.Select<dynamic>((t, a) => new
var queryableTemp = queryable.Select<dynamic>((t, a, s) => new
{
PK_ID = t.Id.SelectAll(),
s.CustomerNo,
s.CustomerNum,
s.BookingNo,
s.HBLNO,
s.CustomerName,
s.Sale,
s.CustomerServiceName,
s.OperatorName,
s.LoadPortCode,
s.LoadPort,
s.DischargePortCode,
s.DischargePort,
s.CntrTotal,
//TASK_USER_STATUS = a.Status,
//TASK_USER_STATUS_NAME = a.StatusName,
//TASK_USER_STATUS_TIME = a.StatusTime
}).Distinct().ToQueryPageAsync(querySearch.PageCondition);
}).Distinct();
var sql = queryableTemp.ToSqlString();
result = await queryableTemp.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
@ -2140,6 +2389,7 @@ namespace DS.WMS.Core.TaskPlat.Method
{
if (result.Data?.Count > 0)
{
// 查询任务接收人列表
var taskIdList = result.Data.Select(x => (long)x.Id).ToList();
var allRecvUserList = await tenantDb.Queryable<TaskBaseAllocation>()
@ -2181,11 +2431,89 @@ namespace DS.WMS.Core.TaskPlat.Method
}
}
}
/// <summary>
/// 设置条件的方法,用于<see cref="GetPageAsync(PageRequest{QueryTaskManageDto})"/>
/// </summary>
private static async Task SetCondition<T>(ISugarQueryable<TaskBaseInfo, TaskBaseAllocation, T, SeaExport> queryable,
List<IConditionalModel>? whereList,
TaskBaseTypeEnum? taskType,
TaskStatLevelEnum? taskStatLevel,
QueryTaskManageDto queryDto,
long userId)
{
queryable.ClearFilter(typeof(IOrgId));
var taskTypeStr = taskType.ToString();
long? parentId = null;
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
{
var parentIdTemp = await queryable.Context.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.BusinessNo).Select(x => x.ParentId).FirstAsync();
parentId = parentIdTemp == 0 ? null : parentIdTemp;
}
queryable.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.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
|| queryDto.BusinessNo == s.MBLNO
|| queryDto.BusinessNo == s.CustomerNo
|| queryDto.BusinessNo == s.BookingNo
|| queryDto.BusinessNo == s.CustomerNum
|| (parentId != null && s.Id == parentId))
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryDto.Status)
.OrderByDescending(t => t.Id);
var sql = queryable.ToSqlString();
}
/// <summary>
/// 设置条件的方法,用于<see cref="GetPageAsync(PageRequest{QueryTaskManageDto})"/>
/// </summary>
private static async Task SetCondition(ISugarQueryable<TaskBaseInfo, TaskBaseAllocation, SeaExport> queryable,
List<IConditionalModel>? whereList,
TaskBaseTypeEnum? taskType,
TaskStatLevelEnum? taskStatLevel,
QueryTaskManageDto queryDto,
long userId)
{
queryable.ClearFilter(typeof(IOrgId));
long? parentId = null;
if (!string.IsNullOrEmpty(queryDto.BusinessNo))
{
var parentIdTemp = await queryable.Context.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.BusinessNo).Select(x => x.ParentId).FirstAsync();
parentId = parentIdTemp == 0 ? null : parentIdTemp;
}
queryable.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
.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
|| queryDto.BusinessNo == s.CustomerNo
|| queryDto.BusinessNo == s.CustomerNum
|| queryDto.BusinessNo == s.BookingNo
|| (parentId != null && s.Id == parentId))
.WhereIF(!string.IsNullOrEmpty(queryDto.PortLoadCode), (t, a, s) => queryDto.PortLoadCode == s.LoadPortCode)
.WhereIF(!string.IsNullOrEmpty(queryDto.PortDischargeCode), (t, a, s) => queryDto.PortDischargeCode == s.DischargePortCode)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryDto.Status)
.OrderByDescending(t => t.Id);
}
/// <summary>
/// 获取登陆人相关的任务统计信息
/// </summary>
/// <returns>返回回执</returns>
public async Task<DataResult<TaskUserStatResultInfo>> GetCurrentTotalStat(GetCurrentTotalStatQueryDto querySearch)
public async Task<DataResult<TaskUserStatResultInfo>> GetCurrentTotalStat(GetCurrentTotalStatQueryDto queryDto)
{
TaskUserStatResultInfo resultInfo = new TaskUserStatResultInfo
@ -2214,9 +2542,9 @@ namespace DS.WMS.Core.TaskPlat.Method
//序列化查询条件
List<IConditionalModel>? whereList = null;
if (!string.IsNullOrEmpty(querySearch.QueryCondition))
if (!string.IsNullOrEmpty(queryDto.QueryCondition))
{
whereList = tenantDb.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
whereList = tenantDb.Utilities.JsonToConditionalModels(queryDto.QueryCondition);
if (whereList != null)
{
@ -2224,7 +2552,12 @@ namespace DS.WMS.Core.TaskPlat.Method
{
if (item is ConditionalModel model)
{
if (!model.FieldName.StartsWith("t."))
string lowerFieldName = model.FieldName.ToLower();
if (seaExportFields.Contains(lowerFieldName))
{
model.FieldName = "s." + model.FieldName;
}
else
{
model.FieldName = "t." + model.FieldName;
}
@ -2234,14 +2567,53 @@ namespace DS.WMS.Core.TaskPlat.Method
}
var userId = long.Parse(user.UserId);
var cancelStr = TaskStatusEnum.Cancel.ToString();
long? parentId = null;
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.BusinessNo))
{
var parentIdTemp = await tenantDb.Queryable<SeaExport>().ClearFilter(typeof(IOrgId)).Where(x => x.HBLNO == queryDto.OtherQueryCondition.BusinessNo).Select(x => x.ParentId).FirstAsync();
parentId = parentIdTemp == 0 ? null : parentIdTemp;
}
long[]? portLoadTaskIdList = [];
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode))
{
var q1 = tenantDb.Queryable<TaskBCInfo>().Where(x => x.PORTLOAD_CODE == queryDto.OtherQueryCondition.PortLoadCode).Select(x => new { x.TASK_ID });
var temp = await q1.ToListAsync();
if (temp.Count > 0)
{
portLoadTaskIdList = temp.Select(x => x.TASK_ID).ToArray();
}
}
long[]? portDischargeTaskIdList = [];
if (!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode))
{
var q1 = tenantDb.Queryable<TaskBCInfo>().Where(x => x.PORTDISCHARGE_CODE == queryDto.OtherQueryCondition.PortDischargeCode).Select(x => new { x.TASK_ID });
var temp = await q1.ToListAsync();
if (temp.Count > 0)
{
portLoadTaskIdList = temp.Select(x => x.TASK_ID).ToArray();
}
}
//任务列表分组统计
var groupList = await tenantDb.Queryable<TaskBaseInfo>()
var queryable = tenantDb.Queryable<TaskBaseInfo>()
.ClearFilter(typeof(IOrgId))
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<SeaExport>((t, a, s) => t.OUT_BS_NO == s.Id)
.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
.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(querySearch.BusinessNo), (t, a) => t.MBL_NO == querySearch.BusinessNo || t.CUSTOMER_NO == querySearch.BusinessNo)
.Where((t, a) => t.STATUS != cancelStr)
.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
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNo
|| queryDto.OtherQueryCondition.BusinessNo == s.BookingNo
|| queryDto.OtherQueryCondition.BusinessNo == s.CustomerNum
|| (parentId != null && s.Id == parentId))
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortLoadCode), (t, a, s) => queryDto.OtherQueryCondition.PortLoadCode == s.LoadPortCode || portLoadTaskIdList.Contains(t.Id))
.WhereIF(!string.IsNullOrEmpty(queryDto.OtherQueryCondition.PortDischargeCode), (t, a, s) => queryDto.OtherQueryCondition.PortDischargeCode == s.DischargePortCode || portDischargeTaskIdList.Contains(t.Id))
.GroupBy((t, a) => new { t.TASK_TYPE, t.STATUS, a.Status, t.IS_PUBLIC })
.Select((t, a) => new
{
@ -2251,7 +2623,10 @@ namespace DS.WMS.Core.TaskPlat.Method
AStatus = a.Status,
//IsExcept = t.IS_EXCEPT,
IsPublic = t.IS_PUBLIC
}).ToListAsync();
});
var sql = queryable.ToSqlString();
var groupList = await queryable.ToListAsync();
//var exceptList = groupList
@ -2696,49 +3071,6 @@ namespace DS.WMS.Core.TaskPlat.Method
return DataResult<TaskManageOrderResultDto>.Success(result);
}
/// <summary>
/// 设置条件的方法,用于<see cref="GetPageAsync(PageRequest{QueryTaskManageDto})"/>
/// </summary>
private void SetCondition<T>(ISugarQueryable<TaskBaseInfo, TaskBaseAllocation, T> queryable,
List<IConditionalModel>? whereList,
TaskBaseTypeEnum? taskType,
TaskStatLevelEnum? taskStatLevel,
QueryTaskManageDto queryTaskManageDto,
long userId)
{
queryable.ClearFilter(typeof(IOrgId))
.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryTaskManageDto.Status)
.OrderByDescending(t => t.Id);
}
/// <summary>
/// 设置条件的方法,用于<see cref="GetPageAsync(PageRequest{QueryTaskManageDto})"/>
/// </summary>
private void SetCondition(ISugarQueryable<TaskBaseInfo, TaskBaseAllocation> queryable,
List<IConditionalModel>? whereList,
TaskBaseTypeEnum? taskType,
TaskStatLevelEnum? taskStatLevel,
QueryTaskManageDto queryTaskManageDto,
long userId)
{
queryable.ClearFilter(typeof(IOrgId))
.Where(whereList)
.Where((t, a) => t.STATUS != TaskStatusEnum.Cancel.ToString())
.WhereIF(taskType != null, (t, a) => t.TASK_TYPE == taskType.ToString())
.WhereIF(!string.IsNullOrEmpty(queryTaskManageDto.BusinessNo), (t, a) => t.MBL_NO == queryTaskManageDto.BusinessNo || t.CUSTOMER_NO == queryTaskManageDto.BusinessNo)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == queryTaskManageDto.Status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (a.UserId == userId) // 2024-8-14 只显示自己需要审批的任务自己创建的任务不显示所以去掉t.CreateBy == userId ||
&& a.Status == queryTaskManageDto.Status)
.OrderByDescending(t => t.Id);
}

@ -81,8 +81,22 @@ public class SaasDBUpdateTest
{
var tenantDb = saasService.GetBizDbScopeById(item.TenantId).CopyNew();
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci"; //较高版本支持
//tenantDb.CodeFirst.InitTables(types); //指定表空间下的实体
tenantDb.CodeFirst.InitTables(typeof(BookingContractNoManageLane));//指定更新特定实体
// 多表更新
//tenantDb.CodeFirst.InitTables(types);
// 单表更新
//tenantDb.CodeFirst.InitTables(typeof(TaskBaseInfo));
// 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);
}
Assert.True(true);

Loading…
Cancel
Save