|
|
@@ -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)
|