chenwenkai 2 weeks ago
commit d1935d521b

@ -7174,7 +7174,7 @@ end
} }
if (!string.IsNullOrEmpty(GoodsCode)) if (!string.IsNullOrEmpty(GoodsCode))
{ {
where += " and GoodsCode like '%" + GoodsCode + "%' "; where += " and GoodsCode='" + GoodsCode + "' ";
} }
if (!string.IsNullOrEmpty(Name)) if (!string.IsNullOrEmpty(Name))
{ {
@ -28582,19 +28582,6 @@ end";
var dt = db.ExecuteDataTable(cmd); var dt = db.ExecuteDataTable(cmd);
return dt.ToList<TemuShopGoodPrice>(); return dt.ToList<TemuShopGoodPrice>();
} }
public static List<TemuShopGoodActive> GetTemuShopGoodActive(int shopid, string sku, string SKUID)
{
var sql = @" select * from TemuShopGoodActive where Shopid=@shopid and SKU=@sku and SPUID=@SKUID ";
var db = DatabaseFactory.CreateDatabase();
var cmd = db.GetSqlStringCommand(sql);
db.AddInParameter(cmd, "@shopid", DbType.Int32, shopid);
db.AddInParameter(cmd, "@SKU", DbType.String, sku);
db.AddInParameter(cmd, "@SKUID", DbType.String, SKUID);
var dt = db.ExecuteDataTable(cmd);
return dt.ToList<TemuShopGoodActive>();
}
public static TemuShopGoodPrice GetTemuShopGoodPriceOne(int shopid, string spuid) public static TemuShopGoodPrice GetTemuShopGoodPriceOne(int shopid, string spuid)
{ {
var sql = @" select top 1 * from TemuShopGoodPrice where Shopid=@shopid and spuid=@spuid "; var sql = @" select top 1 * from TemuShopGoodPrice where Shopid=@shopid and spuid=@spuid ";
@ -31117,7 +31104,7 @@ end
#endregion #endregion
#region 保存TemuShopGoodActive #region 保存
public static int Save_TemuShopGoodActive(TemuShopGoodActive Model) public static int Save_TemuShopGoodActive(TemuShopGoodActive Model)
{ {
string tsql = @" string tsql = @"
@ -31216,7 +31203,6 @@ end";
return a; return a;
} }
#endregion #endregion
#region 删除 #region 删除
public static void Delete_TemuShopGoodActive(int ID) public static void Delete_TemuShopGoodActive(int ID)
@ -31392,5 +31378,4 @@ where c.SKU1=@SKU";
} }
#endregion #endregion
} }
} }

