1.海运出口新增修改接口处理箱信息 2.海运出口单条复制及按复制模板复制指定列信息 3.海运出口详情前端路由后端接口配合修改

master
ZR20090193-陈敬勇 7 months ago
parent 07331a073c
commit e8dfdc49b4

@ -23,7 +23,12 @@ public static class MultiLanguageConst
/// </summary>
[Description("更新成功")]
public const string DataUpdateSuccess = "Data_Update_Success";
/// <summary>
/// 复制成功
/// </summary>
[Description("复制成功")]
public const string DataCopySuccess = "Data_Copy_Success";
/// <summary>
/// 删除成功
/// </summary>

@ -2,11 +2,21 @@
using System.ComponentModel;
using System.Reflection;
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;
namespace DS.Module.Core.Extensions;
public static partial class Extensions
{
/// <summary>
/// 字符串转大驼峰写法
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static string ToUpperCamelCase(this string input)
{
return Regex.Replace(input, "(?:^|_)[a-z]", m => m.Value.ToUpper());
}
/// <summary>
/// 判断类型是否为Nullable类型
/// </summary>

@ -13,12 +13,16 @@ public class SeaExportReq
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public List<OpCtnReq> CtnInfo { get; set; }
/// <summary>
/// 主单Id
/// </summary>
public long ParentId { get; set; } = 0;
/// <summary>
/// 业务状态
/// </summary>
@ -1019,7 +1023,7 @@ public class SeaExportReq
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>

@ -18,7 +18,7 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 业务编号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务编号", IsNullable = false, Length = 100)]
[SqlSugar.SugarColumn(ColumnDescription = "业务编号", IsNullable = true, Length = 100)]
public string BSNO { get; set; }
/// <summary>
/// 箱型代码
@ -41,13 +41,13 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 箱量
/// </summary>
[SugarColumn(ColumnDescription = "箱量", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "箱量", IsNullable = true, DefaultValue = "0")]
public int CtnNum { get; set; }
/// <summary>
/// TEU
/// </summary>
[SugarColumn(ColumnDescription = "TEU", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "TEU", IsNullable = true, DefaultValue = "0")]
public int TEU { get; set; }
/// <summary>
@ -148,19 +148,19 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 主票业务编号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "主票业务编号", IsNullable = false, Length = 100)]
[SqlSugar.SugarColumn(ColumnDescription = "主票业务编号", IsNullable = true, Length = 100)]
public string MasterNo { get; set; }
/// <summary>
/// 承运车队
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "承运车队", IsNullable = false, Length = 20)]
[SqlSugar.SugarColumn(ColumnDescription = "承运车队", IsNullable = true, Length = 20)]
public string Trucker { get; set; }
/// <summary>
/// 车号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "车号", IsNullable = false, Length = 30)]
[SqlSugar.SugarColumn(ColumnDescription = "车号", IsNullable = true, Length = 30)]
public string TruckNo { get; set; }
/// <summary>
/// 运费
@ -171,12 +171,12 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 免堆存天数
/// </summary>
[SugarColumn(ColumnDescription = "免堆存天数", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "免堆存天数", IsNullable = true, DefaultValue = "0")]
public int FreeStorageDay { get; set; }
/// <summary>
/// 堆存天数
/// </summary>
[SugarColumn(ColumnDescription = "堆存天数", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "堆存天数", IsNullable = true, DefaultValue = "0")]
public int StorageDay { get; set; }
/// <summary>
@ -193,12 +193,12 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// 免箱使天数
/// </summary>
[SugarColumn(ColumnDescription = "免箱使天数", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "免箱使天数", IsNullable = true, DefaultValue = "0")]
public int FreeCtnDay { get; set; }
/// <summary>
/// 箱使天数
/// </summary>
[SugarColumn(ColumnDescription = "箱使天数", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "箱使天数", IsNullable = true, DefaultValue = "0")]
public int CtnDay { get; set; }
/// <summary>
@ -216,29 +216,29 @@ namespace DS.WMS.Core.Op.Entity
/// <summary>
/// Desc:是否暂出
/// </summary>
[SugarColumn(ColumnDescription = "是否暂出", DefaultValue = "0")]
[SugarColumn(ColumnDescription = "是否暂出", IsNullable = true, DefaultValue = "0")]
public bool? IsTemp { get; set; } = false;
/// <summary>
/// VGM地址
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "VGM地址", IsNullable = false, Length = 100)]
[SqlSugar.SugarColumn(ColumnDescription = "VGM地址", IsNullable = true, Length = 100)]
public string VGMAddr { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "VGM邮箱", IsNullable = false, Length = 60)]
[SqlSugar.SugarColumn(ColumnDescription = "VGM邮箱", IsNullable = true, Length = 60)]
public string VGMEmail { get; set; }
/// <summary>
/// 提箱时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "提箱时间", IsNullable = false, Length = 50)]
[SqlSugar.SugarColumn(ColumnDescription = "提箱时间", IsNullable = true, Length = 50)]
public string PickUpTime { get; set; }
/// <summary>
/// 实际到港时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "实际到港时间", IsNullable = false, Length = 50)]
[SqlSugar.SugarColumn(ColumnDescription = "实际到港时间", IsNullable = true, Length = 50)]
public string ActualArrivalPortTime { get; set; }
}
}

