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

+ 10 - 12
代码/TVShoppingCallCenter_ZLJ/Controllers/IndexCategory/IndexBaseController.cs

@@ -30,11 +30,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
30 30
         [HttpPost("add")]
31 31
         public async Task<IActionResult> AddAsync(T_QC_IndexBase input)
32 32
         {
33
-                if (input.F_Sort > 100000)
34
-                {
35
-                    return Error("排序过大,请重新输入");
36
-                }
37
-            if (input.F_CategoryId<=0)
33
+            if (input.F_Sort > 100000)
34
+            {
35
+                return Error("排序过大,请重新输入");
36
+            }
37
+            if (input.F_CategoryId <= 0)
38 38
             {
39 39
                 return Error("请选择指标分类");
40 40
             }
@@ -42,7 +42,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
42 42
             {
43 43
                 return Error("请输入分值");
44 44
             }
45
-            string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
45
+            string user = "8000";
46
+            //string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
46 47
             input.F_CreateOn = DateTime.Now;
47 48
             input.F_CreateBy = user;
48 49
             input.F_DeleteFlag = 0;
@@ -79,7 +80,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
79 80
             {
80 81
                 return Error("请输入分值");
81 82
             }
82
-            string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
83
+             string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
83 84
             var model = await _qc_indexbasereposytory.GetSingle(x => x.F_IndexId  == input.F_IndexId);
84 85
 
85 86
             if (model == null)
@@ -138,7 +139,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
138 139
         /// <param name="pagesize"></param>
139 140
         /// <returns></returns>
140 141
         [HttpGet("getlist")]
141
-        public async Task<IActionResult> GetListMark(string keyword, int ParentId = -1, int smstype = -1, int isread = -1, int pageindex = 0, int pagesize = 0)
142
+        public async Task<IActionResult> GetListMark(string keyword,int  pageindex = 0, int pagesize = 0)
142 143
         {
143 144
             // string user = "8000";
144 145
 
@@ -157,10 +158,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
157 158
                     }
158 159
                 });
159 160
             }
160
-            if (ParentId > 0)
161
-            {
162
-                conModels.Add(new ConditionalModel() { FieldName = "F_ParentId", ConditionalType = ConditionalType.Like, FieldValue = ParentId.ToString() });
163
-            }
161
+           
164 162
 
165 163
 
166 164
             #endregion

+ 10 - 8
代码/TVShoppingCallCenter_ZLJ/Controllers/IndexCategory/IndexCategoryController.cs

@@ -17,9 +17,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
17 17
     public class IndexCategoryController : BaseController
18 18
     {
19 19
         private readonly IQC_IndexCategoryReposytory _qc_indexcategoryreposytory;
20
-        public IndexCategoryController(IQC_IndexCategoryReposytory qc_indexcategoryreposytory )
20
+        private readonly IQC_IndexBaseReposytory _qc_indexbasereposytory;
21
+        public IndexCategoryController(IQC_IndexCategoryReposytory qc_indexcategoryreposytory, IQC_IndexBaseReposytory qc_indexbasereposytory)
21 22
         {
22 23
             _qc_indexcategoryreposytory = qc_indexcategoryreposytory;
24
+            _qc_indexbasereposytory = qc_indexbasereposytory;
23 25
         }
24 26
         /// <summary>
25 27
         /// 添加指标
@@ -79,6 +81,12 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
79 81
             var model =  _qc_indexcategoryreposytory.GetSingle(x => x.F_CategoryId == id).Result ;
80 82
             if (model == null)
81 83
                 return Error("该指标不存在");
84
+            var dt = _qc_indexbasereposytory.GetListALL(x => x.F_CategoryId == model.F_CategoryId).Result ;
85
+            if (dt!=null )
86
+            {
87
+                if (dt.Count >0)
88
+                return Error("请先删除此分类下的指标");
89
+            }
82 90
             model.F_DeleteFlag = (int)EnumUserCountState.Delete;
83 91
             bool n = _qc_indexcategoryreposytory.Update(model).Result;
84 92
             if (n )
@@ -94,7 +102,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
94 102
         /// <param name="pagesize"></param>
95 103
         /// <returns></returns>
96 104
         [HttpGet("getlist")]
97
-        public async Task<IActionResult> GetListMark(string name, int ParentId = -1, int smstype = -1, int isread = -1, int pageindex = 0, int pagesize = 0)
105
+        public async Task<IActionResult> GetListMark(string name, int pageindex = 0, int pagesize = 0)
98 106
         {
99 107
             // string user = "8000";
100 108
           
@@ -102,12 +110,6 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.IndexCategory
102 110
             #region 条件筛选
103 111
             conModels.Add(new ConditionalModel() { FieldName = "F_DeleteFlag", ConditionalType = ConditionalType.Equal, FieldValue ="0"});
104 112
             conModels.Add(new ConditionalModel() { FieldName = "F_CategoryName", ConditionalType = ConditionalType.Like , FieldValue = name });
105
-            if (ParentId>0)
106
-            {
107
-                conModels.Add(new ConditionalModel() { FieldName = "F_ParentId", ConditionalType = ConditionalType.Like, FieldValue = ParentId.ToString () });
108
-            }
109
-            
110
-
111 113
             #endregion
112 114
             int recordCount = 0;
113 115
             if (pageindex > 0 && pagesize > 0)

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

@@ -160,6 +160,9 @@ namespace TVShoppingCallCenter_ZLJ
160 160
 
161 161
             services.AddTransient<IQC_IndexBaseReposytory, QC_IndexBaseReposytory>();
162 162
             services.AddTransient<IQC_IndexCategoryReposytory, QC_IndexCategoryReposytory>();
163
+
164
+            services.AddTransient<IRepositoryCategoryRepository, RepositoryCategoryRepository>();
165
+            services.AddTransient<IRepositoryInformationRepository, RepositoryInformationRepository>();
163 166
             #endregion
164 167
 
165 168