|
|
|
@ -1452,18 +1452,13 @@ 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(
|
|
|
|
@ -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";
|
|
|
|
|