合并代码

usertest
cjy 4 months ago
commit 43b192f01f

@ -1400,7 +1400,20 @@ public static class MultiLanguageConst
/// </summary> /// </summary>
[Description("作废成功")] [Description("作废成功")]
public const string BookingSlotDeleteSucc = "BookingSlot_DeleteSucc"; public const string BookingSlotDeleteSucc = "BookingSlot_DeleteSucc";
/// <summary>
/// 舱位变更比对结果不存在
/// </summary>
[Description("舱位变更比对结果不存在")]
public const string BookingSlotCompareNull = "BookingSlot_CompareNull";
/// <summary>
/// 获取舱位变更比对结果错误,比对内容不存在
/// </summary>
[Description("获取舱位变更比对结果错误,比对内容不存在")]
public const string BookingSlotCompareJsonNull = "BookingSlot_CompareJsonNull";
#endregion #endregion

@ -64,7 +64,7 @@ namespace DS.Module.Core
/// <summary> /// <summary>
/// 工作流 /// 工作流
/// </summary> /// </summary>
[Description("系统")] [Description("工作流")]
WORK_FLOW, WORK_FLOW,
} }
} }

@ -0,0 +1,26 @@
using System.ComponentModel;
namespace DS.Module.Core
{
/// <summary>
/// 任务统计分类枚举
/// </summary>
public enum TaskStatLevelEnum
{
/// <summary>
/// 异常
/// </summary>
[Description("异常")]
EXCPTION,
/// <summary>
/// 个人
/// </summary>
[Description("个人")]
PERSON,
/// <summary>
/// 公共
/// </summary>
[Description("公共")]
PUBLIC
}
}

@ -1,4 +1,5 @@
using System.ComponentModel; using System.Collections.Concurrent;
using System.ComponentModel;
using System.Reflection; using System.Reflection;
namespace DS.Module.Core; namespace DS.Module.Core;
@ -8,6 +9,9 @@ namespace DS.Module.Core;
/// </summary> /// </summary>
public static class EnumUtil public static class EnumUtil
{ {
// 枚举显示字典缓存
private static readonly ConcurrentDictionary<Type, Dictionary<string, string>> EnumShowNameDict = new ConcurrentDictionary<Type, Dictionary<string, string>>();
/// <summary> /// <summary>
/// 字符串转Enum /// 字符串转Enum
/// </summary> /// </summary>
@ -58,4 +62,39 @@ public static class EnumUtil
return 0; return 0;
} }
} }
/// <summary>
/// 获取枚举对象Key与名称的字典缓存
/// </summary>
/// <param name="enumType"></param>
/// <returns></returns>
public static Dictionary<string, string> GetEnumDictionaryWithKey(this Type enumType)
{
if (!enumType.IsEnum)
throw new ArgumentException("Type '" + enumType.Name + "' is not an enum.");
// 查询缓存
var enumDic = EnumShowNameDict.ContainsKey(enumType) ? EnumShowNameDict[enumType] : new Dictionary<string, string>();
if (enumDic.Count != 0)
return enumDic;
string[] fieldstrs = Enum.GetNames(enumType);
// 取枚举类型的Key/Value字典集合
enumDic = fieldstrs.Select(item =>
{
object[] arr = enumType.GetField(item).GetCustomAttributes(typeof(DescriptionAttribute), true);
return new
{
Key = item,
Val = ((DescriptionAttribute)arr[0]).Description
};
}).ToDictionary(a => a.Key, b => b.Val);
// 缓存
EnumShowNameDict[enumType] = enumDic;
return enumDic;
}
} }

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.ContainerManagementApi.Controllers;
/// <summary>
/// WebApi控制器基类
/// </summary>
[Authorize]
[ApiController]
[Route("containerManagementApi/[controller]")]
public abstract class ApiController : Controller
{
// /// <summary>
// /// 获取用户信息
// /// </summary>
// public UserInfo UserDetails => Request.GetUserInfo();
}

@ -0,0 +1,95 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.ContainerManagement.Info.Dtos;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.ContainerManagement.Info.Interface;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.View;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.ContainerManagementApi.Controllers;
/// <summary>
/// 集装箱管理
/// </summary>
public class CM_CurrentStateController : ApiController
{
private readonly ICM_CurrentStateService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CM_CurrentStateController(ICM_CurrentStateService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetCM_CurrentStateList")]
public async Task<DataResult<List<CM_CurrentStateRes>>> GetCM_CurrentStateList([FromBody] PageRequest request)
{
var res = await _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 直接编辑状态
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("EditCM_CurrentState")]
public DataResult EditCM_CurrentState([FromBody] CM_CurrentStateReq model)
{
var res = _invokeService.EditCM_CurrentState(model);
return res;
}
/// <summary>
/// 查看状态详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetCM_CurrentStateInfo")]
public DataResult<CM_CurrentStateRes> GetCM_CurrentStateInfo([FromQuery] string id)
{
var res = _invokeService.GetCM_CurrentStateInfo(id);
return res;
}
///// <summary>
///// 费用锁定
///// </summary>
///// <param name="req">主表Ids</param>
///// <returns></returns>
//[HttpPost]
//[Route("FeeLocking")]
//public DataResult FeeLocking([FromBody] IdModel req)
//{
// var res = _invokeService.FeeLocking(req);
// return res;
//}
///// <summary>
///// 费用解除锁定
///// </summary>
///// <param name="req">主表Ids</param>
///// <returns></returns>
//[HttpPost]
//[Route("FeeUnLocking")]
//public DataResult FeeUnLocking([FromBody] IdModel req)
//{
// var res = _invokeService.FeeUnLocking(req);
// return res;
//}
}

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<DocumentationFile>bin\Debug\net8.0\Api.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DS.Module.AutofacModule\DS.Module.AutofacModule.csproj" />
<ProjectReference Include="..\DS.Module.Core\DS.Module.Core.csproj" />
<ProjectReference Include="..\DS.Module.Jwt\DS.Module.Jwt.csproj" />
<ProjectReference Include="..\DS.Module.MultiLanguage\DS.Module.MultiLanguage.csproj" />
<ProjectReference Include="..\DS.Module.Nuget\DS.Module.Nuget.csproj" />
<ProjectReference Include="..\DS.Module.SqlSugar\DS.Module.SqlSugar.csproj" />
<ProjectReference Include="..\DS.Module.Swagger\DS.Module.Swagger.csproj" />
<ProjectReference Include="..\DS.Module.UserModule\DS.Module.UserModule.csproj" />
<ProjectReference Include="..\DS.WMS.Core\DS.WMS.Core.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,6 @@
@DS.WMS.ContainerManagementApi_HostAddress = http://localhost:5011
GET {{DS.WMS.ContainerManagementApi_HostAddress}}/weatherforecast/
Accept: application/json
###

@ -0,0 +1,42 @@
2024-07-25 15:40:36.9950 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 15:40:37.0123 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 15:40:37.0161 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 15:40:37.0333 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 15:40:37.0333 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 15:40:37.0333 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 15:40:37.0498 Info Configuration initialized.
2024-07-25 15:41:29.0953 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 15:41:29.1107 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 15:41:29.1107 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 15:41:29.1294 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 15:41:29.1294 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 15:41:29.1444 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 15:41:29.1444 Info Configuration initialized.
2024-07-25 16:17:59.0630 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 16:17:59.0872 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 16:17:59.0946 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 16:17:59.1151 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 16:17:59.1151 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:17:59.1292 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:17:59.1292 Info Configuration initialized.
2024-07-25 16:19:07.1595 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 16:19:07.1728 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 16:19:07.1728 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 16:19:07.1911 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 16:19:07.1911 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:19:07.1911 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:19:07.2052 Info Configuration initialized.
2024-07-25 16:24:33.7032 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 16:24:33.7032 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 16:24:33.7248 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 16:24:33.7460 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 16:24:33.7541 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:24:33.7541 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:24:33.7696 Info Configuration initialized.
2024-07-25 16:34:52.0017 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-25 16:34:52.0017 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-25 16:34:52.0175 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-25 16:34:52.0332 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-25 16:34:52.0332 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-07-25 16:34:52.0332 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-25 16:34:52.0509 Info Configuration initialized.

@ -0,0 +1,86 @@
using Autofac;
using Autofac.Extensions.DependencyInjection;
using DS.Module.AutofacModule;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.Core.ServiceExtensions;
using DS.Module.Jwt;
using DS.Module.MultiLanguage;
using DS.Module.SqlSugar;
using DS.Module.Swagger;
using DS.Module.UserModule;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;
var builder = WebApplication.CreateBuilder(args);
var environment = builder.Environment.EnvironmentName;
Console.WriteLine("当前开发环境:" + environment);
//注册配置
builder.Configuration
// .SetBasePath(builder.Environment.ContentRootPath)
.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true)
// .AddJsonFile(path: $"appsettings.{environment}.json", optional: true, reloadOnChange: true)
.Build();
builder.Configuration.AddEnvironmentVariables();
builder.Logging.AddNLog("nlog.config");
// Add services to the container.
//Autofac注入
builder.Host
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureContainer<ContainerBuilder>(builder => { builder.RegisterModule(new AutofacModuleRegister()); });
builder.Services.AddAppWebInstal();
builder.Services.AddCorsInstall();
builder.Services.AddUserModuleInstall(); //用户服务
builder.Services.AddSqlSugarInstall();
builder.Services.AddSwaggerInstall();
builder.Services.AddJwtInstall();
builder.Services.AddSaasDbInstall();//分库服务
builder.Services.AddMultiLanguageInstall();//多语言服务
// builder.Services.AddEndpointsApiExplorer();
// builder.Services.AddSwaggerGen();
//builder.Services.AddCrawlerModuleInstall();//运踪服务
var app = builder.Build();
// Configure the HTTP request pipeline.
// if (app.Environment.IsDevelopment())
// {
// app.UseSwagger();
// app.UseSwaggerUI();
// }
//swagger
// app.UseSwagger();
var documentName = AppSetting.app(new string[] { "SwaggerDoc", "ContactName" });
app
.UseSwagger(c => { c.RouteTemplate = "{documentName}/swagger.json"; })
.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/" + documentName + "/swagger.json",
AppSetting.app(new string[] { "SwaggerDoc", "ContactName" }));
c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法
c.DefaultModelExpandDepth(-1);//-1 可不显示Models
});
//跨域
var policyName = AppSetting.app(new string[] { "Cors", "PolicyName" });
if (!policyName.IsNullOrEmpty())
{
app.UseCors(policyName); //添加跨域中间件
}
app.UseRouting();
app.UseStaticFiles();
//多语言中间件
app.UseMiddleware<MultiLanguageMiddleware>();
// //操作日志中间件
// app.UseMiddleware<OperationLogMiddleware>();
// 先开启认证
app.UseAuthentication();
// 然后是授权中间件
app.UseAuthorization();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
app.Run();

