cjy 1 month ago
commit fbdaf26fc8

@ -37,6 +37,9 @@ public class CM_BaseInfoService : ICM_BaseInfoService
private readonly ISaasDbService saasService;
private readonly IEPPlusService epplusService;
private readonly ICM_State_Change_TemplatImportService templatImportService;
private readonly ICM_RentInService CM_RentInService;
private readonly ICM_RentOutService CM_RentOutService;
private readonly ICM_SellCtnService CM_SellCtnService;
/// <summary>
///
@ -50,6 +53,10 @@ public class CM_BaseInfoService : ICM_BaseInfoService
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
epplusService = _serviceProvider.GetRequiredService<IEPPlusService>();
templatImportService = _serviceProvider.GetRequiredService<ICM_State_Change_TemplatImportService>();
CM_RentInService = _serviceProvider.GetRequiredService<ICM_RentInService>();
CM_RentOutService = _serviceProvider.GetRequiredService<ICM_RentOutService>();
CM_SellCtnService = _serviceProvider.GetRequiredService<ICM_SellCtnService>();
}
/// <summary>
@ -354,6 +361,12 @@ public class CM_BaseInfoService : ICM_BaseInfoService
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
if (Head.BillState == "1100")
{
CM_RentInService.CM_RentIn_Confirm(Head.Id);
}
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}
@ -382,6 +395,13 @@ public class CM_BaseInfoService : ICM_BaseInfoService
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
if (Head.BillState == "1100")
{
CM_RentOutService.CM_RentOut_Confirm(Head.Id);
}
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}
@ -410,6 +430,12 @@ public class CM_BaseInfoService : ICM_BaseInfoService
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
if (Head.BillState == "1100")
{
CM_SellCtnService.CM_SellCtn_Confirm(Head.Id);
}
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}

@ -232,6 +232,10 @@ namespace DS.WMS.Core.Fee.Entity
/// </summary>
public string FilePaths { get; set; }
/// <summary>
/// api接口数据创建时间
/// </summary>
public DateTime DataCreateTime { get; set; }
/// <summary>
/// 机构Id