@ -23,7 +23,6 @@ using System.Windows.Forms;
using TradeData; using TradeData;
using NetLibrary.Data; using NetLibrary.Data;
using NetLibrary.ReportPrint; using NetLibrary.ReportPrint;
using TradeManageNew.APIClients.ShopifyAPI;
namespace TradeManageNew.OuterService namespace TradeManageNew.OuterService
{ {
@ -1749,31 +1748,10 @@ namespace TradeManageNew.OuterService
if (orderUsedSalePlatform is null) if (orderUsedSalePlatform is null)
{ {
//throw new Exception( throw new Exception(
// $"No barcode for {input.BarCode} to be shipped used sale item exists"); $"No barcode for {input.BarCode} to be shipped used sale item exists");
orderUsedSalePlatform= db.DT_OrderUsedSalePlatform.FirstOrDefault(x =>
x.BarCode == input.BarCode);
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId);
var result = new GetPickupOrderUsedSalePlatformDto
{
Id = orderUsedSalePlatform.Id,
ProductDescription = product?.GoodsEnglisgName,
SkuId = orderUsedSalePlatform.SkuId,
SkuCode = orderUsedSalePlatform.SkuCode,
BarCode = orderUsedSalePlatform.BarCode,
};
md.Code = "100";
md.Result = "Success";
md.Data = JsonConvert.SerializeObject(result);
} }
else
{
var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId); var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId);
var result = new GetPickupOrderUsedSalePlatformDto var result = new GetPickupOrderUsedSalePlatformDto
@ -1787,7 +1765,7 @@ namespace TradeManageNew.OuterService
BarCode = orderUsedSalePlatform.BarCode, BarCode = orderUsedSalePlatform.BarCode,
IsPrinted = orderUsedSalePlatform.IsPrinted, IsPrinted = orderUsedSalePlatform.IsPrinted,
Status = orderUsedSalePlatform.Status, Status = orderUsedSalePlatform.Status,
WarehouseLocation = orderUsedSalePlatform.WarehouseLocation, WarehouseLocation =orderUsedSalePlatform.WarehouseLocation,
WarehousePositionId = orderUsedSalePlatform.WarehousePositionId, WarehousePositionId = orderUsedSalePlatform.WarehousePositionId,
WarehousePositionCode = orderUsedSalePlatform.WarehousePositionCode, WarehousePositionCode = orderUsedSalePlatform.WarehousePositionCode,
ImageUrls = JsonConvert.DeserializeObject<List<string>>(orderUsedSalePlatform.ImageUrls), ImageUrls = JsonConvert.DeserializeObject<List<string>>(orderUsedSalePlatform.ImageUrls),
@ -1801,9 +1779,6 @@ namespace TradeManageNew.OuterService
md.Result = "Success"; md.Result = "Success";
md.Data = JsonConvert.SerializeObject(result); md.Data = JsonConvert.SerializeObject(result);
} }
}
} }
} }
//xsx OrderReturn结合GetPickupOrderUsedSalePlatform //xsx OrderReturn结合GetPickupOrderUsedSalePlatform
@ -2036,43 +2011,18 @@ namespace TradeManageNew.OuterService
using (var db = new ErpDbContext()) using (var db = new ErpDbContext())
{ {
var exPlatformList = db.DT_OrderUsedSalePlatform.Where(x =>
input.Ids.Contains(x.Id))
.ToList();
//如果传入的状态不是4并且之前的状态是2则需要删除变体
foreach (var i in exPlatformList)
{
if (input.Status != 4 && (int)i.Status == 2)
{
var shopifyApiClient = new ShopifyAPIClient();
var productVariantRes = shopifyApiClient.DeleteProductVariantAsync(new Body3
{
ProductId = i.ProductId.ToString(),
Code = i.ProductCode,
}).ConfigureAwait(false)
.GetAwaiter()
.GetResult();
//if (productVariantRes.Success != true)
//{
// throw new Exception($"删除Shopify条码[{item.ProductCode}]变体失败,{productVariantRes.Message}");
//}
}
}
var orderUsedSalePlatformList = db.DT_OrderUsedSalePlatform.Where(x => var orderUsedSalePlatformList = db.DT_OrderUsedSalePlatform.Where(x =>
input.Ids.Contains(x.Id)) input.Ids.Contains(x.Id)
&& x.Status == UsedSalePlatformStatus.PendingPickup)
.ToList(); .ToList();
if (orderUsedSalePlatformList.Any()) if (orderUsedSalePlatformList.Any())
{ {
db.DT_OrderUsedSalePlatform.Where(x => db.DT_OrderUsedSalePlatform.Where(x =>
input.Ids.Contains(x.Id)) input.Ids.Contains(x.Id)
&& x.Status == UsedSalePlatformStatus.PendingPickup)
.Set(x => x.ShippingMethod, ShippingMethod.SelfPickup) .Set(x => x.ShippingMethod, ShippingMethod.SelfPickup)
.Set(x => x.Status, (UsedSalePlatformStatus)input.Status) .Set(x => x.Status, UsedSalePlatformStatus.Sold)
.Set(x => x.LastModifierId, input.UserId) .Set(x => x.LastModifierId, input.UserId)
.Set(x => x.LastModificationTime, DateTime.Now) .Set(x => x.LastModificationTime, DateTime.Now)
.Set(x => x.imgList, input.imgList) .Set(x => x.imgList, input.imgList)

@ -22,15 +22,6 @@ namespace TradeUsedSale.Enums
/// <summary> /// <summary>
/// 售卖完成 /// 售卖完成
/// </summary> /// </summary>
[Description("售卖完成")] Sold, [Description("售卖完成")] Sold
/// <summary>
/// 使用配件
/// </summary>
[Description("使用配件")] PeiJian ,
/// <summary>
/// 现场出售
/// </summary>
[Description("现场出售")] XcChuShou
} }
} }
Loading…
Cancel
Save