@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52580",
"sslPort": 44370
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5011",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7026;http://localhost:5011",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

@ -0,0 +1,89 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"JwtSettings": {
"Issuer": "vol.core.owner",
"Audience": "vol.core",
"User": "C5ABA9E202D94C43A3CA66002BF77FAF",
"SecretKey": "sdfsdfsrty45634kkhllghtdgdfss345t678fs"
},
"Cors": {
"PolicyName": "WMSCore.API",
"Url": "http://localhost:8000,http://localhost:5999,http://localhost:8088,http://localhost:5173,http://0.0.0.0:5999,http://0.0.0.0:9995,http://localhost:9995,http://60.209.125.238:9995,http://localhost:3000,https://localhost:3100,http://47.104.255.182:3100,http://47.104.255.182:3110,https://localhost:3110,http://localhost:8080,http://localhost:8081,http://localhost:8082,http://localhost:8083,http://localhost:8084"
},
"DBInfo": {
"DefaultDbConnId": "1288018625843826688",
"DefaultDbType": 0,
"DefaultDbString": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_dev",
"DBS": [
{
"ConnId": "1288018625843826680",
"DBType": 0,
"Enabled": false,
"HitRate": 40,
"Connection": "server=60.209.125.238;port=32006;uid=root;pwd=Djy@Mysql.test;database=shippingweb8_log"
}
]
},
"SwaggerDoc": {
"ContactName": "WmsContainerManagementAPI",
"ContactEmail": "Wms API.Core@xxx.com",
"ContactUrl": "https://www.xxx.com",
"Version": "1.0",
"Title": "Wms ContainerManagement API",
"Description": "Wms ContainerManagement API"
},
"Middleware": {
"RecordAccessLogs": {
"Enabled": true,
"IgnoreApis": "/api/permission/getnavigationbar,/api/monitor/getids4users,/api/monitor/getaccesslogs,/api/monitor/server,/api/monitor/getactiveusers,/api/monitor/server,"
}
},
"FileSettings": {
"BasePath": "", //使
"RelativePath": "LinkAttach",
"FileType": [ ".xls", ".xlsx", ".pdf", ".jpg", ".png", ".txt", ".pms" ]
},
//
"PrintTemplate": {
"BasePath": "", //使
"RelativePath": "Upload/PrintTemplate",
"FileType": [ ".frx", ".xls" ]
},
"TempFile": {
"Path": "TempFiles",
"RemainHours": 2
},
"PrintService": {
"IP": "60.209.125.238",
"Port": "3009",
"AccessKey": "1777229107311022080",
"AccessSecret": "d816e6fe938f24e2f205db129d31286a",
"GetModuleListUrl": "/printApi/OpenPrint/GetPrintModuleList",
"GetTemplateListUrl": "/printApi/OpenPrint/GetPrintTemplateList",
"GetJsonPrintInfoUrl": "/printApi/OpenPrint/GetOpenJsonPrintInfo"
},
"DjyService": {
"IP": "60.209.125.238",
"Port": "35100",
"AccessKey": "6b050e757c1e405489e19602dd81ebbe",
"AccessSecret": "51d564741c761e0760f62d904f13c193009e74d0af9f72e2dc67f9320b8ae42580e2339745aee1bf",
"SaveServiceProjectUrl": "/EmbedProjectGoodsStatus/SaveServiceProject",
"CancelServiceProjectUrl": "/EmbedProjectGoodsStatus/CancelServiceProject",
"GetServiceProjectListUrl": "/EmbedProjectGoodsStatus/GetServiceProjectList",
"GetServiceStatusListUrl": "/EmbedProjectGoodsStatus/GetServiceStatusList",
"SaveServiceStatusUrl": "/EmbedProjectGoodsStatus/SaveServiceStatus",
"CancelServiceStatusUrl": "/EmbedProjectGoodsStatus/CancelServiceStatus"
},
"ExcuteRuleService": {
"IP": "47.104.73.97",
"Port": "7115",
"SenderKey": "SEFBZkh5V3R1TGxtdlBIcTF4QmNMWURCS08vb2EvTzVxS0F0eDFKdlgyS3lKVUx6K3JRRE94Q2kvcWZMRytZeWxyVkhLdk9hRGpzVStPamhIUXd5NU9FMjhFTktwUlZ2eThJZGlQd3p5dUk9",
"SendUrl": "/api/RulesEngineManage/ExcuteWorkFlow"
}
}

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogLevel="info"
internalLogFile="Logs\internal-nlog.txt">
<!-- enable asp.net core layout renderers -->
<extensions>
<add assembly="NLog.Web.AspNetCore" />
</extensions>
<targets>
<!-- 写入文件配置 -->
<!-- 将日志写入文件 -->
<target xsi:type="File" name="allfile" fileName="Logs\nlog-all-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring} ${newline}" />
<!-- 另一个文件日志只有自己的日志。使用一些ASP.NET核心渲染器 -->
<target xsi:type="File" name="ownFile-web" fileName="Logs\nlog-own-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action} ${newline}" />
<!-- 将日志写入控制台 -->
<target name="console" xsi:type="ColoredConsole" layout="${longdate} ${message} ${exception:format=tostring}" />
</targets>
<rules>
<!--所有日志包括来自Microsoft的-->
<!--minlevel 改为Trace 跟踪全部 Error 只捕获异常-->
<!-- <logger name="*" minlevel="Trace" writeTo="allfile" /> -->
<logger name="*" minlevel="Trace" writeTo="console" />
<!--跳过非关键的Microsoft日志因此只记录自己的日志-->
<logger name="Microsoft.*" maxlevel="Info" final="true" />
<!-- BlackHole without writeTo -->
<logger name="*" minlevel="Trace" writeTo="ownFile-web" />
</rules>
</nlog>

