duhongyu 3 lat temu
rodzic
commit
79c4cb8770

+ 26 - 20
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/PushMessageController.cs

@@ -130,28 +130,41 @@ namespace CallCenterApi.Interface.Controllers
130 130
             };
131 131
             return Content(obj.ToJson()); ;
132 132
         }
133
-        public ActionResult Pushv(string Title, string count, string usercode)
133
+        public static  string  PushApp(string Title, string count, string usercode)
134 134
         {
135 135
             string pushResult = "";
136
-            if (!string.IsNullOrEmpty(usercode))
136
+            var userModel = new BLL.T_Sys_UserAccount().GetModel(usercode);
137
+
138
+            if (userModel != null)
139
+            {
140
+                usercode = userModel.F_UserCode;
141
+            }
142
+            var clientidStr = RedisHelper.StringGet("clientidlist");
143
+            var list = new List<AppClientListDto>();
144
+            if (clientidStr != null)
145
+                list = clientidStr.ToString().ToList<AppClientListDto>();
146
+            var lists = list.Where(x => x.usercode == usercode).ToList();
147
+            string clientid = "";
148
+            if (lists != null)
149
+            {
150
+                foreach (var item in lists)
151
+                {
152
+                    clientid = item.clientid;
153
+                }
154
+            }
155
+            if (!string.IsNullOrEmpty(clientid))
137 156
             {
138 157
                 try
139 158
                 {
140
-                    pushResult = PushAPP(Title, count, usercode);
159
+                    pushResult = PushAPP(Title, count, clientid);
141 160
                 }
142 161
                catch(Exception e)
143 162
                 {
144 163
                     LogFactory.GetLogger("3333").Error(e.Message );
145 164
                 }
146 165
             }
147
-            var obj = new
148
-            {
149
-                state = "success",
150
-                message = "成功",
151
-                pushResult = pushResult
152
-            };
153
-            return Content(obj.ToJson()); ;
154
-            //  return pushResult; ;
166
+          
167
+             return pushResult; ;
155 168
         }
156 169
         public ActionResult Pushc(string Title, string count, string usercode)
157 170
         {
@@ -225,21 +238,14 @@ namespace CallCenterApi.Interface.Controllers
225 238
             if (!string.IsNullOrEmpty(clientid))
226 239
             {
227 240
                 if (type == 1)
228
-                    pushResult = PushAPP(Title, count, clientid);
241
+                    pushResult = PushMessageToList(Title, count, clientid);
229 242
                 else
230 243
                     pushResult = PushMessageToSingle(Title, count, clientid);
231 244
             }
232 245
             return pushResult; ;
233 246
         }
234 247
 
235
-        public string PushAPP(string Title, string count, string clientid)
236
-        {
237
-
238
-            //    Console.OutputEncoding = Encoding.GetEncoding(936);
239
-            //    Environment.SetEnvironmentVariable("needDetails", "true");
240
-            string pushResult = PushMessageToList(Title, count, clientid);
241
-            return pushResult;
242
-        }
248
+       
243 249
         private static string PushMessageToList(string Title, string count, string CLIENTID)
244 250
         {
245 251
             // 推送主类(方式1,不可与方式2共存)

+ 29 - 9
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -9688,6 +9688,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
9688 9688
                                         string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
9689 9689
                                         string v = SmsNewController.AddSmS(0, count, u.F_Mobile, "681240888655478784", mag,
9690 9690
                                        modelT_Bus_WorkOrder.F_WorkOrderId);
9691
+                                        string t = PushMessageController.PushApp("新工单提醒", count, u .F_UserCode);
9691 9692
                                     }
9692 9693
                                   
9693 9694
                                 }
@@ -11244,6 +11245,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11244 11245
                                 string mag = "[\"" + workorderid + "\"]";
11245 11246
                                 string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
11246 11247
                                workorderid);
11248
+                                string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
11247 11249
                             }
11248 11250
                            
11249 11251
                         }
@@ -11600,6 +11602,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
11600 11602
                                                 string v = SmsNewController.AddSmS(0, count, u.F_Mobile,
11601 11603
                                             "681240181093470208", mag, modelT_Bus_WorkOrder.F_WorkOrderId);
11602 11604
 