@ -1,3 +1,4 @@
using AngleSharp.Dom;
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -11,8 +12,11 @@ using DS.WMS.Core.System.Interface;
using DS.WMS.Core.System.Method;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace DS.WMS.Core.Op.Method;
@ -71,7 +75,7 @@ public class SeaExportService : ISeaExportService
return DataResult.Failed("海运出口信息分提单号已存在!", MultiLanguageConst.SeaExportHBLNOExist);
}
//TODO 会计期间不允许小于已结转期间
if (req.CloseDocDate.IsNotNull()&& req.CloseDocDate < req.ETD)
if (req.CloseDocDate.IsNotNull() && req.CloseDocDate < req.ETD)
{
return DataResult.Failed("截单日期不允许小于开船日期!", MultiLanguageConst.SeaExportCloseDocDateLimit);
}
@ -89,6 +93,17 @@ public class SeaExportService : ISeaExportService
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
if (req.CtnInfo.Count > 0)
{
foreach (var item in req.CtnInfo)
{
var ctn = item.Adapt<OpCtn>();
ctn.BSNO = entity.Id.ToString();
tenantDb.Insertable(ctn).ExecuteCommand();
}
}
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
@ -111,6 +126,20 @@ public class SeaExportService : ISeaExportService
return DataResult.Failed("截港日期不允许小于开船日期!", MultiLanguageConst.SeaExportCloseDateLimit);
}
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).EnableDiffLogEvent().ExecuteCommand();
if (req.CtnInfo.Count > 0)
{
var ctnList = tenantDb.Queryable<OpCtn>().Where(x => x.BSNO == req.Id.ToString()).ToList();
foreach (var item in req.CtnInfo)
{
var ctn = ctnList.First(x => x.Id == item.Id);
ctn = item.Adapt(ctn);
tenantDb.Updateable(ctn).ExecuteCommand();
}
}
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
@ -172,7 +201,7 @@ public class SeaExportService : ISeaExportService
/// <summary>
/// 业务单据复制
/// 业务单据单票复制
/// </summary>
/// <param name="id">业务Id</param>
/// <returns></returns>
@ -186,32 +215,51 @@ public class SeaExportService : ISeaExportService
}
//获取表单复制模板
var template = tenantDb.Queryable<CodeFormCopy>().Where(x => x.PermissionId == 1772509201441099776).First();
var sequence = commonService.GetSequenceNext<SeaExport>();
if (!sequence.Succeeded)
{
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
}
var entity = new SeaExport();
var data = new SeaExport();
if (template.IsNullOrEmpty())
{
data = info.Adapt(data);
data.Id = 0;
data.ParentId = 0;
data.IsBusinessLocking = false;
data.IsFeeLocking = false;
data.CustomerNo = sequence.Data;
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
return DataResult.Successed("复制成功!", entity.Id, MultiLanguageConst.DataCopySuccess);
}
else
{
var sequence = commonService.GetSequenceNext<SeaExport>();
if (!sequence.Succeeded)
data = info.Adapt(data);
data.Id = 0;
data.ParentId = 0;
data.IsBusinessLocking = false;
data.IsFeeLocking = false;
data.CustomerNo = sequence.Data;
var list0 = template.CopyFields.Split(",");
var list1 = new List<string>();
foreach (var item in list0)
{
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
list1.Add(item.ToUpperCamelCase());
}
entity = info.Adapt(entity);
entity.Id = 0;
entity.ParentId = 0;
entity.IsBusinessLocking = false;
entity.IsFeeLocking = false;
entity.CustomerNo = sequence.Data;
list1.Add("IsBusinessLocking");
list1.Add("IsFeeLocking");
list1.Add("CustomerNo");
var insertColumns = list1.ToArray();
//insertColumns.AddRange(["Id", "ParentId", "IsBusinessLocking", "IsFeeLocking", "CustomerNo"]);
var entity = tenantDb.Insertable(data).InsertColumns(insertColumns).ExecuteReturnEntity();
return DataResult.Successed("复制成功!", entity.Id, MultiLanguageConst.DataCopySuccess);
}
info.IsFeeLocking = true;
var partList = tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
#region 删除
@ -229,7 +277,7 @@ public class SeaExportService : ISeaExportService
{
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
}
if (tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).Any())
{
return DataResult.Failed("海运出口存在分票信息,不能删除!", MultiLanguageConst.SeaExportPartExist);
@ -304,7 +352,7 @@ public class SeaExportService : ISeaExportService
item.DeleteBy = long.Parse(user.UserId);
tenantDb.Updateable(item).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
#endregion
@ -354,7 +402,7 @@ public class SeaExportService : ISeaExportService
info.IsFeeLocking = true;
tenantDb.Updateable(info).ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}