@ -0,0 +1,136 @@
using DS.Module.Core;
using FluentValidation;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Dtos;
/// <summary>
/// 集装箱当前状态 请求实体
/// </summary>
public class CM_CurrentStateReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 集装箱号
/// </summary>
public string Cntrno { get; set; }
// <summary>
/// Desc:箱型
/// </summary>
public string Ctnall { get; set; }
/// <summary>
/// Desc:是否上线(是否管理中)
/// </summary>
public bool IsOnline { get; set; } = false;
/// <summary>
/// Desc:新旧箱 空白/used/new
/// </summary>
public string UsedState { get; set; }
/// <summary>
/// Desc:箱主
/// </summary>
public string CtnOwner { get; set; }
/// <summary>
/// Desc:业务所属分部
/// </summary>
public string Corpid { get; set; }
/// <summary>
/// Desc:箱来源: 自有箱/短租租入/长租租入/买箱
/// </summary>
public string CtnSource { get; set; }
/// <summary>
/// Desc:箱业务状态: 短租租出 长租租出 单程 卖箱
/// </summary>
public string CtnBizState { get; set; } = "0";
/// <summary>
/// Desc:箱业务编号:当前
/// </summary>
public string Billno { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
public string CtnReleaseNo { get; set; }
/// <summary>
/// Desc:箱状态
/// </summary>
public string CtnState { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// </summary>
public string CtnBreakState { get; set; }
/// <summary>
/// Desc:当前港口
/// </summary>
public string Portid { get; set; }
/// <summary>
/// Desc:码头或场站
/// </summary>
public string Depot { get; set; }
/// <summary>
/// Desc:运输工具
/// </summary>
public string VehicleName { get; set; }
/// <summary>
/// Desc:当前业务编号
/// </summary>
public string Mblno { get; set; }
/// <summary>
/// Desc:业务委托单位
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
public DateTime? ETA { get; set; }
/// <summary>
/// Desc:状态时间
/// </summary>
public DateTime? StateTime { get; set; }
}
/// <summary>
/// 验证
/// </summary>
public class CM_CurrentStateReqValidator : AbstractValidator<CM_CurrentStateReq>
{
/// <summary>
/// 构造函数
/// </summary>
public CM_CurrentStateReqValidator()
{
this.RuleFor(o => o.Cntrno)
.NotEmpty().WithName("集装箱号");
this.RuleFor(o => o.Ctnall)
.NotEmpty().WithName("箱型");
}
}

@ -0,0 +1,117 @@
using DS.Module.Core;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Dtos;
/// <summary>
/// 集装箱当前状态 返回实体
/// </summary>
public class CM_CurrentStateRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 集装箱号
/// </summary>
public string Cntrno { get; set; }
// <summary>
/// Desc:箱型
/// </summary>
public string Ctnall { get; set; }
/// <summary>
/// Desc:是否上线(是否管理中)
/// </summary>
public bool IsOnline { get; set; } = false;
/// <summary>
/// Desc:新旧箱 空白/used/new
/// </summary>
public string UsedState { get; set; }
/// <summary>
/// Desc:箱主
/// </summary>
public string CtnOwner { get; set; }
/// <summary>
/// Desc:业务所属分部
/// </summary>
public string Corpid { get; set; }
/// <summary>
/// Desc:箱来源: 自有箱/短租租入/长租租入/买箱
/// </summary>
public string CtnSource { get; set; }
/// <summary>
/// Desc:箱业务状态: 短租租出 长租租出 单程 卖箱
/// </summary>
public string CtnBizState { get; set; } = "0";
/// <summary>
/// Desc:箱业务编号:当前
/// </summary>
public string Billno { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
public string CtnReleaseNo { get; set; }
/// <summary>
/// Desc:箱状态
/// </summary>
public string CtnState { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// </summary>
public string CtnBreakState { get; set; }
/// <summary>
/// Desc:当前港口
/// </summary>
public string Portid { get; set; }
/// <summary>
/// Desc:码头或场站
/// </summary>
public string Depot { get; set; }
/// <summary>
/// Desc:运输工具
/// </summary>
public string VehicleName { get; set; }
/// <summary>
/// Desc:当前业务编号
/// </summary>
public string Mblno { get; set; }
/// <summary>
/// Desc:业务委托单位
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
public DateTime? ETA { get; set; }
/// <summary>
/// Desc:状态时间
/// </summary>
public DateTime? StateTime { get; set; }
}

@ -0,0 +1,136 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Entity;
/// <summary>
/// 集装箱当前状态
/// </summary>
[SqlSugar.SugarTable("CM_CurrentState", "箱管_当前状态")]
public class CM_CurrentState : BaseOrgModel<long>
{
/// <summary>
/// Desc:集装箱号
/// </summary>
[SugarColumn(ColumnDescription = "集装箱号", IsNullable = false, Length = 20)]
public string Cntrno { get; set; }
/// <summary>
/// Desc:箱型
/// </summary>
[SugarColumn(ColumnDescription = "箱型", IsNullable = false, Length = 20)]
public string Ctnall { get; set; }
/// <summary>
/// Desc:是否上线(是否管理中)
/// </summary>
[SugarColumn(ColumnDescription = "是否上线", IsNullable = false,DefaultValue ="0")]
public bool IsOnline { get; set; } = false;
/// <summary>
/// Desc:新旧箱 空白/used/new
/// </summary>
[SugarColumn(ColumnDescription = "新旧箱", IsNullable = true, Length = 20)]
public string UsedState { get; set; }
/// <summary>
/// Desc:箱主
/// </summary>
[SugarColumn(ColumnDescription = "箱主", IsNullable = true, Length = 50)]
public string CtnOwner { get; set; }
/// <summary>
/// Desc:业务所属分部
/// </summary>
[SugarColumn(ColumnDescription = "业务所属分部", IsNullable = true, Length = 50)]
public string Corpid { get; set; }
/// <summary>
/// Desc:箱来源: 自有箱/短租租入/长租租入/买箱
/// </summary>
[SugarColumn(ColumnDescription = "箱来源", IsNullable = true, Length = 20)]
public string CtnSource { get; set; }
/// <summary>
/// Desc:箱业务状态: 短租租出 长租租出 单程 卖箱
/// </summary>
[SugarColumn(ColumnDescription = "箱业务状态", DefaultValue = "")]
public string CtnBizState { get; set; } = "0";
/// <summary>
/// Desc:箱业务编号:当前
/// </summary>
[SugarColumn(ColumnDescription = "箱业务编号", IsNullable = true, Length = 50)]
public string Billno { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", Length = 50)]
public string CtnReleaseNo { get; set; }
/// <summary>
/// Desc:箱状态
/// </summary>
[SugarColumn(ColumnDescription = "箱状态", IsNullable = true, Length = 20)]
public string CtnState { get; set; }
/// <summary>
/// Desc:箱损坏/维修状态
/// </summary>
[SugarColumn(ColumnDescription = "箱损坏/维修状态", IsNullable = true, Length = 20)]
public string CtnBreakState { get; set; }
/// <summary>
/// Desc:当前港口
/// </summary>
[SugarColumn(ColumnDescription = "当前港口", IsNullable = true, Length = 50)]
public string Portid { get; set; }
/// <summary>
/// Desc:码头或场站
/// </summary>
[SugarColumn(ColumnDescription = "码头或场站", IsNullable = true, Length = 50)]
public string Depot { get; set; }
/// <summary>
/// Desc:运输工具
/// </summary>
[SugarColumn(ColumnDescription = "运输工具", IsNullable = true, Length = 50)]
public string VehicleName { get; set; }
/// <summary>
/// Desc:当前业务编号
/// </summary>
[SugarColumn(ColumnDescription = "当前业务编号", IsNullable = true, Length = 50)]
public string Mblno { get; set; }
/// <summary>
/// Desc:业务委托单位
/// </summary>
[SugarColumn(ColumnDescription = "业务委托单位", IsNullable = true, Length = 50)]
public string CustomerName { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
[SugarColumn(ColumnDescription = "ETD", IsNullable = true)]
public DateTime? ETD { get; set; }
/// <summary>
/// Desc:ETD
/// </summary>
[SugarColumn(ColumnDescription = "ETA", IsNullable = true)]
public DateTime? ETA { get; set; }
/// <summary>
/// Desc:状态时间
/// </summary>
[SugarColumn(ColumnDescription = "状态时间", IsNullable = true)]
public DateTime? StateTime { get; set; }
}

@ -0,0 +1,33 @@
using DS.Module.Core;
using DS.WMS.ContainerManagement.Info.Dtos;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Op.View;
using DS.WMS.Core.Sys.Dtos;
namespace DS.WMS.ContainerManagement.Info.Interface;
public interface ICM_CurrentStateService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
//DataResult<List<CM_CurrentStateRes>> GetListByPage(PageRequest request);
public Task<DataResult<List<CM_CurrentStateRes>>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DataResult EditCM_CurrentState(CM_CurrentStateReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<CM_CurrentStateRes> GetCM_CurrentStateInfo(string id);
}

@ -0,0 +1,115 @@
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.ContainerManagement.Info.Dtos;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.ContainerManagement.Info.Interface;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.Op.View;
using DS.WMS.Core.Sys.Entity;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Method;
public class CM_CurrentStateService : ICM_CurrentStateService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public CM_CurrentStateService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<CM_CurrentStateRes>>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<CM_CurrentState>()
.Where(whereList)
.Select<CM_CurrentStateRes>().ToQueryPage(request.PageCondition);
return data;
}
//public async Task<DataResult<List<CM_CurrentStateRes>>> GetListByPage(PageRequest request)
//{
// var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
// //序列化查询条件
// var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
// var data = await tenantDb.Queryable<CM_CurrentStateRes>()
// .Where(whereList)
// .ToQueryPageAsync(request.PageCondition);
// return data;
//}
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult EditCM_CurrentState(CM_CurrentStateReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Id == 0)
{
//if (tenantDb.Queryable<InfoClientAccountDate>().Where(x => x.AccountType == req.AccountType &&
// x.AccountType == req.AccountType &&
// x.SaleId == req.SaleId &&
// x.BeginDate == req.BeginDate &&
// x.EndDate == req.EndDate).Any())
//{
// return DataResult.Failed("客户账期信息已存在!", MultiLanguageConst.ClientAccountDateExist);
//}
var data = req.Adapt<CM_CurrentState>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = tenantDb.Queryable<CM_CurrentState>().Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataResult<CM_CurrentStateRes> GetCM_CurrentStateInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CM_CurrentState>()
.Where(a => a.Id == long.Parse(id))
.Select<CM_CurrentStateRes>()
.First();
return DataResult<CM_CurrentStateRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
}

@ -240,7 +240,7 @@ namespace DS.WMS.Core.Op.Entity
/// <summary> /// <summary>
/// 截港时间 /// 截港时间
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "样单截止日期", IsNullable = true)] [SqlSugar.SugarColumn(ColumnDescription = "截港时间", IsNullable = true)]
public Nullable<DateTime> CYCutDate { get; set; } public Nullable<DateTime> CYCutDate { get; set; }
/// <summary> /// <summary>

@ -121,7 +121,7 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="id">舱位主键</param> /// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param> /// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns> /// <returns>返回舱位变更比对结果</returns>
Task<List<CompareResultDetailInfo>> GetSlotCompareResult(long id, string batchNo); Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult(long id, string batchNo);
/// <summary> /// <summary>
/// 导入舱位 /// 导入舱位

@ -978,7 +978,7 @@ namespace DS.WMS.Core.Op.Method
dto.DataObj.CtnList.ForEach(t => dto.DataObj.CtnList.ForEach(t =>
{ {
if (!string.IsNullOrWhiteSpace(t.CtnAll) && string.IsNullOrWhiteSpace(t.CtnCode)) if ((!string.IsNullOrWhiteSpace(t.CtnAll) && string.IsNullOrWhiteSpace(t.CtnCode)) || (!string.IsNullOrWhiteSpace(t.CtnAll) && t.CtnAll == t.CtnCode))
{ {
var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.CtnName) && var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.CtnName) &&
a.CtnName.Equals(t.CtnAll, StringComparison.OrdinalIgnoreCase)); a.CtnName.Equals(t.CtnAll, StringComparison.OrdinalIgnoreCase));
@ -1799,7 +1799,8 @@ namespace DS.WMS.Core.Op.Method
} }
} }
var list = await GetAvailableSlots(null, model.MergeList, null); var getRlt = await GetAvailableSlots(null, model.MergeList, null);
var list = getRlt.Data;
//舱位合票失败,校验库存为不可用,请确认正确的库存 //舱位合票失败,校验库存为不可用,请确认正确的库存
if (list.Count == 0) if (list.Count == 0)
@ -1853,14 +1854,14 @@ namespace DS.WMS.Core.Op.Method
/// <param name="pageInfo">可选:分页信息</param> /// <param name="pageInfo">可选:分页信息</param>
public async Task<DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto input,PageWithTotal pageInfo) public async Task<DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto input,PageWithTotal pageInfo)
{ {
var result = await GetAvailableSlots(input, null, pageInfo); var rlt = await GetAvailableSlots(input, null, pageInfo);
SqlSugarPagedList<BookingSlotBaseWithCtnDto> pageResult = new() SqlSugarPagedList<BookingSlotBaseWithCtnDto> pageResult = new()
{ {
PageIndex = pageInfo.PageNo, PageIndex = pageInfo.PageNo,
PageSize = pageInfo.PageSize, PageSize = pageInfo.PageSize,
TotalCount = pageInfo.Total, TotalCount = pageInfo.Total,
Items = result, Items = rlt.Data,
}; };
return DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>.Success(pageResult); return DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>.Success(pageResult);
} }
@ -1874,7 +1875,7 @@ namespace DS.WMS.Core.Op.Method
/// <param name="slotIdListInput">筛选条件2舱位主键列表</param> /// <param name="slotIdListInput">筛选条件2舱位主键列表</param>
/// <param name="pageInfo">筛选条件3分页</param> /// <param name="pageInfo">筛选条件3分页</param>
/// <returns>可用的舱位列表(含可用的箱子列表)</returns> /// <returns>可用的舱位列表(含可用的箱子列表)</returns>
public async Task<List<BookingSlotBaseWithCtnDto>> GetAvailableSlots(BookingSlotBaseDto slotInput = null, public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
List<long> slotIdListInput = null, List<long> slotIdListInput = null,
PageWithTotal pageInfo = null) PageWithTotal pageInfo = null)
{ {
@ -1985,7 +1986,7 @@ namespace DS.WMS.Core.Op.Method
} }
} }
return result; return DataResult<List<BookingSlotBaseWithCtnDto>>.Success(result);
} }
#endregion #endregion
@ -2022,8 +2023,9 @@ namespace DS.WMS.Core.Op.Method
} }
var slotIdList = slots.Select(s => s.Id).ToList(); var slotIdList = slots.Select(s => s.Id).ToList();
var lsRlt = await GetAvailableSlots(null, slotIdList);
// 查询可用舱位及箱子列表 // 查询可用舱位及箱子列表
var latestSlotList = await GetAvailableSlots(null, slotIdList); var latestSlotList = lsRlt.Data;
// 判断余量是否满足需求 // 判断余量是否满足需求
foreach (var inSlotItem in slots) foreach (var inSlotItem in slots)
@ -2210,20 +2212,20 @@ namespace DS.WMS.Core.Op.Method
SaleId = generateModel.SaleId.HasValue ? generateModel.SaleId.Value : 0, SaleId = generateModel.SaleId.HasValue ? generateModel.SaleId.Value : 0,
Sale = generateModel.SaleName, Sale = generateModel.SaleName,
OperatorId = generateModel.OpId.HasValue ? generateModel.OpId.Value : 0, OperatorId = generateModel.OpId.HasValue ? generateModel.OpId.Value : 0,
//op = generateModel.OpName, OperatorName = generateModel.OpName,
Doc = generateModel.DocId.HasValue ? generateModel.DocId.Value : 0, Doc = generateModel.DocId.HasValue ? generateModel.DocId.Value : 0,
//DOC = generateModel.DocName, DocName = generateModel.DocName,
//ROUTEID = generateModel.RouteID?.ToString(), //ROUTEID = generateModel.RouteID?.ToString(),
//ROUTE = generateModel.Route, //ROUTE = generateModel.Route,
//CZRemark = generateModel.CZRemark, //CZRemark = generateModel.CZRemark,
//ShenQingXiangShi = generateModel.ShenQingXiangShi, //ShenQingXiangShi = generateModel.ShenQingXiangShi,
//LineManageID = generateModel.LineManageID?.ToString(), //LineManageID = generateModel.LineManageID?.ToString(),
//LineName = generateModel.LineManage, //LineName = generateModel.LineManage,
//CLOSEVGMDATE = bookingSlotBase.VGMSubmissionCutDate, VGMCloseDate = bookingSlotBase.VGMSubmissionCutDate,
ClosingDate = bookingSlotBase.CYCutDate, ClosingDate = bookingSlotBase.CYCutDate,
CloseDocDate = bookingSlotBase.SICutDate, CloseDocDate = bookingSlotBase.SICutDate,
CustomerService = generateModel.CustServiceId.HasValue ? generateModel.CustServiceId.Value : 0, CustomerService = generateModel.CustServiceId.HasValue ? generateModel.CustServiceId.Value : 0,
//CUSTSERVICE = generateModel.CustServiceName, CustomerServiceName = generateModel.CustServiceName,
LoadPort = bookingSlotBase.PortLoad, LoadPort = bookingSlotBase.PortLoad,
LoadPortId = bookingSlotBase.PortLoadId.HasValue ? bookingSlotBase.PortLoadId.Value : 0, LoadPortId = bookingSlotBase.PortLoadId.HasValue ? bookingSlotBase.PortLoadId.Value : 0,
@ -2429,7 +2431,7 @@ namespace DS.WMS.Core.Op.Method
Note = djyCustomerContactMan.Note, Note = djyCustomerContactMan.Note,
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
CreateBy = long.Parse(user.UserId), CreateBy = long.Parse(user.UserId),
//CreatedUserName = UserManager.Name CreateUserName = user.UserName
}; };
tenantDb.Insertable<BusinessOrderContact>(bookingContact).ExecuteCommand(); tenantDb.Insertable<BusinessOrderContact>(bookingContact).ExecuteCommand();
@ -2442,7 +2444,7 @@ namespace DS.WMS.Core.Op.Method
bookingContact.Note = djyCustomerContactMan.Note; bookingContact.Note = djyCustomerContactMan.Note;
bookingContact.UpdateTime = DateTime.Now; bookingContact.UpdateTime = DateTime.Now;
bookingContact.UpdateBy = long.Parse(user.UserId); bookingContact.UpdateBy = long.Parse(user.UserId);
//bookingContact.UpdatedUserName = UserManager.Name; bookingContact.UpdateUserName = user.UserName;
tenantDb.Updateable<BusinessOrderContact>(bookingContact).UpdateColumns(it => new tenantDb.Updateable<BusinessOrderContact>(bookingContact).UpdateColumns(it => new
{ {
@ -2451,7 +2453,7 @@ namespace DS.WMS.Core.Op.Method
it.Note, it.Note,
it.UpdateTime, it.UpdateTime,
it.UpdateBy, it.UpdateBy,
//it.UpdatedUserName it.UpdateUserName
}).ExecuteCommand(); }).ExecuteCommand();
} }
@ -3469,10 +3471,6 @@ namespace DS.WMS.Core.Op.Method
} }
#endregion #endregion
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> IBookingSlotService.GetAvailableSlots(BookingSlotBaseDto slotInput, List<long> slotIdListInput, PageWithTotal pageInfo)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// 舱位台账查询 /// 舱位台账查询
@ -3662,10 +3660,42 @@ namespace DS.WMS.Core.Op.Method
throw new NotImplementedException(); throw new NotImplementedException();
} }
Task<List<CompareResultDetailInfo>> IBookingSlotService.GetSlotCompareResult(long id, string batchNo) #region 获取舱位变更比对结果
/// <summary>
/// 获取舱位变更比对结果
/// </summary>
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult(long id, string batchNo)
{ {
throw new NotImplementedException(); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var compareInfo = await tenantDb.Queryable<BookingSlotCompare>()
.FirstAsync(t => t.SlotId == id && t.CompareBatchNo == batchNo);
if (compareInfo == null)
{
//舱位变更比对结果不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotCompareNull)));
}
if (string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
//获取舱位变更比对结果错误,比对内容不存在
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotCompareJsonNull)));
}
if (!string.IsNullOrWhiteSpace(compareInfo.CompareRlt))
{
var data = JsonConvert.DeserializeObject<List<CompareResultDetailInfo>>(compareInfo.CompareRlt);
return DataResult<List<CompareResultDetailInfo>>.Success(data);
}
return DataResult<List<CompareResultDetailInfo>>.FailedData(new List<CompareResultDetailInfo>());
} }
#endregion
#region 获取舱位详情列表 #region 获取舱位详情列表
/// <summary> /// <summary>