11605
+                                                string t = PushMessageController.PushApp("督办工单提醒", count, u  .F_UserCode );
11606
+
11603 11607
 
11604 11608
                                                 msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11605 11609
                                             }
@@ -11619,7 +11623,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11619 11623
                                                    modelT_Bus_WorkOrder.F_WorkOrderId);
11620 11624
 
11621 11625
 
11622
-
11626
+                                                    string t = PushMessageController.PushApp("新工单提醒", count, u .F_UserCode);
11623 11627
 
11624 11628
                                                     msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11625 11629
 
@@ -11642,7 +11646,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11642 11646
                                                 string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
11643 11647
                                                 string v = SmsNewController.AddSmS(0, count, u.F_Mobile,
11644 11648
                                             "681240181093470208", mag, modelT_Bus_WorkOrder.F_WorkOrderId);
11645
-
11649
+                                                string t = PushMessageController.PushApp("督办工单提醒", count, u .F_UserCode);
11646 11650
                                                 msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
11647 11651
                                             }
11648 11652
                                             else
@@ -11653,12 +11657,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
11653 11657
                                                 }
11654 11658
                                                 else
11655 11659
                                                 {
11660
+                                                    
11656 11661
                                                     string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
11657 11662
                                                     //  string msgcount = modelT_Bus_WorkOrder.F_WorkOrderId;
11658 11663
                                                     // bool n = SMSController.AddSmS(0, msgcount, count, u.F_Mobile, "153305", "");
11659 11664
                                                     string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
11660 11665
                                                     string v = SmsNewController.AddSmS(0, count, u.F_Mobile, "681240888655478784", mag,
11661 11666
                                                    modelT_Bus_WorkOrder.F_WorkOrderId);
11667
+                                                    string t = PushMessageController.PushApp("新工单提醒", count, u .F_UserCode);
11662 11668
                                                 }
11663 11669
 
11664 11670
                                                 msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
@@ -11813,6 +11819,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11813 11819
                                                         string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
11814 11820
                                                         string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240181093470208", mag,
11815 11821
                                                         modelT_Bus_WorkOrder1.F_WorkOrderId);
11822
+                                                        string t = PushMessageController.PushApp("督办工单提醒", count, it .F_UserCode);
11816 11823
                                                     }
11817 11824
                                                     else
11818 11825
                                                     {
@@ -11828,6 +11835,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
11828 11835
                                                             string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
11829 11836
                                                             string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
11830 11837
                                                             modelT_Bus_WorkOrder1.F_WorkOrderId);
11838
+                                                            string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
11831 11839
                                                         }
11832 11840
 
11833 11841
                                                     }
@@ -12417,6 +12425,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12417 12425
                             string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
12418 12426
                             string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
12419 12427
                             modelT_Bus_WorkOrder.F_WorkOrderId);
12428
+                            string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
12420 12429
 
12421 12430
                         }
12422 12431
 
@@ -12523,7 +12532,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12523 12532
                                   string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
12524 12533
                                     string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
12525 12534
                                     modelT_Bus_WorkOrder.F_WorkOrderId);
12526
-
12535
+                                    string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
12527 12536
 
12528 12537
                                 }
12529 12538
                             }
@@ -12673,6 +12682,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12673 12682
                                     string mag = "[\"" + workorderid + "\"]";
12674 12683
                                     string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
12675 12684
                                    workorderid);
12685
+                                    string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
12676 12686
                                 }
12677 12687
 
12678 12688
                             }
@@ -12730,6 +12740,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12730 12740
                             string mag = "[\"" + workorderid + "\"]";
12731 12741
                             string v = SmsNewController.AddSmS(0, count, iv.F_Mobile, "681240804383522816", mag,
12732 12742
                             workorderid);
12743
+                            string c = PushMessageController.PushApp("催单提醒", count, iv .F_UserCode);
12733 12744
                         }
12734 12745
                     }
12735 12746
                 }
@@ -12752,6 +12763,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
12752 12763
                             string mag = "[\"" + workorderid + "\"]";
12753 12764
                             string v = SmsNewController.AddSmS(0, count, iv.F_Mobile, "681240804383522816", mag,
12754 12765
                             workorderid);
12766
+                            string c = PushMessageController.PushApp("催单提醒", count, iv.F_UserCode);
12755 12767
                         }
12756 12768
                     }
