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)