cjy 5 months ago
commit 66dd864ad7

@ -87,7 +87,13 @@ namespace DS.WMS.Core.Op.Dtos
/// 收货地代码
/// </summary>
[Description("收货地代码")]
public string PlaceReceiptId { get; set; }
public string PlaceReceiptCode { get; set; }
/// <summary>
/// 收货地主键
/// </summary>
[Description("收货地主键")]
public Nullable<long> PlaceReceiptId { get; set; }
/// <summary>
/// 收货地
@ -99,7 +105,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 交货地代码
/// </summary>
[Description("交货地代码")]
public string PlaceDeliveryId { get; set; }
public string PlaceDeliveryCode { get; set; }
/// <summary>
/// 交货地主键
/// </summary>
public Nullable<long> PlaceDeliveryId { get; set; }
/// <summary>
/// 交货地
@ -111,7 +122,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 装货港代码
/// </summary>
[Description("装货港代码")]
public string PortLoadId { get; set; }
public string PortLoadCode { get; set; }
/// <summary>
/// 装货港主键
/// </summary>
public Nullable<long> PortLoadId { get; set; }
/// <summary>
/// 装货港
@ -123,7 +139,12 @@ namespace DS.WMS.Core.Op.Dtos
/// 卸货港代码
/// </summary>
[Description("卸货港代码")]
public string PortDischargeId { get; set; }
public string PortDischargeCode { get; set; }
/// <summary>
/// 卸货港主键
/// </summary>
public Nullable<long> PortDischargeId { get; set; }
/// <summary>
/// 卸货港

@ -138,7 +138,7 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 装货港主键
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "装货港主键", Length = 10, IsNullable = true)]
[SqlSugar.SugarColumn(ColumnDescription = "装货港主键", IsNullable = true)]
public Nullable<long> PortLoadId { get; set; }
/// <summary>
@ -156,7 +156,7 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 卸货港主键
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "卸货港主键", Length = 10, IsNullable = true)]
[SqlSugar.SugarColumn(ColumnDescription = "卸货港主键", IsNullable = true)]
public Nullable<long> PortDischargeId { get; set; }
/// <summary>

