From 2249b805c56996259c9c426402f4ec1f5b32476a Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Mon, 17 Feb 2025 14:44:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=80=80=E8=B4=A7=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=8Ctemu=E6=B4=BB=E5=8A=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TradeManageNew/DataNew.cs | 13 ++ TradeManageNew/HuoWuServiceNew.asmx.cs | 108 ++++++++++++++++ .../SelfPickupOrderUsedSalePlatformInput.cs | 4 + .../OrderUsedSalePlatformPageDto.cs | 4 + .../OuterService/ShageService.ashx.cs | 117 +++++++++++++----- TradeUsedSale/Enums/UsedSalePlatformStatus.cs | 11 +- .../Models/DT_OrderUsedSalePlatform.cs | 5 + 7 files changed, 229 insertions(+), 33 deletions(-) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index 56e9bb8..ca32513 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -28582,6 +28582,19 @@ end"; var dt = db.ExecuteDataTable(cmd); return dt.ToList(); } + + public static List 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(); + } public static TemuShopGoodPrice GetTemuShopGoodPriceOne(int shopid, string spuid) { var sql = @" select top 1 * from TemuShopGoodPrice where Shopid=@shopid and spuid=@spuid "; diff --git a/TradeManageNew/HuoWuServiceNew.asmx.cs b/TradeManageNew/HuoWuServiceNew.asmx.cs index 6e2df2f..e23b636 100644 --- a/TradeManageNew/HuoWuServiceNew.asmx.cs +++ b/TradeManageNew/HuoWuServiceNew.asmx.cs @@ -7385,6 +7385,114 @@ namespace TradeManageNew } } + //temu 活动导入 + [WebMethod(EnableSession = true)] + public APIReturnModel ImportTemuHuoDongPrices(string filePath) + { + PagesNew.Login(this.Session); + var userid = Convert.ToInt32(base.Session["UserId"]); + string ServerFileName = AppDomain.CurrentDomain.BaseDirectory + filePath; + var rmodel = new APIReturnModel(); + try + { + MicrosoftExcel excel = new MicrosoftExcel(); + DataTable tb = excel.ImportExcel(ServerFileName); + + string error = ""; + if (tb.Columns.Contains("店铺名") == false) { error = error + "导入模板的 店铺名 列不存在"; } + if (tb.Columns.Contains("SKU") == false) { error = error + "导入模板的 SKU 列不存在"; } + if (tb.Columns.Contains("SKUID") == false) { error = error + "导入模板的 SKUID 列不存在"; } + if (tb.Columns.Contains("价格") == false) { error = error + "导入模板的 价格 列不存在"; } + + if (string.IsNullOrEmpty(error) == false) + { + rmodel.Code = 0; + rmodel.Message = error; + } + var goods = new List(); + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < tb.Rows.Count; i++) + { + var shopName = tb.Rows[i]["店铺名"].ToString(); + if (string.IsNullOrEmpty(shopName)) + { + sb.Append("第" + (i + 1).ToString() + "行店铺名不能为空;"); + continue; + } + var shop = DataNew.GetShopByShopName(shopName); + if (shop == null) + { + sb.Append("第" + (i + 1).ToString() + "行店铺名:" + shopName + "不存在;"); + continue; + } + + var sku = tb.Rows[i]["SKU"].ToString(); + if (string.IsNullOrEmpty(sku)) + { + sb.Append("第" + (i + 1).ToString() + "行SKU不能为空;"); + continue; + } + + + var SKUID = tb.Rows[i]["SKUID"].ToString(); + if (string.IsNullOrEmpty(SKUID)) + { + sb.Append("第" + (i + 1).ToString() + "行SKUID不能为空;"); + continue; + } + + if (string.IsNullOrEmpty(tb.Rows[i]["价格"].ToString())) + { + sb.Append("第" + (i + 1).ToString() + "行价格不能为空;"); + continue; + } + + var data = DataNew.GetTemuShopGoodPrice(shop.ShopId.Value, sku, SKUID); + if (data != null) + { + sb.Append("第" + (i + 1).ToString() + "行已存在相同数据;"); + continue; + } + + var md = new TemuShopGoodActive() + { + Shopid = shop.ShopId.Value, + SPUID = SKUID, + SKU = sku, + BasePrice = Convert.ToDecimal(tb.Rows[i]["价格"]), + CreateUserId = userid, + }; + + goods.Add(md); + } + + if (sb.Length > 0) + { + rmodel.Code = 0; + rmodel.Message = sb.ToString(); + return rmodel; + } + + foreach (var md in goods) + { + DataNew.Save_TemuShopGoodActive(md); + } + + rmodel.Code = 1; + rmodel.Message = ""; + return rmodel; + } + catch (Exception ex) + { + rmodel.Code = 0; + rmodel.Message = ex.Message; + return rmodel; + } + } + + + [WebMethod(EnableSession = true)] public APIReturnModel DeleteTemuShopGoodPrice(int id) diff --git a/TradeManageNew/Models/Shage/SelfPickupOrderUsedSalePlatformInput.cs b/TradeManageNew/Models/Shage/SelfPickupOrderUsedSalePlatformInput.cs index f0de104..3d5fe08 100644 --- a/TradeManageNew/Models/Shage/SelfPickupOrderUsedSalePlatformInput.cs +++ b/TradeManageNew/Models/Shage/SelfPickupOrderUsedSalePlatformInput.cs @@ -7,5 +7,9 @@ namespace TradeManageNew.Models.Shage public List Ids { get; set; } public int UserId { get; set; } + + public int Status { get; set; } + + public string imgList { get; set; } } } \ No newline at end of file diff --git a/TradeManageNew/Models/ShopifyUsedSale/OrderUsedSalePlatformPageDto.cs b/TradeManageNew/Models/ShopifyUsedSale/OrderUsedSalePlatformPageDto.cs index ef0f3e5..113efa4 100644 --- a/TradeManageNew/Models/ShopifyUsedSale/OrderUsedSalePlatformPageDto.cs +++ b/TradeManageNew/Models/ShopifyUsedSale/OrderUsedSalePlatformPageDto.cs @@ -107,5 +107,9 @@ namespace TradeManageNew.Models.ShopifyUsedSale /// TrackingCode /// public string TrackingCode { get; set; } + /// + /// imgList + /// + public string imgList { get; set; } } } \ No newline at end of file diff --git a/TradeManageNew/OuterService/ShageService.ashx.cs b/TradeManageNew/OuterService/ShageService.ashx.cs index b2f134d..e499477 100644 --- a/TradeManageNew/OuterService/ShageService.ashx.cs +++ b/TradeManageNew/OuterService/ShageService.ashx.cs @@ -23,6 +23,7 @@ using System.Windows.Forms; using TradeData; using NetLibrary.Data; using NetLibrary.ReportPrint; +using TradeManageNew.APIClients.ShopifyAPI; namespace TradeManageNew.OuterService { @@ -1748,36 +1749,60 @@ namespace TradeManageNew.OuterService if (orderUsedSalePlatform is null) { - throw new Exception( - $"No barcode for {input.BarCode} to be shipped used sale item exists"); - } - - var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId); + //throw new Exception( + // $"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 + 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 { - Id = orderUsedSalePlatform.Id, - ProductId = orderUsedSalePlatform.ProductId, - ProductCode = orderUsedSalePlatform.ProductCode, - ProductDescription = product?.GoodsEnglisgName, - SkuId = orderUsedSalePlatform.SkuId, - SkuCode = orderUsedSalePlatform.SkuCode, - BarCode = orderUsedSalePlatform.BarCode, - IsPrinted = orderUsedSalePlatform.IsPrinted, - Status = orderUsedSalePlatform.Status, - WarehouseLocation =orderUsedSalePlatform.WarehouseLocation, - WarehousePositionId = orderUsedSalePlatform.WarehousePositionId, - WarehousePositionCode = orderUsedSalePlatform.WarehousePositionCode, - ImageUrls = JsonConvert.DeserializeObject>(orderUsedSalePlatform.ImageUrls), - ShippingMethod = orderUsedSalePlatform.ShippingMethod, - IsNew = orderUsedSalePlatform.IsNew, - CreationTime = orderUsedSalePlatform.CreationTime, - CreatorId = orderUsedSalePlatform.CreatorId - }; + var product = db.HW_GoodsInfo.FirstOrDefault(x => x.GoodsId == orderUsedSalePlatform.ProductId); + + var result = new GetPickupOrderUsedSalePlatformDto + { + Id = orderUsedSalePlatform.Id, + ProductId = orderUsedSalePlatform.ProductId, + ProductCode = orderUsedSalePlatform.ProductCode, + ProductDescription = product?.GoodsEnglisgName, + SkuId = orderUsedSalePlatform.SkuId, + SkuCode = orderUsedSalePlatform.SkuCode, + BarCode = orderUsedSalePlatform.BarCode, + IsPrinted = orderUsedSalePlatform.IsPrinted, + Status = orderUsedSalePlatform.Status, + WarehouseLocation = orderUsedSalePlatform.WarehouseLocation, + WarehousePositionId = orderUsedSalePlatform.WarehousePositionId, + WarehousePositionCode = orderUsedSalePlatform.WarehousePositionCode, + ImageUrls = JsonConvert.DeserializeObject>(orderUsedSalePlatform.ImageUrls), + ShippingMethod = orderUsedSalePlatform.ShippingMethod, + IsNew = orderUsedSalePlatform.IsNew, + CreationTime = orderUsedSalePlatform.CreationTime, + CreatorId = orderUsedSalePlatform.CreatorId + }; + + md.Code = "100"; + md.Result = "Success"; + md.Data = JsonConvert.SerializeObject(result); + } - md.Code = "100"; - md.Result = "Success"; - md.Data = JsonConvert.SerializeObject(result); + } } } @@ -2008,23 +2033,51 @@ namespace TradeManageNew.OuterService if (Method == "SelfPickupOrderUsedSalePlatform") { var input = JsonConvert.DeserializeObject(ResponseContent); - + 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 => input.Ids.Contains(x.Id) - && x.Status == UsedSalePlatformStatus.PendingPickup) + && x.Status == (UsedSalePlatformStatus)input.Status) .ToList(); - + + if (orderUsedSalePlatformList.Any()) { db.DT_OrderUsedSalePlatform.Where(x => input.Ids.Contains(x.Id) - && x.Status == UsedSalePlatformStatus.PendingPickup) + && x.Status == (UsedSalePlatformStatus)input.Status) .Set(x => x.ShippingMethod, ShippingMethod.SelfPickup) - .Set(x => x.Status, UsedSalePlatformStatus.Sold) + .Set(x => x.Status, (UsedSalePlatformStatus)input.Status) .Set(x => x.LastModifierId, input.UserId) .Set(x => x.LastModificationTime, DateTime.Now) + .Set(x => x.imgList, input.imgList) .Update(); } } diff --git a/TradeUsedSale/Enums/UsedSalePlatformStatus.cs b/TradeUsedSale/Enums/UsedSalePlatformStatus.cs index 717227a..22eb1f1 100644 --- a/TradeUsedSale/Enums/UsedSalePlatformStatus.cs +++ b/TradeUsedSale/Enums/UsedSalePlatformStatus.cs @@ -22,6 +22,15 @@ namespace TradeUsedSale.Enums /// /// 售卖完成 /// - [Description("售卖完成")] Sold + [Description("售卖完成")] Sold, + + /// + /// 使用配件 + /// + [Description("使用配件")] PeiJian , + /// + /// 现场出售 + /// + [Description("现场出售")] XcChuShou } } \ No newline at end of file diff --git a/TradeUsedSale/Repositories/Models/DT_OrderUsedSalePlatform.cs b/TradeUsedSale/Repositories/Models/DT_OrderUsedSalePlatform.cs index 9e3699f..8fd0c2c 100644 --- a/TradeUsedSale/Repositories/Models/DT_OrderUsedSalePlatform.cs +++ b/TradeUsedSale/Repositories/Models/DT_OrderUsedSalePlatform.cs @@ -117,5 +117,10 @@ namespace TradeUsedSale.Repositories.Models /// 运费 /// public decimal TotalNetCharge { get; set; } + + /// + /// 运费 + /// + public string imgList { get; set; } } } \ No newline at end of file From f71f4ce2c4e9b4028b8d2f5fc5403761a6b856d7 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Mon, 17 Feb 2025 23:20:51 +0800 Subject: [PATCH 2/3] 111 --- TradeManageNew/DD_OrderServiceNew.asmx.cs | 13 +++ TradeManageNew/DataNew.cs | 81 ++++++++++++++++--- TradeManageNew/HuoWuServiceNew.asmx.cs | 2 + .../OuterService/ShageService.ashx.cs | 6 +- 4 files changed, 87 insertions(+), 15 deletions(-) diff --git a/TradeManageNew/DD_OrderServiceNew.asmx.cs b/TradeManageNew/DD_OrderServiceNew.asmx.cs index 1ba1c65..503d20f 100644 --- a/TradeManageNew/DD_OrderServiceNew.asmx.cs +++ b/TradeManageNew/DD_OrderServiceNew.asmx.cs @@ -28752,6 +28752,7 @@ namespace TradeManageNew CreatorId = pageItem.CreatorId, PublishMessage = pageItem.PublishMessage, TrackingCode= pageItem.TrackingCode, + imgList=pageItem.imgList, }; result.DataSource.Add(resultItem); } @@ -30481,6 +30482,18 @@ namespace TradeManageNew return true; } #endregion + + #region 编辑 + [WebMethod(EnableSession = true)] + public int Update_TemuShopGoodActive(TemuShopGoodActive Model) + { + //Pages.Login(this.Session); + Model.State = 1; + Model.CreateTime = DateTime.Now; + Model.CreateUserId = Convert.ToInt32(Session["UserId"]); + return DataNew.Update_TemuShopGoodActive(Model); + } + #endregion #region 结束活动 [WebMethod(EnableSession = true)] public bool Update_TemuShopGoodActive(int ID) diff --git a/TradeManageNew/DataNew.cs b/TradeManageNew/DataNew.cs index ca32513..eb16726 100644 --- a/TradeManageNew/DataNew.cs +++ b/TradeManageNew/DataNew.cs @@ -7174,7 +7174,7 @@ end } if (!string.IsNullOrEmpty(GoodsCode)) { - where += " and GoodsCode='" + GoodsCode + "' "; + where += " and GoodsCode like '%" + GoodsCode + "%' "; } if (!string.IsNullOrEmpty(Name)) { @@ -31117,7 +31117,7 @@ end #endregion - #region 保存 + #region 保存TemuShopGoodActive public static int Save_TemuShopGoodActive(TemuShopGoodActive Model) { string tsql = @" @@ -31146,20 +31146,78 @@ select @ID"; int a = Convert.ToInt32(db.ExecuteScalar(cmd)); tsql = @"INSERT INTO [TemuShopGoodActiveDetail]([ActiveId],[OffNum],[SalePrice],[ActiveNum],[OutNum])values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum)"; cmd = db.GetSqlStringCommand(tsql); - foreach (var item in Model.ListModel) + if (Model.ListModel!=null) { - cmd.Parameters.Clear(); - item.OutNum = 0; - db.AddInParameter(cmd, "@ActiveId", DbType.Int32, a); - db.AddInParameter(cmd, "@OffNum", DbType.Decimal, item.OffNum); - db.AddInParameter(cmd, "@SalePrice", DbType.Decimal, item.SalePrice); - db.AddInParameter(cmd, "@ActiveNum", DbType.Int32, item.ActiveNum); - db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum); - db.ExecuteNonQuery(cmd); + foreach (var item in Model.ListModel) + { + cmd.Parameters.Clear(); + item.OutNum = 0; + db.AddInParameter(cmd, "@ActiveId", DbType.Int32, a); + db.AddInParameter(cmd, "@OffNum", DbType.Decimal, item.OffNum); + db.AddInParameter(cmd, "@SalePrice", DbType.Decimal, item.SalePrice); + db.AddInParameter(cmd, "@ActiveNum", DbType.Int32, item.ActiveNum); + db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum); + db.ExecuteNonQuery(cmd); + } } + return a; } #endregion + + + #region 编辑TemuShopGoodActive + public static int Update_TemuShopGoodActive(TemuShopGoodActive Model) + { + string tsql = @" +if @ID>0 +begin +Update [TemuShopGoodActive] set [Shopid]=@Shopid,[SKU]=@SKU,[SPUID]=@SPUID,[BasePrice]=@BasePrice,[CreateUserId]=@CreateUserId,[CreateTime]=@CreateTime,[PostPrice]=@PostPrice,[State]=@State where ID=@ID +end +else +select @ID"; + Database db = DatabaseFactory.CreateDatabase(); + DbCommand cmd = db.GetSqlStringCommand(tsql); + db.AddInParameter(cmd, "@ID", DbType.Int32, Model.ID); + db.AddInParameter(cmd, "@Shopid", DbType.Int32, Model.Shopid); + db.AddInParameter(cmd, "@SKU", DbType.String, Model.SKU); + db.AddInParameter(cmd, "@SPUID", DbType.String, Model.SPUID); + db.AddInParameter(cmd, "@BasePrice", DbType.Decimal, Model.BasePrice); + db.AddInParameter(cmd, "@CreateUserId", DbType.Int32, Model.CreateUserId); + db.AddInParameter(cmd, "@CreateTime", DbType.DateTime, Model.CreateTime); + db.AddInParameter(cmd, "@PostPrice", DbType.Decimal, Model.PostPrice); + db.AddInParameter(cmd, "@State", DbType.Int32, Model.State); + int a = Convert.ToInt32(db.ExecuteScalar(cmd)); + tsql = @" +if @Id>0 +begin +Update [TemuShopGoodActiveDetail] set [ActiveId]=@ActiveId,[OffNum]=@OffNum,[SalePrice]=@SalePrice,[ActiveNum]=@ActiveNum,[OutNum]=@OutNum where Id=@Id +end +else +begin +INSERT INTO [TemuShopGoodActiveDetail]([ActiveId],[OffNum],[SalePrice],[ActiveNum],[OutNum])values(@ActiveId,@OffNum,@SalePrice,@ActiveNum,@OutNum) +end"; + cmd = db.GetSqlStringCommand(tsql); + if (Model.ListModel != null) + { + foreach (var item in Model.ListModel) + { + cmd.Parameters.Clear(); + item.OutNum = 0; + db.AddInParameter(cmd, "@ActiveId", DbType.Int32, a); + db.AddInParameter(cmd, "@OffNum", DbType.Decimal, item.OffNum); + db.AddInParameter(cmd, "@SalePrice", DbType.Decimal, item.SalePrice); + db.AddInParameter(cmd, "@ActiveNum", DbType.Int32, item.ActiveNum); + db.AddInParameter(cmd, "@OutNum", DbType.Int32, item.OutNum); + db.AddInParameter(cmd, "@Id", DbType.Int32, item.Id); + db.ExecuteNonQuery(cmd); + } + } + + return a; + } + + #endregion #region 删除 public static void Delete_TemuShopGoodActive(int ID) { @@ -31334,4 +31392,5 @@ where c.SKU1=@SKU"; } #endregion } + } \ No newline at end of file diff --git a/TradeManageNew/HuoWuServiceNew.asmx.cs b/TradeManageNew/HuoWuServiceNew.asmx.cs index e23b636..108f39d 100644 --- a/TradeManageNew/HuoWuServiceNew.asmx.cs +++ b/TradeManageNew/HuoWuServiceNew.asmx.cs @@ -7462,6 +7462,8 @@ namespace TradeManageNew SKU = sku, BasePrice = Convert.ToDecimal(tb.Rows[i]["价格"]), CreateUserId = userid, + CreateTime=DateTime.Now, + State=1, }; goods.Add(md); diff --git a/TradeManageNew/OuterService/ShageService.ashx.cs b/TradeManageNew/OuterService/ShageService.ashx.cs index e499477..45d5175 100644 --- a/TradeManageNew/OuterService/ShageService.ashx.cs +++ b/TradeManageNew/OuterService/ShageService.ashx.cs @@ -2063,16 +2063,14 @@ namespace TradeManageNew.OuterService } var orderUsedSalePlatformList = db.DT_OrderUsedSalePlatform.Where(x => - input.Ids.Contains(x.Id) - && x.Status == (UsedSalePlatformStatus)input.Status) + input.Ids.Contains(x.Id)) .ToList(); if (orderUsedSalePlatformList.Any()) { db.DT_OrderUsedSalePlatform.Where(x => - input.Ids.Contains(x.Id) - && x.Status == (UsedSalePlatformStatus)input.Status) + input.Ids.Contains(x.Id)) .Set(x => x.ShippingMethod, ShippingMethod.SelfPickup) .Set(x => x.Status, (UsedSalePlatformStatus)input.Status) .Set(x => x.LastModifierId, input.UserId) From d7f1a9a3d0edde09cdf488201d533e917e19ccf5 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Tue, 18 Feb 2025 08:38:47 +0800 Subject: [PATCH 3/3] 1 --- TradeManageNew/DD_OrderServiceNew.asmx.cs | 8 +- .../Huowu/TemuShopGoodPriceNew.aspx | 994 ++++++++++-------- 2 files changed, 555 insertions(+), 447 deletions(-) diff --git a/TradeManageNew/DD_OrderServiceNew.asmx.cs b/TradeManageNew/DD_OrderServiceNew.asmx.cs index 503d20f..f5d0056 100644 --- a/TradeManageNew/DD_OrderServiceNew.asmx.cs +++ b/TradeManageNew/DD_OrderServiceNew.asmx.cs @@ -30482,18 +30482,18 @@ namespace TradeManageNew return true; } #endregion - - #region 编辑 + #region 保存 [WebMethod(EnableSession = true)] - public int Update_TemuShopGoodActive(TemuShopGoodActive Model) + public int update_TemuShopGoodActive(TemuShopGoodActive Model) { - //Pages.Login(this.Session); + Pages.Login(this.Session); Model.State = 1; Model.CreateTime = DateTime.Now; Model.CreateUserId = Convert.ToInt32(Session["UserId"]); return DataNew.Update_TemuShopGoodActive(Model); } #endregion + #region 结束活动 [WebMethod(EnableSession = true)] public bool Update_TemuShopGoodActive(int ID) diff --git a/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx b/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx index b93c557..e901103 100644 --- a/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx +++ b/TradeManageNew/Huowu/TemuShopGoodPriceNew.aspx @@ -1,469 +1,577 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemuShopGoodPriceNew.aspx.cs" Inherits="TradeManageNew.Huowu.TemuShopGoodPriceNew" %> - - - - - - - - Temu店铺商品活动 - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
店铺SKU状态
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
店铺SKUSPUID
基础价格
- -
-
-
- - - -
+ var error = CreateSaveModel("MainTable", Model); + if (error != "") { alert(error); return; } + Model.ShopId = $("#select_shops").val(); + error = datagrid2.UpdateDataSource(); + if (error != "") { alert(error); return; } + var param = new Object(); + param.Model = Model; + param.Model.ListModel = datagrid2.DataSource + WindowLoadModel.Show(); + $.ajax({ + url: "../DD_OrderServiceNew.asmx/update_TemuShopGoodActive", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (data) { + WindowLoadModel.Hide(); + ReadData(); + alert("保存成功"); + $.fancybox.close(); + } + }); + } + //#endregion + + //#region 显示弹出窗体 + function ShowFancybox(id) { + $.fancybox({ + 'scrolling': 'no', + 'autoScale': false, + 'transitionIn': 'elastic', + 'transitionOut': 'elastic', + 'href': '#' + id, + 'onClosed': function () { + } + }, 0); + } + //#endregion + + + //#region + function ajaxFileUpload() { + var filename = $("#fileToUpload").val(); + if (!filename.endsWith('.xls') && !filename.endsWith('.xlsx')) { alert("文件格式不正确"); return; } + $.ajaxFileUpload({ + url: '../GlobalAshx/AjaxFileUpdate.ashx?DirectoryName=ServerCookies', + secureuri: false, + fileElementId: 'fileToUpload', + dataType: 'json', + success: function (data, status) { + ImportGoods("ServerCookies/" + data.FileName); + }, + error: function (data, status, e) { + alert(e); + } + }); + } + //#endregion + + //#region + function ImportGoods(FileName) { + var param = new Object(); + param.filePath = FileName; + WindowLoadModel.Show(); + $.ajax({ + url: "../HuoWuServiceNew.asmx/ImportTemuHuoDongPrices", + data: Sys.Serialization.JavaScriptSerializer.serialize(param), + success: function (data) { + WindowLoadModel.Hide(); + if (data.d.Code == 0) { alert(data.d.Message); ReadData(); return; } + else { + ReadData(); + } + }, + error: function (xhr, status) { + if (status != "success") alert(xhr.responseText); + } + }); + } + //#endregion + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
店铺SKU状态
+ + + 导入数据: + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
店铺SKUSPUID
基础价格
+ +
+
+
+ + + +
+ +
-
- - - + + \ No newline at end of file