海运出口复制表单部分

master
ZR20090193-陈敬勇 7 months ago
parent 13b220e5fc
commit 7870db98f3

@ -302,7 +302,8 @@ public static class MultiLanguageConst
#region 海关出口
[Description("海运出口信息已存在")]
public const string SeaExportExist = "Sea_Export_Exist";
[Description("海运出口信息不存在")]
public const string SeaExportNotExist = "Sea_Export_Not_Exist";
[Description("海运出口信息业务已锁定")]
public const string SeaExportBusinessLock = "Sea_Export_Business_Lock";
[Description("海运出口信息费用已锁定")]

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Code.Dtos
{
/// <summary>
/// 表单复制选项
/// </summary>
public class FormCopyItem
{
/// <summary>
/// 字段
/// </summary>
public string Field { get; set; }
/// <summary>
/// 是否复制
/// </summary>
public bool IsCopy { get; set; }
/// <summary>
/// 是否显示
/// </summary>
public bool Show { get; set; }
}
}

@ -568,10 +568,10 @@ public class SeaExportReq
/// </summary>
public string BookingType { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
///// <summary>
///// 订舱编号
///// </summary>
//public string BookingNo { get; set; }
/// <summary>
/// Desc:保险人

@ -566,10 +566,10 @@ public class SeaExportRes
/// </summary>
public string BookingType { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
public string BookingNo { get; set; }
///// <summary>
///// 订舱编号
///// </summary>
//public string BookingNo { get; set; }
/// <summary>
/// Desc:保险人

@ -668,11 +668,11 @@ public class SeaExport : BaseOrgModel<long>
[SugarColumn(ColumnDescription = "订舱类型", IsNullable = true, Length = 50)]
public string BookingType { get; set; }
/// <summary>
/// 订舱编号
/// </summary>
[SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 20)]
public string BookingNo { get; set; }
///// <summary>
///// 订舱编号
///// </summary>
//[SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 20)]
//public string BookingNo { get; set; }
/// <summary>
/// Desc:保险人

@ -2,6 +2,7 @@ using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
@ -9,6 +10,7 @@ using DS.WMS.Core.System.Interface;
using DS.WMS.Core.System.Method;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using Org.BouncyCastle.Ocsp;
using SqlSugar;
namespace DS.WMS.Core.Op.Method;
@ -141,4 +143,74 @@ public class SeaExportService : ISeaExportService
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
/// <summary>
/// 业务单据复制
/// </summary>
/// <param name="id">业务Id</param>
/// <returns></returns>
public DataResult SeaExportCopy(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<SeaExport>().Where(x => x.Id == long.Parse(id)).First();
if (info.IsNullOrEmpty())
{
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
}
//获取表单复制模板
var template = tenantDb.Queryable<CodeFormCopy>().Where(x=>x.PermissionId == 1772509201441099776).First();
var entity = new SeaExport();
if (template.IsNullOrEmpty()) {
var sequence = commonService.GetSequenceNext<SeaExport>();
if (!sequence.Succeeded)
{
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
}
entity = info.Adapt(entity);
entity.Id = 0;
entity.ParentId = 0;
entity.IsBusinessLocking = false;
entity.IsFeeLocking = false;
entity.CustomerNo = sequence.Data;
}
info.IsFeeLocking = true;
var partList = tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
/// <summary>
/// 费用锁定
/// </summary>
/// <param name="id">业务Id</param>
/// <returns></returns>
public DataResult SeaExportFeeLook(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<SeaExport>().Where(x => x.Id == long.Parse(id)).First();
if (info.IsNullOrEmpty()) {
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
}
if ((bool)info.IsFeeLocking) {
return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock);
}
info.IsFeeLocking = true;
var partList= tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}

@ -1223,3 +1223,10 @@
2024-04-22 15:35:58.1631 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-22 15:35:58.1631 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-22 15:35:58.1866 Info Configuration initialized.
2024-04-23 09:01:23.6191 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-04-23 09:01:23.6657 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-04-23 09:01:23.6657 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-04-23 09:01:23.7103 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-23 09:01:23.7292 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-23 09:01:23.7292 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-04-23 09:01:23.7573 Info Configuration initialized.

Loading…
Cancel
Save