@ -663,8 +663,42 @@ public class CommonService : ICommonService
//去重
childs.Distinct();
//排序
childs = childs.OrderBy(x => x.SortCode).ToList();
childs = childs.OrderBy(x => x.SortCode).ToList();
foreach (var child in childs)
{
var grandsons = db.Queryable<SysPermission>().Where(x =>
x.MenuType == 2 && x.ParentId == child.Id && x.IsHidden == false &&
permissions.Contains(x.Id)) //排除企业用户维护
.OrderBy(x => x.SortCode)
.Select(a => new RouteItem
{
Id = a.Id,
ParentId = a.ParentId,
Path = a.Url,
Name = a.PermissionName,
Component = a.Component,
Meta = new RouteMeta()
{
Title = a.Title,
Icon = a.Icon,
}
}).ToList();
if (grandsons.Count > 0)
{
//去重
grandsons.Distinct();
//排序
grandsons = grandsons.OrderBy(x => x.SortCode).ToList();
child.Children = grandsons;
}
}
item.Children = childs;
}
}

@ -185,7 +185,7 @@ public class PermissionService : IPermissionService
foreach (var child in childs)
{
var buttons = db.Queryable<SysPermission>().Where(x => x.MenuType == 3 && x.ParentId == child.Key)
var buttons = db.Queryable<SysPermission>().Where(x =>(x.MenuType == 3 || x.MenuType == 2) && x.ParentId == child.Key)
.OrderBy(x => x.SortCode)
.Select(a => new PermissionTreeList
{

@ -177,7 +177,7 @@ public class SysRoleService : ISysRoleService
{
foreach (var child in childs)
{
var buttons = db.Queryable<SysPermission>().Filter(null, true).Where(x => x.MenuType == 3 && x.ParentId == child.Key)
var buttons = db.Queryable<SysPermission>().Filter(null, true).Where(x => (x.MenuType == 3 || x.MenuType == 2) && x.ParentId == child.Key)
.Select(a => new RolePermissionTree
{
Title = a.PermissionName,

@ -1251,3 +1251,17 @@
2024-04-24 16:11:01.7409 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-24 16:11:01.7496 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-24 16:11:01.7621 Info Configuration initialized.
2024-04-26 15:48:51.1363 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-26 15:48:51.1607 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-26 15:48:51.1678 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-26 15:48:51.1846 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-04-26 15:48:51.1846 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-26 15:48:51.2015 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-26 15:48:51.2113 Info Configuration initialized.
2024-04-26 16:00:39.8384 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-26 16:00:39.8665 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-26 16:00:39.8745 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-26 16:00:39.8912 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-04-26 16:00:39.9054 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-26 16:00:39.9054 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-26 16:00:39.9229 Info Configuration initialized.

@ -5,8 +5,11 @@ using DS.Module.SqlSugar;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.System.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;
@ -50,10 +53,10 @@ public class SaasTest
{
var tenantDb = saasService.GetBizDbScopeById("1750335377144680448");
var info = tenantDb.Queryable<InfoClient>().Filter(null,true).Where(x => x.Id == 1772138307266940928).First();
var info = tenantDb.Queryable<InfoClient>().Filter(null, true).Where(x => x.Id == 1772138307266940928).First();
var temp = new ClientTemp
{
{
Address = "4",
Name = "4",
};
@ -65,6 +68,25 @@ public class SaasTest
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
{

Loading…
Cancel
Save