Procházet zdrojové kódy

提交产品分页查询

zhangkun %!s(int64=5) %!d(string=před) roky
rodič
revize
aa8ec13545

+ 179 - 96
代码/TVShoppingCallCenter_ZLJ/Controllers/Product/ProductController.cs

@@ -1,4 +1,9 @@
1
-using System;
1
+//————————————
2
+//des:产品管理类
3
+//author:zhangkun
4
+//addtime:2020-06-10
5
+//————————————
6
+using System;
2 7
 using System.Collections.Generic;
3 8
 using System.Common;
4 9
 using System.IRepositories;
@@ -21,7 +26,6 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
21 26
 
22 27
         private readonly IBus_ProductRepository _productRepository;
23 28
         private readonly IBus_ProductClassRepository _productClassRepository;
24
-
25 29
         public ProductController(IBus_ProductRepository productRepository, IBus_ProductClassRepository productClassRepository)
26 30
         {
27 31
             _productRepository = productRepository;
@@ -209,31 +213,31 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
209 213
 
210 214
             #region 验证 参数
211 215
 
212
-            if (input.F_ClassId == 0)
216
+            if (input.ClassId == 0)
213 217
                 return Error("请选择分类名称");
214
-            if (string.IsNullOrEmpty(input.F_ProductName))
218
+            if (string.IsNullOrEmpty(input.ProductName))
215 219
                 return Error("请输入产品名称");
216
-            if (string.IsNullOrEmpty(input.F_ProductShortName))
220
+            if (string.IsNullOrEmpty(input.ProductShortName))
217 221
                 return Error("请输入产品简写");
218
-            if (string.IsNullOrEmpty(input.F_ProductNumber))
222
+            if (string.IsNullOrEmpty(input.ProductNumber))
219 223
                 return Error("请输入产品条形码");
220
-            if (string.IsNullOrEmpty(input.F_ClassName))
224
+            if (string.IsNullOrEmpty(input.ClassName))
221 225
                 return Error("请选择分类名称");
222
-            if (input.F_MarketPrice <= 0)
226
+            if (input.MarketPrice <= 0)
223 227
                 return Error("请输入正确市场价");
224
-            if (input.F_MemberPrice <= 0)
228
+            if (input.MemberPrice <= 0)
225 229
                 return Error("请输入正确会员价");
226
-            if (input.F_SpecialPrice <= 0)
230
+            if (input.SpecialPrice <= 0)
227 231
                 return Error("请输入正确特惠价");
228
-            if (input.F_ProductId <= 0)
232
+            if (input.ProductId <= 0)
229 233
                 return Error("请输入正确产品编码");
230
-            if (string.IsNullOrEmpty(input.F_PinyinShort))
234
+            if (string.IsNullOrEmpty(input.PinyinShort))
231 235
                 return Error("请输入正确拼音简码");
232 236
             #endregion
233
-            Expression<Func<T_Bus_Product, bool>> eq = a => a.F_ProductName == input.F_ProductName;
234
-            eq = eq.Or(b => b.F_PinyinShort == input.F_PinyinShort);
235
-            eq = eq.Or(b => b.F_ProductId == input.F_ProductId);
236
-            eq = eq.Or(b => b.F_ProductShortName == input.F_ProductShortName);
237
+            Expression<Func<T_Bus_Product, bool>> eq = a => a.F_ProductName == input.ProductName;
238
+            eq = eq.Or(b => b.F_PinyinShort == input.PinyinShort);
239
+            eq = eq.Or(b => b.F_ProductId == input.ProductId);
240
+            eq = eq.Or(b => b.F_ProductShortName == input.ProductShortName);
237 241
             if (await _productRepository.GetCount(eq) > 0)
238 242
             {
239 243
                 return Error("名称/条形码/简称 有重复");
@@ -242,32 +246,33 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
242 246
             T_Bus_Product T_Bus_ProductModel = new T_Bus_Product();
243 247
 
244 248
 
245
-            T_Bus_ProductModel.F_ProductId = input.F_ProductId;
246
-            T_Bus_ProductModel.F_ProductName = input.F_ProductName;
247
-            T_Bus_ProductModel.F_ProductShortName = input.F_ProductShortName;
248
-            T_Bus_ProductModel.F_ProductNumber = input.F_ProductNumber;
249
-            T_Bus_ProductModel.F_PinyinShort = input.F_PinyinShort;
249
+            T_Bus_ProductModel.F_ProductId = input.ProductId;
250
+            T_Bus_ProductModel.F_ProductName = input.ProductName;
251
+            T_Bus_ProductModel.F_ProductShortName = input.ProductShortName;
252
+            T_Bus_ProductModel.F_ProductNumber = input.ProductNumber;
253
+            T_Bus_ProductModel.F_PinyinShort = input.PinyinShort;
250 254
 
251
-            T_Bus_ProductModel.F_ClassId = input.F_ClassId;
252
-            T_Bus_ProductModel.F_ClassName = input.F_ClassName;
255
+            T_Bus_ProductModel.F_ClassId = input.ClassId;
256
+            T_Bus_ProductModel.F_ClassName = input.ClassName;
253 257
 
254 258
 
255
-            T_Bus_ProductModel.F_MarketPrice = input.F_MarketPrice;
256
-            T_Bus_ProductModel.F_MemberPrice = input.F_MemberPrice;
257
-            T_Bus_ProductModel.F_SpecialPrice = input.F_SpecialPrice;
258
-            T_Bus_ProductModel.F_Integral = input.F_Integral;
259
+            T_Bus_ProductModel.F_MarketPrice = input.MarketPrice;
260
+            T_Bus_ProductModel.F_MemberPrice = input.MemberPrice;
261
+            T_Bus_ProductModel.F_SpecialPrice = input.SpecialPrice;
262
+            T_Bus_ProductModel.F_Integral = input.Integral;
259 263
 
260
-            T_Bus_ProductModel.F_Address = input.F_Address;
261
-            T_Bus_ProductModel.F_Des = input.F_Des;
262
-            T_Bus_ProductModel.F_Factory = input.F_Factory;
263
-            T_Bus_ProductModel.F_Supplier = input.F_Supplier;
264
+            T_Bus_ProductModel.F_Address = input.Address;
265
+            T_Bus_ProductModel.F_Des = input.Des;
266
+            T_Bus_ProductModel.F_Factory = input.Factory;
267
+            T_Bus_ProductModel.F_Supplier = input.Supplier;
268
+            T_Bus_ProductModel.F_IsDelete = 1;
264 269
 
265
-            T_Bus_ProductModel.F_IsSale = input.F_IsSale = input.F_OnSaleBegin < DateTime.Now;
266
-            T_Bus_ProductModel.F_Weight = input.F_Weight;
267
-            if (input.F_OnSaleBegin != null)
268
-            { T_Bus_ProductModel.F_OnSaleBegin = input.F_OnSaleBegin.GetValueOrDefault().ToString("yyyy-MM-dd 00:00:01").ObjToDate(); }
269
-            if (input.F_OnSaleEnd != null)
270
-            { T_Bus_ProductModel.F_OnSaleEnd = input.F_OnSaleEnd.GetValueOrDefault().ToString("yyyy-MM-dd 23:59:59").ObjToDate(); }
270
+            T_Bus_ProductModel.F_IsSale = input.IsSale = input.OnSaleBegin < DateTime.Now;
271
+            T_Bus_ProductModel.F_Weight = input.Weight;
272
+            if (input.OnSaleBegin != null)
273
+            { T_Bus_ProductModel.F_OnSaleBegin = input.OnSaleBegin.GetValueOrDefault().ToString("yyyy-MM-dd 00:00:01").ObjToDate(); }
274
+            if (input.OnSaleEnd != null)
275
+            { T_Bus_ProductModel.F_OnSaleEnd = input.OnSaleEnd.GetValueOrDefault().ToString("yyyy-MM-dd 23:59:59").ObjToDate(); }
271 276
 
272 277
 
273 278
 
@@ -296,56 +301,56 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
296 301
 
297 302
             #region 验证 参数
298 303
 
299
-            if (input.F_ClassId == 0)
304
+            if (input.ClassId == 0)
300 305
                 return Error("请选择分类名称");
301
-            if (string.IsNullOrEmpty(input.F_ProductName))
306
+            if (string.IsNullOrEmpty(input.ProductName))
302 307
                 return Error("请输入产品名称");
303
-            if (string.IsNullOrEmpty(input.F_ProductShortName))
308
+            if (string.IsNullOrEmpty(input.ProductShortName))
304 309
                 return Error("请输入产品简写");
305
-            if (string.IsNullOrEmpty(input.F_ProductNumber))
310
+            if (string.IsNullOrEmpty(input.ProductNumber))
306 311
                 return Error("请输入产品条形码");
307
-            if (string.IsNullOrEmpty(input.F_ClassName))
312
+            if (string.IsNullOrEmpty(input.ClassName))
308 313
                 return Error("请选择分类名称");
309
-            if (input.F_MarketPrice <= 0)
314
+            if (input.MarketPrice <= 0)
310 315
                 return Error("请输入正确市场价");
311
-            if (input.F_MemberPrice <= 0)
316
+            if (input.MemberPrice <= 0)
312 317
                 return Error("请输入正确会员价");
313
-            if (input.F_SpecialPrice <= 0)
318
+            if (input.SpecialPrice <= 0)
314 319
                 return Error("请输入正确特惠价");
315
-            if (input.F_ProductId <= 0)
320
+            if (input.ProductId <= 0)
316 321
                 return Error("产品ID不能修改");
317
-            if (string.IsNullOrEmpty(input.F_PinyinShort))
322
+            if (string.IsNullOrEmpty(input.PinyinShort))
318 323
                 return Error("请输入正确拼音简码");
319 324
             #endregion
320 325
 
321
-            T_Bus_Product T_Bus_ProductModel = await _productRepository.GetSingle(a => a.F_ProductId == input.F_ProductId);
326
+            T_Bus_Product T_Bus_ProductModel = await _productRepository.GetSingle(a => a.F_ProductId == input.ProductId);
322 327
 
323 328
             if (T_Bus_ProductModel == null)
324 329
                 return Error("如需新添加,请点击新增按钮,此记录不存在");
325 330
 
326
-            T_Bus_ProductModel.F_ProductName = input.F_ProductName;
327
-            T_Bus_ProductModel.F_ProductShortName = input.F_ProductShortName;
328
-            T_Bus_ProductModel.F_ProductNumber = input.F_ProductNumber;
329
-            T_Bus_ProductModel.F_PinyinShort = input.F_PinyinShort;
331
+            T_Bus_ProductModel.F_ProductName = input.ProductName;
332
+            T_Bus_ProductModel.F_ProductShortName = input.ProductShortName;
333
+            T_Bus_ProductModel.F_ProductNumber = input.ProductNumber;
334
+            T_Bus_ProductModel.F_PinyinShort = input.PinyinShort;
330 335
 
331
-            T_Bus_ProductModel.F_ClassId = input.F_ClassId;
332
-            T_Bus_ProductModel.F_ClassName = input.F_ClassName;
336
+            T_Bus_ProductModel.F_ClassId = input.ClassId;
337
+            T_Bus_ProductModel.F_ClassName = input.ClassName;
333 338
 
334 339
 
335
-            T_Bus_ProductModel.F_MarketPrice = input.F_MarketPrice;
336
-            T_Bus_ProductModel.F_MemberPrice = input.F_MemberPrice;
337
-            T_Bus_ProductModel.F_SpecialPrice = input.F_SpecialPrice;
338
-            T_Bus_ProductModel.F_Integral = input.F_Integral;
340
+            T_Bus_ProductModel.F_MarketPrice = input.MarketPrice;
341
+            T_Bus_ProductModel.F_MemberPrice = input.MemberPrice;
342
+            T_Bus_ProductModel.F_SpecialPrice = input.SpecialPrice;
343
+            T_Bus_ProductModel.F_Integral = input.Integral;
339 344
 
340
-            T_Bus_ProductModel.F_Address = input.F_Address;
341
-            T_Bus_ProductModel.F_Des = input.F_Des;
342
-            T_Bus_ProductModel.F_Factory = input.F_Factory;
343
-            T_Bus_ProductModel.F_Supplier = input.F_Supplier;
345
+            T_Bus_ProductModel.F_Address = input.Address;
346
+            T_Bus_ProductModel.F_Des = input.Des;
347
+            T_Bus_ProductModel.F_Factory = input.Factory;
348
+            T_Bus_ProductModel.F_Supplier = input.Supplier;
344 349
 
345
-            T_Bus_ProductModel.F_IsSale = input.F_IsSale = input.F_OnSaleBegin < DateTime.Now;//此状态暂不启用 以时间判断
346
-            T_Bus_ProductModel.F_Weight = input.F_Weight;
347
-            T_Bus_ProductModel.F_OnSaleBegin = input.F_OnSaleBegin ?? input.F_OnSaleBegin.GetValueOrDefault().ToString("yyyy-MM-dd 00:00:01").ObjToDate();
348
-            T_Bus_ProductModel.F_OnSaleEnd = input.F_OnSaleEnd ?? input.F_OnSaleEnd.GetValueOrDefault().ToString("yyyy-MM-dd 23:59:59").ObjToDate();
350
+            T_Bus_ProductModel.F_IsSale = input.IsSale = input.OnSaleBegin < DateTime.Now;//此状态暂不启用 以时间判断
351
+            T_Bus_ProductModel.F_Weight = input.Weight;
352
+            T_Bus_ProductModel.F_OnSaleBegin = input.OnSaleBegin ?? input.OnSaleBegin.GetValueOrDefault().ToString("yyyy-MM-dd 00:00:01").ObjToDate();
353
+            T_Bus_ProductModel.F_OnSaleEnd = input.OnSaleEnd ?? input.OnSaleEnd.GetValueOrDefault().ToString("yyyy-MM-dd 23:59:59").ObjToDate();
349 354
 
350 355
 
351 356
 
@@ -430,63 +435,138 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
430 435
         public async Task<IActionResult> ProductList(ProductInput input)
431 436
         {
432 437
 
433
-
434 438
             #region  拼接条件
435 439
 
436
-            Expression<Func<T_Bus_Product, bool>> eq = a => a.F_IsDelete == 0;
440
+            Expression<Func<T_Bus_Product, bool>> eq = a => a.F_IsDelete == 1;
437 441
 
438
-            if (input.F_ClassId > 0)
439
-                eq = eq.And(a => a.F_ProductId == input.F_ProductId);
440
-            if (!string.IsNullOrEmpty(input.F_ClassName))
442
+            if (input.ClassId > 0)
443
+                eq = eq.And(a => a.F_ProductId == input.ProductId);
444
+            if (!string.IsNullOrEmpty(input.ClassName))
441 445
             {
442
-                eq = eq.And(a => a.F_ClassName.Contains(input.F_ClassName));
446
+                eq = eq.And(a => a.F_ClassName.Contains(input.ClassName));
443 447
                 // eq.Or(a => a.F_ClassShortName.Contains(input.F_ClassName));
444 448
             }
445 449
             //产品名/标题
446
-            if (!string.IsNullOrEmpty(input.F_ProductName))
450
+            if (!string.IsNullOrEmpty(input.ProductName))
447 451
             {
448
-                eq = eq.And(a => a.F_ProductName.Contains(input.F_ProductName));
452
+                eq = eq.And(a => a.F_ProductName.Contains(input.ProductName));
449 453
             }
450 454
             //指定分类
451
-            if (input.F_ClassId > 0)
455
+            if (input.ClassId > 0)
452 456
             {
453
-                eq = eq.And(a => a.F_ClassId == input.F_ClassId);
457
+                eq = eq.And(a => a.F_ClassId == input.ClassId);
454 458
             }
455 459
             //分类名称
456
-            if (!string.IsNullOrEmpty(input.F_ClassName))
460
+            if (!string.IsNullOrEmpty(input.ClassName))
457 461
             {
458
-                eq = eq.And(a => a.F_ClassName.Contains(input.F_ClassName));
462
+                eq = eq.And(a => a.F_ClassName.Contains(input.ClassName));
459 463
             }
460 464
             //拼音简码
461
-            if (!string.IsNullOrEmpty(input.F_PinyinShort))
465
+            if (!string.IsNullOrEmpty(input.PinyinShort))
462 466
             {
463
-                eq = eq.And(a => a.F_PinyinShort == input.F_PinyinShort);
467
+                eq = eq.And(a => a.F_PinyinShort == input.PinyinShort);
464 468
             }
465 469
 
466 470
             //条形码
467
-            if (!string.IsNullOrEmpty(input.F_ProductNumber))
471
+            if (!string.IsNullOrEmpty(input.ProductNumber))
468 472
             {
469
-                eq = eq.And(a => a.F_ProductNumber == input.F_ProductNumber);
473
+                eq = eq.And(a => a.F_ProductNumber == input.ProductNumber);
470 474
             }
471 475
             //简称/编码/副标题
472
-            if (!string.IsNullOrEmpty(input.F_ProductShortName))
476
+            if (!string.IsNullOrEmpty(input.ProductShortName))
473 477
             {
474
-                eq = eq.And(a => a.F_ProductShortName == input.F_ProductShortName);
478
+                eq = eq.And(a => a.F_ProductShortName == input.ProductShortName);
475 479
             }
476 480
             //标签
477
-            if (!string.IsNullOrEmpty(input.F_Tag))
481
+            if (!string.IsNullOrEmpty(input.Tag))
478 482
             {
479
-                eq.And(a => a.F_Tag.Contains(input.F_Tag));
483
+                eq.And(a => a.F_Tag.Contains(input.Tag));
480 484
             }
481 485
 
482 486
             #endregion
483 487
 
484
-
485
-            List<T_Bus_Product> list = await _productRepository.GetListALL(eq);
488
+            int  count = 0;
489
+            var list = await _productRepository.GetListByPage(eq,new PageModel{PageCount= count, PageSize=5,PageIndex=1 });
486 490
 
487 491
             return Success("成功", list);
488 492
 
489 493
         }
494
+        /// <summary>
495
+        /// 分页获取产品列表
496
+        /// </summary>
497
+        /// <param name="input">筛选字段</param>
498
+        /// <param name="pagesize"></param>
499
+        /// <param name="pageindex"></param>
500
+        /// <returns></returns>
501
+        [HttpPost("getlistbypage")]
502
+        public async Task<IActionResult> GetListByPage([FromBody]ProductInput input, int pagesize, int pageindex)
503
+        {
504
+            List<IConditionalModel> conModels = new List<IConditionalModel>();
505
+            #region 条件筛选
506
+
507
+
508
+            conModels.Add(new ConditionalModel() { FieldName = "F_IsDelete", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumDelState.Enabled).ToString() });
509
+
510
+            if (input.ProductId > 0)
511
+            {
512
+                conModels.Add(new ConditionalModel() { FieldName = "F_ProductId", ConditionalType = ConditionalType.Equal, FieldValue = input.ProductId.ToString() });
513
+            }
514
+            //指定分类
515
+            if (input.ClassId > 0)
516
+            {
517
+                conModels.Add(new ConditionalModel() { FieldName = "F_ClassId", ConditionalType = ConditionalType.Equal, FieldValue = input.ClassId.ToString() });
518
+            }
519
+
520
+            if (!string.IsNullOrEmpty(input.ClassName))
521
+            {
522
+                conModels.Add(new ConditionalModel() { FieldName = "F_ClassName", ConditionalType = ConditionalType.Like, FieldValue = input.ClassName });
523
+
524
+            }
525
+            //产品名/标题
526
+            if (!string.IsNullOrEmpty(input.ProductName))
527
+            {
528
+                conModels.Add(new ConditionalModel() { FieldName = "F_ProductName", ConditionalType = ConditionalType.Like, FieldValue = input.ProductName });
529
+            }
530
+            //分类名称
531
+            if (!string.IsNullOrEmpty(input.ClassName))
532
+            {
533
+                conModels.Add(new ConditionalModel() { FieldName = "F_ClassName", ConditionalType = ConditionalType.Like, FieldValue = input.ClassName });
534
+            }
535
+            //拼音简码
536
+            if (!string.IsNullOrEmpty(input.PinyinShort))
537
+            {
538
+                conModels.Add(new ConditionalModel() { FieldName = "F_PinyinShort", ConditionalType = ConditionalType.Equal, FieldValue = input.PinyinShort });
539
+            }
540
+
541
+            //条形码
542
+            if (!string.IsNullOrEmpty(input.ProductNumber))
543
+            {
544
+                conModels.Add(new ConditionalModel() { FieldName = "F_ProductNumber", ConditionalType = ConditionalType.Equal, FieldValue = input.ProductNumber });
545
+            }
546
+            //简称/编码/副标题
547
+            if (!string.IsNullOrEmpty(input.ProductShortName))
548
+            {
549
+                conModels.Add(new ConditionalModel() { FieldName = "F_ProductShortName", ConditionalType = ConditionalType.Like, FieldValue = input.ProductShortName });
550
+            }
551
+            //标签
552
+            if (!string.IsNullOrEmpty(input.Tag))
553
+            {
554
+                conModels.Add(new ConditionalModel() { FieldName = "F_Tag", ConditionalType = ConditionalType.Equal, FieldValue = input.Tag });
555
+            }
556
+
557
+
558
+            #endregion
559
+            int recordCount =0;
560
+            var list = await _productRepository.GetListByPage(conModels, new PageModel() { PageIndex = pageindex, PageSize = pagesize, PageCount = recordCount });
561
+            var obj = new
562
+            {
563
+                state = "success",
564
+                message = "成功",
565
+                rows = list,
566
+                total=  recordCount
567
+            };
568
+            return Content(obj.ToJson());
569
+        }
490 570
 
491 571
 
492 572
         #endregion
@@ -497,13 +577,13 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
497 577
         /// 更新库存(对方库存变化  入库 出库 时做更新)  订单发货时,对面库存 出库要对应订单,以便跟踪
498 578
         /// </summary>
499 579
         /// <param name="input">目前暂定Id唯一标识更新如果不方便可以以F_ProductName,如果那边更好操作,顺序上这边先有产品的话可以以id操作,或者以条形码操作</param>
580
+        /// 基类BaseController继承的不是[ApiController],也没有加[ApiController]头标  所以用到json序列化传值 和测试工具raw传值必须加[FromBody]
500 581
         /// <returns></returns>
501 582
         [HttpPost("updatestock")]
502
-        public async Task<IActionResult> UpdateStock(List<ProductInput> input)
583
+        public async Task<IActionResult> UpdateStock([FromBody]List<ProductInput> input)
503 584
         {
504 585
 
505 586
             #region 验证 参数
506
-            //List<ProductInput> m = input;
507 587
             if (input.Count <= 0)
508 588
                 return Error("参数缺失,没有数据");
509 589
             List<T_Bus_Product> listmodel = new List<T_Bus_Product>();
@@ -511,15 +591,18 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
511 591
             foreach (ProductInput m in input)
512 592
             {
513 593
                 // return Success(m.F_ProductId.ToString() + ":" + m.F_Stock.ToString());
514
-                if (!string.IsNullOrEmpty(m.F_ProductName))
594
+                if (!string.IsNullOrEmpty(m.ProductName))
515 595
                     return Error("参数缺失产品名称");
516
-                if (m.F_ProductId <= 0)
596
+                if (m.ProductId <= 0)
517 597
                     return Error("参数缺失产品id");
518
-                if (m.F_Stock < 0)
598
+                if (m.Stock < 0)
519 599
                     return Error("参数缺失库存");
520
-                T_Bus_Product model = await _productRepository.GetSingle(a => a.F_ProductId == m.F_ProductId);
521
-                model.F_Stock = m.F_Stock;
522
-                listmodel.Add(model);
600
+                T_Bus_Product model = await _productRepository.GetSingle(a => a.F_ProductId == m.ProductId);
601
+                if (model != null)
602
+                {
603
+                    model.F_Stock = m.Stock;
604
+                    listmodel.Add(model);
605
+                }
523 606
             }
524 607
 
525 608
             #endregion

+ 294 - 292
代码/TVShoppingCallCenter_ZLJ/Models/Inputs/ProductInput.cs

@@ -6,301 +6,303 @@ using System.Threading.Tasks;
6 6
 namespace TVShoppingCallCenter_ZLJ.Models.Inputs
7 7
 {
8 8
     public class ProductInput
9
-	{
9
+    {
10 10
 
11
-		#region Model
12
-		private int _f_productid;
13
-		private string _f_productnumber;
14
-		private string _f_productname;
15
-		private string _f_productshortname;
16
-		private string _f_classname;
17
-		private int _f_classid;
18
-		private string _f_pinyinshort;
19
-		private DateTime? _f_onsalebegin;
20
-		private DateTime? _f_onsaleend;
21
-		private bool _f_issale;
22
-		private string _f_factory;
23
-		private string _f_address;
24
-		private string _f_supplier;
25
-		private int? _f_integral;
26
-		private decimal? _f_marketprice;
27
-		private decimal? _f_memberprice;
28
-		private decimal? _f_specialprice;
29
-		private int? _f_isdelete;
30
-		private string _f_des;
31
-		private string _f_attribute;
32
-		private decimal? _f_weight;
33
-		private string _f_tag;
34
-		private string _f_picture;
35
-		private string _f_video;
36
-		private string _f_content;
37
-		private int? _f_userid;
38
-		private string _f_username;
39
-		private DateTime? _f_addtime;
40
-		private DateTime? _f_updatetime;
41
-		private int _f_sort;
42
-		private DateTime? _f_laststockupdate;
43
-		private int _f_stock = 0;
11
+        #region Model
12
+        private int _f_productid;
13
+        private string _f_productnumber;
14
+        private string _f_productname;
15
+        private string _f_productshortname;
16
+        private string _f_classname;
17
+        private int _f_classid;
18
+        private string _f_pinyinshort;
19
+        private DateTime? _f_onsalebegin;
20
+        private DateTime? _f_onsaleend;
21
+        private bool _f_issale;
22
+        private string _f_factory;
23
+        private string _f_address;
24
+        private string _f_supplier;
25
+        private int? _f_integral;
26
+        private decimal? _f_marketprice;
27
+        private decimal? _f_memberprice;
28
+        private decimal? _f_specialprice;
29
+        private int? _f_isdelete;
30
+        private string _f_des;
31
+        private string _f_attribute;
32
+        private decimal? _f_weight;
33
+        private string _f_tag;
34
+        private string _f_picture;
35
+        private string _f_video;
36
+        private string _f_content;
37
+        private int? _f_userid;
38
+        private string _f_username;
39
+        private DateTime? _f_addtime;
40
+        private DateTime? _f_updatetime;
41
+        private int _f_sort;
42
+        private DateTime? _f_laststockupdate;
43
+        private int _f_stock = 0;
44 44
 
45
-		/// <summary>
46
-		/// 产品编号ID
47
-		/// </summary>
48
-		public int F_ProductId
49
-		{
50
-			set { _f_productid = value; }
51
-			get { return _f_productid; }
52
-		}
53
-		/// <summary>
54
-		/// 产品条形码
55
-		/// </summary>
56
-		public string F_ProductNumber
57
-		{
58
-			set { _f_productnumber = value; }
59
-			get { return _f_productnumber; }
60
-		}
61
-		/// <summary>
62
-		/// 产品名称
63
-		/// </summary>
64
-		public string F_ProductName
65
-		{
66
-			set { _f_productname = value; }
67
-			get { return _f_productname; }
68
-		}
69
-		/// <summary>
70
-		/// 产品简称/编码
71
-		/// </summary>
72
-		public string F_ProductShortName
73
-		{
74
-			set { _f_productshortname = value; }
75
-			get { return _f_productshortname; }
76
-		}
77
-		/// <summary>
78
-		/// 分类名称
79
-		/// </summary>
80
-		public string F_ClassName
81
-		{
82
-			set { _f_classname = value; }
83
-			get { return _f_classname; }
84
-		}
85
-		/// <summary>
86
-		/// 分类id
87
-		/// </summary>
88
-		public int F_ClassId
89
-		{
90
-			set { _f_classid = value; }
91
-			get { return _f_classid; }
92
-		}
93
-		/// <summary>
94
-		/// 拼音简码
95
-		/// </summary>
96
-		public string F_PinyinShort
97
-		{
98
-			set { _f_pinyinshort = value; }
99
-			get { return _f_pinyinshort; }
100
-		}
101
-		/// <summary>
102
-		/// 上架时间
103
-		/// </summary>
104
-		public DateTime? F_OnSaleBegin
105
-		{
106
-			set { _f_onsalebegin = value; }
107
-			get { return _f_onsalebegin; }
108
-		}
109
-		/// <summary>
110
-		/// 下架时间
111
-		/// </summary>
112
-		public DateTime? F_OnSaleEnd
113
-		{
114
-			set { _f_onsaleend = value; }
115
-			get { return _f_onsaleend; }
116
-		}
117
-		/// <summary>
118
-		/// 是否正在上架(可暂不启用)
119
-		/// </summary>
120
-		public bool F_IsSale
121
-		{
122
-			set { _f_issale = value; }
123
-			get { return _f_issale; }
124
-		}
125
-		/// <summary>
126
-		/// 生产厂家
127
-		/// </summary>
128
-		public string F_Factory
129
-		{
130
-			set { _f_factory = value; }
131
-			get { return _f_factory; }
132
-		}
133
-		/// <summary>
134
-		/// 产品产地
135
-		/// </summary>
136
-		public string F_Address
137
-		{
138
-			set { _f_address = value; }
139
-			get { return _f_address; }
140
-		}
141
-		/// <summary>
142
-		/// 供货商
143
-		/// </summary>
144
-		public string F_Supplier
145
-		{
146
-			set { _f_supplier = value; }
147
-			get { return _f_supplier; }
148
-		}
149
-		/// <summary>
150
-		/// 兑换积分
151
-		/// </summary>
152
-		public int? F_Integral
153
-		{
154
-			set { _f_integral = value; }
155
-			get { return _f_integral; }
156
-		}
157
-		/// <summary>
158
-		/// 市场价
159
-		/// </summary>
160
-		public decimal? F_MarketPrice
161
-		{
162
-			set { _f_marketprice = value; }
163
-			get { return _f_marketprice; }
164
-		}
165
-		/// <summary>
166
-		/// 会员价
167
-		/// </summary>
168
-		public decimal? F_MemberPrice
169
-		{
170
-			set { _f_memberprice = value; }
171
-			get { return _f_memberprice; }
172
-		}
173
-		/// <summary>
174
-		/// 特价/优惠价
175
-		/// </summary>
176
-		public decimal? F_SpecialPrice
177
-		{
178
-			set { _f_specialprice = value; }
179
-			get { return _f_specialprice; }
180
-		}
181
-		/// <summary>
182
-		/// 0整除 1已删除(隐藏)
183
-		/// </summary>
184
-		public int? F_IsDelete
185
-		{
186
-			set { _f_isdelete = value; }
187
-			get { return _f_isdelete; }
188
-		}
189
-		/// <summary>
190
-		/// 产品描述
191
-		/// </summary>
192
-		public string F_Des
193
-		{
194
-			set { _f_des = value; }
195
-			get { return _f_des; }
196
-		}
197
-		/// <summary>
198
-		/// 商品属性(体积)规格(暂不启用)
199
-		/// </summary>
200
-		public string F_Attribute
201
-		{
202
-			set { _f_attribute = value; }
203
-			get { return _f_attribute; }
204
-		}
205
-		/// <summary>
206
-		/// 产品重量
207
-		/// </summary>
208
-		public decimal? F_Weight
209
-		{
210
-			set { _f_weight = value; }
211
-			get { return _f_weight; }
212
-		}
213
-		/// <summary>
214
-		/// 产品标签
215
-		/// </summary>
216
-		public string F_Tag
217
-		{
218
-			set { _f_tag = value; }
219
-			get { return _f_tag; }
220
-		}
221
-		/// <summary>
222
-		/// 产品图片(暂不启用)
223
-		/// </summary>
224
-		public string F_Picture
225
-		{
226
-			set { _f_picture = value; }
227
-			get { return _f_picture; }
228
-		}
229
-		/// <summary>
230
-		/// 产品视频(暂不启用)
231
-		/// </summary>
232
-		public string F_Video
233
-		{
234
-			set { _f_video = value; }
235
-			get { return _f_video; }
236
-		}
237
-		/// <summary>
238
-		/// 产品图文介绍(暂不启用)
239
-		/// </summary>
240
-		public string F_Content
241
-		{
242
-			set { _f_content = value; }
243
-			get { return _f_content; }
244
-		}
245
-		/// <summary>
246
-		/// 操作人Id
247
-		/// </summary>
248
-		public int? F_UserId
249
-		{
250
-			set { _f_userid = value; }
251
-			get { return _f_userid; }
252
-		}
253
-		/// <summary>
254
-		/// 操作人姓名
255
-		/// </summary>
256
-		public string F_UserName
257
-		{
258
-			set { _f_username = value; }
259
-			get { return _f_username; }
260
-		}
261
-		/// <summary>
262
-		/// 添加时间
263
-		/// </summary>
264
-		public DateTime? F_AddTime
265
-		{
266
-			set { _f_addtime = value; }
267
-			get { return _f_addtime; }
268
-		}
269
-		/// <summary>
270
-		/// 上次操作时间
271
-		/// </summary>
272
-		public DateTime? F_UpdateTime
273
-		{
274
-			set { _f_updatetime = value; }
275
-			get { return _f_updatetime; }
276
-		}
277
-		/// <summary>
278
-		/// 排序
279
-		/// </summary>
280
-		public int F_Sort
281
-		{
282
-			set { _f_sort = value; }
283
-			get { return _f_sort; }
284
-		}
45
+        /// <summary>
46
+        /// 产品编号ID
47
+        /// </summary>
48
+        public int ProductId
49
+        {
50
+            set { _f_productid = value; }
51
+            get { return _f_productid; }
52
+        }
53
+        public int Top
54
+        { set; get; }
55
+        /// <summary>
56
+        /// 产品条形码
57
+        /// </summary>
58
+        public string ProductNumber
59
+        {
60
+            set { _f_productnumber = value; }
61
+            get { return _f_productnumber; }
62
+        }
63
+        /// <summary>
64
+        /// 产品名称
65
+        /// </summary>
66
+        public string ProductName
67
+        {
68
+            set { _f_productname = value; }
69
+            get { return _f_productname; }
70
+        }
71
+        /// <summary>
72
+        /// 产品简称/编码
73
+        /// </summary>
74
+        public string ProductShortName
75
+        {
76
+            set { _f_productshortname = value; }
77
+            get { return _f_productshortname; }
78
+        }
79
+        /// <summary>
80
+        /// 分类名称
81
+        /// </summary>
82
+        public string ClassName
83
+        {
84
+            set { _f_classname = value; }
85
+            get { return _f_classname; }
86
+        }
87
+        /// <summary>
88
+        /// 分类id
89
+        /// </summary>
90
+        public int ClassId
91
+        {
92
+            set { _f_classid = value; }
93
+            get { return _f_classid; }
94
+        }
95
+        /// <summary>
96
+        /// 拼音简码
97
+        /// </summary>
98
+        public string PinyinShort
99
+        {
100
+            set { _f_pinyinshort = value; }
101
+            get { return _f_pinyinshort; }
102
+        }
103
+        /// <summary>
104
+        /// 上架时间
105
+        /// </summary>
106
+        public DateTime? OnSaleBegin
107
+        {
108
+            set { _f_onsalebegin = value; }
109
+            get { return _f_onsalebegin; }
110
+        }
111
+        /// <summary>
112
+        /// 下架时间
113
+        /// </summary>
114
+        public DateTime? OnSaleEnd
115
+        {
116
+            set { _f_onsaleend = value; }
117
+            get { return _f_onsaleend; }
118
+        }
119
+        /// <summary>
120
+        /// 是否正在上架(可暂不启用)
121
+        /// </summary>
122
+        public bool IsSale
123
+        {
124
+            set { _f_issale = value; }
125
+            get { return _f_issale; }
126
+        }
127
+        /// <summary>
128
+        /// 生产厂家
129
+        /// </summary>
130
+        public string Factory
131
+        {
132
+            set { _f_factory = value; }
133
+            get { return _f_factory; }
134
+        }
135
+        /// <summary>
136
+        /// 产品产地
137
+        /// </summary>
138
+        public string Address
139
+        {
140
+            set { _f_address = value; }
141
+            get { return _f_address; }
142
+        }
143
+        /// <summary>
144
+        /// 供货商
145
+        /// </summary>
146
+        public string Supplier
147
+        {
148
+            set { _f_supplier = value; }
149
+            get { return _f_supplier; }
150
+        }
151
+        /// <summary>
152
+        /// 兑换积分
153
+        /// </summary>
154
+        public int? Integral
155
+        {
156
+            set { _f_integral = value; }
157
+            get { return _f_integral; }
158
+        }
159
+        /// <summary>
160
+        /// 市场价
161
+        /// </summary>
162
+        public decimal? MarketPrice
163
+        {
164
+            set { _f_marketprice = value; }
165
+            get { return _f_marketprice; }
166
+        }
167
+        /// <summary>
168
+        /// 会员价
169
+        /// </summary>
170
+        public decimal? MemberPrice
171
+        {
172
+            set { _f_memberprice = value; }
173
+            get { return _f_memberprice; }
174
+        }
175
+        /// <summary>
176
+        /// 特价/优惠价
177
+        /// </summary>
178
+        public decimal? SpecialPrice
179
+        {
180
+            set { _f_specialprice = value; }
181
+            get { return _f_specialprice; }
182
+        }
183
+        /// <summary>
184
+        /// 0整除 1已删除(隐藏)
185
+        /// </summary>
186
+        public int? IsDelete
187
+        {
188
+            set { _f_isdelete = value; }
189
+            get { return _f_isdelete; }
190
+        }
191
+        /// <summary>
192
+        /// 产品描述
193
+        /// </summary>
194
+        public string Des
195
+        {
196
+            set { _f_des = value; }
197
+            get { return _f_des; }
198
+        }
199
+        /// <summary>
200
+        /// 商品属性(体积)规格(暂不启用)
201
+        /// </summary>
202
+        public string Attribute
203
+        {
204
+            set { _f_attribute = value; }
205
+            get { return _f_attribute; }
206
+        }
207
+        /// <summary>
208
+        /// 产品重量
209
+        /// </summary>
210
+        public decimal? Weight
211
+        {
212
+            set { _f_weight = value; }
213
+            get { return _f_weight; }
214
+        }
215
+        /// <summary>
216
+        /// 产品标签
217
+        /// </summary>
218
+        public string Tag
219
+        {
220
+            set { _f_tag = value; }
221
+            get { return _f_tag; }
222
+        }
223
+        /// <summary>
224
+        /// 产品图片(暂不启用)
225
+        /// </summary>
226
+        public string Picture
227
+        {
228
+            set { _f_picture = value; }
229
+            get { return _f_picture; }
230
+        }
231
+        /// <summary>
232
+        /// 产品视频(暂不启用)
233
+        /// </summary>
234
+        public string Video
235
+        {
236
+            set { _f_video = value; }
237
+            get { return _f_video; }
238
+        }
239
+        /// <summary>
240
+        /// 产品图文介绍(暂不启用)
241
+        /// </summary>
242
+        public string Content
243
+        {
244
+            set { _f_content = value; }
245
+            get { return _f_content; }
246
+        }
247
+        /// <summary>
248
+        /// 操作人Id
249
+        /// </summary>
250
+        public int? UserId
251
+        {
252
+            set { _f_userid = value; }
253
+            get { return _f_userid; }
254
+        }
255
+        /// <summary>
256
+        /// 操作人姓名
257
+        /// </summary>
258
+        public string UserName
259
+        {
260
+            set { _f_username = value; }
261
+            get { return _f_username; }
262
+        }
263
+        /// <summary>
264
+        /// 添加时间
265
+        /// </summary>
266
+        public DateTime? AddTime
267
+        {
268
+            set { _f_addtime = value; }
269
+            get { return _f_addtime; }
270
+        }
271
+        /// <summary>
272
+        /// 上次操作时间
273
+        /// </summary>
274
+        public DateTime? UpdateTime
275
+        {
276
+            set { _f_updatetime = value; }
277
+            get { return _f_updatetime; }
278
+        }
279
+        /// <summary>
280
+        /// 排序
281
+        /// </summary>
282
+        public int Sort
283
+        {
284
+            set { _f_sort = value; }
285
+            get { return _f_sort; }
286
+        }
285 287
 
286
-		/// <summary>
287
-		/// 上次库存更新时间
288
-		/// </summary>
289
-		public DateTime? F_LastStockUpdate
290
-		{
291
-			set { _f_laststockupdate = value; }
292
-			get { return _f_laststockupdate; }
293
-		}
288
+        /// <summary>
289
+        /// 上次库存更新时间
290
+        /// </summary>
291
+        public DateTime? LastStockUpdate
292
+        {
293
+            set { _f_laststockupdate = value; }
294
+            get { return _f_laststockupdate; }
295
+        }
294 296
 
295
-		/// <summary>
296
-		/// 产品库存
297
-		/// </summary>
298
-		public int F_Stock
299
-		{
300
-			set { _f_stock = value; }
301
-			get { return _f_stock; }
302
-		}
303
-		#endregion Model
297
+        /// <summary>
298
+        /// 产品库存
299
+        /// </summary>
300
+        public int Stock
301
+        {
302
+            set { _f_stock = value; }
303
+            get { return _f_stock; }
304
+        }
305
+        #endregion Model
304 306
 
305
-	}
307
+    }
306 308
 }

+ 34 - 0
代码/TVShoppingCallCenter_ZLJ/Models/Inputs/ProductStock.cs

@@ -0,0 +1,34 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+
6
+namespace TVShoppingCallCenter_ZLJ.Models.Inputs
7
+{
8
+    public class ProductStock
9
+	{
10
+
11
+		private string _productid;
12
+		private int _stock;
13
+		/// <summary>
14
+		/// 产品标识
15
+		/// </summary>
16
+		public string ProductId
17
+		{
18
+			set { _productid = value; }
19
+			get { return _productid; }
20
+		}
21
+
22
+		/// <summary>
23
+		/// 当前库存
24
+		/// </summary>
25
+		public int Stock
26
+		{
27
+			set { _stock = value; }
28
+			get { return _stock; }
29
+		}
30
+
31
+
32
+
33
+	}
34
+}