优化修改

This commit is contained in:
tongfei
2024-03-30 09:23:40 +08:00
parent 06a2d23ff5
commit cdabe7b1b6
6 changed files with 102 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ using WMS.Web.Core.Dto;
using System.Linq;
using WMS.Web.Domain.IService.Public;
using WMS.Web.Core.Dto.Erp;
using WMS.Web.Domain.Entitys;
namespace WMS.Web.Domain.Services
{
@@ -183,6 +184,7 @@ namespace WMS.Web.Domain.Services
foreach (var current_det in current_notSendDetails)
{
var det = new SendDataDetailsDto();
det.TaskDetailId = current_det.Id;
det.MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, current_det.MaterialNumber);
det.Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, current_det.MaterialNumber);
det.MaterialNumber = current_det.MaterialNumber;
@@ -210,6 +212,8 @@ namespace WMS.Web.Domain.Services
{
try
{
var update_taskDetailsIds = new List<int>();
var sendContentList_result = await this.GetSendContent();
if (sendContentList_result.IsSuccess)
{
@@ -225,6 +229,7 @@ namespace WMS.Web.Domain.Services
int i = 1;
foreach (var det in item.Details)
{
update_taskDetailsIds.Add(det.TaskDetailId);
if (i == item.Details.Count)
content = det.Specifications + " X 数量" +Convert.ToInt32(det.Qty);
else
@@ -237,6 +242,18 @@ namespace WMS.Web.Domain.Services
//短信
this.SendSms(item.PhoneNumbers, content);
}
//任务明细:修改的
var tasksDetails = await _inStockTaskRepositories.GetDetailsList(update_taskDetailsIds);
if(tasksDetails!=null && tasksDetails.Count != 0)
{
tasksDetails.ForEach(x => { x.IsHasSend = true; });
var update_Result= await _inStockTaskRepositories.UpdateRange(tasksDetails);
if (!update_Result)
{
_logger.LogInformation("发送消息:失败-修改任务明细->" + JsonConvert.SerializeObject(tasksDetails));
}
}
}
}