@ -17,10 +17,10 @@ public class ClientTagReq
/// </summary>
public long? ClientId { get; set; }
///// <summary>
///// Desc:是否特批放单客户
///// </summary>
//public bool? IsSpecialApproval { get; set; } = false;
/// <summary>
/// Desc:是否特批放单客户
/// </summary>
public bool? IsSpecialApproval { get; set; } = false;
/// <summary>
/// Desc:是否船公司
@ -121,8 +121,7 @@ public class ClientTagReq
/// <summary>
/// Desc:其他类型
/// </summary>
public string Others { get; set; }
public string? Others { get; set; }
/// <summary>
/// Desc:是否船代
@ -141,6 +140,42 @@ public class ClientTagReq
/// Desc:是否约主
/// </summary>
public bool? IsContract { get; set; } = false;
/// <summary>
/// 是否国内同行
/// </summary>
public bool IsForeignCounterparts { get; set; }
/// <summary>
/// 是否国内直客
/// </summary>
public bool IsDirectCustomerCn { get; set; }
/// <summary>
/// 是否国外直客
/// </summary>
public bool IsDirectCustomer { get; set; }
/// <summary>
/// 是否指定货发货人
/// </summary>
public bool IsShipperZDH { get; set; }
/// <summary>
/// 是否个人
/// </summary>
public bool IsPersonal { get; set; }
/// <summary>
/// 是否装箱加固
/// </summary>
public bool IsPacking { get; set; }
/// <summary>
/// 是否放箱公司
/// </summary>
public bool IsContainerCompany { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -18,7 +18,7 @@ public class InfoClientBank : BaseModelV2<long>
/// <summary>
/// Desc:代码
/// </summary>
[SugarColumn(ColumnDescription = "代码", Length = 20)]
[SugarColumn(ColumnDescription = "代码", Length = 50)]
public string CodeName { get; set; }
/// <summary>
@ -36,13 +36,13 @@ public class InfoClientBank : BaseModelV2<long>
/// <summary>
/// Desc:银行账户
/// </summary>
[SugarColumn(ColumnDescription = "银行账户", Length = 40, IsNullable = true)]
[SugarColumn(ColumnDescription = "银行账户", Length = 100, IsNullable = true)]
public string Account { get; set; }
/// <summary>
/// Desc:银行地址
/// </summary>
[SugarColumn(ColumnDescription = "银行地址", Length = 50, IsNullable = true)]
[SugarColumn(ColumnDescription = "银行地址", Length = 500, IsNullable = true)]
public string BankAddress { get; set; }
/// <summary>
@ -72,7 +72,7 @@ public class InfoClientBank : BaseModelV2<long>
/// <summary>
/// Desc:银行账号
/// </summary>
[SugarColumn(ColumnDescription = "银行账号", Length = 20, IsNullable = true)]
[SugarColumn(ColumnDescription = "银行账号", Length = 100, IsNullable = true)]
public string BankAccountNo { get; set; }
/// <summary>

@ -6,6 +6,7 @@ using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.TaskPlat.Dtos;
using Mapster;
namespace DS.WMS.Core.Info.Method;
@ -114,6 +115,7 @@ public class ClientBankService : ServiceBase, IClientBankService
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
const int PAGE_SIZE = 200;
/// <summary>
/// 导入客户银行
/// </summary>
@ -152,6 +154,7 @@ public class ClientBankService : ServiceBase, IClientBankService
{
ClientId = item.Id,
OrgId = item.OrgId,
CodeName = PinYinUtil.GetFristLetter(model.BankName),
BankName = model.BankName,
Account = model.BankAccount,
BankAddress = model.BankAddress,
@ -163,6 +166,9 @@ public class ClientBankService : ServiceBase, IClientBankService
InvoiceHeaders = []
};
if (bank.CodeName.Length > 50)
bank.CodeName = bank.CodeName.Substring(0, 50);
if (model.Currency == "人民币")
bank.Currency = FeeCurrency.RMB_CODE;
else if (model.Currency == "美元")
@ -178,16 +184,23 @@ public class ClientBankService : ServiceBase, IClientBankService
}
}
if (sb.Length > 0)
{
sb.Remove(0, 1);
return DataResult.Failed("下列【公司名称】匹配不到客户/供应商:" + sb.ToString());
}
//if (sb.Length > 0)
//{
// sb.Remove(0, 1);
// return DataResult.Failed("下列【公司名称】匹配不到客户/供应商:" + sb.ToString());
//}
await TenantDb.Ado.BeginTranAsync();
try
{
await TenantDb.Fastest<InfoClientBank>().BulkMergeAsync(banks);
//await TenantDb.Fastest<InfoClientBank>().BulkMergeAsync(banks);
int page = Convert.ToInt32(Math.Ceiling(banks.Count / Convert.ToDouble(PAGE_SIZE)));
for (int i = 0; i < page; i++)
{
var batchList = banks.Skip(i * PAGE_SIZE).Take(PAGE_SIZE).ToList();
await TenantDb.Insertable(batchList).ExecuteCommandAsync();
}
foreach (var bank in banks)
{

@ -88,6 +88,11 @@ namespace DS.WMS.Core.Op.Dtos
/// 关联的航线列表
/// </summary>
public List<BookingContractNoManageLane>? LaneList { get; set; }
/// <summary>
/// 提单类型MBL-Master单,HBL-House单
/// </summary>
public string BLIssueType { get; set; }
}
/// <summary>

@ -432,6 +432,31 @@ namespace DS.WMS.Core.Op.Dtos
/// 船公司航次
/// </summary>
public string CarrierVoyno { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
public string TakeCtnYard { get; set; }
/// <summary>
/// 更新标记 ORIGINAL-原BC文件 CANCELLATION-取消 REJECTION-拒绝 1ST UPDATE-首次更新 2ND-2次 3RD-3次 4TH..多次)
/// </summary>
public string UpdateFlag { get; set; }
/// <summary>
/// 船公司参考号
/// </summary>
public string CarrierReferNo { get; set; }
/// <summary>
/// 用户参考号
/// </summary>
public string UserReferNo { get; set; }
/// <summary>
/// 提单类型MBL-Master单,HBL-House单
/// </summary>
public string BLIssueType { get; set; }
}
/// <summary>

@ -100,5 +100,11 @@ namespace DS.WMS.Core.Op.Entity
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(BookingContractNoManageLane.PId))]
public List<BookingContractNoManageLane>? LaneList { get; set; }
/// <summary>
/// 提单类型MBL-Master单,HBL-House单
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "提单类型MBL-Master单,HBL-House单", Length = 20, IsNullable = true)]
public string BLIssueType { get; set; }
}
}

