Procházet zdrojové kódy

菜单管理修改,修复bug679

zhengbingbing %!s(int64=8) %!d(string=před) roky
rodič
revize
a4e8cad0e1

+ 2 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/MenuManage/ModuleInfoController.cs

@@ -159,7 +159,8 @@ namespace CallCenterApi.Interface.Controllers
159 159
             var entity_ModuleInfo = moduleInfoBLL.GetModel(input.id);
160 160
             if (entity_ModuleInfo != null)
161 161
             {
162
-                entity_ModuleInfo.F_ParentID = input.parentid;
162
+                if (input.parentid > 0)
163
+                    entity_ModuleInfo.F_ParentID = input.parentid;
163 164
                 entity_ModuleInfo.F_ModuleName = input.name;
164 165
                 entity_ModuleInfo.F_ModuleCode = input.code;
165 166
                 entity_ModuleInfo.F_Remark = input.remark;

+ 53 - 43
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/ModuleController.cs

@@ -108,7 +108,8 @@ namespace CallCenterApi.Interface.Controllers
108 108
                             enable = baseModel.F_StateFlag,
109 109
                             remark = baseModel.F_Remark,
110 110
                             sort = baseModel.F_Sort,
111
-                            type = baseModel.F_Type
111
+                            type = baseModel.F_Type,
112
+                            parentid=baseModel.F_ParentId
112 113
                         },
113 114
                         modellist = filterModuleList.Select(x => new
114 115
                         {
@@ -132,27 +133,29 @@ namespace CallCenterApi.Interface.Controllers
132 133
         public ActionResult AddModule(ModuleFunctionInput input)
133 134
         {
134 135
             ActionResult res = NoToken("未知错误,请重新登录");
135
-   
136
-                BLL.T_Sys_ModuleFunctions orderBll = new BLL.T_Sys_ModuleFunctions();
137
-                Model.T_Sys_ModuleFunctions orderModel = new Model.T_Sys_ModuleFunctions();
138
-                if (input.ParentId <= 0) return Error("参数错误");
139
-                var model = orderBll.GetModel(input.ParentId);
140
-                if (model == null) return Error("父节点不存在");
141
-                orderModel.F_ParentId = model.F_FunctionId;
142
-                orderModel.F_ParentCode = model.F_ParentCode;
143
-                orderModel.F_Name = input.Name;
144
-                orderModel.F_FunctionCode = input.Code;
145
-                orderModel.F_Controller = input.Controller;
146
-                orderModel.F_Action = input.Action;
147
-                orderModel.F_OptUrl = input.Url;
148
-                orderModel.F_Remark = input.Remark;
149
-                orderModel.F_Sort = input.Sort;
150
-                orderModel.F_StateFlag = input.Flag ? 1 : 0;
151
-                orderModel.F_Type = input.Type;
152
-                if (orderBll.Add(orderModel) > 0)
153
-                    res = Success("菜单添加成功");
154
-                else
155
-                    res = Error("菜单添加失败");
136
+
137
+            BLL.T_Sys_ModuleFunctions orderBll = new BLL.T_Sys_ModuleFunctions();
138
+            Model.T_Sys_ModuleFunctions orderModel = new Model.T_Sys_ModuleFunctions();
139
+
140
+            if (input.ParentId <= 0) return Error("参数错误");
141
+            var model = orderBll.GetModel(input.ParentId);
142
+            if (model == null) return Error("父节点不存在");
143
+            orderModel.F_ParentId = model.F_FunctionId;
144
+            orderModel.F_ParentCode = model.F_ParentCode;
145
+
146
+            orderModel.F_Name = input.Name;
147
+            orderModel.F_FunctionCode = input.Code;
148
+            orderModel.F_Controller = input.Controller;
149
+            orderModel.F_Action = input.Action;
150
+            orderModel.F_OptUrl = input.Url;
151
+            orderModel.F_Remark = input.Remark;
152
+            orderModel.F_Sort = input.Sort;
153
+            orderModel.F_StateFlag = input.Flag ? 1 : 0;
154
+            orderModel.F_Type = input.Type;
155
+            if (orderBll.Add(orderModel) > 0)
156
+                res = Success("菜单添加成功");
157
+            else
158
+                res = Error("菜单添加失败");
156 159
 
157 160
 
158 161
             return res;
@@ -167,32 +170,39 @@ namespace CallCenterApi.Interface.Controllers
167 170
         public ActionResult EditModule(ModuleFunctionInput input)
168 171
         {
169 172
             ActionResult res = NoToken("未知错误,请重新登录");
170
-       
171
-                BLL.T_Sys_ModuleFunctions orderBll = new BLL.T_Sys_ModuleFunctions();
172
-                Model.T_Sys_ModuleFunctions orderModel = orderBll.GetModel(input.ParentId);
173
-                if (orderModel != null)
173
+
174
+            BLL.T_Sys_ModuleFunctions orderBll = new BLL.T_Sys_ModuleFunctions();
175
+            Model.T_Sys_ModuleFunctions orderModel = orderBll.GetModel(input.ParentId);
176
+            if (orderModel != null)
177
+            {
178
+                orderModel.F_Name = input.Name;
179
+                //orderModel.F_Controller = input.Controller;
180
+                //orderModel.F_Action = input.Action;
181
+                orderModel.F_OptUrl = input.Url;
182
+                orderModel.F_Remark = input.Remark;
183
+                orderModel.F_Sort = input.Sort;
184
+                orderModel.F_StateFlag = input.Flag ? 1 : 0;
185
+                orderModel.F_Type = input.Type;
186
+
187
+                if (input.ParentId <= 0) return Error("参数错误");
188
+                var model = orderBll.GetModel(input.ParentId);
189
+                if (model == null) return Error("父节点不存在");
190
+                orderModel.F_ParentId = input.ParentId;
191
+                orderModel.F_ParentCode = model.F_ParentCode;
192
+
193
+                if (orderBll.Update(orderModel))
174 194
                 {
175
-                    orderModel.F_Name = input.Name;
176
-                    //orderModel.F_Controller = input.Controller;
177
-                    //orderModel.F_Action = input.Action;
178
-                    orderModel.F_OptUrl = input.Url;
179
-                    orderModel.F_Remark = input.Remark;
180
-                    orderModel.F_Sort = input.Sort;
181
-                    orderModel.F_StateFlag = input.Flag ? 1 : 0;
182
-                    orderModel.F_Type = input.Type;
183
-                    if (orderBll.Update(orderModel))
184
-                    {
185
-                        res = Success("菜单修改成功");
186
-                    }
187
-                    else
188
-                    {
189
-                        res = Error("菜单修改失败");
190
-                    }
195
+                    res = Success("菜单修改成功");
191 196
                 }
192 197
                 else
193 198
                 {
194
-                    res = Error("菜单对象获取失败");
199
+                    res = Error("菜单修改失败");
195 200
                 }
201
+            }
202
+            else
203
+            {
204
+                res = Error("菜单对象获取失败");
205
+            }
196 206
 
197 207
             return res;
198 208
         }