修改库存

usertest
jianghaiqing 3 months ago
parent 96eb875412
commit 0c97c109a6

@ -1,5 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
@ -16,5 +17,11 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="paraObj">请求参数</param>
/// <returns>返回回执</returns>
Task<DataResult<string>> BookingSlotStock(BookingSlotStockUpdateModel paraObj);
/// <summary>
/// 重新计算某租户下面所有的库存
/// </summary>
/// <returns></returns>
Task RefreshAllStock();
}
}

@ -54,6 +54,7 @@ using NPOI.XSSF.UserModel;
using AngleSharp.Dom;
using DS.WMS.Core.TaskPlat.Entity;
using Microsoft.VisualBasic.FileIO;
using Microsoft.Extensions.Logging;
namespace DS.WMS.Core.Op.Method
{
@ -4356,6 +4357,7 @@ namespace DS.WMS.Core.Op.Method
return DataResult<List<BookingSlotUseToConfigDto>>.Success(data);
}
#endregion
}
public static class LetterIndexUtil

@ -14,6 +14,7 @@ using System.Text;
using System.Threading.Tasks;
using Mapster;
using DS.WMS.Core.Op.Interface;
using Microsoft.Extensions.Logging;
namespace DS.WMS.Core.Op.Method
{
@ -41,6 +42,7 @@ namespace DS.WMS.Core.Op.Method
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
#region 计算舱位库存
/// <summary>
/// 计算舱位库存
/// </summary>
@ -247,5 +249,54 @@ namespace DS.WMS.Core.Op.Method
return DataResult<string>.Success(string.Empty);
}
#endregion
#region 重新计算某租户下面所有的库存
/// <summary>
/// 重新计算某租户下面所有的库存
/// </summary>
/// <returns></returns>
public async Task RefreshAllStock()
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var n = await tenantDb.Deleteable<BookingSlotStock>().ExecuteCommandAsync();
var group = await tenantDb.Queryable<BookingSlotBase>()
.Where(x => x.Deleted == false)
.GroupBy(x => new
{
x.Vessel,
x.Voyno,
x.CarrierCode,
x.ContractNo,
x.BookingSlotType,
x.PortLoadCode,
x.PortDischargeCode,
}).Select(x => new
{
x.Vessel,
x.Voyno,
x.CarrierCode,
x.ContractNo,
x.BookingSlotType,
x.PortLoadCode,
x.PortDischargeCode,
}).ToListAsync();
foreach (var item in group)
{
BookingSlotStockUpdateModel model = new BookingSlotStockUpdateModel {
Vessel = item.Vessel,
Voyno = item.Voyno,
CarrierCode = item.CarrierCode,
ContractNo = item.ContractNo,
BookingSlotType = item.BookingSlotType,
PortLoadId = item.PortLoadCode,
PortDischargeId = item.PortDischargeCode,
};
await BookingSlotStock(model);
}
}
#endregion
}
}