@ -0,0 +1,62 @@
namespace DS.WMS.Core.TaskPlat.Dtos
{
public class TaskUserStatResultInfo
{
/// <summary>
/// 第一层(异常/个人/公共)
/// </summary>
public List<TaskUserStatItem> LevelTop { get; set; }
/// <summary>
/// 第二层(待处理/已完成/已取消/已挂起)
/// </summary>
public List<TaskUserStatItemNext> LevelNext { get; set; }
/// <summary>
/// 任务类型树(按照任务类型展示)
/// </summary>
public List<TaskUserStatItemTree> LevelTree { get; set; }
}
/// <summary>
/// 用户任务统计展示
/// </summary>
public class TaskUserStatItem
{
/// <summary>
/// 排序值
/// </summary>
public int SortNo { get; set; }
/// <summary>
/// 展示代码
/// </summary>
public string Key { get; set; }
/// <summary>
/// 展示名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 记录条数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 执行KEY
/// </summary>
public string ActionKey { get; set; }
}
public class TaskUserStatItemNext: TaskUserStatItem
{
public string TopKey { get; set; }
}
public class TaskUserStatItemTree : TaskUserStatItemNext
{
public string NextKey { get; set; }
}
}

@ -251,11 +251,11 @@ namespace DS.WMS.Core.TaskPlat.Entity
[SugarColumn(ColumnDescription = "批次统计", IsNullable = true, Length = 50)] [SugarColumn(ColumnDescription = "批次统计", IsNullable = true, Length = 50)]
public string? BATCH_STATIC { get; set; } public string? BATCH_STATIC { get; set; }
/// <summary> ///// <summary>
/// 大简云userid ///// 大简云userid
/// </summary> ///// </summary>
[SugarColumn(ColumnDescription = "大简云userid", IsNullable = true, Length = 50)] //[SugarColumn(ColumnDescription = "大简云userid", IsNullable = true, Length = 50)]
public string? DJYUserId { get; set; } //public string? DJYUserId { get; set; }
} }

