shopify上传商品

master^2
chenwenkai 22 hours ago
parent afef83eb11
commit b55a77755e

@ -28846,7 +28846,7 @@ namespace TradeManageNew
[WebMethod(EnableSession = true)]
public APIReturnModel OrderUsedSalePlatformPublish(List<int> Ids)
{
// PagesNew.Login(base.Session);
PagesNew.Login(base.Session);
bool lockTaken = false;
try
@ -28887,16 +28887,6 @@ namespace TradeManageNew
continue;
}
//建议售价
if (product.JYPrice is null || product.JYPrice <= 0)
{
var message = $"产品[{product.GoodsCode}]无建议售价无法推送至Shopify";
db.DT_OrderUsedSalePlatform.Where(x => x.Id == orderUsedSalePlatform.Id)
.Set(x => x.PublishMessage, message)
.Update();
continue;
}
//预估运费
var postFee = db.HW_PostFee.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId);
@ -28921,7 +28911,24 @@ namespace TradeManageNew
postFee.Fee8,
}.Where(x => x != null).ToList();
var feeCost = fees.Any() ? fees.Min() : 0;
decimal jyprice = 0m;
decimal feerate = 6.5m;
//建议售价
if (product.JYPrice is null || product.JYPrice <= 0)
{
//var message = $"产品[{product.GoodsCode}]无建议售价无法推送至Shopify";
//db.DT_OrderUsedSalePlatform.Where(x => x.Id == orderUsedSalePlatform.Id)
// .Set(x => x.PublishMessage, message)
// .Update();
//continue;
decimal? sumJy = (Convert.ToDecimal(product.InPrice) / feerate + (feerate * Convert.ToDecimal(product.InPrice) * Convert.ToDecimal(0.01) / feerate) + product.Solid * 130 + feeCost);
jyprice = Convert.ToDecimal(sumJy) / 0.8m;
}
else
{
jyprice = Convert.ToDecimal(product.JYPrice);
}
if (feeCost <= 0)
{
db.DT_OrderUsedSalePlatform.Where(x => x.Id == orderUsedSalePlatform.Id)
@ -28959,7 +28966,7 @@ namespace TradeManageNew
ProductType = shopifyProductProfile?.Category,
Tags = shopifyProductProfile?.Tags,
Weight = product.Weight.Value,
JYPrice = product.JYPrice.Value, //product.JYPrice.Value,
JYPrice = jyprice, //product.JYPrice.Value,
ShippingFee = feeCost.Value, //feeCost.Value,
}
};
@ -29025,7 +29032,7 @@ namespace TradeManageNew
ProductType = shopifyProductProfile?.Category,
Tags = shopifyProductProfile?.Tags,
Weight = product.Weight.Value,
JYPrice = product.JYPrice.Value,// product.JYPrice.Value,
JYPrice = jyprice,// product.JYPrice.Value,
ShippingFee= feeCost.Value,// feeCost.Value
},
Variants = new Variants
@ -30593,10 +30600,11 @@ namespace TradeManageNew
#region 分页查询
[WebMethod(EnableSession = true)]
public JsonModel<List<TemuShopGoodActive>> GetListTemuShopGoodActive(string cs, int PageIndex, int PageSize)
public JsonModel<List<TemuShopGoodActive>> GetListTemuShopGoodActive(string cs, int PageIndex, int PageSize, string sku)
{
PagesNew.Login(this.Session);
//PagesNew.Login(this.Session);
string where = CustomIO.Base64StringToString(cs);
string Sku = CustomIO.Base64StringToString(sku);
if (where != "") where = "where " + where.Substring(4);
var resultModel = new JsonModel<List<TemuShopGoodActive>>();
int RowCount = 0;
@ -30613,7 +30621,7 @@ namespace TradeManageNew
ids = ids.TrimEnd(',');
if (ids != "")
{
var dlist = DataNew.GetListTemuShopGoodActiveDetail(ids);
var dlist = DataNew.GetListTemuShopGoodActiveDetail(ids, Sku);
if (dlist != null)
{

@ -31391,10 +31391,19 @@ delete from TemuShopGoodActiveDetail where Id=@Id";
}
#endregion
#region 返回列表
public static List<TemuShopGoodActiveDetail> GetListTemuShopGoodActiveDetail(string ids)
public static List<TemuShopGoodActiveDetail> GetListTemuShopGoodActiveDetail(string ids, string Sku)
{
string tsql = string.Empty;
if (!string.IsNullOrEmpty(Sku))
{
tsql = "select * from TemuShopGoodActiveDetail where ActiveId in (" + ids + ") and sku like '%" + Sku + "%' order by id";
}
else
{
tsql = "select * from TemuShopGoodActiveDetail where ActiveId in (" + ids + ") order by id";
}
//string tsql = "select a.ID,a.Shopid,a.SKU,a.SPUID,a.BasePrice,a.CreateUserId,a.CreateTime,a.PostPrice,a.State from TemuShopGoodActive";
string tsql = "select * from TemuShopGoodActiveDetail where ActiveId in (" + ids + ") order by id";
//string tsql = "select * from TemuShopGoodActiveDetail where ActiveId in (" + ids + ") and sku like '%"+ Sku + "%' order by id";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetSqlStringCommand(tsql);
DataTable tb = db.ExecuteDataTable(cmd);

Loading…
Cancel
Save