duhongyu 4 vuotta sitten
vanhempi
commit
ff4081188f
1 muutettua tiedostoa jossa 43 lisäystä ja 21 poistoa
  1. 43 21
      CallCenterCommon/CallCenter.QuartzService/SatisfactionClose.cs

+ 43 - 21
CallCenterCommon/CallCenter.QuartzService/SatisfactionClose.cs

@@ -1,6 +1,7 @@
1 1
 using CallCenterApi.Model;
2 2
 using System;
3 3
 using System.Collections.Generic;
4
+using System.Data;
4 5
 using System.Linq;
5 6
 using System.Text;
6 7
 using System.Threading.Tasks;
@@ -14,33 +15,54 @@ namespace CallCenter.QuartzService
14 15
             CronExpression = "0 0 0 * * ? *";
15 16
             DoWork += MyWork_DoWork;
16 17
         }
18
+       
17 19
         private readonly CallCenterApi.BLL.T_Bus_WorkOrder  workorder = new CallCenterApi.BLL.T_Bus_WorkOrder();
18 20
         private void MyWork_DoWork(object sender, EventArgs e)
19 21
         {
22
+            string sql = "and F_WorkState = 6 and F_IsSms = 1  and F_IsDelete = 0 and(datediff(hh, (select top 1  RecvTime  from T_SMS_RecvSMS where   Content = '您反映的诉求已办理完成,请前往安阳政务服务官网(https://zwfw.anyang.gov.cn),登录后查看办结结果并对办理情况进行评价,谢谢' and CallerNum = b.F_CusPhone and F_Name = b.F_WorkOrderId order by    RecvTime desc), GETDATE()) >= 15) and F_DealTime is not null";
23
+            DataTable dt = new DataTable();
24
+            int recordCount = 0;
25
+              dt = CallCenterApi.BLL.PagerBLL.GetListPager(
26
+                "T_Bus_WorkOrder b WITH(NOLOCK)",
27
+                "F_WorkOrderId",
28
+                "*",
29
+                sql,
30
+                "ORDER BY F_CreateTime DESC",
31
+                1000,
32
+                1,
33
+                true,
34
+                out recordCount);
20 35
             var now = DateTime.Now;
21
-            var modellist = workorder.GetModelList("F_WorkState =6 and F_IsSms =1  and F_IsDelete =0 and  (datediff(hh,F_DealTime   ,GETDATE()  )>=15)");
22
-            if (modellist!=null && modellist.Count >0)
36
+           // var modellist = workorder.GetModelList("F_WorkState =6 and F_IsSms =1  and F_IsDelete =0 and  (datediff(hh,F_DealTime   ,GETDATE()  )>=15) and  F_DealTime is not null");
37
+            if (dt != null && dt.Rows .Count >0)
23 38
             {
24
-                foreach (var it in modellist)
39
+              
40
+               foreach (DataRow dr in dt.Rows)
25 41
                 {
26
-                    it.F_WorkState = 9;
27
-                    it.F_IsSatisfie = 1;
28
-                    it.F_IsClosed = 1;
29
-                    it.F_CloseUser = "";
30
-                    it.F_CloseTime = DateTime.Now;
31
-                    it.F_FinalOpinion = "15天自动满意";
32
-                    it.F_IsStandard = 1;
33
-                    it.F_StandardIDS = "";
34
-                    it.F_ToBereply = 0;
35
-                    workorder.Update(it);
36
-                    CallCenterApi.Model.T_Bus_Operation oper = new CallCenterApi.Model.T_Bus_Operation();
37
-                    oper.F_WorkOrderId = it.F_WorkOrderId;
38
-                    oper.F_State = it.F_WorkState;
39
-                    oper.F_Message = " 15天未评价自动结案了工单,结果:满意";
40
-                    oper.F_CreateUser = "8000";
41
-                    oper.F_CreateTime = DateTime.Now;
42
-                    oper.F_IsDelete = 0;
43
-                   new CallCenterApi.BLL.T_Bus_Operation().Add(oper);
42
+                     CallCenterApi.Model.T_Bus_WorkOrder it = new CallCenterApi.Model.T_Bus_WorkOrder();
43
+                    it = workorder.GetModel(dr["F_WorkOrderId"].ToString());
44
+                    if (it !=null )
45
+                    {
46
+                        it.F_WorkState = 9;
47
+                        it.F_IsSatisfie = 1;
48
+                        it.F_IsClosed = 1;
49
+                        it.F_CloseUser = "";
50
+                        it.F_CloseTime = DateTime.Now;
51
+                        it.F_FinalOpinion = "15天自动满意";
52
+                        it.F_IsStandard = 1;
53
+                        it.F_StandardIDS = "";
54
+                        it.F_ToBereply = 0;
55
+                        workorder.Update(it);
56
+                        CallCenterApi.Model.T_Bus_Operation oper = new CallCenterApi.Model.T_Bus_Operation();
57
+                        oper.F_WorkOrderId = it.F_WorkOrderId;
58
+                        oper.F_State = it.F_WorkState;
59
+                        oper.F_Message = " 15天未评价自动结案了工单,结果:满意";
60
+                        oper.F_CreateUser = "8000";
61
+                        oper.F_CreateTime = DateTime.Now;
62
+                        oper.F_IsDelete = 0;
63
+                        new CallCenterApi.BLL.T_Bus_Operation().Add(oper);
64
+                    }
65
+                  
44 66
                 }
45 67
             }
46 68
         }