@ -177,8 +177,8 @@ namespace DS.WMS.Core.Op.Method
|| oldObj.Voyno != model.Voyno
|| oldObj.BookingSlotType != model.BookingSlotType
|| oldObj.CarrierCode != model.CarrierCode
|| oldObj.PortLoadId != model.PortLoadCode
|| oldObj.PortDischargeId != model.PortDischargeCode)
|| oldObj.PortLoadCode != model.PortLoadCode
|| oldObj.PortDischargeCode != model.PortDischargeCode)
{
isNeedUpdateOldStock = true;
}
@ -194,8 +194,8 @@ namespace DS.WMS.Core.Op.Method
ContractNo = oldObj.ContractNo,
Vessel = oldObj.Vessel,
Voyno = oldObj.Voyno,
PortLoadId = oldObj.PortLoadId,
PortDischargeId = oldObj.PortDischargeId,
PortLoadId = oldObj.PortLoadCode,
PortDischargeId = oldObj.PortDischargeCode,
TenantId = long.Parse(user.TenantId)
});
}
@ -372,14 +372,14 @@ namespace DS.WMS.Core.Op.Method
{
DataObj = new BookingSlotBaseApiSaveDto
{
PortDischargeId = model.PortDischargeCode,
PortDischargeCode = model.PortDischargeCode,
PortDischarge = model.PortDischarge,
PortLoadId = model.PortLoadCode,
PortLoadCode = model.PortLoadCode,
PortLoad = model.PortLoad,
PlaceDelivery = model.PlaceDelivery,
PlaceDeliveryId = model.PlaceDeliveryCode,
PlaceDeliveryCode = model.PlaceDeliveryCode,
PlaceReceipt = model.PlaceReceipt,
PlaceReceiptId = model.PlaceReceiptCode,
PlaceReceiptCode = model.PlaceReceiptCode,
}
};
@ -432,7 +432,7 @@ namespace DS.WMS.Core.Op.Method
if (regList[j].name.Equals("PORTLOADID", StringComparison.OrdinalIgnoreCase))
{
isSucc = CheckLabel("PORTLOADID", dto.DataObj.PortLoadId, regList[j].val, regList[j].master, operEnum);
isSucc = CheckLabel("PORTLOADID", dto.DataObj.PortLoadCode, regList[j].val, regList[j].master, operEnum);
if (isSucc)
{
@ -481,7 +481,7 @@ namespace DS.WMS.Core.Op.Method
}
else if (regList[j].name.Equals("PORTDISCHARGEID", StringComparison.OrdinalIgnoreCase))
{
isSucc = CheckLabel("PORTDISCHARGEID", dto.DataObj.PortDischargeId, regList[j].val, regList[j].master, operEnum);
isSucc = CheckLabel("PORTDISCHARGEID", dto.DataObj.PortDischargeCode, regList[j].val, regList[j].master, operEnum);
if (isSucc)
{
@ -1030,7 +1030,7 @@ namespace DS.WMS.Core.Op.Method
else
{
dto.DataObj.PortLoad = portInfo.Data.PortName;
dto.DataObj.PortLoadId = portInfo.Data.EdiCode;
dto.DataObj.PortLoadCode = portInfo.Data.EdiCode;
}
}
else
@ -1077,7 +1077,7 @@ namespace DS.WMS.Core.Op.Method
var portInfo = await PlaceDeliveryToPort(portEnName, portCodeList, () => _mappingPortService.GetAllList());
if (portInfo.Succeeded)
if (!portInfo.Succeeded)
{
Logger.Log(NLog.LogLevel.Info, $"通过交货地城市名称未匹配到港口信息,订舱编号:{dto.DataObj.SlotBookingNo}");
}
@ -1095,7 +1095,7 @@ namespace DS.WMS.Core.Op.Method
}
dto.DataObj.PortDischarge = portInfo.Data?.PortName;
dto.DataObj.PortDischargeId = portInfo.Data?.EdiCode;
dto.DataObj.PortDischargeCode = portInfo.Data?.EdiCode;
@ -1275,8 +1275,8 @@ namespace DS.WMS.Core.Op.Method
|| oldObj.Voyno != model.Voyno
|| oldObj.BookingSlotType != model.BookingSlotType
|| oldObj.CarrierId != model.CarrierId
|| oldObj.PortLoadId != model.PortLoadCode
|| oldObj.PortDischargeId != model.PortDischargeCode)
|| oldObj.PortLoadCode != model.PortLoadCode
|| oldObj.PortDischargeCode != model.PortDischargeCode)
{
isNeedUpdateOldStock = true;
}
@ -1292,8 +1292,8 @@ namespace DS.WMS.Core.Op.Method
ContractNo = oldObj.ContractNo,
Vessel = oldObj.Vessel,
Voyno = oldObj.Voyno,
PortLoadId = oldObj.PortLoadId,
PortDischargeId = oldObj.PortDischargeId,
PortLoadId = oldObj.PortLoadCode,
PortDischargeId = oldObj.PortDischargeCode,
TenantId = long.Parse(user.TenantId)
});
}
@ -1471,7 +1471,7 @@ namespace DS.WMS.Core.Op.Method
var newFile = new OpFile
{
Id = SnowFlakeSingle.Instance.NextId(),
//Id = SnowFlakeSingle.Instance.NextId(),
FileName = fileName,
FilePath = FilePath,
TypeCode = fileTypeCode,
@ -1479,7 +1479,7 @@ namespace DS.WMS.Core.Op.Method
LinkId = boookId,
};
await tenantDb.Insertable(newFile).ExecuteCommandAsync();
await tenantDb.Insertable<OpFile>(newFile).ExecuteCommandAsync();
return DataResult<string>.Success(string.Empty);
}

