集装箱多品名、相关问题处理

master
ZR20090193-陈敬勇 7 months ago
parent c4d0de85d4
commit 33c977785a

@ -52,6 +52,12 @@ public static class MultiLanguageConst
[Description("程序异常")]
public const string ProgramException = "Program_Exception";
/// <summary>
/// 请选择数据
/// </summary>
[Description("请选择数据!")]
public const string DataNoSelect = "Data_No_Select";
#region 数据映射
[Description("场站映射信息已存在")]
public const string MappingYardExist = "MappingYard_Exist";

@ -44,10 +44,10 @@ namespace DS.Module.CrawlerData
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var account = tenantDb.Queryable<CodeThirdParty>().Where(x => x.CustomerId == req.YardId && x.AccountType == "BillTrace").First();
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserKeyBilltrace").WithCache().First().Value;
var userSecret = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserSecretBilltrace").WithCache().First().Value;
var spiderServerUrl = db.Queryable<SysConfig>().Where(x => x.Code == "spiderServerUrlBillTraceNew").WithCache().First().Value;
var tenantName = db.Queryable<SysTenant>().Filter(null, true).Where(x => x.Id == long.Parse(user.TenantId)).WithCache().First().Name;
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserKeyBilltrace").First().Value;
var userSecret = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserSecretBilltrace").First().Value;
var spiderServerUrl = db.Queryable<SysConfig>().Where(x => x.Code == "spiderServerUrlBillTraceNew").First().Value;
var tenantName = db.Queryable<SysTenant>().Filter(null, true).Where(x => x.Id == long.Parse(user.TenantId)).First().Name;
if (account.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("未配置出口运踪场站第三方账号信息!"));

@ -303,7 +303,7 @@ public class ClientInfoReq
/// <summary>
/// 审批时间
/// </summary>
public DateTime AuditTime { get; set; }
public DateTime? AuditTime { get; set; }
/// <summary>
/// 审批意见

@ -301,7 +301,7 @@ public class ClientInfoRes
/// <summary>
/// 审批时间
/// </summary>
public DateTime AuditTime { get; set; }
public DateTime? AuditTime { get; set; }
/// <summary>
/// 审批意见

@ -363,8 +363,8 @@ public class InfoClient : BaseOrgModel<long>
/// <summary>
/// 审批时间
/// </summary>
[SugarColumn(ColumnDescription = "审批时间")]
public DateTime AuditTime { get; set; }
[SugarColumn(ColumnDescription = "审批时间",IsNullable = true)]
public DateTime? AuditTime { get; set; }
/// <summary>
/// 审批意见
/// </summary>

@ -73,7 +73,7 @@ public class ClientInfoService : IClientInfoService
else
{
var info = tenantDb.Queryable<InfoClient>().Where(x => x.Id == req.Id).First();
var tag = tenantDb.Queryable<InfoClientTag>().Where(x => x.Id == req.ClientTag.Id).First();
var tag = tenantDb.Queryable<InfoClientTag>().Where(x => x.ClientId == req.Id).First();
info = req.Adapt(info);
tag = req.ClientTag.Adapt(tag);

@ -42,7 +42,14 @@ namespace DS.WMS.Core.Map.Dtos
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 箱型名称
/// </summary>
public string CtnName { get; set; }
/// <summary>
/// 船公司名称
/// </summary>
public string CarrierName { get; set; }
/// <summary>
/// 船司Id
/// </summary>

@ -28,6 +28,15 @@ namespace DS.WMS.Core.Map.Dtos
/// </summary>
public string Code { get; set; }
/// <summary>
/// 场站名称
/// </summary>
public string YardName { get; set; }
/// <summary>
/// 船公司名称
/// </summary>
public string CarrierName { get; set; }
/// <summary>
/// 模块
/// </summary>

@ -19,6 +19,7 @@ using System.Threading.Tasks;
using Org.BouncyCastle.Ocsp;
using Mapster;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Code.Entity;
namespace DS.WMS.Core.Map.Method
{
@ -99,7 +100,13 @@ namespace DS.WMS.Core.Map.Method
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<MappingCtn>()
.Where(whereList)
.Select<MappingCtnRes>().ToQueryPage(request.PageCondition);
.Select<MappingCtnRes>()
.Mapper(it =>
{
it.CarrierName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.CarrierId).Select(n => n.ShortName).First();
it.CtnName = tenantDb.Queryable<CodeCtn>().Where(x => x.Id == it.LinkId).Select(n => n.CtnName).First();
}
).ToQueryPage(request.PageCondition);
return data;
}
@ -109,6 +116,12 @@ namespace DS.WMS.Core.Map.Method
var data = tenantDb.Queryable<MappingCtn>()
.Where(a => a.Id == long.Parse(id))
.Select<MappingCtnRes>()
.Mapper(it =>
{
it.CarrierName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.CarrierId).Select(n => n.ShortName).First();
it.CtnName = tenantDb.Queryable<CodeCtn>().Where(x => x.Id == it.LinkId).Select(n => n.CtnName).First();
}
)
.First();
return DataResult<MappingCtnRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}