12757 12769
                 }
@@ -16545,7 +16557,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
16545 16557
                                                                 string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
16546 16558
                                                                 string v = SmsNewController.AddSmS(0, count, u.F_Mobile,
16547 16559
          "681240181093470208", mag, modelT_Bus_WorkOrder.F_WorkOrderId);
16548
-                                                                msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
16560
+                                                            string c = PushMessageController.PushApp("督办工单提醒", count, u .F_UserCode);
16561
+
16562
+                                                            msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
16549 16563
                                                             }
16550 16564
                                                             else
16551 16565
                                                             {
@@ -16580,7 +16594,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
16580 16594
                                                                 string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
16581 16595
                                                                 string v = SmsNewController.AddSmS(0, count, u.F_Mobile,
16582 16596
          "681240181093470208", mag, modelT_Bus_WorkOrder.F_WorkOrderId);
16583
-                                                                msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
16597
+                                                            string c = PushMessageController.PushApp("督办工单提醒", count, u .F_UserCode);
16598
+                                                            msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
16584 16599
                                                             }
16585 16600
                                                             else
16586 16601
                                                             {
@@ -16596,8 +16611,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
16596 16611
                                                                     string mag = "[\"" + modelT_Bus_WorkOrder.F_WorkOrderId + "\"]";
16597 16612
                                                                     string v = SmsNewController.AddSmS(0, count, u.F_Mobile, "681240888655478784", mag,
16598 16613
                                                                    modelT_Bus_WorkOrder.F_WorkOrderId);
16614
+                                                                string c = PushMessageController.PushApp("新工单提醒", count, u .F_UserCode);
16599 16615
 
16600
-                                                                }
16616
+                                                            }
16601 16617
 
16602 16618
                                                                 msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
16603 16619
                                                             }
@@ -16770,7 +16786,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
16770 16786
                                                                         string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
16771 16787
                                                                         string v = SmsNewController.AddSmS(0, count, it.F_Mobile,
16772 16788
                  "681240181093470208", mag, modelT_Bus_WorkOrder1.F_WorkOrderId);
16773
-                                                                    }
16789
+                                                                    string c = PushMessageController.PushApp("督办工单提醒", count, it .F_UserCode);
16790
+                                                                }
16774 16791
                                                                     else
16775 16792
                                                                     {
16776 16793
                                                                         if (it.F_RoleCode == "WLDW" && it.F_IsSms != null && it.F_IsSms == 1)
@@ -16785,7 +16802,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
16785 16802
                                                                             string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
16786 16803
                                                                             string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
16787 16804
                                                                            modelT_Bus_WorkOrder1.F_WorkOrderId);
16788
-                                                                        }
16805
+                                                                        string c = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
16806
+                                                                    }
16789 16807
 
16790 16808
                                                                     }
16791 16809
 
@@ -19022,6 +19040,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
19022 19040
                                         string mag = "[\"" + workorderid + "\"]";
19023 19041
                                         string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag,
19024 19042
                                        workorderid);
19043
+                                        string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
19025 19044
                                     }
19026 19045
                                 }
19027 19046
                                 oper.F_CreateUser = User.F_UserCode;
@@ -19154,7 +19173,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
19154 19173
                                                       
19155 19174
                                                        string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
19156 19175
                                                        string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240181093470208", mag, modelT_Bus_WorkOrder1.F_WorkOrderId);
19157
-
19176
+                                                       string c = PushMessageController.PushApp("督办工单提醒", count, it .F_UserCode);
19158 19177
                                                    }
19159 19178
                                                     else
19160 19179
                                                     {
@@ -19169,6 +19188,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
19169 19188
                                                            //  bool f = SMSController.AddSmS(0, msg, count, it.F_Mobile, "153305", "");
19170 19189
                                                            string mag = "[\"" + modelT_Bus_WorkOrder1.F_WorkOrderId + "\"]";
19171 19190
                                                            string v = SmsNewController.AddSmS(0, count, it.F_Mobile, "681240888655478784", mag, modelT_Bus_WorkOrder1.F_WorkOrderId);
19191
+                                                           string t = PushMessageController.PushApp("新工单提醒", count, it .F_UserCode);
19172 19192
                                                        }
19173 19193
 
19174 19194
                                                     }