@ -101,7 +101,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.SpaceRelease
BusinessId = context.TaskInfo.BusinessId,
BusinessType = context.TaskInfo.BusinessType,
};
MailService mailService = new(context.ServiceProvider);
MailService mailService = new MailService(context.ServiceProvider);
var result3 = await mailService.SendAsync(mailConfig, model);
if (!result3.Succeeded)
{

@ -1,107 +1,66 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.Op.Dtos.SeaExportRes> *@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.TaskPlat.Dtos.TaskPOLContainerNotPickUpShowDto> *@
@{
var item = Model.Primary;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<style>
.parent {
position: relative;
height: 300px;
width: 300px;
}
.child {
position: absolute;
bottom: 0;
right: 0;
width: 50px;
height: 50px;
}
.title {
background-color: darkblue;
color: whitesmoke;
font-size: 20px;
font-weight: 300;
}
</style>
<span>*** Auto Email, please reply to all (delete sender Admin)!If only reply to sender, we will not be able to find and deal with it! ***</span>
<br />
Dear @Model.Contacts
<div class="title">
RE: BOOKING - JOB NO.
</div>
请查看附件中的订舱委托请2小时内先行回复订舱号给我们并帮忙催促船东尽快放舱如下信息同订舱委托一致便于您查阅
CARRIER@item.Carrier
S/QXX
ETD : @item.ETD
POL: @item.LoadPort
POD: @item.DischargePort
FPOD: @item.DeliveryPlace
VOL: XX
Commdity: XX取中文品名
HS CODE: @item.HSCode
POD FREE TIME
REMARK
(取供应商备注)
此票订舱我司对接同事的联系方式如下,任何问题请及时跟我们沟通,谢谢!
<table>
<thead>
<tr>
<th>CN Name</th>
<th>Name</th>
<th>Tel No.</th>
<th>Mobile/Wechat/QQ</th>
<th>Email</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title class="head-title">邮件模板</title>
</head>
<body style="margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#EDF9F5" style="font-size: 12px;font-family: Arial;">
<tr>
<td>邵 芳</td>
<td>Candy</td>
<td>0532-80688387</td>
<td>13375570007 2853083550</td>
<td>candy@sunniness.net</td>
<td>Cooperation</td>
<td height="30"></td>
</tr>
<tr>
<td>魏涛</td>
<td>Wilson</td>
<td>0532-80688353</td>
<td>13969858993 2853083555</td>
<td>ope@sunniness.net</td>
<td>OP manager</td>
</tr>
<tr>
<td>徐平平</td>
<td>Cathy</td>
<td>0532-80688350</td>
<td>13969662965 2853083551</td>
<td>opg@sunniness.net</td>
<td>Document</td>
</tr>
</tbody>
</table>
<td>
<table class="out-table" border="0" cellpadding="8" cellspacing="0" width="800" bgcolor="#FFFFFF" align="center" style="font-size: 12px;font-family: Arial;">
<tr>
<td>
<p>尊敬的客户,</p>
</td>
</tr>
<tr>
<td>
<table class="base-table" border="1" cellpadding="8" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;border-color: #ebeef5;font-size: 12px;font-family: Arial;">
<tr>
<td class="billno-label" width="120px;">船名/航次:</td>
<td class="billno-val">@item.Vessel/@item.Voyno</td>
</tr>
<tr>
<td class="billno-label" width="120px;">定舱号码:</td>
<td class="billno-val">@item.MBlNo</td>
</tr>
<div class="parent">
<div id="sign" class="child">
@* Tks + Brgds
Candy SHAO 邵芳 (此处用当票操作的信息)
General Manager | SUNNINESS LOGISTICS CO.,LTD.
TEL: +86-0532-80688387 |MB./We chat: +86-18866622731|QQ:2853083553 | Email:candy@sunniness.net *@
</div>
</div>
</table>
</td>
</tr>
<tr class="email-noreply">
<td>
<p class="dynamic-val"></p>
<p class="notice1-val">以上是贵司还未提柜记录的定舱现已接近截箱时间请参考如下信息操作否则您的订舱将在CY cut-off deadline取消</p>
<p class="notice1-val">A. 推下一航次,请&lt;在CY&nbsp;Closing&nbsp;-&nbsp;1&nbsp;天之前&gt;提交更改</p>
<p class="notice1-val">B. <font style="color: #4051f0; font-weight: 500;">已提柜,且于马士基网站未查询到柜号,<font style="background-color: #f1de2f; font-weight: 500;">请立即联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone</font></font>告知柜号。若网站已有完整柜号且确认正常出运,请自行安排,无需再回复邮件,<font style="color: #f70f0f; font-weight: 500;">目前Maersk不接受未提供明确柜号而保留订舱的要求。</font></p>
<p class="notice1-val">
鉴于船舶配载方面的要求Maersk将在配载前将所有没有提柜记录以Maersk EDI记录为准的定舱视为无效定舱,并统一在取消,因此,<font style="background-color: #5bcef1; font-weight: 500;">友情提醒:请尽快提柜并告知柜号,以免产生不必要的工作和费用。</font>
如果上方的单号需要取消订舱, 或已经提交过取消操作, 无需回复邮件。
如有任何疑问,欢迎垂询我司操作。
</p>
<p class="notice2-val"><font style="color: #4051f0; font-weight: 500;">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,</font><font style="background-color: #f1de2f; font-weight: 500;">请联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone谢谢</font></p>
<p>顺祝</p>
<p>商祺</p>
<p class="notice-comp-val">@item.TenantCompanyName</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
@* 此邮件模板是订舱委托推送的邮件模板,在商务订单审核通过后,自动生成,并推送:
1蓝色是调取系统数据、红色是醒目提醒
2订舱委托PDF格式作为附件一起发出
3邮件发给订舱代理联系人抄送我司销售/客服和操作/单证;未勾选推送的订舱代理,仅推送我司干系人! *@

@ -62,5 +62,15 @@ namespace DS.WMS.Core.TaskPlat.Dtos
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantCompanyName { get; set; }
}
}

@ -39,6 +39,9 @@ using DS.WMS.Core.Op.EDI;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Code.Dtos;
using DS.Module.Core.Data;
using LanguageExt.Common;
using DS.WMS.Core.Op.Method.TaskInteraction;
using DS.WMS.Core.Op.Entity.TaskInteraction;
namespace DS.WMS.Core.TaskPlat.Method
{
@ -118,6 +121,32 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <returns>返回回执</returns>
public async Task<DataResult> SendEmailToCustomer(long taskPKId)
{
//BusinessTaskMail? mailConfig = null;
//if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Id), out var id))
//{
// if (id == null)
// {
// await LogService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
// return;
// }
// var idVal = (long)Convert.ChangeType(id, typeof(long));
// mailConfig = (await taskMailService.GetAsync(idVal)).Data;
//}
//if (mailConfig == null)
//{
// //await LogService.WriteLogAsync(context.TaskInfo, $"未能根据任务配置值获取邮件模板设置");
// //return;
//}
//MailService mailService = new(_serviceProvider);
//var result3 = await mailService.SendAsync(mailConfig, model);
//if (!result3.Succeeded)
//{
// //await LogService.WriteLogAsync(context.TaskInfo, result.Message);
// //return;
//}
return null;
}
#endregion

@ -19,14 +19,16 @@ namespace DS.WMS.OpApi.Controllers
public class BookingSlotServiceController : ApiController
{
private readonly IBookingSlotService _bookingSlotService;
private readonly IBookingSlotStockService _bookingSlotStockService;
/// <summary>
///
/// </summary>
/// <param name="bookingSlotService"></param>
public BookingSlotServiceController(IBookingSlotService bookingSlotService)
public BookingSlotServiceController(IBookingSlotService bookingSlotService, IBookingSlotStockService bookingSlotStockService)
{
_bookingSlotService = bookingSlotService;
_bookingSlotStockService = bookingSlotStockService;
}
#region 舱位接收保存、取消接口
@ -428,5 +430,18 @@ namespace DS.WMS.OpApi.Controllers
return await _bookingSlotService.GetSlotUseToConfig();
}
#endregion
#region 重新计算某租户下面所有的库存
/// <summary>
/// 重新计算某租户下面所有的库存
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("RefreshAllStock")]
public async Task RefreshAllStock()
{
await _bookingSlotStockService.RefreshAllStock();
}
#endregion
}
}

Loading…
Cancel
Save