|
|
@ -28846,7 +28846,7 @@ namespace TradeManageNew
|
|
|
|
[WebMethod(EnableSession = true)]
|
|
|
|
[WebMethod(EnableSession = true)]
|
|
|
|
public APIReturnModel OrderUsedSalePlatformPublish(List<int> Ids)
|
|
|
|
public APIReturnModel OrderUsedSalePlatformPublish(List<int> Ids)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// PagesNew.Login(base.Session);
|
|
|
|
PagesNew.Login(base.Session);
|
|
|
|
bool lockTaken = false;
|
|
|
|
bool lockTaken = false;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
@ -28887,16 +28887,6 @@ namespace TradeManageNew
|
|
|
|
continue;
|
|
|
|
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);
|
|
|
|
var postFee = db.HW_PostFee.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId);
|
|
|
@ -28921,7 +28911,24 @@ namespace TradeManageNew
|
|
|
|
postFee.Fee8,
|
|
|
|
postFee.Fee8,
|
|
|
|
}.Where(x => x != null).ToList();
|
|
|
|
}.Where(x => x != null).ToList();
|
|
|
|
var feeCost = fees.Any() ? fees.Min() : 0;
|
|
|
|
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)
|
|
|
|
if (feeCost <= 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
db.DT_OrderUsedSalePlatform.Where(x => x.Id == orderUsedSalePlatform.Id)
|
|
|
|
db.DT_OrderUsedSalePlatform.Where(x => x.Id == orderUsedSalePlatform.Id)
|
|
|
@ -28959,7 +28966,7 @@ namespace TradeManageNew
|
|
|
|
ProductType = shopifyProductProfile?.Category,
|
|
|
|
ProductType = shopifyProductProfile?.Category,
|
|
|
|
Tags = shopifyProductProfile?.Tags,
|
|
|
|
Tags = shopifyProductProfile?.Tags,
|
|
|
|
Weight = product.Weight.Value,
|
|
|
|
Weight = product.Weight.Value,
|
|
|
|
JYPrice = product.JYPrice.Value, //product.JYPrice.Value,
|
|
|
|
JYPrice = jyprice, //product.JYPrice.Value,
|
|
|
|
ShippingFee = feeCost.Value, //feeCost.Value,
|
|
|
|
ShippingFee = feeCost.Value, //feeCost.Value,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -29025,7 +29032,7 @@ namespace TradeManageNew
|
|
|
|
ProductType = shopifyProductProfile?.Category,
|
|
|
|
ProductType = shopifyProductProfile?.Category,
|
|
|
|
Tags = shopifyProductProfile?.Tags,
|
|
|
|
Tags = shopifyProductProfile?.Tags,
|
|
|
|
Weight = product.Weight.Value,
|
|
|
|
Weight = product.Weight.Value,
|
|
|
|
JYPrice = product.JYPrice.Value,// product.JYPrice.Value,
|
|
|
|
JYPrice = jyprice,// product.JYPrice.Value,
|
|
|
|
ShippingFee= feeCost.Value,// feeCost.Value
|
|
|
|
ShippingFee= feeCost.Value,// feeCost.Value
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Variants = new Variants
|
|
|
|
Variants = new Variants
|
|
|
@ -29224,10 +29231,10 @@ namespace TradeManageNew
|
|
|
|
// Shopify客户端 删除产品变体
|
|
|
|
// Shopify客户端 删除产品变体
|
|
|
|
var shopifyApiClient = new ShopifyAPIClient();
|
|
|
|
var shopifyApiClient = new ShopifyAPIClient();
|
|
|
|
var productVariantRes = shopifyApiClient.DeleteProductVariantAsync(new Body3
|
|
|
|
var productVariantRes = shopifyApiClient.DeleteProductVariantAsync(new Body3
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProductId = shopifyProductGoodsMap.ShopifyProductId,
|
|
|
|
ProductId = shopifyProductGoodsMap.ShopifyProductId,
|
|
|
|
Code = item.ProductCode,
|
|
|
|
Code = item.ProductCode,
|
|
|
|
}).ConfigureAwait(false)
|
|
|
|
}).ConfigureAwait(false)
|
|
|
|
.GetAwaiter()
|
|
|
|
.GetAwaiter()
|
|
|
|
.GetResult();
|
|
|
|
.GetResult();
|
|
|
|
|
|
|
|
|
|
|
@ -29938,7 +29945,8 @@ namespace TradeManageNew
|
|
|
|
TotalNetCharge = rateDetail.TotalNetCharge?? 0m,
|
|
|
|
TotalNetCharge = rateDetail.TotalNetCharge?? 0m,
|
|
|
|
OriginJson = JsonConvert.SerializeObject(response),
|
|
|
|
OriginJson = JsonConvert.SerializeObject(response),
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
IsDeleted = false
|
|
|
|
IsDeleted = false,
|
|
|
|
|
|
|
|
imgList= imagePath
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//记录返回结果
|
|
|
|
//记录返回结果
|
|
|
@ -30004,6 +30012,50 @@ namespace TradeManageNew
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 保存退货订单渠道
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[WebMethod(EnableSession = true)]
|
|
|
|
|
|
|
|
public APIReturnModel SaveOrderUsedSaleService(int UsedSalePlatformId, int UsedSaleApplyId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
using (var db = new TradeUsedSale.Repositories.ErpDbContext())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var orderUsedSaleApplyDtos = db.DT_OrderUsedSaleApply.Where(x => x.Id == UsedSaleApplyId &&
|
|
|
|
|
|
|
|
x.IsDeleted == false)
|
|
|
|
|
|
|
|
.Select(o => new OrderUsedSaleApplyDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Id = o.Id,
|
|
|
|
|
|
|
|
UsedSaleBarCode = o.UsedSaleBarCode,
|
|
|
|
|
|
|
|
ServiceType = o.ServiceType,
|
|
|
|
|
|
|
|
TrackingCode = o.TrackingCode,
|
|
|
|
|
|
|
|
TotalNetCharge = o.TotalNetCharge,
|
|
|
|
|
|
|
|
CreationTime = o.CreationTime,
|
|
|
|
|
|
|
|
imgList=o.imgList
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
|
|
|
if (orderUsedSaleApplyDtos!=null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
db.DT_OrderUsedSalePlatform.Where(x => x.Id == UsedSalePlatformId)
|
|
|
|
|
|
|
|
.Set(x => x.ServiceType, orderUsedSaleApplyDtos.ServiceType)
|
|
|
|
|
|
|
|
.Set(x => x.imgList, orderUsedSaleApplyDtos.imgList)
|
|
|
|
|
|
|
|
.Set(x => x.outboundTrackCode, orderUsedSaleApplyDtos.TrackingCode)
|
|
|
|
|
|
|
|
.Update();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new APIReturnModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Code = 1,
|
|
|
|
|
|
|
|
Message = "Success",
|
|
|
|
|
|
|
|
Datas = JsonConvert.SerializeObject(orderUsedSaleApplyDtos)
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 自提填写预约时间
|
|
|
|
/// 自提填写预约时间
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -30597,27 +30649,36 @@ namespace TradeManageNew
|
|
|
|
|
|
|
|
|
|
|
|
#region 分页查询
|
|
|
|
#region 分页查询
|
|
|
|
[WebMethod(EnableSession = true)]
|
|
|
|
[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, string skuid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PagesNew.Login(this.Session);
|
|
|
|
//PagesNew.Login(this.Session);
|
|
|
|
string where = CustomIO.Base64StringToString(cs);
|
|
|
|
string shopid = CustomIO.Base64StringToString(cs);
|
|
|
|
if (where != "") where = "where " + where.Substring(4);
|
|
|
|
string Sku = CustomIO.Base64StringToString(sku);
|
|
|
|
|
|
|
|
string SkuId = CustomIO.Base64StringToString(skuid);
|
|
|
|
|
|
|
|
//if (where != "") where = "where " + where.Substring(4);
|
|
|
|
var resultModel = new JsonModel<List<TemuShopGoodActive>>();
|
|
|
|
var resultModel = new JsonModel<List<TemuShopGoodActive>>();
|
|
|
|
int RowCount = 0;
|
|
|
|
int RowCount = 0;
|
|
|
|
resultModel.DataSource = DataNew.GetListTemuShopGoodActive(where, PageIndex, PageSize, "", out RowCount);
|
|
|
|
resultModel.DataSource = DataNew.GetListTemuShopGoodActive_Test(shopid, Sku, SkuId);
|
|
|
|
resultModel.RowCount = RowCount;
|
|
|
|
//resultModel.RowCount = RowCount;
|
|
|
|
|
|
|
|
|
|
|
|
string ids = "";
|
|
|
|
string ids = "";
|
|
|
|
if (resultModel.DataSource != null)
|
|
|
|
if (resultModel.DataSource != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var omd in resultModel.DataSource)
|
|
|
|
RowCount = resultModel.DataSource.Count();
|
|
|
|
|
|
|
|
resultModel.DataSource = resultModel.DataSource.Take(PageSize).Skip(PageSize * (PageIndex - 1)).ToList();
|
|
|
|
|
|
|
|
var Active= DataNew.GetListTemuShopGoodActive();
|
|
|
|
|
|
|
|
//foreach (var omd in resultModel.DataSource)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// ids += omd.ID + ",";
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
foreach (var omd in Active)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ids += omd.ID + ",";
|
|
|
|
ids += omd.ID + ",";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ids = ids.TrimEnd(',');
|
|
|
|
ids = ids.TrimEnd(',');
|
|
|
|
if (ids != "")
|
|
|
|
if (ids != "")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dlist = DataNew.GetListTemuShopGoodActiveDetail(ids);
|
|
|
|
var dlist = DataNew.GetListTemuShopGoodActiveDetail(ids, Sku, SkuId);
|
|
|
|
if (dlist != null)
|
|
|
|
if (dlist != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -30655,8 +30716,8 @@ namespace TradeManageNew
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resultModel.RowCount = RowCount;
|
|
|
|
return resultModel;
|
|
|
|
return resultModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|