浏览代码

商品标签

duhongyu 5 年之前
父节点
当前提交
c1c0c01fc0

+ 1 - 1
代码/TVShoppingCallCenter_ZLJ/Controllers/AutoDial/OutboundTaskController.cs

@@ -161,7 +161,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.AutoDial
161 161
         [HttpPost("addmiddleware")]
162 162
         public async Task<IActionResult> Addmiddleware()
163 163
         {
164
-            string user ="8000";
164
+            string user = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
165 165
             List<IConditionalModel> conModels = new List<IConditionalModel>();
166 166
             conModels.Add(new ConditionalModel() { FieldName = "F_IsDelete", ConditionalType = ConditionalType.Equal, FieldValue = ((int)EnumUserCountState.Enabled).ToString() });
167 167
              conModels.Add(new ConditionalCollections()

+ 8 - 2
代码/TVShoppingCallCenter_ZLJ/Controllers/Product/TagController.cs

@@ -128,8 +128,12 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
128 128
                 input.NewTagName = input.NewTagName.Replace(".", "");
129 129
             }
130 130
             #endregion
131
-
132
-            Expression<Func<T_Bus_Tag, bool>> eq = a => a.F_TagName == input.TagName;
131
+            if (await _tagRepository.GetCount(x => x.F_TagName == input.NewTagName 
132
+                   && x.F_Type == input.Type && x.F_TagName!= input.TagName) > 0)
133
+            {
134
+                return Error("标签名称重复");
135
+            }
136
+            Expression<Func<T_Bus_Tag, bool>> eq = a =>( a.F_TagName == input.TagName);
133 137
 
134 138
             T_Bus_Tag T_Bus_TagModel = await _tagRepository.GetSingle(eq.And(b => b.F_Type == input.Type));
135 139
             //除非某固定权限 定之后再加
@@ -137,6 +141,8 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
137 141
             {
138 142
                 return Error("系统标签不能更改");
139 143
             }
144
+
145
+           
140 146
             T_Bus_TagModel.F_TagName = input.NewTagName;
141 147
             T_Bus_TagModel.F_Sort = input.Sort;
142 148