打印日志
This commit is contained in:
@@ -150,6 +150,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Result> GenerateMoveBox(List<MoveBoxRecord> dtoDatas, bool isTransaction)
|
public async Task<Result> GenerateMoveBox(List<MoveBoxRecord> dtoDatas, bool isTransaction)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("移箱-箱库存变更1:" + JsonConvert.SerializeObject(dtoDatas));
|
||||||
//1.判断来源数据是否存在
|
//1.判断来源数据是否存在
|
||||||
if (dtoDatas == null || dtoDatas.Count == 0)
|
if (dtoDatas == null || dtoDatas.Count == 0)
|
||||||
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
|
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
|
||||||
@@ -824,6 +825,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
var add_entitys = new List<BoxInventory>();
|
var add_entitys = new List<BoxInventory>();
|
||||||
var InventoryDetailsGenerateDto = new List<InventoryDetailsGenerateDto>();
|
var InventoryDetailsGenerateDto = new List<InventoryDetailsGenerateDto>();
|
||||||
|
|
||||||
|
_logger.LogInformation("移箱-箱库存变更2:" + JsonConvert.SerializeObject(dtoDatas));
|
||||||
//3.遍历:dto
|
//3.遍历:dto
|
||||||
foreach (var dto in dtoDatas)
|
foreach (var dto in dtoDatas)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -22,11 +24,13 @@ namespace WMS.Web.Domain.Services
|
|||||||
private readonly IBoxRepositories _boxRepositories;
|
private readonly IBoxRepositories _boxRepositories;
|
||||||
private readonly ISerialNumbersRepositories _serialNumbersRepositories;
|
private readonly ISerialNumbersRepositories _serialNumbersRepositories;
|
||||||
private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories;
|
private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories;
|
||||||
|
private readonly ILogger<InventoryDetailsService> _logger;
|
||||||
public InventoryDetailsService(IMapper mapper, IBoxRepositories boxRepositories,
|
public InventoryDetailsService(IMapper mapper, IBoxRepositories boxRepositories,
|
||||||
ISerialNumbersRepositories serialNumbersRepositories,
|
ISerialNumbersRepositories serialNumbersRepositories, ILogger<InventoryDetailsService> logger,
|
||||||
IInventoryDetailsRepositories inventoryDetailsRepositories)
|
IInventoryDetailsRepositories inventoryDetailsRepositories)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
|
_logger = logger;
|
||||||
_boxRepositories = boxRepositories;
|
_boxRepositories = boxRepositories;
|
||||||
_inventoryDetailsRepositories = inventoryDetailsRepositories;
|
_inventoryDetailsRepositories = inventoryDetailsRepositories;
|
||||||
_serialNumbersRepositories = serialNumbersRepositories;
|
_serialNumbersRepositories = serialNumbersRepositories;
|
||||||
@@ -50,7 +54,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
var add_entitys = new List<InventoryDetails>();
|
var add_entitys = new List<InventoryDetails>();
|
||||||
var update_entitys = new List<InventoryDetails>();
|
var update_entitys = new List<InventoryDetails>();
|
||||||
|
_logger.LogInformation(" 生成:即时库存明细:" + JsonConvert.SerializeObject(dtos));
|
||||||
//2.遍历
|
//2.遍历
|
||||||
foreach (var dto in dtos)
|
foreach (var dto in dtos)
|
||||||
{
|
{
|
||||||
@@ -62,6 +66,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
x.OrgCode==dto.OrgCode).FirstOrDefault();
|
x.OrgCode==dto.OrgCode).FirstOrDefault();
|
||||||
if (currentDetail == null)
|
if (currentDetail == null)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation(" 生成:即时库存明细-->明细NULL:" + JsonConvert.SerializeObject(dto));
|
||||||
//出库的时候,判断是否有库存,没有就返回错误
|
//出库的时候,判断是否有库存,没有就返回错误
|
||||||
if (dto.InventoryInOutType == (int)InventoryInOutType.Out)
|
if (dto.InventoryInOutType == (int)InventoryInOutType.Out)
|
||||||
return Result.ReFailure(ResultCodes.InventoryDetailsNoInventoryError);
|
return Result.ReFailure(ResultCodes.InventoryDetailsNoInventoryError);
|
||||||
@@ -71,6 +76,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation(" 生成:即时库存明细-->明细HAVE:" + JsonConvert.SerializeObject(currentDetail));
|
||||||
var entity = currentDetail;
|
var entity = currentDetail;
|
||||||
if (dto.InventoryInOutType == (int)InventoryInOutType.In)
|
if (dto.InventoryInOutType == (int)InventoryInOutType.In)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user