@ -6,6 +6,13 @@ namespace DS.WMS.Core.TaskPlat.Interface
{ {
public interface ITaskManageService public interface ITaskManageService
{ {
/// <summary>
/// 获取登陆人相关的任务统计信息
/// </summary>
/// <param name="isReCalc">是否强制计算</param>
/// <returns>返回回执</returns>
Task<DataResult<TaskUserStatResultInfo>> GetCurrentTotalStat(bool isReCalc);
/// <summary> /// <summary>
/// 任务台台账列表查询 /// 任务台台账列表查询
/// </summary> /// </summary>

@ -7,7 +7,6 @@ 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;
using Mapster; using Mapster;
using Masuit.Tools.Systems;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -160,7 +159,7 @@ namespace DS.WMS.Core.TaskPlat.Method
CUSTOMER_ID = info.Main.CustomerId, CUSTOMER_ID = info.Main.CustomerId,
CUSTOMER_NAME = info.Main.CustomerName, CUSTOMER_NAME = info.Main.CustomerName,
BATCH_STATIC = info.Main.BatchStatic, BATCH_STATIC = info.Main.BatchStatic,
DJYUserId = info.Head.DJYUserId, //DJYUserId = info.Head.DJYUserId,
OUT_BS_NO = info.Head.BSNO, OUT_BS_NO = info.Head.BSNO,
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
}; };
@ -469,12 +468,12 @@ namespace DS.WMS.Core.TaskPlat.Method
if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE) if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE)
{ {
fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC.ToString(); fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC.ToString();
fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC.GetDescription(); fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC.EnumDescription();
} }
else if (TaskBaseTypeEnum.BC_MODIFY.ToString() == taskInfo.TASK_BASE_TYPE) else if (TaskBaseTypeEnum.BC_MODIFY.ToString() == taskInfo.TASK_BASE_TYPE)
{ {
fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC_MODIFY.ToString(); fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC_MODIFY.ToString();
fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC_MODIFY.GetDescription(); fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC_MODIFY.EnumDescription();
} }
} }
else else
@ -484,7 +483,7 @@ namespace DS.WMS.Core.TaskPlat.Method
System.Enum.TryParse(file.FileCategory, out fileCategoryEnum); System.Enum.TryParse(file.FileCategory, out fileCategoryEnum);
fileInfo.FILE_CATEGORY = fileCategoryEnum.ToString(); fileInfo.FILE_CATEGORY = fileCategoryEnum.ToString();
fileInfo.FILE_CATEGORY_NAME = fileCategoryEnum.GetDescription(); fileInfo.FILE_CATEGORY_NAME = fileCategoryEnum.EnumDescription();
} }
if (string.IsNullOrWhiteSpace(fileInfo.FILE_NAME)) if (string.IsNullOrWhiteSpace(fileInfo.FILE_NAME))
@ -686,108 +685,639 @@ namespace DS.WMS.Core.TaskPlat.Method
{ {
taskType = (TaskBaseTypeEnum)temp; taskType = (TaskBaseTypeEnum)temp;
}; };
var userId = long.Parse(user.UserId);
DataResult<List<dynamic>> result;
switch (taskType) switch (taskType)
{ {
case TaskBaseTypeEnum.BC: case TaskBaseTypeEnum.BC:
{ {
var result = await tenantDb.Queryable<TaskBaseInfo>() result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskBCInfo>((t, bc) => t.Id == bc.TASK_ID) .LeftJoin<TaskBCInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList) .Where(whereList)
.Select<dynamic>((t, bc) => new .Where((t, a) => a.UserId == userId || t.CreateBy == userId)
{ .Select<dynamic>((t, a, bc) => new
Id = t.Id.SelectAll(), {
bc.BUSI_TYPE, Id = t.Id.SelectAll(),
bc.SHIPPER, bc.BUSI_TYPE,
bc.CONSIGNEE, bc.SHIPPER,
bc.NOTIFYPARTY, bc.CONSIGNEE,
bc.BC_MODIFY_TIMES, bc.NOTIFYPARTY,
bc.BC_MODIFY_DATE, bc.BC_MODIFY_TIMES,
//bc.MBL_NO, bc.BC_MODIFY_DATE,
bc.VESSEL, //bc.MBL_NO,
bc.VOYNO, bc.VESSEL,
bc.CARRIER, bc.VOYNO,
bc.PLACERECEIPT, bc.CARRIER,
bc.PORTLOAD, bc.PLACERECEIPT,
bc.CLOSING_DATE, bc.PORTLOAD,
bc.VGM_CUTOFF_TIME, bc.CLOSING_DATE,
bc.ETA, bc.VGM_CUTOFF_TIME,
//bc.ETD, bc.ETA,
bc.POD_ETA, //bc.ETD,
bc.CUT_SINGLE_TIME, bc.POD_ETA,
bc.PORTDISCHARGE, bc.CUT_SINGLE_TIME,
bc.PLACEDELIVERY, bc.PORTDISCHARGE,
bc.SHIPPING_METHOD, bc.PLACEDELIVERY,
bc.SERVICE, bc.SHIPPING_METHOD,
bc.PRETRANS_MODE, bc.SERVICE,
bc.DESCRIPTION, bc.PRETRANS_MODE,
bc.ISSUEPLACE, bc.DESCRIPTION,
bc.COLLECTION_TERMINAL, bc.ISSUEPLACE,
bc.CONTRACTNO, bc.COLLECTION_TERMINAL,
bc.PREPARDAT, bc.CONTRACTNO,
bc.SHIP_AGENT, bc.PREPARDAT,
bc.YARD, bc.SHIP_AGENT,
bc.YARD_CONTACT_USR, bc.YARD,
bc.YARD_CONTACT_TEL, bc.YARD_CONTACT_USR,
bc.FST_CUSTOMER_SER_USRNAME, bc.YARD_CONTACT_TEL,
bc.FST_CUSTOMER_SER_TEL, bc.FST_CUSTOMER_SER_USRNAME,
bc.FST_CUSTOMER_SER_EMAIL, bc.FST_CUSTOMER_SER_TEL,
bc.REMARK1, bc.FST_CUSTOMER_SER_EMAIL,
bc.CY_CUTOFF_TIME, bc.REMARK1,
bc.CARRIERID, bc.CY_CUTOFF_TIME,
bc.LANECODE, bc.CARRIERID,
bc.LANENAME, bc.LANECODE,
bc.CARRIAGE_TYPE, bc.LANENAME,
bc.CARRIAGE_TYPE_NAME, bc.CARRIAGE_TYPE,
bc.BOOKING_SLOT_TYPE, bc.CARRIAGE_TYPE_NAME,
bc.BOOKING_SLOT_TYPE_NAME, bc.BOOKING_SLOT_TYPE,
bc.CTN_STAT, bc.BOOKING_SLOT_TYPE_NAME,
bc.WEEK_AT, bc.CTN_STAT,
bc.DETENSION_FREE_DAYS, bc.WEEK_AT,
bc.SI_CUT_DATE, bc.DETENSION_FREE_DAYS,
bc.MANIFEST_CUT_DATE, bc.SI_CUT_DATE,
bc.MDGF_CUT_DATE, bc.MANIFEST_CUT_DATE,
bc.TRANSFER_PORT_1, bc.MDGF_CUT_DATE,
bc.TRANSFER_PORT_2, bc.TRANSFER_PORT_1,
bc.SECOND_VESSEL, bc.TRANSFER_PORT_2,
bc.SECOND_VOYNO, bc.SECOND_VESSEL,
bc.SECOND_ETD, bc.SECOND_VOYNO,
bc.SECOND_ETA, bc.SECOND_ETD,
//bc.STATUS, bc.SECOND_ETA,
bc.FILE_MD5, //bc.STATUS,
bc.LAST_TOBOOKING_DATE, bc.FILE_MD5,
bc.FROM_EMAIL, bc.LAST_TOBOOKING_DATE,
bc.RECV_EMAIL, bc.FROM_EMAIL,
bc.BOOKING_ORDER_ID, bc.RECV_EMAIL,
bc.BOOKING_SLOT_ID, bc.BOOKING_ORDER_ID,
bc.BOOKING_COMFIRM_DATE, bc.BOOKING_SLOT_ID,
bc.BATCH_NO, bc.BOOKING_COMFIRM_DATE,
bc.CUSTOM_SI_CUT_DATE, bc.BATCH_NO,
bc.IS_SET_AUTO_EMAIL, bc.CUSTOM_SI_CUT_DATE,
bc.IS_SEND_EMAIL, bc.IS_SET_AUTO_EMAIL,
bc.DIFF_NUM, bc.IS_SEND_EMAIL,
bc.AUTO_SEND_USER, bc.DIFF_NUM,
bc.PROCESS_STATUS, bc.AUTO_SEND_USER,
bc.PROCESS_RESULT, bc.PROCESS_STATUS,
bc.PROCESS_DATE, bc.PROCESS_RESULT,
bc.PRICE_CALCULATION_DATE bc.PROCESS_DATE,
}) bc.PRICE_CALCULATION_DATE
.ToQueryPageAsync(querySearch.PageCondition); })
.ToQueryPageAsync(querySearch.PageCondition);
return result; return result;
} }
default: case TaskBaseTypeEnum.SI_FEEDBACK:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskSiSubmitted>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.CARRIER,
//bc.MBL_NO,
bc.TAKE_ISSUETYPE_NAME,
bc.ISSUETYPE,
bc.NOTICE_DATE,
bc.BOOKING_ID,
bc.SUBMITTED_DATE,
bc.BILLOF_NUM,
bc.RELEASE_INSTRUCTION,
bc.SI_SUBTYPE,
bc.SHIPPER,
bc.CONSIGNEE,
bc.NOTIFYPARTY,
bc.NOTIFYPARTY2,
bc.TRANSPORT_RECEIVER,
bc.MARKS,
bc.HSCODE,
bc.DESCRIPTION,
bc.PKGS,
bc.KINDPKGS,
bc.KGS,
bc.CBM,
bc.VESSEL,
bc.VOYNO,
bc.COMMODITY,
bc.PLACERECEIPTID,
bc.PLACERECEIPT,
bc.PORTLOADID,
bc.PORTLOAD,
bc.PORTDISCHARGEID,
bc.PORTDISCHARGE,
bc.PLACEDELIVERYID,
bc.PLACEDELIVERY,
bc.PROCESS_STATUS,
bc.IS_SET_AUTO_UPD_BOOKING,
bc.PROCESS_RESULT,
bc.PROCESS_DATE,
bc.DIFF_NUM,
bc.IS_UPDATE_BOOKING,
bc.UPDATE_BOOKING_DATE
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.INVOICE_BILL_MAIL:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPerBillBase>((t, a, bc) => t.Id == bc.TASK_PKID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_PKID,
//bc.MBL_NO,
bc.INVOICE_NO,
bc.CANCEL_NO,
bc.TOTAL_AMOUNT,
bc.IS_DONGSH_RECV,
bc.IS_DONGSH_RESULT,
bc.DONGSH_RECV_TIME,
bc.DONGSH_RESULT_TIME,
bc.DONGSH_RECV_REASON
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.TRUCK_DISPATCH:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskTruck>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.BookingTruckId,
bc.BookingId,
bc.TruckId,
bc.TruckCode,
bc.TruckName,
bc.ToName,
bc.Attn,
bc.AttnTel,
bc.AttnMail,
bc.AttnFax,
bc.FromName,
bc.FromTel,
bc.FromMail,
bc.FromMobile,
bc.FromFax,
bc.KGS,
bc.Fee,
bc.PayMethod,
bc.PayMethodName,
bc.TruckTime,
bc.YARDID,
bc.YARD,
bc.YARDCONTRACT,
bc.YARDCONTRACTTEL,
bc.FactoryId,
bc.FactoryCode,
bc.FactoryName,
bc.FactoryContact,
bc.FactoryTel,
bc.ReturnTime,
bc.InYardID,
bc.InYard,
bc.InYardContact,
bc.InYardContractTel,
//bc.NeedArriveTime,
bc.ClosingTime,
bc.PickUpTime,
bc.IsGuaJi,
//bc.Status,
bc.Attention,
bc.Remark,
bc.DispatcherId,
bc.DispatcherName,
bc.TruckFlowNo,
bc.TaskNo,
bc.Vessel,
bc.VoyNo,
bc.MBLNo,
bc.CntrTotal,
bc.FactoryAddr
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CUT_MODIFY:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCutDateChangeInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.VESSEL,
bc.VOYNO,
bc.NOTICE_DATE
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROLLING_NOMINATION:
case TaskBaseTypeEnum.TRANSFER_NOMINATION:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRollingNomination>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.PLAN_TYPE,
bc.BATCH_NO,
bc.CARRIERID,
bc.CARRIER,
bc.CONFIRM_DEAD_LINE,
bc.READ_CREATE_TIME,
bc.ROLL_DOUBLE_REMARK,
bc.PLAN_TXT,
//bc.REMARK,
bc.TASK_BATCH_TOTAL,
bc.TASK_BATCH_PER_TOTAL
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.DRAFT:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskDraftInfo>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
//bc.MBL_NO,
bc.BOOKING_ID,
bc.IS_CHANGE,
bc.IS_EMAIL_SEND,
bc.SEND_EMAIL_DATE,
bc.NOTICE_DATE,
})
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.POD_DISCHARGE_FULL:
case TaskBaseTypeEnum.POD_GATEOUT_FULL:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskPodDischargeGateoutFull>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.CARRIER,
bc.NOTICE_TYPE,
bc.NOTICE_TYPE_NAME,
//bc.MBL_NO,
bc.NOTICE_DATE
}).ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.CAUTION_NOTICE:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskCautionNotice>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>((t, a, bc) => new
{
PK_ID = t.Id.SelectAll(),
bc.TASK_ID,
bc.SOURCE_SYSTEM,
bc.SOURCE_BUSI_TYPE,
bc.SOURCE_BUSI_TYPENAME,
bc.NOTIFY_CONTENT,
//bc.MBL_NO,
bc.CARRIER,
bc.CAUTION_NOTICE_TYPE,
bc.IS_WEEK_DIFF,
bc.IS_PRICE_DATE_DIFF,
bc.IS_TRANSFER,
bc.IS_VESSEL_CHANGE,
bc.IS_CUT_DATE_ADVANCED,
bc.BOOKING_ID,
bc.BOOKING_SLOT_ID,
bc.SOURCE_TASK_ID,
bc.OLD_VAL,
bc.NEW_VAL,
}).ToQueryPageAsync(querySearch.PageCondition);
return result;
}
case TaskBaseTypeEnum.ROUTE_CUT_CHANGE:
{ {
var result = await tenantDb.Queryable<TaskBaseInfo>() result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.LeftJoin<TaskRouteChangeAdvisory>((t, a, bc) => t.Id == bc.TASK_ID)
.Where(whereList) .Where(whereList)
.Select<dynamic>(t => new .Where((t, a) => a.UserId == userId || t.CreateBy == userId)
{ .Select<dynamic>((t, a, bc) => new
Id = t.Id.SelectAll() {
}) PK_ID = t.Id.SelectAll(),
.ToQueryPageAsync(querySearch.PageCondition); bc.TASK_ID,
bc.VESSEL,
bc.VOYNO,
bc.CARRIER,
bc.READ_PORTLOAD,
bc.ORIG_ETD,
bc.MDGF_CUT_DATE,
bc.ETA,
//bc.ETD,
bc.SI_CUT_DATE,
bc.TM_SHIFT_CUT_DATE,
bc.VGM_CUTOFF_TIME,
bc.CY_CUT_DATE,
bc.ROUTE_CODE,
bc.EMAIL_SUBJECT,
bc.WEEK,
bc.PORTLOADID,
bc.PORTLOAD
}).ToQueryPageAsync(querySearch.PageCondition);
return result; return result;
} }
default:
{
result = await tenantDb.Queryable<TaskBaseInfo>().LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.Where(whereList)
.Where((t, a) => a.UserId == userId || t.CreateBy == userId)
.Select<dynamic>(t => t)
.ToQueryPageAsync(querySearch.PageCondition);
return result;
}
}
}
/// <summary>
/// 获取登陆人相关的任务统计信息
/// </summary>
/// <param name="isReCalc">是否强制计算</param>
/// <returns>返回回执</returns>
public async Task<DataResult<TaskUserStatResultInfo>> GetCurrentTotalStat(bool isReCalc)
{
TaskUserStatResultInfo resultInfo = new TaskUserStatResultInfo
{
LevelTop = new List<TaskUserStatItem>(),
LevelNext = new List<TaskUserStatItemNext>(),
LevelTree = new List<TaskUserStatItemTree>()
};
/*
1
2isReCalc=true
3/
*/
//var userTendInfo = await _sysUserRepository.AsQueryable()
// .LeftJoin<SysTenant>((usr, ten) => usr.TenantId == ten.Id)
// .Where(usr => usr.Id == UserManager.UserId)
// .Select((usr, ten) => new { User = usr, Tend = ten }).FirstAsync();
//if (userTendInfo == null)
// throw Oops.Oh($"当前用户关联租户信息获取失败");
////var statList = _taskStatManageInfoRepository.AsQueryable().Where(t => (t.USER_ID == userTendInfo.User.Id
////&& t.STAT_TYPE == TaskStatLevelEnum.PERSON.ToString()) || (t.COMP_ID == userTendInfo.Tend.Id && t.STAT_TYPE == TaskStatLevelEnum.PUBLIC.ToString())).ToList();
////菜单375504048771141=我的任务台账
//List<long> userlist = await _sysDataUserMenuService.GetDataScopeList(MenuConst.MenuTaskManage);
//bool isAdmin = userlist == null;
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var userId = long.Parse(user.UserId);
//任务列表分组统计
var groupList = await tenantDb.Queryable<TaskBaseInfo>()
.LeftJoin<TaskBaseAllocation>((t, a) => t.Id == a.TaskId)
.Where((t, a) => t.IS_PUBLIC == 1
|| t.CreateBy == userId
|| (t.IS_PUBLIC == 0 && a.UserId == userId))
.GroupBy(t => new { t.TASK_TYPE, t.STATUS, t.IS_EXCEPT, t.IS_PUBLIC })
.Select(t => new
{
Total = SqlFunc.AggregateCount(t.Id),
TaskType = t.TASK_TYPE,
Status = t.STATUS,
IsExcept = t.IS_EXCEPT,
IsPublic = t.IS_PUBLIC
}).ToListAsync();
var exceptList = groupList
.Where(t => t.IsExcept == 1).ToList();
var personList = groupList
.Where(t => t.IsExcept == 0 && t.IsPublic == 0).ToList();
var publicList = groupList
.Where(t => t.IsExcept == 0 && t.IsPublic == 1).ToList();
#region 异常
if (exceptList.Count > 0)
{
resultInfo.LevelTop.Add(new TaskUserStatItem
{
Key = TaskStatLevelEnum.EXCPTION.ToString(),
Name = TaskStatLevelEnum.EXCPTION.EnumDescription(),
Total = exceptList.Sum(t => t.Total),
SortNo = (int)TaskStatLevelEnum.EXCPTION,
ActionKey = TaskStatLevelEnum.EXCPTION.ToString()
});
var nextList = new List<TaskUserStatItemNext>();
exceptList.GroupBy(t => t.Status)
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
TaskStatusEnum currEnum = (TaskStatusEnum)System.Enum.Parse(typeof(TaskStatusEnum), t.Key);
nextList.Add(new TaskUserStatItemNext
{
TopKey = TaskStatLevelEnum.EXCPTION.ToString(),
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.EXCPTION.ToString()}#{currEnum.ToString()}"
});
});
if (nextList.Count > 0)
resultInfo.LevelNext.AddRange(nextList.OrderBy(t => t.SortNo).ToList());
exceptList.GroupBy(t => new { t.Status, t.TaskType })
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
//TaskBusiTypeEnum currEnum = (TaskBusiTypeEnum)System.Enum.Parse(typeof(TaskBusiTypeEnum), t.Key.TaskType);
TaskBaseTypeEnum currEnum = (TaskBaseTypeEnum)System.Enum.Parse(typeof(TaskBaseTypeEnum), t.Key.TaskType);
resultInfo.LevelTree.Add(new TaskUserStatItemTree
{
TopKey = TaskStatLevelEnum.EXCPTION.ToString(),
NextKey = t.Key.Status,
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.EXCPTION.ToString()}#{t.Key.Status}#{currEnum.ToString()}"
});
});
}
#endregion
#region 个人
if (personList.Count > 0)
{
resultInfo.LevelTop.Add(new TaskUserStatItem
{
Key = TaskStatLevelEnum.PERSON.ToString(),
Name = TaskStatLevelEnum.PERSON.EnumDescription(),
Total = personList.Sum(t => t.Total),
SortNo = (int)TaskStatLevelEnum.PERSON,
ActionKey = TaskStatLevelEnum.PERSON.ToString()
});
var nextList = new List<TaskUserStatItemNext>();
personList.GroupBy(t => t.Status)
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
TaskStatusEnum currEnum = (TaskStatusEnum)System.Enum.Parse(typeof(TaskStatusEnum), t.Key);
nextList.Add(new TaskUserStatItemNext
{
TopKey = TaskStatLevelEnum.PERSON.ToString(),
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.PERSON.ToString()}#{currEnum.ToString()}"
});
});
if (nextList.Count > 0)
resultInfo.LevelNext.AddRange(nextList.OrderBy(t => t.SortNo).ToList());
personList.GroupBy(t => new { t.Status, t.TaskType })
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
//TaskBusiTypeEnum currEnum = (TaskBusiTypeEnum)System.Enum.Parse(typeof(TaskBusiTypeEnum), t.Key.TaskType);
TaskBaseTypeEnum currEnum = (TaskBaseTypeEnum)System.Enum.Parse(typeof(TaskBaseTypeEnum), t.Key.TaskType);
resultInfo.LevelTree.Add(new TaskUserStatItemTree
{
TopKey = TaskStatLevelEnum.PERSON.ToString(),
NextKey = t.Key.Status,
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.PERSON.ToString()}#{t.Key.Status}#{currEnum.ToString()}"
});
});
} }
#endregion
#region 公共
if (publicList.Count > 0)
{
resultInfo.LevelTop.Add(new TaskUserStatItem
{
Key = TaskStatLevelEnum.PUBLIC.ToString(),
Name = TaskStatLevelEnum.PUBLIC.EnumDescription(),
Total = publicList.Sum(t => t.Total),
SortNo = (int)TaskStatLevelEnum.PUBLIC,
ActionKey = TaskStatLevelEnum.PUBLIC.ToString()
});
var nextList = new List<TaskUserStatItemNext>();
publicList.GroupBy(t => t.Status)
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
TaskStatusEnum currEnum = (TaskStatusEnum)System.Enum.Parse(typeof(TaskStatusEnum), t.Key);
nextList.Add(new TaskUserStatItemNext
{
TopKey = TaskStatLevelEnum.PUBLIC.ToString(),
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.PUBLIC.ToString()}#{currEnum.ToString()}"
});
});
if (nextList.Count > 0)
resultInfo.LevelNext.AddRange(nextList.OrderBy(t => t.SortNo).ToList());
publicList.GroupBy(t => new { t.Status, t.TaskType })
.Select(t => new { Key = t.Key, Total = t.ToList().Sum(p => p.Total) })
.ToList().ForEach(t =>
{
//TaskBusiTypeEnum currEnum = (TaskBusiTypeEnum)System.Enum.Parse(typeof(TaskBusiTypeEnum), t.Key.TaskType);
TaskBaseTypeEnum currEnum = (TaskBaseTypeEnum)System.Enum.Parse(typeof(TaskBaseTypeEnum), t.Key.TaskType);
resultInfo.LevelTree.Add(new TaskUserStatItemTree
{
TopKey = TaskStatLevelEnum.PUBLIC.ToString(),
NextKey = t.Key.Status,
Key = currEnum.ToString(),
Name = currEnum.EnumDescription(),
Total = t.Total,
SortNo = (int)currEnum,
ActionKey = $"{TaskStatLevelEnum.PUBLIC.ToString()}#{t.Key.Status}#{currEnum.ToString()}"
});
});
}
#endregion
if (resultInfo.LevelTree != null && resultInfo.LevelTree.Count > 0)
{
resultInfo.LevelTree = resultInfo.LevelTree.OrderBy(x => x.SortNo).ToList();
}
return DataResult<TaskUserStatResultInfo>.Success(resultInfo);
} }
#region 私有方法 #region 私有方法
/// <summary> /// <summary>

