master
wufan 2 months ago
parent 09854f01b4
commit a8a2f887f2

@ -1452,25 +1452,20 @@ namespace TradeManageNew.OuterService
}
var warehouseLocation = WarehouseLocation.East;
var storePositionQueryable = db.CK_StorePostion.AsQueryable();
if (user.WorkDesc == "东仓")
if (user.WorkDesc == "西仓")
{
storePositionQueryable = storePositionQueryable.Where(x => x.StoreId == 11);
}
else
{
storePositionQueryable = storePositionQueryable.Where(x => x.StoreId == 6);
warehouseLocation = WarehouseLocation.West;
}
var storePosition = storePositionQueryable.FirstOrDefault(x => x.PostionCode == input.WarehousePositionCode.Trim());
var storePosition = db.CK_StorePostion.FirstOrDefault(x =>
x.PostionCode == input.WarehousePositionCode.Trim());
if (storePosition is null)
{
throw new Exception(
$"There is no storage location encoded as {input.WarehousePositionCode}");
}
var sku = db.HW_GoodsDetail.FirstOrDefault(x => x.DetailId==input.SkuId);
var sku = db.HW_GoodsDetail.FirstOrDefault(x => x.DetailId == input.SkuId);
if (sku is null)
{
@ -1479,6 +1474,10 @@ namespace TradeManageNew.OuterService
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == sku.GoodsId);
if (product is null)
{
throw new Exception($"There is no product with ID {sku.GoodsId}");
}
var newOrderUsedSalePlatform =
new TradeUsedSale.Repositories.Models.DT_OrderUsedSalePlatform
{
@ -1486,7 +1485,8 @@ namespace TradeManageNew.OuterService
ProductCode = product.GoodsCode,
SkuId = sku.DetailId,
SkuCode = sku.SKU1,
BarCode = null,
BarCode =string.Empty,
IsPrinted = false,
IsPublished = false,
WarehouseLocation = warehouseLocation,
WarehousePositionId = storePosition.PostionId,
@ -1497,6 +1497,12 @@ namespace TradeManageNew.OuterService
};
var newOrderUsedSalePlatformId = db.InsertWithInt32Identity(newOrderUsedSalePlatform);
var barCode =
$"{(warehouseLocation == WarehouseLocation.East ? "E" : "W")}{newOrderUsedSalePlatformId.ToString().PadLeft(7, '0')}";
db.DT_OrderUsedSalePlatform.Where(x => x.Id == newOrderUsedSalePlatformId)
.Set(x => x.BarCode, barCode)
.Update();
md.Code = "100";
md.Result = "Success";

@ -33,6 +33,11 @@ namespace TradeUsedSale.Repositories.Models
/// </summary>
public string BarCode { get; set; }
/// <summary>
/// 是否已打印
/// </summary>
public bool IsPrinted { get; set; }
/// <summary>
/// 是否已推送
/// </summary>

Loading…
Cancel
Save