浏览代码

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

weieryang 3 年之前
父节点
当前提交
541b7bd565
共有 2 个文件被更改,包括 37 次插入5 次删除
  1. 18 3
      RMYY_CallCenter_Api/Common/WorkOrderBase.cs
  2. 19 2
      RMYY_CallCenter_Api/Common/WorkOrderButton.cs

+ 18 - 3
RMYY_CallCenter_Api/Common/WorkOrderBase.cs

@@ -266,7 +266,7 @@ namespace RMYY_CallCenter_Api
266 266
             }
267 267
 
268 268
             // 获取对应字段名
269
-            string typeFieldName = "", stateFieldName = "", gapTimeFieldName = "", endTimeFieldName = "";
269
+            string typeFieldName = "", stateFieldName = "", gapTimeFieldName = "", endTimeFieldName = "", assistanceStateFieldName = "";
270 270
 
271 271
             for (int i = 0; i < dt.Columns.Count; i++)
272 272
             {
@@ -301,6 +301,13 @@ namespace RMYY_CallCenter_Api
301 301
                                 endTimeFieldName = dt.Columns[i].ColumnName;
302 302
                             }
303 303
                         }; break;
304
+                    case "AssistanceState":
305
+                        {
306
+                            if (assistanceStateFieldName == "")
307
+                            {
308
+                                assistanceStateFieldName = dt.Columns[i].ColumnName;
309
+                            }
310
+                        }; break;
304 311
                     default: break;
305 312
                 }
306 313
             }
@@ -325,7 +332,15 @@ namespace RMYY_CallCenter_Api
325 332
                 {
326 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 345
                 //TODO: 特殊逻辑处理
331 346
 
@@ -349,7 +364,7 @@ namespace RMYY_CallCenter_Api
349 364
                         }
350 365
                     }
351 366
 
352
-                    if (dr["GapTime"] != "-")
367
+                    if (dr["GapTime"].ToString() != "-")
353 368
                     {
354 369
                         TimeSpan ts = deadline.Subtract(thisDate);
355 370
                         double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());

+ 19 - 2
RMYY_CallCenter_Api/Common/WorkOrderButton.cs

@@ -13,7 +13,7 @@ namespace RMYY_CallCenter_Api
13 13
         private static string _buttonCacheKey = "ButtonCacheKey_";
14 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 18
             var desc = menuName.GetType().GetMember(menuName.ToString())[0].GetCustomAttributes(typeof(DescriptionAttribute), false);
19 19
             if (desc == null || desc.Length != 1)
@@ -28,7 +28,9 @@ namespace RMYY_CallCenter_Api
28 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 36
             List<string> roleButtons = null;
@@ -102,8 +104,23 @@ namespace RMYY_CallCenter_Api
102 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 124
     /// <summary>
108 125
     /// 列表菜单,需要和T_Sys_Menu保持一致
109 126
     /// </summary>