@ -199,6 +199,24 @@
"Type": "RoundRobin" "Type": "RoundRobin"
} }
}, },
{
"DownstreamPathTemplate": "/containerManagementApi/{url}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 3005
}
],
"UpstreamPathTemplate": "/containerManagementApi/{url}",
"UpstreamHttpMethod": [
"Get",
"Post"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
}
},
{ {
"DownstreamPathTemplate": "/LinkAttach/{url}", "DownstreamPathTemplate": "/LinkAttach/{url}",
"DownstreamScheme": "http", "DownstreamScheme": "http",

@ -182,7 +182,7 @@ namespace DS.WMS.OpApi.Controllers
[Route("GetSlotCompareResult")] [Route("GetSlotCompareResult")]
public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult([FromQuery] long id, [FromQuery] string batchNo) public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult([FromQuery] long id, [FromQuery] string batchNo)
{ {
return null;//await _bookingSlotService.GetSlotCompareResult(id, batchNo); return await _bookingSlotService.GetSlotCompareResult(id, batchNo);
} }
#endregion #endregion
@ -208,9 +208,9 @@ namespace DS.WMS.OpApi.Controllers
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
[HttpPost] [HttpPost]
[Route("CreateBookingOrder")] [Route("CreateBookingOrder")]
public async Task<DataResult> CreateBookingOrder([FromBody] BookingGenerateDto model) public async Task<DataResult<long>> CreateBookingOrder([FromBody] BookingGenerateDto model)
{ {
return null;// await _bookingSlotService.CreateBookingOrder(model); return await _bookingSlotService.CreateBookingOrder(model);
} }
#endregion #endregion

@ -28,7 +28,7 @@ public class TaskManageController : ApiController
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
[HttpPost("CreateTaskJob")] [HttpPost("CreateTaskJob")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous] [ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<DataResult<object>> CreateTaskJob(TaskManageOrderMessageInfo info) public async Task<DataResult> CreateTaskJob(TaskManageOrderMessageInfo info)
{ {
var result = await taskManageService.InitTaskJob(info); var result = await taskManageService.InitTaskJob(info);
return result; return result;
@ -43,7 +43,7 @@ public class TaskManageController : ApiController
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
[HttpPost("CreateBCTaskJob")] [HttpPost("CreateBCTaskJob")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous] [ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<DataResult<object>> CreateBCTaskJob(IFormFile file, IFormFile modifyFile, [FromForm] string jsonData) public async Task<DataResult> CreateBCTaskJob(IFormFile file, IFormFile modifyFile, [FromForm] string jsonData)
{ {
TaskManageOrderMessageInfo? info = JsonConvert.DeserializeObject<TaskManageOrderMessageInfo>(jsonData); TaskManageOrderMessageInfo? info = JsonConvert.DeserializeObject<TaskManageOrderMessageInfo>(jsonData);
if (info == null) if (info == null)
@ -77,6 +77,65 @@ public class TaskManageController : ApiController
return result; return result;
} }
/// <summary>
/// 获取登陆人相关的任务统计信息
/// </summary>
/// <param name="isReCalc">是否强制计算</param>
[HttpPost("GetCurrentTotalStat")]
public async Task<DataResult<TaskUserStatResultInfo>> GetCurrentTotalStat([FromQuery] bool isReCalc = false)
{
var result = await taskManageService.GetCurrentTotalStat(isReCalc);
return result;
}
/// <summary>
/// 取消任务(可批量)
/// </summary>
/// <param name="Ids">任务主键数组</param>
/// <returns>返回结果</returns>
[HttpPost("CancelTask")]
public async Task<DataResult<TaskUserStatResultInfo>> CancelTask([FromBody] string[] Ids)
{
return default;
//var result = await taskManageService.GetCurrentTotalStat(isReCalc);
//return result;
}
/// <summary>
/// 获取任务台相关的枚举类型的值
/// </summary>
[HttpPost("GetTaskPlatEnumDict")]
public DataResult<object> GetTaskPlatEnumDict()
{
Dictionary<string, List<(string key, string value)>> dict = new();
dict.Add("STATUS", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatusEnum))
.Select(x => (x.Key.ToString(), x.Value))
.ToList());
dict.Add("TASK_TYPE", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskBaseTypeEnum))
.Select(x => (x.Key.ToString(), x.Value))
.ToList());
dict.Add("SOURCE", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskSourceEnum))
.Select(x => (x.Key.ToString(), x.Value))
.ToList());
dict.Add("CATEGORY", EnumUtil.GetEnumDictionaryWithKey(typeof(TaskStatLevelEnum))
.Select(x => (x.Key.ToString(), x.Value))
.ToList());
var result = dict.Select(x => new
{
Type = x.Key,
Data = x.Value.Select(y => new
{
Code = y.key,
Name = y.value
})
});
return DataResult.Success(result);
}
// /TaskManage/CreateBCTaskJob // /TaskManage/CreateBCTaskJob
// /TaskManage/CreateDRAFTTaskJob // /TaskManage/CreateDRAFTTaskJob
// /TaskManage/CreateAdvisoryTaskJob // /TaskManage/CreateAdvisoryTaskJob

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>false</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>D:\WebPublish\ds_taskapi</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>