@ -0,0 +1,78 @@
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
/// 我的任务查询
/// </summary>
public sealed class QueryTaskManageDto
{
/// <summary>
/// 提单号
/// </summary>
/// <example></example>
public string MBlNo { get; set; }
/// <summary>
/// 开船日期起始
/// </summary>
/// <example></example>
public string ETDBegin { get; set; }
/// <summary>
/// 开船日期结束
/// </summary>
/// <example></example>
public string ETDEnd { get; set; }
/// <summary>
/// 任务起始日期
/// </summary>
/// <example>2022-12-01</example>
public string TaskDateBegin { get; set; }
/// <summary>
/// 任务起始结束
/// </summary>
/// <example></example>
public string TaskDateEnd { get; set; }
/// <summary>
/// 任务类型
/// </summary>
/// <example></example>
public string TaskType { get; set; }
/// <summary>
/// 任务来源
/// </summary>
/// <example></example>
public string TaskSource { get; set; }
/// <summary>
/// 任务分类
/// </summary>
/// <example></example>
public string TaskCategory { get; set; }
/// <summary>
/// 接收人
/// </summary>
/// <example></example>
public string TaskRecvName { get; set; }
/// <summary>
/// 任务状态
/// </summary>
/// <example></example>
public string Status { get; set; }
/// <summary>
/// 任务主键
/// </summary>
public string PKId { get; set; }
/// <summary>
/// 大简云用户Id
/// </summary>
public string DJYUserId { get; set; }
}
}

@ -0,0 +1,66 @@
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.Core.TaskPlat.Entity
{
/// <summary>
/// 任务分配设置表
///</summary>
[SugarTable("task_allot_set", "任务分配设置表")]
public class TaskAllotSet : BaseModelV2<long>
{
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(ColumnDescription = "任务类型编码", IsNullable = false, Length = 40)]
public string TaskType { get; set; }
/// <summary>
/// 是否分配至操作
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至操作", IsNullable = false)]
public bool AllotOperator { get; set; }
/// <summary>
/// 是否分配至单证
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至单证", IsNullable = false)]
public bool AllotVouchingClerk { get; set; }
/// <summary>
/// 是否分配至销售
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至销售", IsNullable = false)]
public bool AllotSale { get; set; }
/// <summary>
/// 是否分配至报关员
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至报关员", IsNullable = false)]
public bool AllotCustom { get; set; }
/// <summary>
/// 是否分配至财务
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至财务", IsNullable = false)]
public bool AllotFinancialStaff { get; set; }
/// <summary>
/// 是否分配至客服
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至客服", IsNullable = false)]
public bool AllotCustomerService { get; set; }
/// <summary>
/// 是否分配至司机
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至司机", IsNullable = false)]
public bool AllotDriver { get; set; }
/// <summary>
/// 是否分配至派车调度人员
/// </summary>
[SugarColumn(ColumnDescription = "是否分配至派车调度人员", IsNullable = false)]
public bool AllotDispatcher { get; set; }
}
}

