master
wufan 2 months ago
parent 09854f01b4
commit a8a2f887f2

@ -1452,25 +1452,20 @@ namespace TradeManageNew.OuterService
} }
var warehouseLocation = WarehouseLocation.East; 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; 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) if (storePosition is null)
{ {
throw new Exception( throw new Exception(
$"There is no storage location encoded as {input.WarehousePositionCode}"); $"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) if (sku is null)
{ {
@ -1479,6 +1474,10 @@ namespace TradeManageNew.OuterService
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == sku.GoodsId); 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 = var newOrderUsedSalePlatform =
new TradeUsedSale.Repositories.Models.DT_OrderUsedSalePlatform new TradeUsedSale.Repositories.Models.DT_OrderUsedSalePlatform
{ {
@ -1486,7 +1485,8 @@ namespace TradeManageNew.OuterService
ProductCode = product.GoodsCode, ProductCode = product.GoodsCode,
SkuId = sku.DetailId, SkuId = sku.DetailId,
SkuCode = sku.SKU1, SkuCode = sku.SKU1,
BarCode = null, BarCode =string.Empty,
IsPrinted = false,
IsPublished = false, IsPublished = false,
WarehouseLocation = warehouseLocation, WarehouseLocation = warehouseLocation,
WarehousePositionId = storePosition.PostionId, WarehousePositionId = storePosition.PostionId,
@ -1497,7 +1497,13 @@ namespace TradeManageNew.OuterService
}; };
var newOrderUsedSalePlatformId = db.InsertWithInt32Identity(newOrderUsedSalePlatform); 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.Code = "100";
md.Result = "Success"; md.Result = "Success";
md.Data = JsonConvert.SerializeObject(newOrderUsedSalePlatform); md.Data = JsonConvert.SerializeObject(newOrderUsedSalePlatform);

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

Loading…
Cancel
Save