箱管 20240725
parent
25e3235de3
commit
c54a74acd5
@ -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,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,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue