Bladeren bron

Merge branch 'master' of http://192.168.1.222:3000/zhengbingbing/ZLJ_API_V6.0

mengjie 5 jaren geleden
bovenliggende
commit
caf057dad1

+ 4 - 0
代码/System.Common/IRepositories/IRepository.cs

@@ -21,6 +21,7 @@ namespace System.Common
21 21
         /// <returns></returns>
22 22
         Task<List<T>> GetList();
23 23
         Task<List<T>> GetListALL(Expression<Func<T, bool>> whereExpression);
24
+        Task<List<T>> GetListALL(List<IConditionalModel> conModels, string orderby);
24 25
         Task<List<T>> GetListALL(Expression<Func<T, bool>> whereExpression, Expression<Func<T, object>> orderExpression, OrderByType ordertype = OrderByType.Asc);
25 26
 
26 27
         /// <summary>
@@ -28,6 +29,9 @@ namespace System.Common
28 29
         /// </summary>
29 30
         /// <returns></returns>
30 31
         Task<PageData<T>> GetListByPage(List<IConditionalModel> conModels, PageModel pagemodel);
32
+        Task<PageData<T>> GetListByPage(List<IConditionalModel> conModels, PageModel pagemodel, string orderby);
33
+        Task<PageData<T>> GetListByPage(Expression<Func<T, bool>> whereExpression, PageModel pagemodel);
34
+        Task<PageData<T>> GetListByPage(Expression<Func<T, bool>> whereExpression, PageModel pagemodel, string orderby);
31 35
 
32 36
         Task<T> GetSingle(Expression<Func<T, bool>> whereExpression);
33 37
 

+ 42 - 9
代码/System.Common/Repositories/BaseRepository.cs

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
7 7
 
8 8
 namespace System.Common
9 9
 {
10
-    public class BaseRepository<T> : BaseContext,IRepository<T> where T : class, new()
10
+    public class BaseRepository<T> : BaseContext, IRepository<T> where T : class, new()
11 11
     {
12 12
         //public SimpleClient<T> CurrentDb => new SimpleClient<T>(Db);
13 13
 
@@ -16,12 +16,12 @@ namespace System.Common
16 16
         /// </summary>
17 17
         /// <param name="whereExpression"></param>
18 18
         /// <returns></returns>
19
-        public async Task<int> GetCount(Expression<Func<T, bool>> whereExpression=null)
19
+        public async Task<int> GetCount(Expression<Func<T, bool>> whereExpression = null)
20 20
         {
21 21
             if (whereExpression != null)
22
-                return await Db.Queryable<T>().CountAsync(whereExpression);
22
+                return await Db.Queryable<T>().With(SqlWith.NoLock).CountAsync(whereExpression);
23 23
             else
24
-                return await Db.Queryable<T>().CountAsync();
24
+                return await Db.Queryable<T>().With(SqlWith.NoLock).CountAsync();
25 25
         }
26 26
 
27 27
         /// <summary>
@@ -30,16 +30,22 @@ namespace System.Common
30 30
         /// <returns></returns>
31 31
         public async Task<List<T>> GetList()
32 32
         {
33
-            return await Db.Queryable<T>().ToListAsync();
33
+            return await Db.Queryable<T>().With(SqlWith.NoLock).ToListAsync();
34 34
             //return CurrentDb.GetList();
35 35
         }
36 36
         public async Task<List<T>> GetListALL(Expression<Func<T, bool>> whereExpression)
37 37
         {
38
-            return await Db.Queryable<T>().Where(whereExpression).ToListAsync();
38
+            return await Db.Queryable<T>().With(SqlWith.NoLock).Where(whereExpression).ToListAsync();
39 39
         }
40
+
41
+        public async Task<List<T>> GetListALL(List<IConditionalModel> conModels, string orderby)
42
+        {
43
+            return await Db.Queryable<T>().With(SqlWith.NoLock).Where(conModels).OrderBy(orderby).ToListAsync();
44
+        }
45
+
40 46
         public async Task<List<T>> GetListALL(Expression<Func<T, bool>> whereExpression, Expression<Func<T, object>> orderExpression, OrderByType ordertype = OrderByType.Asc)
41 47
         {
42
-            return await Db.Queryable<T>().Where(whereExpression).OrderBy(orderExpression,ordertype).ToListAsync();
48
+            return await Db.Queryable<T>().With(SqlWith.NoLock).Where(whereExpression).OrderBy(orderExpression,ordertype).ToListAsync();
43 49
         }
44 50
 
45 51
         /// <summary>
@@ -48,9 +54,36 @@ namespace System.Common
48 54
         /// <param name="conModels"></param>
49 55
         /// <param name="pagemodel"></param>
50 56
         /// <returns></returns>
57
+        public async Task<PageData<T>> GetListByPage(List<IConditionalModel> conModels, PageModel pagemodel,string orderby)
58
+        {
59
+            var list= await Db.Queryable<T>().With(SqlWith.NoLock).Where(conModels).OrderBy(orderby).ToPageListAsync(pagemodel.PageIndex, pagemodel.PageSize, pagemodel.PageCount);
60
+            PageData<T> pd = new PageData<T>();
61
+            pd.Rows = list;
62
+            pd.Totals = pagemodel.PageCount;
63
+            return pd;// CurrentDb.GetPageList(conModels, pagemodel);
64
+        }
65
+
51 66
         public async Task<PageData<T>> GetListByPage(List<IConditionalModel> conModels, PageModel pagemodel)
52 67
         {
53
-            var list= await Db.Queryable<T>().With(SqlWith.NoLock).Where(conModels).ToPageListAsync(pagemodel.PageIndex, pagemodel.PageSize, pagemodel.PageCount);
68
+            var list = await Db.Queryable<T>().With(SqlWith.NoLock).Where(conModels).ToPageListAsync(pagemodel.PageIndex, pagemodel.PageSize, pagemodel.PageCount);
69
+            PageData<T> pd = new PageData<T>();
70
+            pd.Rows = list;
71
+            pd.Totals = pagemodel.PageCount;
72
+            return pd;// CurrentDb.GetPageList(conModels, pagemodel);
73
+        }
74
+
75
+        public async Task<PageData<T>> GetListByPage(Expression<Func<T, bool>> whereExpression, PageModel pagemodel)
76
+        {
77
+            var list = await Db.Queryable<T>().With(SqlWith.NoLock).Where(whereExpression).ToPageListAsync(pagemodel.PageIndex, pagemodel.PageSize, pagemodel.PageCount);
78
+        PageData<T> pd = new PageData<T>();
79
+        pd.Rows = list;
80
+            pd.Totals = pagemodel.PageCount;
81
+            return pd;// CurrentDb.GetPageList(conModels, pagemodel);
82
+        }
83
+
84
+        public async Task<PageData<T>> GetListByPage(Expression<Func<T, bool>> whereExpression, PageModel pagemodel, string orderby)
85
+        {
86
+            var list = await Db.Queryable<T>().With(SqlWith.NoLock).Where(whereExpression).OrderBy(orderby).ToPageListAsync(pagemodel.PageIndex, pagemodel.PageSize, pagemodel.PageCount);
54 87
             PageData<T> pd = new PageData<T>();
55 88
             pd.Rows = list;
56 89
             pd.Totals = pagemodel.PageCount;
@@ -59,7 +92,7 @@ namespace System.Common
59 92
 
60 93
         public async Task<T> GetSingle(Expression<Func<T, bool>> whereExpression)
61 94
         {
62
-            return await Db.Queryable<T>().Where(whereExpression).SingleAsync();
95
+            return await Db.Queryable<T>().With(SqlWith.NoLock).Where(whereExpression).SingleAsync();
63 96
             //return CurrentDb.GetSingle(whereExpression);
64 97
         }
65 98
 

+ 10 - 0
代码/System.IRepositories/IBus_ProductClassRepository.cs

@@ -0,0 +1,10 @@
1
+using System.Common;
2
+using System;
3
+using System.Model;
4
+
5
+namespace System.IRepositories
6
+{
7
+    public interface IBus_ProductClassRepository : IRepository<T_Bus_ProductClass>
8
+    {
9
+    }
10
+}

+ 10 - 0
代码/System.IRepositories/IBus_ProductRepository.cs

@@ -0,0 +1,10 @@
1
+using System.Common;
2
+using System;
3
+using System.Model;
4
+
5
+namespace System.IRepositories
6
+{
7
+    public interface IBus_ProductRepository : IRepository<T_Bus_Product>
8
+    {
9
+    }
10
+}

+ 287 - 0
代码/System.Model/T_Bus_Product.cs

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

+ 98 - 0
代码/System.Model/T_Bus_ProductClass.cs

@@ -0,0 +1,98 @@
1
+using System;
2
+namespace System.Model
3
+{
4
+	/// <summary>
5
+	/// 商品分类表
6
+	/// </summary>
7
+	[Serializable]
8
+	public partial class T_Bus_ProductClass
9
+	{
10
+		public T_Bus_ProductClass()
11
+		{ }
12
+		#region Model
13
+		private int _f_classid;
14
+		private int? _f_parentid = 0;
15
+		private string _f_classname = "";
16
+		private string _f_classshortname = "";
17
+		private DateTime? _f_addtime = DateTime.Now;
18
+		private string _f_username = "";
19
+		private DateTime? _f_updatetime = DateTime.Now;
20
+		private int? _f_userid;
21
+		private int? _f_sort = 10000;
22
+		/// <summary>
23
+		/// 产品分类编号
24
+		/// </summary>
25
+		public int F_ClassId
26
+		{
27
+			set { _f_classid = value; }
28
+			get { return _f_classid; }
29
+		}
30
+		/// <summary>
31
+		/// 上级分类 0顶级
32
+		/// </summary>
33
+		public int? F_parentId
34
+		{
35
+			set { _f_parentid = value; }
36
+			get { return _f_parentid; }
37
+		}
38
+		/// <summary>
39
+		/// 产品分类名称
40
+		/// </summary>
41
+		public string F_ClassName
42
+		{
43
+			set { _f_classname = value; }
44
+			get { return _f_classname; }
45
+		}
46
+		/// <summary>
47
+		/// 产品分类简称/代码
48
+		/// </summary>
49
+		public string F_ClassShortName
50
+		{
51
+			set { _f_classshortname = value; }
52
+			get { return _f_classshortname; }
53
+		}
54
+		/// <summary>
55
+		/// 添加时间
56
+		/// </summary>
57
+		public DateTime? F_Addtime
58
+		{
59
+			set { _f_addtime = value; }
60
+			get { return _f_addtime; }
61
+		}
62
+		/// <summary>
63
+		/// 操作员
64
+		/// </summary>
65
+		public string F_UserName
66
+		{
67
+			set { _f_username = value; }
68
+			get { return _f_username; }
69
+		}
70
+		/// <summary>
71
+		/// 最后更新时间
72
+		/// </summary>
73
+		public DateTime? F_UpdateTime
74
+		{
75
+			set { _f_updatetime = value; }
76
+			get { return _f_updatetime; }
77
+		}
78
+		/// <summary>
79
+		/// 操作员id
80
+		/// </summary>
81
+		public int? F_UserId
82
+		{
83
+			set { _f_userid = value; }
84
+			get { return _f_userid; }
85
+		}
86
+		/// <summary>
87
+		/// 排序
88
+		/// </summary>
89
+		public int? F_Sort
90
+		{
91
+			set { _f_sort = value; }
92
+			get { return _f_sort; }
93
+		}
94
+		#endregion Model
95
+
96
+	}
97
+}
98
+

+ 13 - 0
代码/System.Repositories/Bus_ProductClassRepository.cs

@@ -0,0 +1,13 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using System.IRepositories;
5
+using System.Model;
6
+using System.Common;
7
+
8
+namespace System.Repositories
9
+{
10
+    public class Bus_ProductClassRepository : BaseRepository<T_Bus_ProductClass>, IBus_ProductClassRepository
11
+    {
12
+    }
13
+}

+ 13 - 0
代码/System.Repositories/Bus_ProductRepository.cs

@@ -0,0 +1,13 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using System.IRepositories;
5
+using System.Model;
6
+using System.Common;
7
+
8
+namespace System.Repositories
9
+{
10
+    public class Bus_ProductRepository : BaseRepository<T_Bus_Product>, IBus_ProductRepository
11
+    {
12
+    }
13
+}

+ 275 - 0
代码/TVShoppingCallCenter_ZLJ/Controllers/Product/ProductController.cs

@@ -0,0 +1,275 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Common;
4
+using System.IRepositories;
5
+using System.Linq;
6
+using System.Linq.Expressions;
7
+using System.Model;
8
+using System.Security.Claims;
9
+using System.Threading.Tasks;
10
+using Microsoft.AspNetCore.Authorization;
11
+using Microsoft.AspNetCore.Http;
12
+using Microsoft.AspNetCore.Mvc;
13
+using SqlSugar;
14
+using TVShoppingCallCenter_ZLJ.Models.Dtos;
15
+
16
+namespace TVShoppingCallCenter_ZLJ.Controllers.Product
17
+{
18
+    [Route("api/[controller]")]
19
+    public class ProductController : BaseController
20
+    {
21
+
22
+        private readonly IBus_ProductRepository _productRepository;
23
+        private readonly IBus_ProductClassRepository _productClassRepository;
24
+
25
+        public ProductController(IBus_ProductRepository productRepository, IBus_ProductClassRepository productClassRepository)
26
+        {
27
+            _productRepository = productRepository;
28
+            _productClassRepository = productClassRepository;
29
+        }
30
+        [AllowAnonymous]
31
+        [HttpGet("/api/test")]
32
+        public IActionResult Test()
33
+        {
34
+            return new JsonResult(new
35
+            {
36
+                Status = false,
37
+                Message = "访问信息"
38
+            });
39
+        }
40
+        #region 产品分类
41
+
42
+        /// <summary>
43
+        /// 新增商品分类
44
+        /// </summary>
45
+        /// <param name="input"></param>
46
+        /// <returns></returns>
47
+        [HttpPost("addproductclass")]
48
+        public async Task<IActionResult> AddProductClass(ProductClassDto input)
49
+        {
50
+
51
+            #region 验证 参数
52
+
53
+
54
+            if (string.IsNullOrEmpty(input.F_ClassName))
55
+                return Error("请输入分类名称");
56
+            if (string.IsNullOrEmpty(input.F_ClassShortName))
57
+                return Error("请输入分类简写");
58
+
59
+            #endregion
60
+            T_Bus_ProductClass T_Bus_ProductClassModel = new T_Bus_ProductClass();
61
+            if (input.F_ClassId != 0)
62
+                T_Bus_ProductClassModel.F_ClassId = input.F_ClassId;
63
+
64
+            T_Bus_ProductClassModel.F_ClassShortName = input.F_ClassShortName;
65
+            T_Bus_ProductClassModel.F_parentId = input.F_parentId;
66
+            T_Bus_ProductClassModel.F_ClassName = input.F_ClassName;
67
+            T_Bus_ProductClassModel.F_UserName = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value;
68
+            T_Bus_ProductClassModel.F_UserId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.PrimarySid).Value, 0);
69
+
70
+
71
+            if (await _productClassRepository.Add(T_Bus_ProductClassModel) > 0)
72
+            {
73
+                return Success("新增商品分类成功");
74
+            }
75
+            else
76
+            {
77
+                return Error("新增分类失败,请重试!");
78
+            }
79
+        }
80
+
81
+
82
+        /// <summary>
83
+        /// 更新商品分类名称
84
+        /// </summary>
85
+        /// <param name="input"></param>
86
+        /// <returns></returns>
87
+        [HttpPost("updateproductclass")]
88
+        public async Task<IActionResult> UpdateProductClass(ProductClassDto input)
89
+        {
90
+
91
+            #region 验证 参数
92
+
93
+
94
+            if (string.IsNullOrEmpty(input.F_ClassName))
95
+                return Error("请输入分类名称");
96
+            if (string.IsNullOrEmpty(input.F_ClassShortName))
97
+                return Error("请输入分类简写");
98
+            if (input.F_ClassId <= 0)
99
+                return Error("缺少参数");
100
+            #endregion
101
+            T_Bus_ProductClass T_Bus_ProductClassModel = await _productClassRepository.GetSingle(a => a.F_ClassId == input.F_ClassId);
102
+
103
+            T_Bus_ProductClassModel.F_ClassName = input.F_ClassName;
104
+            T_Bus_ProductClassModel.F_ClassShortName = input.F_ClassShortName;
105
+            T_Bus_ProductClassModel.F_parentId = input.F_parentId;
106
+
107
+            T_Bus_ProductClassModel.F_UserName = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value;
108
+            T_Bus_ProductClassModel.F_UserId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.PrimarySid).Value, 0);
109
+
110
+
111
+            if (await _productClassRepository.Update(T_Bus_ProductClassModel))
112
+            {
113
+                return Success("新增商品分类成功");
114
+            }
115
+            else
116
+            {
117
+                return Error("新增分类失败,请重试!");
118
+            }
119
+        }
120
+
121
+        /// <summary>
122
+        /// 删除商品分类
123
+        /// </summary>
124
+        /// <param name="input"></param>
125
+        /// <returns></returns>
126
+        [HttpPost("deleteproductclass")]
127
+        public async Task<IActionResult> DeleteProductClass(ProductClassDto input)
128
+        {
129
+
130
+            #region 验证 参数
131
+
132
+            if (input.F_ClassId <= 0)
133
+                return Error("缺少参数");
134
+            #endregion
135
+
136
+            //删除的时候  分类下有商品怎么处理  暂未处理  后续根据需求处理
137
+
138
+            if (await _productClassRepository.Delete(a => a.F_ClassId == input.F_ClassId))
139
+            {
140
+                return Success("删除商品分类成功");
141
+            }
142
+            else
143
+            {
144
+                return Error("删除分类失败,请重试!");
145
+            }
146
+        }
147
+
148
+        /// <summary>
149
+        /// 查询商品分类
150
+        /// </summary>
151
+        /// <param name="input"></param>
152
+        /// <returns></returns>
153
+        [HttpPost("getproductclass")]
154
+        public async Task<IActionResult> ProductClassList(ProductClassDto input)
155
+        {
156
+
157
+            #region 验证 参数
158
+
159
+            if (input.F_ClassId <= 0)
160
+                return Error("缺少参数");
161
+            #endregion
162
+
163
+
164
+            #region  拼接条件
165
+
166
+            Expression<Func<T_Bus_ProductClass, bool>> eq = a => a.F_ClassId > 0;
167
+
168
+            if (input.F_ClassId > 0)
169
+                eq.And(a => a.F_ClassId == input.F_ClassId);
170
+            if (!string.IsNullOrEmpty(input.F_ClassName))
171
+            {
172
+                eq.And(a => a.F_ClassName.Contains(input.F_ClassName));
173
+                // eq.Or(a => a.F_ClassShortName.Contains(input.F_ClassName));
174
+            }
175
+            if (input.F_parentId > 0)
176
+            {
177
+                eq.And(a => a.F_parentId == input.F_parentId);
178
+            }
179
+            if (input.F_parentId == -1)
180
+            {
181
+                eq.And(a => a.F_parentId == 0);
182
+            }
183
+
184
+            #endregion
185
+
186
+            //删除的时候  分类下有商品怎么处理  暂未处理  后续根据需求处理   需要事务
187
+            List<T_Bus_ProductClass> list = await _productClassRepository.GetListALL(eq);
188
+
189
+            return Success("成功", list);
190
+
191
+        }
192
+
193
+
194
+        #endregion
195
+        /// <summary>
196
+        /// 新增商品
197
+        /// </summary>
198
+        /// <param name="input"></param>
199
+        /// <returns></returns>
200
+        [HttpPost("addproduct")]
201
+        public async Task<IActionResult> AddProduct(ProductDto input)
202
+        {
203
+
204
+            #region 验证 参数
205
+
206
+            if (input.F_ClassId == 0)
207
+                return Error("请选择分类名称");
208
+            if (string.IsNullOrEmpty(input.F_ProductName))
209
+                return Error("请输入产品名称");
210
+            if (string.IsNullOrEmpty(input.F_ProductShortName))
211
+                return Error("请输入产品简写");
212
+            if (string.IsNullOrEmpty(input.F_ProductNumber))
213
+                return Error("请输入产品条形码");
214
+            if (string.IsNullOrEmpty(input.F_ClassName))
215
+                return Error("请选择分类名称");
216
+            if (input.F_MarketPrice <= 0)
217
+                return Error("请输入正确市场价");
218
+            if (input.F_MemberPrice <= 0)
219
+                return Error("请输入正确会员价");
220
+            if (input.F_SpecialPrice <= 0)
221
+                return Error("请输入正确特惠价");
222
+            if (string.IsNullOrEmpty(input.F_PinyinShort))
223
+                return Error("请输入正确拼音简码");
224
+            #endregion
225
+
226
+            T_Bus_Product T_Bus_ProductModel = new T_Bus_Product();
227
+
228
+
229
+            if (input.F_ProductId > 0)
230
+                T_Bus_ProductModel.F_ProductId = input.F_ProductId;
231
+            T_Bus_ProductModel.F_ProductName = input.F_ProductName;
232
+            T_Bus_ProductModel.F_ProductShortName = input.F_ProductShortName;
233
+            T_Bus_ProductModel.F_ProductNumber = input.F_ProductNumber;
234
+            T_Bus_ProductModel.F_PinyinShort = input.F_PinyinShort;
235
+
236
+            T_Bus_ProductModel.F_ClassId = input.F_ClassId;
237
+            T_Bus_ProductModel.F_ClassName = input.F_ClassName;
238
+
239
+
240
+            T_Bus_ProductModel.F_MarketPrice = input.F_MarketPrice;
241
+            T_Bus_ProductModel.F_MemberPrice = input.F_MemberPrice;
242
+            T_Bus_ProductModel.F_SpecialPrice = input.F_SpecialPrice;
243
+            T_Bus_ProductModel.F_Integral = input.F_Integral;
244
+
245
+            T_Bus_ProductModel.F_Address = input.F_Address;
246
+            T_Bus_ProductModel.F_Des = input.F_Des;
247
+            T_Bus_ProductModel.F_Factory = input.F_Factory;
248
+            T_Bus_ProductModel.F_Supplier = input.F_Supplier;
249
+
250
+            T_Bus_ProductModel.F_IsSale = input.F_IsSale = input.F_OnSaleBegin < DateTime.Now;
251
+            T_Bus_ProductModel.F_Weight = input.F_Weight;
252
+            T_Bus_ProductModel.F_OnSaleBegin = input.F_OnSaleBegin ?? input.F_OnSaleBegin.GetValueOrDefault().ToString("yyyy-MM-dd 00:00:01").ObjToDate();
253
+            T_Bus_ProductModel.F_OnSaleEnd = input.F_OnSaleEnd ?? input.F_OnSaleEnd.GetValueOrDefault().ToString("yyyy-MM-dd 23:59:59").ObjToDate();
254
+
255
+
256
+
257
+            T_Bus_ProductModel.F_UserName = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value;
258
+            T_Bus_ProductModel.F_UserId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.PrimarySid).Value, 0);
259
+
260
+
261
+            if (await _productRepository.Update(T_Bus_ProductModel))
262
+            {
263
+                return Success("新增商品成功");
264
+            }
265
+            else
266
+            {
267
+                return Error("新增商品失败,请重试!");
268
+            }
269
+        }
270
+
271
+
272
+
273
+
274
+    }
275
+}

+ 302 - 0
代码/TVShoppingCallCenter_ZLJ/Controllers/System/SeatGroupController.cs

@@ -0,0 +1,302 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Common;
4
+using System.IRepositories;
5
+using System.Linq;
6
+using System.Linq.Expressions;
7
+using System.Model;
8
+using System.Security.Claims;
9
+using System.Threading.Tasks;
10
+using Microsoft.AspNetCore.Authorization;
11
+using Microsoft.AspNetCore.Mvc;
12
+using SqlSugar;
13
+
14
+namespace TVShoppingCallCenter_ZLJ.Controllers.System
15
+{
16
+    [Authorize]
17
+    [Produces("application/json")]
18
+    [Route("api/[controller]")]
19
+    public class SeatGroupController : BaseController
20
+    {
21
+        private readonly ISys_SeatGroupRepository _sys_seatgroupRepository;
22
+        public SeatGroupController(ISys_SeatGroupRepository sys_seatgroupRepository)
23
+        {
24
+            _sys_seatgroupRepository = sys_seatgroupRepository;
25
+        }
26
+        /// <summary>
27
+        /// 获取坐席组列表
28
+        /// </summary>
29
+        /// <param name="filter"></param>
30
+        /// <returns></returns>
31
+        [Authorize]
32
+        [HttpGet("getlistbypage")]
33
+        public async Task<IActionResult> GetListsByPage(string key, int pageindex = 1, int pagesize = 10)
34
+        {
35
+            List<IConditionalModel> conModels = new List<IConditionalModel>();
36
+            #region 条件筛选
37
+            conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumDelState.Enabled).ToString() });
38
+
39
+            List<IConditionalModel> conModels1 = new List<IConditionalModel>();
40
+            if (!string.IsNullOrEmpty(key))
41
+            {
42
+                conModels.Add(new ConditionalCollections()
43
+                {
44
+                    ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>()
45
+                    {
46
+                        new  KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel() { FieldName = "F_ZXZName", ConditionalType = ConditionalType.Like, FieldValue = key }),
47
+                        new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_ZXZCode", ConditionalType = ConditionalType.Like, FieldValue = key }),
48
+                        new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or, new ConditionalModel() { FieldName = "F_ZXAtt", ConditionalType = ConditionalType.Like, FieldValue = key })
49
+                    }
50
+                });
51
+            }
52
+            #endregion
53
+            int recordCount = 0;
54
+            var list = await _sys_seatgroupRepository.GetListByPage(conModels, new PageModel() { PageIndex = pageindex, PageSize = pagesize, PageCount = recordCount }, "F_CreateOn desc");
55
+
56
+            return Success("成功", list);
57
+        }
58
+
59
+        [Authorize]
60
+        [HttpGet("getlist")]
61
+        public async Task<IActionResult> GetList(string key)
62
+        {
63
+            List<IConditionalModel> conModels = new List<IConditionalModel>();
64
+            #region 条件筛选
65
+            conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumDelState.Enabled).ToString() });
66
+
67
+            if (!string.IsNullOrEmpty(key))
68
+            {
69
+                conModels.Add(new ConditionalCollections()
70
+                {
71
+                    ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>()
72
+                    {
73
+                        new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_ZXZCode", ConditionalType = ConditionalType.Like, FieldValue = key }),
74
+                        new  KeyValuePair<WhereType, ConditionalModel>(WhereType.Or, new ConditionalModel() { FieldName = "F_ZXZName", ConditionalType = ConditionalType.Like, FieldValue = key }),
75
+                        new  KeyValuePair<WhereType, ConditionalModel>( WhereType.Or, new ConditionalModel() { FieldName = "F_ZXAtt", ConditionalType = ConditionalType.Like, FieldValue = key })
76
+                    }
77
+                });
78
+
79
+            }
80
+            #endregion
81
+            var list = await _sys_seatgroupRepository.GetListALL(conModels, "F_CreateOn desc");
82
+
83
+            return Success("根据条件获取数据成功", list);
84
+        }
85
+
86
+        /// <summary>
87
+        /// 获取实体
88
+        /// </summary>
89
+        [Authorize]
90
+        [HttpGet("getsingle")]
91
+        public async Task<IActionResult> GetSingle(int id)
92
+        {
93
+            if (id > 0)
94
+            {
95
+                var dModel = await _sys_seatgroupRepository.GetSingle(x => x.F_ZXZID == id);
96
+
97
+                if (dModel != null)
98
+                {
99
+                    return Success("获取坐席组成功", dModel);
100
+                }
101
+                else
102
+                {
103
+                    return Error("获取坐席组失败");
104
+                }
105
+            }
106
+            else
107
+            {
108
+                return Error("获取参数失败");
109
+            }
110
+        }
111
+
112
+        /// <summary>
113
+        /// 添加坐席组
114
+        /// </summary>
115
+        [Authorize]
116
+        [HttpPost("add")]
117
+        public async Task<IActionResult> Add(string zxzcode, string zxzname, string zxatt,
118
+            string whwdkey, string whbdkey, int ivrkey, string outcallnum, string des)
119
+        {
120
+            T_Sys_SeatGroup clmodel = new T_Sys_SeatGroup();
121
+            if (await GetExistByCodeAsync(zxzcode, 0) || await GetExistByNameAsync(zxzname, 0))
122
+            {
123
+                return Error("坐席组编号和名称必须唯一,请重新输入!");
124
+            }
125
+            if (!string.IsNullOrWhiteSpace(zxzcode))
126
+                clmodel.F_ZXZCode = zxzcode.Trim();
127
+            else
128
+            {
129
+                return Error("编号不能为空");
130
+            }
131
+            if (!string.IsNullOrWhiteSpace(zxzname))
132
+                clmodel.F_ZXZName = zxzname.Trim();
133
+            else
134
+            {
135
+                return Error("名称不能为空");
136
+            }
137
+            if (!string.IsNullOrWhiteSpace(zxatt))
138
+                clmodel.F_ZXAtt = zxatt.Trim();
139
+            else
140
+            {
141
+                return Error("坐席地区号不能为空");
142
+            }
143
+            if (!string.IsNullOrWhiteSpace(whwdkey))
144
+                clmodel.F_WHWDKey = whwdkey.Trim();
145
+            else
146
+            {
147
+                return Error("外呼外地前缀不能为空");
148
+            }
149
+            if (!string.IsNullOrWhiteSpace(whbdkey))
150
+                clmodel.F_WHBDKey = whbdkey.Trim();
151
+            else
152
+            {
153
+                return Error("外呼本地前缀不能为空");
154
+            }
155
+            if (!ValidateString.IsNumberStr(whwdkey.Trim().ToString()))
156
+            {
157
+                return Error("外呼外地前缀必须为数字");
158
+            }
159
+            if (!ValidateString.IsNumberStr(whbdkey.Trim().ToString()))
160
+            {
161
+                return Error("外呼本地前缀必须为数字");
162
+            }
163
+
164
+            clmodel.F_IVRKey = ivrkey;
165
+            clmodel.F_Des = des;
166
+            clmodel.F_CreateBy = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value; //"8000";
167
+            clmodel.F_CreateOn = DateTime.Now;
168
+            clmodel.F_State = (int)EnumDelState.Enabled;
169
+
170
+            var res = await _sys_seatgroupRepository.Add(clmodel);
171
+            if (res > 0)
172
+                return Success("坐席组保存成功");
173
+            else
174
+            {
175
+                return Error("坐席组保存失败");
176
+            }
177
+        }
178
+
179
+        /// <summary>
180
+        /// 修改坐席组
181
+        /// </summary>
182
+        [Authorize]
183
+        [HttpPost("update")]
184
+        public async Task<IActionResult> Edit(int id, string zxzcode, string zxzname, string zxatt,
185
+            string whwdkey, string whbdkey, int ivrkey, string outcallnum, string des)
186
+        {
187
+            if (id > 0)
188
+            {
189
+                if (await GetExistByCodeAsync(zxzcode, id) || await GetExistByNameAsync(zxzname, id))
190
+                {
191
+                    return Error("坐席组编号和名称必须唯一,请重新输入!");
192
+                }
193
+                if (string.IsNullOrWhiteSpace(whwdkey))
194
+                    return Error("外呼外地前缀不能为空");
195
+                if (string.IsNullOrWhiteSpace(whbdkey))
196
+                    return Error("外呼本地前缀不能为空");
197
+
198
+                if (!ValidateString.IsNumberStr(whwdkey.Trim().ToString()))
199
+                {
200
+                    return Error("外呼外地前缀必须为数字");
201
+                }
202
+                if (!ValidateString.IsNumberStr(whbdkey.Trim().ToString()))
203
+                {
204
+                    return Error("外呼本地前缀必须为数字");
205
+                }
206
+
207
+                var res = false;
208
+                var clmodel = await _sys_seatgroupRepository.GetSingle(x => x.F_ZXZID == id);
209
+                if (clmodel != null)
210
+                {
211
+                    if (!string.IsNullOrWhiteSpace(zxzcode))
212
+                        clmodel.F_ZXZCode = zxzcode.Trim();
213
+                    if (!string.IsNullOrWhiteSpace(zxzname))
214
+                        clmodel.F_ZXZName = zxzname.Trim();
215
+                    if (!string.IsNullOrWhiteSpace(zxatt))
216
+                        clmodel.F_ZXAtt = zxatt.Trim();
217
+                    if (!string.IsNullOrWhiteSpace(whwdkey))
218
+                        clmodel.F_WHWDKey = whwdkey.Trim();
219
+                    if (!string.IsNullOrWhiteSpace(whbdkey))
220
+                        clmodel.F_WHBDKey = whbdkey.Trim();
221
+
222
+                    clmodel.F_IVRKey = ivrkey;
223
+                    if (!string.IsNullOrWhiteSpace(des))
224
+                        clmodel.F_Des = des;
225
+
226
+                    clmodel.F_LastModifyBy = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value; //"8000";
227
+                    clmodel.F_LastModifyOn = DateTime.Now;
228
+
229
+                    res = await _sys_seatgroupRepository.Update(clmodel);
230
+                }
231
+                if (res)
232
+                    return Success("坐席组保存成功");
233
+                else
234
+                {
235
+                    return Error("坐席组保存失败");
236
+                }
237
+            }
238
+            else
239
+                return Error("请选择要编辑的坐席组");
240
+        }
241
+
242
+        [Authorize]
243
+        [HttpPost("delete")]
244
+        public async Task<IActionResult> Remove(int[] ids)
245
+        {
246
+            //使用逻辑删除
247
+            //物理删除的数据无法恢复
248
+            var res = 0;
249
+            if (ids != null && ids.Length > 0)
250
+            {
251
+                foreach (var item in ids)
252
+                {
253
+                    var ml = await _sys_seatgroupRepository.GetSingle(x => x.F_ZXZID == item);
254
+                    ml.F_State = (int)EnumDelState.Delete;
255
+                    if (await _sys_seatgroupRepository.Update(ml))
256
+                        res += 1;
257
+                }
258
+                if (res == ids.Length)
259
+                    return Success("删除成功");
260
+                else if (res > 0 && res < ids.Length)
261
+                    return Error("部分删除失败,请查看后重新操作");
262
+                else
263
+                    return Error("删除失败,请查看后重新操作");
264
+            }
265
+            else
266
+                return Error("请选择要删除的记录");
267
+        }
268
+
269
+        #region 私有方法
270
+        /// <summary>
271
+        /// 根据坐席组编号查询是否存在此坐席组编号
272
+        /// </summary>
273
+        /// <param name="code"></param>
274
+        /// <returns></returns>
275
+        private async Task<bool> GetExistByCodeAsync(string code, int id)
276
+        {
277
+            long c = 0;
278
+            if (id > 0)
279
+                c = await _sys_seatgroupRepository.GetCount(x => x.F_ZXZCode.Equals(code) && x.F_ZXZID != id);
280
+            else
281
+                c = await _sys_seatgroupRepository.GetCount(x => x.F_ZXZCode.Equals(code));
282
+
283
+            return c > 0;
284
+        }
285
+        /// <summary>
286
+        /// 根据坐席组名称查询是否存在此坐席组编号
287
+        /// </summary>
288
+        /// <param name="code"></param>
289
+        /// <returns></returns>
290
+        private async Task<bool> GetExistByNameAsync(string name, int id)
291
+        {
292
+            long c = 0;
293
+            if (id > 0)
294
+                c = await _sys_seatgroupRepository.GetCount(x => x.F_ZXZName.Equals(name) && x.F_ZXZID != id);
295
+            else
296
+                c = await _sys_seatgroupRepository.GetCount(x => x.F_ZXZName.Equals(name));
297
+            
298
+            return c > 0;
299
+        }
300
+        #endregion
301
+    }
302
+}

+ 96 - 0
代码/TVShoppingCallCenter_ZLJ/Models/Dtos/ProductClassDto.cs

@@ -0,0 +1,96 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+
6
+namespace TVShoppingCallCenter_ZLJ.Models.Dtos
7
+{
8
+    public class ProductClassDto
9
+	{
10
+
11
+		#region Model
12
+		private int _f_classid;
13
+		private int? _f_parentid=0;
14
+		private string _f_classname="";
15
+		private string _f_classshortname="";
16
+		private DateTime? _f_addtime=DateTime.Now;
17
+		private string _f_username="";
18
+		private DateTime? _f_updatetime=DateTime.Now;
19
+		private int? _f_userid;
20
+		private int? _f_sort=10000;
21
+		/// <summary>
22
+		/// 产品分类编号
23
+		/// </summary>
24
+		public int F_ClassId
25
+		{
26
+			set { _f_classid = value; }
27
+			get { return _f_classid; }
28
+		}
29
+		/// <summary>
30
+		/// 上级分类 0顶级
31
+		/// </summary>
32
+		public int? F_parentId
33
+		{
34
+			set { _f_parentid = value; }
35
+			get { return _f_parentid; }
36
+		}
37
+		/// <summary>
38
+		/// 产品分类名称
39
+		/// </summary>
40
+		public string F_ClassName
41
+		{
42
+			set { _f_classname = value; }
43
+			get { return _f_classname; }
44
+		}
45
+		/// <summary>
46
+		/// 产品分类简称/代码
47
+		/// </summary>
48
+		public string F_ClassShortName
49
+		{
50
+			set { _f_classshortname = value; }
51
+			get { return _f_classshortname; }
52
+		}
53
+		/// <summary>
54
+		/// 添加时间
55
+		/// </summary>
56
+		public DateTime? F_Addtime
57
+		{
58
+			set { _f_addtime = value; }
59
+			get { return _f_addtime; }
60
+		}
61
+		/// <summary>
62
+		/// 操作员
63
+		/// </summary>
64
+		public string F_UserName
65
+		{
66
+			set { _f_username = value; }
67
+			get { return _f_username; }
68
+		}
69
+		/// <summary>
70
+		/// 最后更新时间
71
+		/// </summary>
72
+		public DateTime? F_UpdateTime
73
+		{
74
+			set { _f_updatetime = value; }
75
+			get { return _f_updatetime; }
76
+		}
77
+		/// <summary>
78
+		/// 操作员id
79
+		/// </summary>
80
+		public int? F_UserId
81
+		{
82
+			set { _f_userid = value; }
83
+			get { return _f_userid; }
84
+		}
85
+		/// <summary>
86
+		/// 排序
87
+		/// </summary>
88
+		public int? F_Sort
89
+		{
90
+			set { _f_sort = value; }
91
+			get { return _f_sort; }
92
+		}
93
+		#endregion Model
94
+
95
+	}
96
+}

+ 285 - 0
代码/TVShoppingCallCenter_ZLJ/Models/Dtos/ProductDto.cs

@@ -0,0 +1,285 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Threading.Tasks;
5
+
6
+namespace TVShoppingCallCenter_ZLJ.Models.Dtos
7
+{
8
+    public class ProductDto
9
+	{
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
+		/// <summary>
43
+		/// 产品编号ID
44
+		/// </summary>
45
+		public int F_ProductId
46
+		{
47
+			set { _f_productid = value; }
48
+			get { return _f_productid; }
49
+		}
50
+		/// <summary>
51
+		/// 产品条形码
52
+		/// </summary>
53
+		public string F_ProductNumber
54
+		{
55
+			set { _f_productnumber = value; }
56
+			get { return _f_productnumber; }
57
+		}
58
+		/// <summary>
59
+		/// 产品名称
60
+		/// </summary>
61
+		public string F_ProductName
62
+		{
63
+			set { _f_productname = value; }
64
+			get { return _f_productname; }
65
+		}
66
+		/// <summary>
67
+		/// 产品简称/编码
68
+		/// </summary>
69
+		public string F_ProductShortName
70
+		{
71
+			set { _f_productshortname = value; }
72
+			get { return _f_productshortname; }
73
+		}
74
+		/// <summary>
75
+		/// 分类名称
76
+		/// </summary>
77
+		public string F_ClassName
78
+		{
79
+			set { _f_classname = value; }
80
+			get { return _f_classname; }
81
+		}
82
+		/// <summary>
83
+		/// 分类id
84
+		/// </summary>
85
+		public int F_ClassId
86
+		{
87
+			set { _f_classid = value; }
88
+			get { return _f_classid; }
89
+		}
90
+		/// <summary>
91
+		/// 拼音简码
92
+		/// </summary>
93
+		public string F_PinyinShort
94
+		{
95
+			set { _f_pinyinshort = value; }
96
+			get { return _f_pinyinshort; }
97
+		}
98
+		/// <summary>
99
+		/// 上架时间
100
+		/// </summary>
101
+		public DateTime? F_OnSaleBegin
102
+		{
103
+			set { _f_onsalebegin = value; }
104
+			get { return _f_onsalebegin; }
105
+		}
106
+		/// <summary>
107
+		/// 下架时间
108
+		/// </summary>
109
+		public DateTime? F_OnSaleEnd
110
+		{
111
+			set { _f_onsaleend = value; }
112
+			get { return _f_onsaleend; }
113
+		}
114
+		/// <summary>
115
+		/// 是否正在上架(可暂不启用)
116
+		/// </summary>
117
+		public bool F_IsSale
118
+		{
119
+			set { _f_issale = value; }
120
+			get { return _f_issale; }
121
+		}
122
+		/// <summary>
123
+		/// 生产厂家
124
+		/// </summary>
125
+		public string F_Factory
126
+		{
127
+			set { _f_factory = value; }
128
+			get { return _f_factory; }
129
+		}
130
+		/// <summary>
131
+		/// 产品产地
132
+		/// </summary>
133
+		public string F_Address
134
+		{
135
+			set { _f_address = value; }
136
+			get { return _f_address; }
137
+		}
138
+		/// <summary>
139
+		/// 供货商
140
+		/// </summary>
141
+		public string F_Supplier
142
+		{
143
+			set { _f_supplier = value; }
144
+			get { return _f_supplier; }
145
+		}
146
+		/// <summary>
147
+		/// 兑换积分
148
+		/// </summary>
149
+		public int? F_Integral
150
+		{
151
+			set { _f_integral = value; }
152
+			get { return _f_integral; }
153
+		}
154
+		/// <summary>
155
+		/// 市场价
156
+		/// </summary>
157
+		public decimal? F_MarketPrice
158
+		{
159
+			set { _f_marketprice = value; }
160
+			get { return _f_marketprice; }
161
+		}
162
+		/// <summary>
163
+		/// 会员价
164
+		/// </summary>
165
+		public decimal? F_MemberPrice
166
+		{
167
+			set { _f_memberprice = value; }
168
+			get { return _f_memberprice; }
169
+		}
170
+		/// <summary>
171
+		/// 特价/优惠价
172
+		/// </summary>
173
+		public decimal? F_SpecialPrice
174
+		{
175
+			set { _f_specialprice = value; }
176
+			get { return _f_specialprice; }
177
+		}
178
+		/// <summary>
179
+		/// 0整除 1已删除(隐藏)
180
+		/// </summary>
181
+		public int? F_IsDelete
182
+		{
183
+			set { _f_isdelete = value; }
184
+			get { return _f_isdelete; }
185
+		}
186
+		/// <summary>
187
+		/// 产品描述
188
+		/// </summary>
189
+		public string F_Des
190
+		{
191
+			set { _f_des = value; }
192
+			get { return _f_des; }
193
+		}
194
+		/// <summary>
195
+		/// 商品属性(体积)规格(暂不启用)
196
+		/// </summary>
197
+		public string F_Attribute
198
+		{
199
+			set { _f_attribute = value; }
200
+			get { return _f_attribute; }
201
+		}
202
+		/// <summary>
203
+		/// 产品重量
204
+		/// </summary>
205
+		public decimal? F_Weight
206
+		{
207
+			set { _f_weight = value; }
208
+			get { return _f_weight; }
209
+		}
210
+		/// <summary>
211
+		/// 产品标签
212
+		/// </summary>
213
+		public string F_Tag
214
+		{
215
+			set { _f_tag = value; }
216
+			get { return _f_tag; }
217
+		}
218
+		/// <summary>
219
+		/// 产品图片(暂不启用)
220
+		/// </summary>
221
+		public string F_Picture
222
+		{
223
+			set { _f_picture = value; }
224
+			get { return _f_picture; }
225
+		}
226
+		/// <summary>
227
+		/// 产品视频(暂不启用)
228
+		/// </summary>
229
+		public string F_Video
230
+		{
231
+			set { _f_video = value; }
232
+			get { return _f_video; }
233
+		}
234
+		/// <summary>
235
+		/// 产品图文介绍(暂不启用)
236
+		/// </summary>
237
+		public string F_Content
238
+		{
239
+			set { _f_content = value; }
240
+			get { return _f_content; }
241
+		}
242
+		/// <summary>
243
+		/// 操作人Id
244
+		/// </summary>
245
+		public int? F_UserId
246
+		{
247
+			set { _f_userid = value; }
248
+			get { return _f_userid; }
249
+		}
250
+		/// <summary>
251
+		/// 操作人姓名
252
+		/// </summary>
253
+		public string F_UserName
254
+		{
255
+			set { _f_username = value; }
256
+			get { return _f_username; }
257
+		}
258
+		/// <summary>
259
+		/// 添加时间
260
+		/// </summary>
261
+		public DateTime? F_AddTime
262
+		{
263
+			set { _f_addtime = value; }
264
+			get { return _f_addtime; }
265
+		}
266
+		/// <summary>
267
+		/// 上次操作时间
268
+		/// </summary>
269
+		public DateTime? F_UpdateTime
270
+		{
271
+			set { _f_updatetime = value; }
272
+			get { return _f_updatetime; }
273
+		}
274
+		/// <summary>
275
+		/// 排序
276
+		/// </summary>
277
+		public int F_Sort
278
+		{
279
+			set { _f_sort = value; }
280
+			get { return _f_sort; }
281
+		}
282
+		#endregion Model
283
+
284
+	}
285
+}

+ 5 - 0
代码/TVShoppingCallCenter_ZLJ/Startup.cs

@@ -114,6 +114,11 @@ namespace TVShoppingCallCenter_ZLJ
114 114
             services.AddTransient<ISys_RoleFunctionRepository, Sys_RoleFunctionRepository>();
115 115
             services.AddTransient<ISys_SeatPermissionConfigRepository, Sys_SeatPermissionConfigRepository>();
116 116
             services.AddTransient<ISys_SystemConfigRepository, Sys_SystemConfigRepository>();
117
+
118
+
119
+            services.AddTransient<IBus_ProductClassRepository, Bus_ProductClassRepository>();
120
+            services.AddTransient<IBus_ProductRepository, Bus_ProductRepository>();
121
+
117 122
             #endregion
118 123
 
119 124
             //services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);