@ -423,5 +423,11 @@ namespace DS.WMS.Core.Op.Entity
/// </summary>
[SugarColumn(ColumnDescription = "用户参考号", IsNullable = true, Length = 50)]
public string UserReferNo { get; set; }
/// <summary>
/// 提单类型MBL-Master单,HBL-House单
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "提单类型MBL-Master单,HBL-House单", Length = 20, IsNullable = true)]
public string BLIssueType { get; set; }
}
}

@ -74,6 +74,11 @@
/// 主要数据项
/// </summary>
public dynamic? Primary { get; protected internal set; }
/// <summary>
/// 箱型价格列表
/// </summary>
public List<BusinessCtnPrice>? CtnPriceList { get; set; }
}
public class MailSender
@ -179,27 +184,6 @@
public string? CustomerType { get; set; }
}
/// <summary>
/// 客户
/// </summary>
public class Client
{
/// <summary>
/// 客户ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 中文全称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 英文全称
/// </summary>
public string? EnName { get; set; }
}
/// <summary>
/// 邮件模板模型
/// </summary>

@ -865,6 +865,8 @@ namespace DS.WMS.Core.Op.Method
Logger.Log(NLog.LogLevel.Info, $"执行ApiReceiveTask时未获取到{TaskFlowDataNameConst.TaskBCInfo}");
}
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
DynameFileInfo? bcFileInfo = dataContext.Get<DynameFileInfo>(TaskFlowDataNameConst.BCFileInfo);
DynameFileInfo? bcNoticeFileInfo = dataContext.Get<DynameFileInfo>(TaskFlowDataNameConst.BCNotifyFileInfo);
@ -915,6 +917,10 @@ namespace DS.WMS.Core.Op.Method
TransferPort1 = taskBCInfoDto.TransferPort1,
TransferPort2 = taskBCInfoDto.TransferPort2,
PriceCalculationDate = taskBCInfoDto.PriceCalculationDate,
TakeCtnYard = taskBCInfoDto.TakeCTNYard,
UpdateFlag = taskBCInfoDto.UpdateFlag,
CarrierReferNo = taskBCInfoDto.CarrierReferNo,
UserReferNo = taskBCInfoDto.UserReferNo,
CtnList = new List<BookingSlotCtnSaveInput>()
},
OpType = messageInfo.Head.RequestAction?.ToLower(),
@ -925,6 +931,21 @@ namespace DS.WMS.Core.Op.Method
{
slotModel.DataObj.WeekAt = week;
}
//如果约号不为空,通过约号来对应提单类型 MBL 或者HBL
if (!string.IsNullOrWhiteSpace(taskBCInfoDto.ContractNo))
{
string s = taskBCInfoDto.ContractNo.Trim();
var contractInfo = tenantDb.Queryable<BookingContractNoManage>().First(b => b.ContractNo.Equals(s, StringComparison.OrdinalIgnoreCase));
if(contractInfo != null && !string.IsNullOrWhiteSpace(contractInfo.BLIssueType))
{
slotModel.DataObj.BLIssueType = contractInfo.BLIssueType;
}
}
if (taskBCInfoDto.CtnList.Count > 0)
{
var ctnCodeList = (await _codeCtnService.GetAllList()).Data ?? new List<Code.Dtos.CodeCtnRes>();
@ -953,7 +974,7 @@ namespace DS.WMS.Core.Op.Method
// 回写舱位主键到BC任务
if (rlt.Succeeded && rlt.Data != null && taskBcInfo != null)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var taskBcInfo = await tenantDb.Queryable<TaskBCInfo>().Where(x => x.Id == taskBcId).FirstAsync();
if (taskBcInfo != null)
{

@ -58,7 +58,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking
return;
}
MailService mailService = new(context.ServiceProvider);
MailGenerator mailService = new(context.ServiceProvider);
var model = await mailService.GetTemplateModelAsync(context.ActionManager, context.TaskInfo.BusinessId, context.TaskInfo.BusinessType);
if (model.Primary == null)
{

@ -51,7 +51,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
return;
}
MailService mailService = new(context.ServiceProvider);
MailGenerator mailService = new(context.ServiceProvider);
var model = await mailService.GetTemplateModelAsync(context.ActionManager, context.TaskInfo.BusinessId, context.TaskInfo.BusinessType);
if (model.Primary == null)
{

@ -74,7 +74,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease
return;
}
MailService mailService = new MailService(context.ServiceProvider);
MailGenerator mailService = new MailGenerator(context.ServiceProvider);
var model = await mailService.GetTemplateModelAsync(context.ActionManager, context.TaskInfo.BusinessId, context.TaskInfo.BusinessType);
if (model.Primary == null)
{

@ -17,6 +17,8 @@ using Masuit.Tools;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NPOI.OpenXmlFormats;
using NPOI.OpenXmlFormats.Wordprocessing;
using RazorEngineCore;
namespace DS.WMS.Core.Op.Method.TaskInteraction
@ -24,18 +26,18 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
/// <summary>
/// 业务邮件发送服务
/// </summary>
public class MailService : ServiceBase
public class MailGenerator : ServiceBase
{
static readonly ConcurrentDictionary<string, IRazorEngineCompiledTemplate> TemplateCache = new();
IConfiguration config;
ApiFox Api = DefaultActionExecutor.Api;
readonly IConfiguration config;
readonly ApiFox Api = DefaultActionExecutor.Api;
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public MailService(IServiceProvider provider) : base(provider)
public MailGenerator(IServiceProvider provider) : base(provider)
{
config = provider.GetRequiredService<IConfiguration>();
TenantDb.QueryFilter.Clear<IOrgId>();
@ -82,8 +84,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
List<Tuple<long, string>> list = [];
long? forwarderId = null, shipperCNId = null, customerId = null;
var order = model.Primary as SeaExportRes;
if (order != null)
if (model.Primary is SeaExportRes order)
{
list.Add(new Tuple<long, string>(order.SaleId, "sale"));
list.Add(new Tuple<long, string>(order.OperatorId, "op"));
@ -96,8 +97,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
else
{
IDictionary<string, object>? dic = model.Primary as IDictionary<string, object>;
if (dic == null)
if (model.Primary is not IDictionary<string, object> dic)
return model;
if (dic.TryGetValue(nameof(SeaExport.SaleId), out object? sale))
@ -157,6 +157,18 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
model.Document = userList.Find(x => x.Id == docId);
}
//获取箱型价格
model.CtnPriceList = await TenantDb.Queryable<BusinessCtnPrice>().Where(x => x.BusinessId == model.BusinessId)
.Select(x => new BusinessCtnPrice
{
Ctn = x.Ctn,
CtnAll = x.CtnAll,
CtnNum = x.CtnNum,
QuotePrice = x.QuotePrice,
GuidePrice = x.GuidePrice,
FloorPrice = x.FloorPrice
}).ToListAsync();
return model;
}

@ -14,7 +14,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
public class TaskMailService : ServiceBase, ITaskMailService
{
readonly Lazy<IActionManagerService> actionService;
readonly MailService mailService;
readonly MailGenerator mailService;
/// <summary>
/// 初始化
@ -47,7 +47,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (model.Primary == null)
return DataResult<string>.FailedWithDesc(MultiLanguageConst.EmptyData);
string content = await MailService.RenderTemplateAsync(taskMail.Content, model);
string content = await MailGenerator.RenderTemplateAsync(taskMail.Content, model);
return DataResult<string>.Success(content);
}
@ -69,8 +69,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var bsId = await TenantDb.Queryable<SeaExport>().Where(x => x.CustomerNo.Contains(customerNO)).Select(x => x.Id).FirstAsync();
var model = await mailService.GetTemplateModelAsync(actionService.Value, bsId, BusinessType.OceanShippingExport);
string title = await MailService.RenderTemplateAsync(taskMail.Title, model);
string content = await MailService.RenderTemplateAsync(taskMail.Content, model);
string title = await MailGenerator.RenderTemplateAsync(taskMail.Title, model);
string content = await MailGenerator.RenderTemplateAsync(taskMail.Content, model);
return DataResult<Tuple<string, string>>.Success(new Tuple<string, string>(title, content));
}

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

@ -127,6 +127,8 @@ namespace DS.WMS.Core.QuarztJobs.Method
bs.AccountNumberOfNominalPayee = itemdata.AccountNumberOfNominalPayee;
bs.NameOfNominalPayee = itemdata.NameOfNominalPayee;
bs.FilePaths = itemdata.FilePaths;
bs.DataCreateTime = itemdata.CreateTime;
bs.CreateTime = DateTime.Now;
//await tenantDb.Insertable(bs).ExecuteCommandAsync();
datalist.Add(bs);

@ -611,7 +611,7 @@ namespace DS.WMS.Core.TaskPlat.Method
BusinessType = BusinessType.OceanShippingExport,
};
MailService mailService = new MailService(serviceProvider);
MailGenerator mailService = new MailGenerator(serviceProvider);
var result = await mailService.SendAsync(mailConfig, model);
if (!result.Succeeded)

@ -279,7 +279,7 @@ namespace DS.WMS.Core.TaskPlat.Method
BusinessType = BusinessType.OceanShippingExport,
};
MailService mailService = new MailService(serviceProvider);
MailGenerator mailService = new MailGenerator(serviceProvider);
var result = await mailService.SendAsync(mailConfig, model);
if (!result.Succeeded)

@ -1746,26 +1746,25 @@ namespace DS.WMS.Core.TaskPlat.Method
}
else if (bcTaskInfo.TASK_TYPE == TaskBaseTypeEnum.BC_MODIFY.ToString())
{
////CMA没有变更附件所以转发邮件时默认用原文件转发
//if (bcTaskInfo.CARRIER_CODE.Equals("CMA", StringComparison.OrdinalIgnoreCase))
//{
// fileInfo = tenantDb.Queryable<TaskFileInfo>().Where(a => a.TASK_PKID == taskBCInfo.TASK_ID && a.FILE_CATEGORY.Contains("BC_MODIFY"))
//.OrderByDescending(a => a.CreateTime).First();
//}
//else
//{
//}
if (orderInfo.splitOrMergeFlag == 1)
//CMA没有变更附件所以转发邮件时默认用原文件转发
if (bcTaskInfo.CARRIER_CODE.Equals("CMA", StringComparison.OrdinalIgnoreCase))
{
//这里需要按照箱量重新修改变更附件
fileInfo = tenantDb.Queryable<TaskFileInfo>().Where(a => a.TASK_PKID == taskBCInfo.TASK_ID && a.FILE_CATEGORY.Contains("BC_MODIFY"))
.OrderByDescending(a => a.CreateTime).First();
}
else
{
fileInfo = tenantDb.Queryable<TaskFileInfo>().Where(a => a.TASK_PKID == taskBCInfo.TASK_ID && a.FILE_CATEGORY.Contains("BC_MODIFY_NOTICE"))
.OrderByDescending(a => a.CreateTime).First();
if (orderInfo.splitOrMergeFlag == 1)
{
//这里需要按照箱量重新修改变更附件
}
else
{
fileInfo = tenantDb.Queryable<TaskFileInfo>().Where(a => a.TASK_PKID == taskBCInfo.TASK_ID && a.FILE_CATEGORY.Contains("BC_MODIFY_NOTICE"))
.OrderByDescending(a => a.CreateTime).First();
}
}
}
if (fileInfo == null)
@ -3332,7 +3331,7 @@ namespace DS.WMS.Core.TaskPlat.Method
BusinessType = BusinessType.OceanShippingExport,
};
MailService mailService = new MailService(serviceProvider);
MailGenerator mailService = new MailGenerator(serviceProvider);
//如果是拆票需要每票调用生成拆票的BC文件
var result = await mailService.SendAsync(mailConfig, model);

Loading…
Cancel
Save