jianghaiqing 4 months ago
commit 34c998bfab

@ -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",

@ -5,7 +5,7 @@
/// <summary>
/// 是否成功
/// </summary>
public bool Successed { get; set; }
public bool Succeeded { get; set; }
/// <summary>
/// 返回消息
@ -26,7 +26,7 @@
{
return new PrintDataResult()
{
Successed = false,
Succeeded = false,
Message = message
};
}
@ -35,7 +35,7 @@
{
return new PrintDataResult()
{
Successed = true,
Succeeded = true,
Data = data
};
}

@ -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>
Loading…
Cancel
Save