|
|
@@ -18,9 +18,9 @@ namespace CallCenterApi.Interface.Controllers
|
|
18
|
18
|
[Authorize]
|
|
19
|
19
|
public class ModuleInfoController : BaseController
|
|
20
|
20
|
{
|
|
21
|
|
- private BLL.T_Sys_ModuleInfo moduleInfoBLL= new BLL.T_Sys_ModuleInfo();
|
|
|
21
|
+ private BLL.T_Sys_ModuleInfo moduleInfoBLL = new BLL.T_Sys_ModuleInfo();
|
|
|
22
|
+
|
|
22
|
23
|
|
|
23
|
|
-
|
|
24
|
24
|
/// <summary>
|
|
25
|
25
|
/// 返回树形下拉框 菜单数据
|
|
26
|
26
|
/// </summary>
|
|
|
@@ -30,7 +30,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
30
|
30
|
{
|
|
31
|
31
|
var ds_ModuleInfo = moduleInfoBLL.GetAllList();//DataSet
|
|
32
|
32
|
List<Model.T_Sys_ModuleInfo> list_ModuleInfo = moduleInfoBLL.DataTableToList(ds_ModuleInfo.Tables[0]);
|
|
33
|
|
- list_ModuleInfo.Sort((x,y)=>x.F_Sort-y.F_Sort);//排序
|
|
|
33
|
+ list_ModuleInfo.Sort((x, y) => x.F_Sort - y.F_Sort);//排序
|
|
34
|
34
|
var treeList = new List<TreeModel>();
|
|
35
|
35
|
foreach (var item in list_ModuleInfo)
|
|
36
|
36
|
{
|
|
|
@@ -58,11 +58,11 @@ namespace CallCenterApi.Interface.Controllers
|
|
58
|
58
|
List<Model.T_Sys_ModuleInfo> list_ModuleInfo = moduleInfoBLL.DataTableToList(ds_ModuleInfo.Tables[0]);
|
|
59
|
59
|
if (!string.IsNullOrEmpty(keyword))
|
|
60
|
60
|
{
|
|
61
|
|
- list_ModuleInfo=list_ModuleInfo.TreeWhere(t => t.F_ModuleName.Contains(keyword), "F_ModuleId", "F_ParentID").ToList();
|
|
|
61
|
+ list_ModuleInfo = list_ModuleInfo.TreeWhere(t => t.F_ModuleName.Contains(keyword), "F_ModuleId", "F_ParentID").ToList();
|
|
62
|
62
|
}
|
|
63
|
63
|
list_ModuleInfo.Sort((x, y) => x.F_Sort - y.F_Sort);//排序
|
|
64
|
64
|
return Success("获取菜单", list_ModuleInfo);
|
|
65
|
|
-
|
|
|
65
|
+
|
|
66
|
66
|
}
|
|
67
|
67
|
|
|
68
|
68
|
/// <summary>
|
|
|
@@ -76,7 +76,15 @@ namespace CallCenterApi.Interface.Controllers
|
|
76
|
76
|
var entity_ModuleInfo = moduleInfoBLL.GetModel(mId);
|
|
77
|
77
|
if (entity_ModuleInfo != null)
|
|
78
|
78
|
{
|
|
79
|
|
- return Success("加载菜单成功", entity_ModuleInfo);
|
|
|
79
|
+ return Success("加载菜单成功", new
|
|
|
80
|
+ {
|
|
|
81
|
+ name = entity_ModuleInfo.F_ModuleName,
|
|
|
82
|
+ code = entity_ModuleInfo.F_ModuleCode,
|
|
|
83
|
+ url = entity_ModuleInfo.F_OptUrl,
|
|
|
84
|
+ enable = entity_ModuleInfo.F_StateFlag,
|
|
|
85
|
+ remark = entity_ModuleInfo.F_Remark,
|
|
|
86
|
+ sort = entity_ModuleInfo.F_Sort
|
|
|
87
|
+ });
|
|
80
|
88
|
}
|
|
81
|
89
|
else
|
|
82
|
90
|
{
|
|
|
@@ -94,21 +102,17 @@ namespace CallCenterApi.Interface.Controllers
|
|
94
|
102
|
public ActionResult AddModule(ModuleInfoDto input)
|
|
95
|
103
|
{
|
|
96
|
104
|
var entity_ModuleInfo = new Model.T_Sys_ModuleInfo();
|
|
97
|
|
- entity_ModuleInfo.F_ModuleId = input.F_ModuleId;
|
|
98
|
|
- entity_ModuleInfo.F_ModuleName = input.F_ModuleName;
|
|
99
|
|
- entity_ModuleInfo.F_ModuleCode = input.F_ModuleCode;
|
|
100
|
|
- entity_ModuleInfo.F_Remark = input.F_Remark;
|
|
101
|
|
- entity_ModuleInfo.F_Sort = input.F_Sort;
|
|
102
|
|
- entity_ModuleInfo.F_StateFlag = input.F_StateFlag;
|
|
103
|
|
- entity_ModuleInfo.F_OptUrl = input.F_OptUrl;
|
|
104
|
|
- entity_ModuleInfo.F_ImgUrl = input.F_ImgUrl;
|
|
105
|
|
- entity_ModuleInfo.F_Target = input.F_Target;
|
|
106
|
|
- entity_ModuleInfo.F_IsMenu = input.F_IsMenu;
|
|
107
|
|
- entity_ModuleInfo.F_Button = input.F_Button;
|
|
108
|
|
- entity_ModuleInfo.F_CreateTime = input.F_Time;
|
|
109
|
|
- entity_ModuleInfo.F_CreateUID = input.F_UID;
|
|
110
|
|
-
|
|
111
|
|
- if (moduleInfoBLL.Add(entity_ModuleInfo)>0)
|
|
|
105
|
+ entity_ModuleInfo.F_ParentID = input.parentid;
|
|
|
106
|
+ entity_ModuleInfo.F_ModuleName = input.name;
|
|
|
107
|
+ entity_ModuleInfo.F_ModuleCode = input.code;
|
|
|
108
|
+ entity_ModuleInfo.F_Remark = input.remark;
|
|
|
109
|
+ entity_ModuleInfo.F_Sort = input.sort;
|
|
|
110
|
+ entity_ModuleInfo.F_StateFlag = Convert.ToInt32(input.flag);
|
|
|
111
|
+ entity_ModuleInfo.F_OptUrl = input.url;
|
|
|
112
|
+ entity_ModuleInfo.F_CreateTime = DateTime.Now;
|
|
|
113
|
+ entity_ModuleInfo.F_CreateUID = CurrentUser.UserData.F_UserId;
|
|
|
114
|
+
|
|
|
115
|
+ if (moduleInfoBLL.Add(entity_ModuleInfo) > 0)
|
|
112
|
116
|
{
|
|
113
|
117
|
return Success("菜单添加成功");
|
|
114
|
118
|
}
|
|
|
@@ -116,7 +120,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
116
|
120
|
{
|
|
117
|
121
|
return Error("菜单添加失败,请重试!");
|
|
118
|
122
|
}
|
|
119
|
|
-
|
|
|
123
|
+
|
|
120
|
124
|
}
|
|
121
|
125
|
|
|
122
|
126
|
/// <summary>
|
|
|
@@ -156,22 +160,17 @@ namespace CallCenterApi.Interface.Controllers
|
|
156
|
160
|
[HttpPost]
|
|
157
|
161
|
public ActionResult EditModule(ModuleInfoDto input)
|
|
158
|
162
|
{
|
|
159
|
|
- var entity_ModuleInfo = moduleInfoBLL.GetModel(input.F_ModuleId);
|
|
|
163
|
+ var entity_ModuleInfo = moduleInfoBLL.GetModel(input.id);
|
|
160
|
164
|
if (entity_ModuleInfo != null)
|
|
161
|
165
|
{
|
|
162
|
|
- entity_ModuleInfo.F_ModuleId = input.F_ModuleId;
|
|
163
|
|
- entity_ModuleInfo.F_ModuleName = input.F_ModuleName;
|
|
164
|
|
- entity_ModuleInfo.F_ModuleCode = input.F_ModuleCode;
|
|
165
|
|
- entity_ModuleInfo.F_Remark = input.F_Remark;
|
|
166
|
|
- entity_ModuleInfo.F_Sort = input.F_Sort;
|
|
167
|
|
- entity_ModuleInfo.F_StateFlag = input.F_StateFlag;
|
|
168
|
|
- entity_ModuleInfo.F_OptUrl = input.F_OptUrl;
|
|
169
|
|
- entity_ModuleInfo.F_ImgUrl = input.F_ImgUrl;
|
|
170
|
|
- entity_ModuleInfo.F_Target = input.F_Target;
|
|
171
|
|
- entity_ModuleInfo.F_IsMenu = input.F_IsMenu;
|
|
172
|
|
- entity_ModuleInfo.F_Button = input.F_Button;
|
|
173
|
|
- entity_ModuleInfo.F_LastModifyTime = input.F_Time;
|
|
174
|
|
- entity_ModuleInfo.F_LastModifyUID = input.F_UID;
|
|
|
166
|
+ entity_ModuleInfo.F_ParentID = input.parentid;
|
|
|
167
|
+ entity_ModuleInfo.F_ModuleName = input.name;
|
|
|
168
|
+ entity_ModuleInfo.F_ModuleCode = input.code;
|
|
|
169
|
+ entity_ModuleInfo.F_Remark = input.remark;
|
|
|
170
|
+ entity_ModuleInfo.F_Sort = input.sort;
|
|
|
171
|
+ entity_ModuleInfo.F_StateFlag = Convert.ToInt32(input.flag);
|
|
|
172
|
+ entity_ModuleInfo.F_OptUrl = input.url;
|
|
|
173
|
+
|
|
175
|
174
|
|
|
176
|
175
|
if (moduleInfoBLL.Update(entity_ModuleInfo))
|
|
177
|
176
|
{
|
|
|
@@ -198,11 +197,11 @@ namespace CallCenterApi.Interface.Controllers
|
|
198
|
197
|
{
|
|
199
|
198
|
var sql = "";
|
|
200
|
199
|
var key = WebHelper.Formatstr(filter.Name ?? "");
|
|
201
|
|
- if (key!="")
|
|
|
200
|
+ if (key != "")
|
|
202
|
201
|
{
|
|
203
|
|
- sql += " and F_ModuleName like '%" + key+ "%' ";
|
|
|
202
|
+ sql += " and F_ModuleName like '%" + key + "%' ";
|
|
204
|
203
|
}
|
|
205
|
|
-
|
|
|
204
|
+
|
|
206
|
205
|
int recordCount = 0;
|
|
207
|
206
|
Model.PageData<Model.T_Sys_ModuleInfo> pageModel = new Model.PageData<Model.T_Sys_ModuleInfo>();
|
|
208
|
207
|
|
|
|
@@ -221,12 +220,8 @@ namespace CallCenterApi.Interface.Controllers
|
|
221
|
220
|
rows = dt,
|
|
222
|
221
|
total = recordCount
|
|
223
|
222
|
};
|
|
224
|
|
- return Content(obj.ToJson());
|
|
225
|
|
-
|
|
226
|
|
- }
|
|
227
|
|
-
|
|
228
|
|
-
|
|
229
|
|
-
|
|
|
223
|
+ return Content(obj.ToJson());
|
|
230
|
224
|
|
|
|
225
|
+ }
|
|
231
|
226
|
}
|
|
232
|
227
|
}
|