@ -0,0 +1,258 @@
using System.Reflection;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.Core.Check.Entity;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Info.Entity;
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 Mapster;
using Masuit.Tools.Strings;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Owin.BuilderProperties;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
using SqlSugar.IOC;
using Xunit;
namespace Ds.WMS.Test;
public class ContainerManagementTest
{
private readonly IServiceProvider _serviceProvider;
private readonly SqlSugarScope db;
private readonly ISaasDbService saasService;
public ContainerManagementTest(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
[Fact]
public void ContainerManagementTest1()
{
Type[] types = Assembly
.LoadFrom("DS.WMS.Core.dll")//如果 .dll报错可以换成 xxx.exe 有些生成的是exe
.GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Op.Entity."))
//.GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Code.Entity.") || it.FullName.Contains("DS.WMS.Core.Info.Entity.") || it.FullName.Contains("DS.WMS.Core.Flow.Entity.")
//|| it.FullName.Contains("DS.WMS.Core.Check.Entity.") || it.FullName.Contains("DS.WMS.Core.Map.Entity."))//命名空间过滤,当然你也可以写其他条件过滤
.ToArray();
//Type[] types = Assembly
// .LoadFrom("DS.WMS.Core.dll")//如果 .dll报错可以换成 xxx.exe 有些生成的是exe
// .GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Code.Entity."))//命名空间过滤,当然你也可以写其他条件过滤
// .ToArray();
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
// var temp = tenantDb.CodeFirst.GetDifferenceTables(types); || it.FullName.Contains("DS.WMS.Core.Op.Entity.")
// var diffString= tenantDb.CodeFirst.GetDifferenceTables(types).ToDiffString();
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
//types = types.Where(it => it.Name != "BusinessFeeStatus").ToArray();
//types = types.Where(it => it.Name != "BusinessOrderContact").ToArray();
tenantDb.CodeFirst.InitTables(types);
// //初始化数库
// tenantDb.DbMaintenance.CreateDatabase();
//
// tenantDb.CodeFirst.InitTables(typeof(CodeCountry));
Assert.True(true);
}
/// <summary>
/// 主库初始化单表
/// </summary>
//[Fact]
//public void MasterInitTableTest()
//{
// StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
// db.CodeFirst.InitTables(typeof(SysPrintTemplate));
// //tenantDb.CodeFirst.InitTables(typeof(CheckBillAutoDetail));
// //db.CodeFirst.InitTables(typeof(OpBusinessTruckCtn));
// Assert.True(true);
//}
/// <summary>
/// 初始化单表
/// </summary>
[Fact]
public void InitTableTest()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
tenantDb.CodeFirst.InitTables(typeof(CM_CurrentState));
//tenantDb.CodeFirst.InitTables(typeof(BookingStatusLog));
//tenantDb.CodeFirst.InitTables(typeof(BookingStatus));
//tenantDb.CodeFirst.InitTables(typeof(BookingStatusLogDetail));
//tenantDb.CodeFirst.InitTables(typeof(BusinessOrderContact));
//tenantDb.CodeFirst.InitTables(typeof(BusinessTruck));
//tenantDb.CodeFirst.InitTables(typeof(BusinessTruckCtn));
//tenantDb.CodeFirst.InitTables(typeof(BusinessYard));
////tenantDb.CodeFirst.InitTables(typeof(OpCtn));
//tenantDb.CodeFirst.InitTables(typeof(OpCtnDetail));
//tenantDb.CodeFirst.InitTables(typeof(OpFile));
////tenantDb.CodeFirst.InitTables(typeof(SeaExport));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportBillManage));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportBillManageCtn));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportEdi));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportRemark));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportShippingBill));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportShippingBillCtn));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportShippingBillPartCtn));
//tenantDb.CodeFirst.InitTables(typeof(SeaExportShippingBillTemplate));
//db.CodeFirst.InitTables(typeof(OpBusinessTruckCtn));
Assert.True(true);
}
///// <summary>
///// 初始化海运出口视图
///// </summary>
//[Fact]
//public void InitSeaExportViewTest()
//{
// var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
// StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
// tenantDb.CodeFirst.InitTables(typeof(SeaExport));
// Assert.True(true);
//}
[Fact]
public void SaasCheckTest()
{
Type[] types = Assembly
.LoadFrom("DS.WMS.Core.dll")//如果 .dll报错可以换成 xxx.exe 有些生成的是exe
.GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Code.Entity"))//命名空间过滤,当然你也可以写其他条件过滤
.ToArray();
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
tenantDb.CodeFirst.InitTables(types);
Assert.True(true);
}
[Fact]
public void SaasFeeTest()
{
Type[] types = Assembly
.LoadFrom("DS.WMS.Core.dll")//如果 .dll报错可以换成 xxx.exe 有些生成的是exe
.GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Fee.Entity"))//命名空间过滤,当然你也可以写其他条件过滤
.ToArray();
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
tenantDb.CodeFirst.InitTables(types);
Assert.True(true);
}
[Fact]
public void ClientBatchEdit()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
var info = tenantDb.Queryable<InfoClient>().Filter(null, true).Where(x => x.Id == 1772138307266940928).First();
var temp = new ClientTemp
{
Address = "4",
Name = "4",
};
var dic = temp.GetPropertiesArray();
info = temp.Adapt(info);
tenantDb.Updateable(info).UpdateColumns(dic).ExecuteCommand();
Assert.True(true);
}
[Fact]
public void CopyColumnTest()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
var columns = "noBill,enName,copyNoBill";
var list = columns.Split(",");
var list1 = new List<string>();
foreach (var item in list)
{
list1.Add(item.ToUpperCamelCase());
}
Console.WriteLine(list1[0]);
Assert.True(true);
}
public class ClientTemp
{
/// <summary>
/// Desc:客户中文名称或描述信息
/// </summary>
public string Description { get; set; }
/// <summary>
/// Desc:客户英文简称
/// </summary>
public string Name { get; set; }
/// <summary>
/// Desc:客户英文全称
/// </summary>
public string EnFullName { get; set; }
/// <summary>
/// Desc:通讯地址
/// </summary>
public string Address { get; set; }
}
/// <summary>
/// 初始化单表
/// </summary>
[Fact]
public void InitTableTestJHQ()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrder));
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderCtn));
//tenantDb.CodeFirst.InitTables(typeof(SpaceBookingOrderShipSchedule));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotBase));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotCtn));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotStock));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocation));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotAllocationCtn));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemand));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotDemandCtn));
//tenantDb.CodeFirst.InitTables(typeof(BookingSlotCompare));
//tenantDb.CodeFirst.InitTables(typeof(BookingContractNoManage));
//tenantDb.CodeFirst.InitTables(typeof(BookingLabel));
//tenantDb.CodeFirst.InitTables(typeof(BookingLabelAllocation));
tenantDb.CodeFirst.InitTables(typeof(InfoClient));
//tenantDb.CodeFirst.InitTables(typeof(CodeThirdParty));
//tenantDb.CodeFirst.InitTables(typeof(CheckBillAutoDetail));
//db.CodeFirst.InitTables(typeof(OpBusinessTruckCtn));
Assert.True(true);
}
/// <summary>
/// 初始化单表
/// </summary>
[Fact]
public void InitTableTestZXF()
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持
var ass = Assembly.Load("DS.WMS.Core");
var types = ass.GetTypes().Where(it => it.FullName?.Contains("DS.WMS.Core.TaskPlat.Entity") == true).ToArray();
tenantDb.CodeFirst.InitTables(types);
//tenantDb.CodeFirst.InitTables(typeof(TaskFlowLog));
//tenantDb.CodeFirst.InitTables(typeof(TaskFlowLogDetail));
Assert.True(true);
}
}