@ -99,7 +99,13 @@ namespace DS.WMS.Core.Map.Method
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<MappingYard>()
.Where(whereList)
.Select<MappingYardRes>().ToQueryPage(request.PageCondition);
.Select<MappingYardRes>()
.Mapper(it =>
{
it.CarrierName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.CarrierId).Select(n => n.ShortName).First();
it.YardName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.LinkId).Select(n => n.ShortName).First();
}
).ToQueryPage(request.PageCondition);
return data;
}
@ -109,6 +115,12 @@ namespace DS.WMS.Core.Map.Method
var data = tenantDb.Queryable<MappingYard>()
.Where(a => a.Id == long.Parse(id))
.Select<MappingYardRes>()
.Mapper(it =>
{
it.CarrierName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.CarrierId).Select(n=>n.ShortName).First();
it.YardName = tenantDb.Queryable<InfoClient>().Where(x => x.Id == it.LinkId).Select(n => n.ShortName).First();
}
)
.First();
return DataResult<MappingYardRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}

@ -0,0 +1,79 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 集装箱多品名信息请求
/// </summary>
public class OpCtnDetailReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// CtnId
/// </summary>
public long CtnId { get; set; }
/// <summary>
/// 件数
/// </summary>
public int? PKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public decimal? KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public decimal? CBM { get; set; }
/// <summary>
/// 包装 t_code_package
/// </summary>
public string KindPkgs { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string HSCode { get; set; }
/// <summary>
/// 唛头 N/M
/// </summary>
public string Marks
{
get; set;
}
/// <summary>
/// 货物描述
/// </summary>
public string Description
{
get; set;
}
}
/// <summary>
/// 批量编辑箱型多品名信息
/// </summary>
public class BatchEditCtnDetailReq {
/// <summary>
/// CtnId
/// </summary>
public long CtnId { get; set; }
/// <summary>
/// 明细
/// </summary>
public List<OpCtnDetailReq> Detail { get; set; }
}
}

@ -0,0 +1,74 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 集装箱多品名信息返回
/// </summary>
public class OpCtnDetailRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// CtnId
/// </summary>
public long CtnId { get; set; }
/// <summary>
/// 件数
/// </summary>
public int? PKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public decimal? KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public decimal? CBM { get; set; }
/// <summary>
/// 包装 t_code_package
/// </summary>
public string KindPkgs { get; set; }
/// <summary>
/// 海关代码
/// </summary>
public string HSCode { get; set; }
/// <summary>
/// 唛头 N/M
/// </summary>
public string Marks
{
get; set;
}
/// <summary>
/// 货物描述
/// </summary>
public string Description
{
get; set;
}
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}

@ -0,0 +1,41 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Op.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Interface
{
/// <summary>
///
/// </summary>
public interface IOpCtnDetailService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<OpCtnDetailRes>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
DataResult SaveOpCtnDetail(BatchEditCtnDetailReq req);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelOpCtnDetail(IdModel req);
}
}

@ -0,0 +1,87 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using DS.Module.Core.Extensions;
using AngleSharp.Dom;
using Mapster;
namespace DS.WMS.Core.Op.Method
{
public class OpCtnDetailService : IOpCtnDetailService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public OpCtnDetailService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
public DataResult BatchDelOpCtnDetail(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<OpCtnDetail>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
public DataResult SaveOpCtnDetail(BatchEditCtnDetailReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Detail.Count > 0)
{
var ctnDetails = tenantDb.Queryable<OpCtnDetail>().Where(x => x.CtnId == req.CtnId).ToList();
foreach (var item in req.Detail)
{
if (item.Id == 0)
{
var detail = item.Adapt<OpCtnDetailReq>();
detail.CtnId = req.CtnId;
tenantDb.Insertable(detail).ExecuteCommand();
}
else
{
var detail = ctnDetails.First(x => x.Id == item.Id);
detail = item.Adapt(detail);
tenantDb.Updateable(detail).ExecuteCommand();
}
}
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
else
{
return DataResult.Failed("请选择数据!", MultiLanguageConst.DataNoSelect);
}
}
public DataResult<List<OpCtnDetailRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<OpCtnDetail>()
.Where(whereList)
.Select<OpCtnDetailRes>().ToQueryPage(request.PageCondition);
return data;
}
}
}