@ -1,17 +1,16 @@
using DS.Module.Core;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.TaskPlat.Dtos;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Interface
{
public interface ITaskManageService
{
/// <summary>
/// 任务台台账列表查询
/// </summary>
Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch);
/// <summary>
/// 创建任务
/// </summary>

@ -14,6 +14,7 @@ using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using SqlSugar;
using System.Runtime.InteropServices;
using DS.Module.Core.Extensions;
namespace DS.WMS.Core.TaskPlat.Method
{
@ -143,7 +144,8 @@ namespace DS.WMS.Core.TaskPlat.Method
MBL_NO = info.Main.MBlNo,
TASK_BASE_TYPE = info.Main.TaskType.ToString(),
CARRIER_ID = info.Main.CarrierId?.Trim(),
IS_PUBLIC = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0,
//IS_PUBLIC = string.IsNullOrWhiteSpace(info.Main.TaskUserId) ? 1 : 0,
IS_PUBLIC = 1,
BOOK_ORDER_NO = info.Main.BookingOrderNo,
OUT_BUSI_NO = $"{info.Head.SenderId}_{info.Head.GID}",
TASK_TITLE = info.Main.TaskTitle,
@ -166,7 +168,7 @@ namespace DS.WMS.Core.TaskPlat.Method
// 人员字段说明:
// TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息)
// TaskBaseInfo.TASK_REQ_USERID 制单人只有一个人使用任务创建报文中传入的TaskUserId
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:TaskBaseInfo.TASK_REQ_USERID>关联订单>TaskBaseInfo.CreateBy
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:info.Main.RecvUserInfoList>关联订单
// TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人
// 创建人
@ -203,14 +205,20 @@ namespace DS.WMS.Core.TaskPlat.Method
UserName = x.RecvUserName
}).ToList();
await tenantDb.Insertable(allocationList).ExecuteCommandAsync();
}
// 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务
else
{
taskInfo.IS_PUBLIC = 1;
//
}
//else
//{
// // 1.查找任务的匹配设置
// var allotSet = await tenantDb.Queryable<TaskAllotSet>().Where(x => x.TaskType == info.Main.TaskType.ToString()).FirstAsync();
// if (allotSet != null)
// {
// // 2. 根据提单号查找订单\根据订舱编号查找订单\...
// // 3. 查找订单之后获取匹配设置参数得到人员Id列表
// // 4. 获取任务Id
// // 5. 存关系
// }
//}
if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue)
{
@ -658,6 +666,128 @@ namespace DS.WMS.Core.TaskPlat.Method
}
/// <summary>
/// 任务台台账列表查询
/// </summary>
public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch)
{
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
List<IConditionalModel>? whereList = null;
if (!string.IsNullOrEmpty(querySearch.QueryCondition))
{
whereList = tenantDb.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
}
TaskBaseTypeEnum? taskType = null;
if (Enum.TryParse(typeof(TaskBaseTypeEnum), querySearch.OtherQueryCondition?.TaskType, out object? temp))
{
taskType = (TaskBaseTypeEnum)temp;
};
switch (taskType)
{
case TaskBaseTypeEnum.BC:
{
var result = await tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBCInfo>((t, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Select<dynamic>((t, bc) => new
{
Id = t.Id.SelectAll(),
bc.BUSI_TYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.BC_MODIFY_TIMES,
bc.BC_MODIFY_DATE,
//bc.MBL_NO,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.PLACERECEIPT,
bc.PORTLOAD,
bc.CLOSING_DATE,
bc.VGM_CUTOFF_TIME,
bc.ETA,
//bc.ETD,
bc.POD_ETA,
bc.CUT_SINGLE_TIME,
bc.PORTDISCHARGE,
bc.PLACEDELIVERY,
bc.SHIPPING_METHOD,
bc.SERVICE,
bc.PRETRANS_MODE,
bc.DESCRIPTION,
bc.ISSUEPLACE,
bc.COLLECTION_TERMINAL,
bc.CONTRACTNO,
bc.PREPARDAT,
bc.SHIP_AGENT,
bc.YARD,
bc.YARD_CONTACT_USR,
bc.YARD_CONTACT_TEL,
bc.FST_CUSTOMER_SER_USRNAME,
bc.FST_CUSTOMER_SER_TEL,
bc.FST_CUSTOMER_SER_EMAIL,
bc.REMARK1,
bc.CY_CUTOFF_TIME,
bc.CARRIERID,
bc.LANECODE,
bc.LANENAME,
bc.CARRIAGE_TYPE,
bc.CARRIAGE_TYPE_NAME,
bc.BOOKING_SLOT_TYPE,
bc.BOOKING_SLOT_TYPE_NAME,
bc.CTN_STAT,
bc.WEEK_AT,
bc.DETENSION_FREE_DAYS,
bc.SI_CUT_DATE,
bc.MANIFEST_CUT_DATE,
bc.MDGF_CUT_DATE,
bc.TRANSFER_PORT_1,
bc.TRANSFER_PORT_2,
bc.SECOND_VESSEL,
bc.SECOND_VOYNO,
bc.SECOND_ETD,
bc.SECOND_ETA,
//bc.STATUS,
bc.FILE_MD5,
bc.LAST_TOBOOKING_DATE,
bc.FROM_EMAIL,
bc.RECV_EMAIL,
bc.BOOKING_ORDER_ID,
bc.BOOKING_SLOT_ID,
bc.BOOKING_COMFIRM_DATE,
bc.BATCH_NO,
bc.CUSTOM_SI_CUT_DATE,
bc.IS_SET_AUTO_EMAIL,
bc.IS_SEND_EMAIL,
bc.DIFF_NUM,
bc.AUTO_SEND_USER,
bc.PROCESS_STATUS,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.PRICE_CALCULATION_DATE
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
default:
{
var result = await tenantDb.Queryable<TaskBaseInfo>()
.Where(whereList)
.Select<dynamic>(t => new
{
Id = t.Id.SelectAll()
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
}
}
#region 私有方法
/// <summary>

@ -41,7 +41,7 @@ if (!policyName.IsNullOrEmpty())
// if (app.Environment.IsDevelopment())
// {
var apis = new List<string> { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "TestApi" };
var apis = new List<string> { "WmsMainAPI", "WmsAdminAPI", "WmsOpAPI", "WmsFeeAPI", "WmsCheckAPI", "WmsFinanceAPI", "WmsPrintAPI", "WmsTaskAPI", "TestApi" };
app
.UseSwagger()

@ -216,6 +216,21 @@
"ReRouteIsCaseSensitive": false,
"UseServiceDiscovery": false
},
{
"DownstreamPathTemplate": "/WmsTaskAPI/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 3006
}
],
"UpstreamPathTemplate": "/WmsTaskAPI/swagger.json",
"UpstreamHttpMethod": [
"Get",
"Post"
]
},
{
"DownstreamPathTemplate": "/taskApi/{url}",
"DownstreamScheme": "http",

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.7",
"commands": [
"dotnet-ef"
]
}
}
}

@ -66,6 +66,17 @@ public class TaskManageController : ApiController
return result;
}
/// <summary>
/// 任务台台账列表查询
/// </summary>
[HttpPost("GetPageAsync")]
public async Task<DataResult<List<dynamic>>> GetPageAsync(PageRequest<QueryTaskManageDto> querySearch)
{
var result = await taskManageService.GetPageAsync(querySearch);
return result;
}
// /TaskManage/CreateBCTaskJob
// /TaskManage/CreateDRAFTTaskJob
// /TaskManage/CreateAdvisoryTaskJob

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net8.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ProjectGuid>8dae16a3-e249-4c86-beec-da8429fd837c</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

@ -215,7 +215,7 @@ public class SaasTest
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrder));
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderCtn));
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderShipSchedule));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotBase));
tenantDb.CodeFirst.InitTables(typeof(BookingSlotBase));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotCtn));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotStock));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocation));
@ -227,7 +227,7 @@ public class SaasTest
//tenantDb.CodeFirst.InitTables(typeof(BookingLabel));
//tenantDb.CodeFirst.InitTables(typeof(BookingLabelAllocation));
tenantDb.CodeFirst.InitTables(typeof(InfoClient));
//tenantDb.CodeFirst.InitTables(typeof(InfoClient));
//tenantDb.CodeFirst.InitTables(typeof(CodeThirdParty));
//tenantDb.CodeFirst.InitTables(typeof(CheckBillAutoDetail));
//db.CodeFirst.InitTables(typeof(OpBusinessTruckCtn));

Loading…
Cancel
Save