Ver Código Fonte

mod:公共协作完成按钮判断

weieryang 3 anos atrás
pai
commit
541b7bd565

+ 18 - 3
RMYY_CallCenter_Api/Common/WorkOrderBase.cs

266
             }
266
             }
267
 
267
 
268
             // 获取对应字段名
268
             // 获取对应字段名
269
-            string typeFieldName = "", stateFieldName = "", gapTimeFieldName = "", endTimeFieldName = "";
269
+            string typeFieldName = "", stateFieldName = "", gapTimeFieldName = "", endTimeFieldName = "", assistanceStateFieldName = "";
270
 
270
 
271
             for (int i = 0; i < dt.Columns.Count; i++)
271
             for (int i = 0; i < dt.Columns.Count; i++)
272
             {
272
             {
301
                                 endTimeFieldName = dt.Columns[i].ColumnName;
301
                                 endTimeFieldName = dt.Columns[i].ColumnName;
302
                             }
302
                             }
303
                         }; break;
303
                         }; break;
304
+                    case "AssistanceState":
305
+                        {
306
+                            if (assistanceStateFieldName == "")
307
+                            {
308
+                                assistanceStateFieldName = dt.Columns[i].ColumnName;
309
+                            }
310
+                        }; break;
304
                     default: break;
311
                     default: break;
305
                 }
312
                 }
306
             }
313
             }
325
                 {
332
                 {
326
                     thisTypeId = int.Parse(dr[typeFieldName].ToString());
333
                     thisTypeId = int.Parse(dr[typeFieldName].ToString());
327
                 }
334
                 }
328
-                var allButtons = WorkOrderButton.GetButtons(menuName, thisTypeId, int.Parse(dr[stateFieldName].ToString()), roleId);
335
+
336
+                int assistanceState = 1;
337
+                if (assistanceStateFieldName != "" && dr[assistanceStateFieldName].ToString() == "未完成")
338
+                {
339
+                    assistanceState = 0;
340
+                }
341
+                
342
+
343
+                var allButtons = WorkOrderButton.GetButtons(menuName, thisTypeId, int.Parse(dr[stateFieldName].ToString()), roleId, assistanceState);
329
 
344
 
330
                 //TODO: 特殊逻辑处理
345
                 //TODO: 特殊逻辑处理
331
 
346
 
349
                         }
364
                         }
350
                     }
365
                     }
351
 
366
 
352
-                    if (dr["GapTime"] != "-")
367
+                    if (dr["GapTime"].ToString() != "-")
353
                     {
368
                     {
354
                         TimeSpan ts = deadline.Subtract(thisDate);
369
                         TimeSpan ts = deadline.Subtract(thisDate);
355
                         double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
370
                         double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());

+ 19 - 2
RMYY_CallCenter_Api/Common/WorkOrderButton.cs

13
         private static string _buttonCacheKey = "ButtonCacheKey_";
13
         private static string _buttonCacheKey = "ButtonCacheKey_";
14
         private static Bll.T_Sys_Menu menuBLL = new Bll.T_Sys_Menu();
14
         private static Bll.T_Sys_Menu menuBLL = new Bll.T_Sys_Menu();
15
 
15
 
16
-        public static List<Button> GetButtons(MENUENUM menuName, int type, int status, int roleId = 0)
16
+        public static List<Button> GetButtons(MENUENUM menuName, int type, int status, int roleId = 0, int assistanceState = 0)
17
         {
17
         {
18
             var desc = menuName.GetType().GetMember(menuName.ToString())[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
18
             var desc = menuName.GetType().GetMember(menuName.ToString())[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
19
             if (desc == null || desc.Length != 1)
19
             if (desc == null || desc.Length != 1)
28
                 return buttonList;
28
                 return buttonList;
29
             }
29
             }
30
 
30
 
31
-            buttonList = buttons.Where(p => p.type == type && (p.status.IndexOf(status) >= 0 || p.status.Count == 0)).ToList();
31
+            List<string> filterButtons = GetAssistanceFilterButtons(type);
32
+
33
+            buttonList = buttons.Where(p => p.type == type && (p.status.IndexOf(status) >= 0 || p.status.Count == 0) && (assistanceState == 1 || (assistanceState == 0 && !filterButtons.Contains(p.key)))).ToList();
32
 
34
 
33
             // 获取角色对应的按钮
35
             // 获取角色对应的按钮
34
             List<string> roleButtons = null;
36
             List<string> roleButtons = null;
102
             return returnList;
104
             return returnList;
103
         }
105
         }
104
 
106
 
107
+
108
+        private static List<string> GetAssistanceFilterButtons(int type)
109
+        {
110
+            List<string> returnList = new List<string>();
111
+            switch (type)
112
+            {
113
+                case 3000: returnList = new List<string> { "wancheng", "" }; break;
114
+            }
115
+
116
+            return returnList;
117
+        }
118
+
105
     }
119
     }
106
 
120
 
121
+
122
+ 
123
+
107
     /// <summary>
124
     /// <summary>
108
     /// 列表菜单,需要和T_Sys_Menu保持一致
125
     /// 列表菜单,需要和T_Sys_Menu保持一致
109
     /// </summary>
126
     /// </summary>