@ -115,7 +115,6 @@ namespace DS.WMS.Core.Op.Method
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<OpCtn>().Where(x => req.Ids.Contains(x.Id)).ToList();
;
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();

@ -512,8 +512,8 @@ public class SeaExportService : ISeaExportService
// throw Oops.Bah(rtn.Value);
//}
//场站引入的数据,转换为订舱箱型,且带上箱型代码
var ctnList = tenantDb.Queryable<CodeCtn>().Where(x => x.Status == StatusEnum.Enable).WithCache().ToList();
var mapCtn = tenantDb.Queryable<MappingCtn>().Where(x => x.Status == StatusEnum.Enable).WithCache().ToList();
var ctnList = tenantDb.Queryable<CodeCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var mapCtn = tenantDb.Queryable<MappingCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var listRtn = JsonConvert.DeserializeObject<List<YardCtnImportRes>>(rtn.Data);
@ -554,10 +554,10 @@ public class SeaExportService : ISeaExportService
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var account = tenantDb.Queryable<CodeThirdParty>().Where(x => x.CustomerId == req.YardId && x.AccountType == "BillTrace").First();
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserKeyBilltrace").WithCache().First().Value;
var userSecret = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserSecretBilltrace").WithCache().First().Value;
var spiderServerUrl = db.Queryable<SysConfig>().Where(x => x.Code == "spiderServerUrlBillTraceNew").WithCache().First().Value;
var tenantName = db.Queryable<SysTenant>().Filter(null, true).Where(x => x.Id == long.Parse(user.TenantId)).WithCache().First().Name;
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserKeyBilltrace").First().Value;
var userSecret = db.Queryable<SysConfig>().Where(x => x.Code == "spiderUserSecretBilltrace").First().Value;
var spiderServerUrl = db.Queryable<SysConfig>().Where(x => x.Code == "spiderServerUrlBillTraceNew").First().Value;
var tenantName = db.Queryable<SysTenant>().Filter(null, true).Where(x => x.Id == long.Parse(user.TenantId)).First().Name;
if (account.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("未配置出口运踪场站第三方账号信息!"));

@ -1279,3 +1279,24 @@
2024-04-28 17:04:22.8626 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-04-28 17:04:22.8762 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-28 17:04:22.9041 Info Configuration initialized.
2024-05-09 14:20:00.8841 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-09 14:20:00.9615 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-09 14:20:00.9821 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-09 14:20:01.0194 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-05-09 14:20:01.0448 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-05-09 14:20:01.0617 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-09 14:20:01.0898 Info Configuration initialized.
2024-05-09 14:27:34.1708 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-09 14:27:34.1916 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-09 14:27:34.1975 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-09 14:27:34.2127 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-05-09 14:27:34.2127 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-05-09 14:27:34.2313 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-09 14:27:34.2474 Info Configuration initialized.
2024-05-09 16:03:34.3290 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-05-09 16:03:34.3981 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-05-09 16:03:34.4227 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-05-09 16:03:34.6103 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-05-09 16:03:34.6576 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config
2024-05-09 16:03:34.6817 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-05-09 16:03:34.7177 Info Configuration initialized.

@ -0,0 +1,66 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 集装箱多品名 服务
/// </summary>
public class OpCtnDetailController : ApiController
{
private readonly IOpCtnDetailService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public OpCtnDetailController(IOpCtnDetailService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetOpCtnDetailList")]
public DataResult<List<OpCtnDetailRes>> GetOpCtnDetailList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SaveOpCtnDetail")]
public DataResult SaveOpCtnDetail([FromBody] BatchEditCtnDetailReq req)
{
var res = _invokeService.SaveOpCtnDetail(req);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelOpCtnDetail")]
public DataResult BatchDelOpCtnDetail([FromBody] IdModel req)
{
var res = _invokeService.BatchDelOpCtnDetail(req);
return res;
}
}

@ -10,7 +10,6 @@ using DS.Module.MultiLanguage;
using DS.Module.SqlSugar;
using DS.Module.Swagger;
using DS.Module.UserModule;
using DS.Module.CrawlerData;
using NLog.Web;
using Swashbuckle.AspNetCore.SwaggerUI;

Loading…
Cancel
Save