@ -67,6 +67,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DS.WMS.PrintApi", "DS.WMS.P
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.OcrModule", "DS.Module.OcrModule\DS.Module.OcrModule.csproj", "{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.Module.OcrModule", "DS.Module.OcrModule\DS.Module.OcrModule.csproj", "{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS.WMS.ContainerManagementApi", "DS.WMS.ContainerManagementApi\DS.WMS.ContainerManagementApi.csproj", "{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -189,6 +191,10 @@ Global
{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Debug|Any CPU.Build.0 = Debug|Any CPU {3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Release|Any CPU.ActiveCfg = Release|Any CPU {3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Release|Any CPU.Build.0 = Release|Any CPU {3EB9CA1E-5910-42A5-A64D-0CB435F6A64A}.Release|Any CPU.Build.0 = Release|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -223,6 +229,7 @@ Global
{4B51DCC1-62A5-49C5-978B-798E6B48F3C0} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} {4B51DCC1-62A5-49C5-978B-798E6B48F3C0} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{274B1D18-A15A-4917-A567-6FDCD090D5B0} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4} {274B1D18-A15A-4917-A567-6FDCD090D5B0} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
{3EB9CA1E-5910-42A5-A64D-0CB435F6A64A} = {518DB9B5-80A8-4B2C-8570-52BD406458DE} {3EB9CA1E-5910-42A5-A64D-0CB435F6A64A} = {518DB9B5-80A8-4B2C-8570-52BD406458DE}
{7C3E248A-DF40-46AC-A8DF-224DD7C4EEF7} = {65D75DB2-12D5-4D1F-893D-9750905CE5E4}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788} SolutionGuid = {66115F23-94B4-43C0-838E-33B5CF77F788}

Loading…
Cancel
Save