优化发送
This commit is contained in:
@@ -237,6 +237,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var update_DetailsIds = new List<int>();
|
var update_DetailsIds = new List<int>();
|
||||||
|
var update_InstockIds = new List<int>();
|
||||||
|
|
||||||
var (sendContentList,updateList) = await this.GetSendContent();
|
var (sendContentList,updateList) = await this.GetSendContent();
|
||||||
|
|
||||||
@@ -288,23 +289,39 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_DetailsIds = updateList.GroupBy(x=>x.Id).Select(x => x.Key).ToList();
|
update_DetailsIds = updateList.GroupBy(x=>x.Id).Select(x => x.Key).ToList();
|
||||||
//任务明细:修改的
|
//var inStockDetails = await _inStockRepositories.GetDetailsList(update_DetailsIds);
|
||||||
//var tasksDetails = await _inStockTaskRepositories.GetDetailsList(update_taskDetailsIds);
|
//if (inStockDetails != null && inStockDetails.Count != 0)
|
||||||
var inStockDetails = await _inStockRepositories.GetDetailsList(update_DetailsIds);
|
//{
|
||||||
if (inStockDetails != null && inStockDetails.Count != 0)
|
// inStockDetails.ForEach(x => { x.IsHasSend = true; });
|
||||||
{
|
|
||||||
inStockDetails.ForEach(x => { x.IsHasSend = true; });
|
|
||||||
|
|
||||||
var update_Result = await _inStockRepositories.UpdateRange(inStockDetails);
|
// var update_Result = await _inStockRepositories.UpdateRange(inStockDetails);
|
||||||
if (!update_Result)
|
// if (!update_Result)
|
||||||
|
// {
|
||||||
|
// _logger.LogInformation("发送消息:失败-修改入库明细->:" + JsonConvert.SerializeObject(inStockDetails));
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// _logger.LogInformation("发送消息:成功-修改入库明细->:" + JsonConvert.SerializeObject(inStockDetails));
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
update_InstockIds = updateList.GroupBy(x => x.Fid).Select(x => x.Key).ToList();
|
||||||
|
var inStocks = await _inStockRepositories.GetList(update_InstockIds);
|
||||||
|
if (inStocks != null && inStocks.Count != 0)
|
||||||
|
{
|
||||||
|
inStocks.SelectMany(x => x.Details).Where(x=> update_DetailsIds.Contains(x.Id)).ToList().ForEach(x => { x.IsHasSend = true; });
|
||||||
|
var isSuccess = await _inStockRepositories.UpdateRange(inStocks);
|
||||||
|
if (!isSuccess)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("发送消息:失败-修改入库明细->:" + JsonConvert.SerializeObject(inStockDetails));
|
_logger.LogInformation("发送消息:失败-修改入库明细->:" + JsonConvert.SerializeObject(inStocks.SelectMany(x => x.Details).Where(x => update_DetailsIds.Contains(x.Id)).ToList()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogInformation("发送消息:成功-修改入库明细->:" + JsonConvert.SerializeObject(inStockDetails));
|
_logger.LogInformation("发送消息:成功-修改入库明细->:" + JsonConvert.SerializeObject(inStocks.SelectMany(x => x.Details).Where(x => update_DetailsIds.Contains(x.Id)).ToList()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_logger.LogInformation("发送消息:暂无可发送的通知明细");
|
_logger.LogInformation("发送消息:暂无可发送的通知明细");
|
||||||
|
|||||||
Reference in New Issue
Block a user