duhongyu 4 years ago
parent
commit
42f247b4fe

+ 6 - 14
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Quality/QCResultController.cs

71
                     int ctsc = 0;//总分
71
                     int ctsc = 0;//总分
72
                     for (int i = 0; i < drlist.Length; i++)
72
                     for (int i = 0; i < drlist.Length; i++)
73
                     {
73
                     {
74
-                        obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId in(select F_CategoryId from T_QC_IndexCategory where F_ParentId=" + drlist[i]["F_CategoryId"] + ")");
75
-
74
+                        obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId ="+ drlist[i]["F_CategoryId"] + "");
76
                         Model.QCModel qcml = new Model.QCModel();
75
                         Model.QCModel qcml = new Model.QCModel();
77
                         qcml.Qcid = drlist[i]["F_CategoryId"].ToString();
76
                         qcml.Qcid = drlist[i]["F_CategoryId"].ToString();
78
                         qcml.Qcname = drlist[i]["F_CategoryName"].ToString();
77
                         qcml.Qcname = drlist[i]["F_CategoryName"].ToString();
79
                         qcml.Colspan = obj.ToString();
78
                         qcml.Colspan = obj.ToString();
80
-
81
-                        //strColom1 += "<td colspan='" + obj.ToString() + "' style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>" + drlist[i]["F_CategoryName"] + "</td>";
82
-                        //strColom1 += "<td rowspan='3' style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>分项得分</td>";
83
-
84
-                        DataRow[] drlistnew = dt.Select("F_ParentId=" + drlist[i]["F_CategoryId"]);
79
+                        DataRow[] drlistnew = dt.Select("F_CategoryId=" + drlist[i]["F_CategoryId"]);
85
                         if (drlistnew != null && drlist.Length > 0)
80
                         if (drlistnew != null && drlist.Length > 0)
86
                         {
81
                         {
87
                             List<Model.QCModel> qcclist = new List<Model.QCModel>();
82
                             List<Model.QCModel> qcclist = new List<Model.QCModel>();
91
                             {
86
                             {
92
                                 Model.QCModel qccml = new Model.QCModel();
87
                                 Model.QCModel qccml = new Model.QCModel();
93
                                 obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId=" + drlistnew[n]["F_CategoryId"]);
88
                                 obj = DbHelperSQL.GetSingle("select count(*) from T_QC_IndexBase where F_CategoryId=" + drlistnew[n]["F_CategoryId"]);
94
-                                //strColom2 += "<td colspan='" + obj + "' style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>" + drlistnew[n]["F_CategoryName"] + "</td>";
95
                                 qccml.Qcid = drlist[i]["F_CategoryId"].ToString() + "-" + drlistnew[n]["F_CategoryId"].ToString();
89
                                 qccml.Qcid = drlist[i]["F_CategoryId"].ToString() + "-" + drlistnew[n]["F_CategoryId"].ToString();
96
                                 qccml.Qcname = drlistnew[n]["F_CategoryName"].ToString();
90
                                 qccml.Qcname = drlistnew[n]["F_CategoryName"].ToString();
97
                                 qccml.Colspan = obj.ToString();
91
                                 qccml.Colspan = obj.ToString();
106
                                         qccmll.Qcid = drlist[i]["F_CategoryId"].ToString() + "-" + drlistnew[n]["F_CategoryId"].ToString() + "-" + drContent[m]["F_IndexId"].ToString();
100
                                         qccmll.Qcid = drlist[i]["F_CategoryId"].ToString() + "-" + drlistnew[n]["F_CategoryId"].ToString() + "-" + drContent[m]["F_IndexId"].ToString();
107
                                         qccmll.Qcname = drContent[m]["F_Title"].ToString();
101
                                         qccmll.Qcname = drContent[m]["F_Title"].ToString();
108
                                         qccmll.Qcscore = drContent[m]["F_Score"].ToString();
102
                                         qccmll.Qcscore = drContent[m]["F_Score"].ToString();
109
-                                        //strColom3 += "<td  align='center'style='border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>" + drContent[m]["F_Title"] + "</td>";
110
-                                        //strColom4 += "<td  align='center'style='border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>" + drContent[m]["F_Score"] + "</td>";
111
                                         if (!string.IsNullOrEmpty(drContent[m]["F_Score"].ToString()))
103
                                         if (!string.IsNullOrEmpty(drContent[m]["F_Score"].ToString()))
112
                                         {
104
                                         {
113
                                             sc += int.Parse(drContent[m]["F_Score"].ToString());
105
                                             sc += int.Parse(drContent[m]["F_Score"].ToString());
205
             }
197
             }
206
             if (dpt != null && dpt.ToString() != "")
198
             if (dpt != null && dpt.ToString() != "")
207
             {
199
             {
208
-                strsql = " and UserId in(select F_UserId from T_Sys_UserAccount where F_DeptId=" + dpt.ToString() + ") ";
200
+                strsql = " and UserCode in(select F_UserCode from T_Sys_UserAccount where F_DeptId=" + dpt.ToString() + ") ";
209
             }
201
             }
210
 
202
 
211
-            DataSet ds = DbHelperSQL.Query("select *,(select F_UserName from  T_Sys_UserAccount as b where b.F_UserId=a.UserId) as name,(select F_UserCode from  T_Sys_UserAccount as b where b.F_UserId=a.UserId) as wknmb from (select COUNT(*) as ct,UserId from T_Call_CallRecords where F_QCState=1 " + sqltimeCallRecords + strsql + " group by  UserId) as a order by wknmb asc");
203
+            DataSet ds = DbHelperSQL.Query("select *,(select F_UserName from  T_Sys_UserAccount as b where b.F_UserCode=a.UserCode) as name,(select F_UserCode from  T_Sys_UserAccount as b where b.F_UserCode=a.UserCode) as wknmb from (select COUNT(*) as ct,UserCode from T_Call_CallRecords where F_QCState=1 " + sqltimeCallRecords + strsql + " group by  UserCode) as a order by wknmb asc");
212
             DataTable dtTitle = DbHelperSQL.Query("select F_IndexId from T_QC_IndexBase where F_DeleteFlag=0").Tables[0];
204
             DataTable dtTitle = DbHelperSQL.Query("select F_IndexId from T_QC_IndexBase where F_DeleteFlag=0").Tables[0];
213
             if (ds != null && ds.Tables.Count > 0)
205
             if (ds != null && ds.Tables.Count > 0)
214
             {
206
             {
250
                             if (str != "")
242
                             if (str != "")
251
                             {
243
                             {
252
                                 double fs = 0;//每一项分数
244
                                 double fs = 0;//每一项分数
253
-                                obj = DbHelperSQL.GetSingle("select sum(F_QCScore) from T_QC_IndexRes where CallRecordsId in (select CallRecordsId from T_Call_CallRecords where F_QCState=1 and UserId=" + dr["UserId"] + " " + sqltimeCallRecords + ") and F_IndexId=" + str);
245
+                                obj = DbHelperSQL.GetSingle("select sum(F_QCScore) from T_QC_IndexRes where CallRecordsId in (select CallRecordsId from T_Call_CallRecords where F_QCState=1 and UserCode='" + dr["wknmb"] + "'" + " " + sqltimeCallRecords + ") and F_IndexId=" + str);
254
                                 if (obj != null && obj.ToString() != "")
246
                                 if (obj != null && obj.ToString() != "")
255
                                 {
247
                                 {
256
                                     if (ct != 0)
248
                                     if (ct != 0)
296
                     {
288
                     {
297
                         string question = "";
289
                         string question = "";
298
                         string advise = "";
290
                         string advise = "";
299
-                        DataSet dss = DbHelperSQL.Query("select * from T_Call_CallRecords where UserId=" + dr["UserId"] + " and F_QCState=1 " + sqltimeCallRecords);
291
+                        DataSet dss = DbHelperSQL.Query("select * from T_Call_CallRecords where UserCode='" + dr["wknmb"] + "'"+" and F_QCState=1 " + sqltimeCallRecords);
300
                         if (dss.Tables[0].Rows.Count > 0)
292
                         if (dss.Tables[0].Rows.Count > 0)
301
                         {
293
                         {
302
                             for (int ii = 0; ii < dss.Tables[0].Rows.Count; ii++)
294
                             for (int ii = 0; ii < dss.Tables[0].Rows.Count; ii++)

+ 93 - 30
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/WebChart/InfoNewController.cs

37
             int kptype = RequestString.GetInt("kptype", 0);
37
             int kptype = RequestString.GetInt("kptype", 0);
38
 
38
 
39
             int handling = RequestString.GetInt("handling", 0);
39
             int handling = RequestString.GetInt("handling", 0);
40
-
40
+            Dictionary<int, int> DWDeptid = new Dictionary<int, int>();
41
+            DWDeptid.Add(220, 1267);
42
+            DWDeptid.Add(219, 1266);
43
+            DWDeptid.Add(197, 1268);
44
+            DWDeptid.Add(204, 1271);
45
+            DWDeptid.Add(199, 1264);
46
+            DWDeptid.Add(218, 1265);
47
+            DWDeptid.Add(202, 1269);
48
+            DWDeptid.Add(203, 1270);
41
 
49
 
42
             string  kpcontent = RequestString.GetQueryString("kpcontent");
50
             string  kpcontent = RequestString.GetQueryString("kpcontent");
43
             string latitude = RequestString.GetQueryString("latitude");
51
             string latitude = RequestString.GetQueryString("latitude");
54
             {
62
             {
55
                 if (dealtype == 2)
63
                 if (dealtype == 2)
56
                 {//按时
64
                 {//按时
57
-                    sql += " and F_IsResult=0 and isnull(F_DealTime,'')<>'' and F_LimitTime>=F_DealTime ";
65
+                    sql += " and F_IsResult=0 and isnull(F_DealTime,'')<>'' and F_LimitTime>= a.F_DealTime ";
58
                 }
66
                 }
59
                 else if (dealtype == 3)
67
                 else if (dealtype == 3)
60
                 {//超期
68
                 {//超期
61
-                    sql += " and isnull(F_DealTime,'')<>'' and F_LimitTime<F_DealTime ";
69
+                    sql += " and isnull(a.F_DealTime,'')<>'' and a.F_LimitTime<a.F_DealTime ";
62
                 }
70
                 }
63
                 else
71
                 else
64
-                    sql += " and isnull(F_IsResult,0) = '" + dealtype + "' ";
72
+                    sql += " and isnull(a.F_IsResult,0) = '" + dealtype + "' ";
65
             }
73
             }
66
             if (strpagesize.Trim() != "")
74
             if (strpagesize.Trim() != "")
67
             {
75
             {
70
             string value = "";
78
             string value = "";
71
             if (key >0)
79
             if (key >0)
72
             {
80
             {
73
-                sql += "and F_Key in(select F_ValueId  from  dbo.GetValueId("+ key + ")) ";
81
+                sql += "and a.F_Key in(select F_ValueId  from  dbo.GetValueId(" + key + ")) ";
74
                
82
                
75
             }
83
             }
76
             if (handling>0)
84
             if (handling>0)
81
                 }
89
                 }
82
                 else if (handling == 2)
90
                 else if (handling == 2)
83
                 {
91
                 {
84
-                    sql += "and F_IsResult=1";
92
+                    sql += "and a.F_IsResult=1";
85
                 }
93
                 }
86
                 else if (handling == 3)
94
                 else if (handling == 3)
87
                 {
95
                 {
88
-                    sql += "and F_IsResult !=1";
96
+                    sql += "and a.F_IsResult !=1";
89
                 }
97
                 }
90
                 else if (handling == 4)
98
                 else if (handling == 4)
91
                 {
99
                 {
95
             }
103
             }
96
             if (deptid > 0)
104
             if (deptid > 0)
97
             {
105
             {
98
-                sql += "and F_MainDeptId='" + deptid + "'";
106
+                if (DWDeptid.ContainsKey(deptid))
107
+                {
108
+                    sql += "and a.F_MainDeptId in(" + DWDeptid[deptid] + "," + deptid + ")";
109
+                }
110
+                else 
111
+                sql += "and a.F_MainDeptId='" + deptid + "'";
99
             }
112
             }
100
             if (latitude.Trim ()!="")
113
             if (latitude.Trim ()!="")
101
             {
114
             {
102
-                sql += "and F_Latitude='" + latitude + "'";
115
+                sql += "and a.F_Latitude='" + latitude + "'";
103
             }
116
             }
104
             if (longitude .Trim() != "")
117
             if (longitude .Trim() != "")
105
             {
118
             {
106
-                sql += "and F_Longitude='" + longitude + "'";
119
+                sql += "and a.F_Longitude='" + longitude + "'";
107
             }
120
             }
108
            if (sourceArea >0)
121
            if (sourceArea >0)
109
             {
122
             {
110
-                sql += "and F_SourceArea='" + sourceArea + "'";
123
+                sql += "and a.F_SourceArea='" + sourceArea + "'";
111
             }
124
             }
112
             if (type >0)
125
             if (type >0)
113
             {
126
             {
114
-                sql += "and F_InfoType='" + type + "'";
127
+                sql += "and a.F_InfoType='" + type + "'";
115
             }
128
             }
116
             if (source >0)
129
             if (source >0)
117
             {
130
             {
118
-                sql += "and F_InfoSource='" + source + "'";
131
+                sql += "and a.F_InfoSource='" + source + "'";
119
             }
132
             }
120
 
133
 
121
             if (keyid>0)
134
             if (keyid>0)
122
             {
135
             {
123
-                sql += "and F_Key='"+ keyid + "' ";
136
+                sql += "and a.F_Key='" + keyid + "' ";
124
             }
137
             }
125
           
138
           
126
            
139
            
129
             {
142
             {
130
                 if (timetype == 1)
143
                 if (timetype == 1)
131
                 {
144
                 {
132
-                    sql += "and datediff(DAY ,F_CreateTime ,getdate())=0 ";
145
+                    sql += "and datediff(DAY ,a.F_CreateTime ,getdate())=0 ";
133
                 }
146
                 }
134
                 else if (timetype == 2)
147
                 else if (timetype == 2)
135
                 {
148
                 {
136
-                    sql += "and datediff(WEEK ,F_CreateTime ,getdate())=0 ";
149
+                    sql += "and datediff(WEEK ,a.F_CreateTime ,getdate())=0 ";
137
                 }
150
                 }
138
                 else
151
                 else
139
                 {
152
                 {
140
-                    sql += "and datediff(MONTH ,F_CreateTime ,getdate())=0 ";
153
+                    sql += "and datediff(MONTH ,a.F_CreateTime ,getdate())=0 ";
141
                 }
154
                 }
142
             }
155
             }
143
           
156
           
144
             if (hour > -1)
157
             if (hour > -1)
145
             {
158
             {
146
-                sql += " and  datepart(hh,F_CreateTime)=" + hour;
159
+                sql += " and  datepart(hh,a.F_CreateTime)=" + hour;
147
             }
160
             }
148
             if (dptype>0)
161
             if (dptype>0)
149
             {
162
             {
154
                     if (dptype==1)
167
                     if (dptype==1)
155
                 {
168
                 {
156
                     //当月平均办理时长
169
                     //当月平均办理时长
157
-                    sql += " F_IsResult=0 and datediff(MONTH , F_CreateTime , getdate())= 0  and F_DealDeptId  is not null and F_MainDeptId is not null and F_WorkState in(6, 9)  and F_AssignTime is not null and F_DealTime is not null";
170
+                    sql += " a.F_IsResult=0 and datediff(MONTH , a.F_CreateTime , getdate())= 0  and a.F_DealDeptId  is not null and a.F_MainDeptId is not null and a.F_WorkState in(6, 9)  and a.F_AssignTime is not null and F_DealTime is not null";
158
                 }
171
                 }
159
                 else if (dptype == 1)
172
                 else if (dptype == 1)
160
                 {
173
                 {
194
                     return Error("请选择考评内容");
207
                     return Error("请选择考评内容");
195
                 if (kptype==1)
208
                 if (kptype==1)
196
                 {
209
                 {
197
-                    sql +=" and F_WorkOrderId in( F_Deptid="+ deptid + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Evaluation = '"+ kpcontent + "') ";
210
+                    if (DWDeptid.ContainsKey(deptid))
211
+                    {
212
+                        sql += " and a.F_WorkOrderId in(select F_WorkOrderId from T_Sys_Achievements where  F_Deptid in(" + DWDeptid[deptid] + "," + deptid + ")" + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Evaluation = '" + kpcontent + "') ";
213
+                    }
214
+                    else
215
+                        sql += " and a.F_WorkOrderId in( select F_WorkOrderId from T_Sys_Achievements where  F_Deptid=" + deptid + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Evaluation = '" + kpcontent + "') ";
216
+
217
+
198
                 }
218
                 }
199
                 else
219
                 else
200
                 {
220
                 {
201
-                    sql += " and F_WorkOrderId in( F_Deptid=" + deptid + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Bonusitems = '" + kpcontent + "') ";
221
+
222
+                    if (DWDeptid.ContainsKey(deptid))
223
+                    {
224
+                        sql += " and a.F_WorkOrderId in(select F_WorkOrderId from T_Sys_Achievements where  F_Deptid in(" + DWDeptid[deptid] + "," + deptid + ")" + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Bonusitems = '" + kpcontent + "') ";
225
+                    }
226
+                    else
227
+                        sql += " and a.F_WorkOrderId in(select F_WorkOrderId from T_Sys_Achievements where  F_Deptid=" + deptid + " and datediff(MONTH ,F_CreatTime ,getdate())=0    and F_Type = 0 and F_Bonusitems = '" + kpcontent + "') ";
228
+
202
                 }
229
                 }
203
             }
230
             }
204
             string cols = "DISTINCT  a.F_WorkOrderId,F_ComTitle,F_WorkState,F_MainDeptId,F_IsResult,a.F_CreateTime,dbo.GetUserName(a.F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) KeyName,dbo.GetDeptNames(F_MainDeptId) as DeptName,F_CloseTime,F_LimitTime as LimitTime,F_ComContent";
231
             string cols = "DISTINCT  a.F_WorkOrderId,F_ComTitle,F_WorkState,F_MainDeptId,F_IsResult,a.F_CreateTime,dbo.GetUserName(a.F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) KeyName,dbo.GetDeptNames(F_MainDeptId) as DeptName,F_CloseTime,F_LimitTime as LimitTime,F_ComContent";
244
             {
271
             {
245
                 pagesize = Convert.ToInt32(strpagesize);
272
                 pagesize = Convert.ToInt32(strpagesize);
246
             }
273
             }
274
+            Dictionary<int, int> DWDeptid = new Dictionary<int, int>();
275
+            DWDeptid.Add(220, 1267);
276
+            DWDeptid.Add(219, 1266);
277
+            DWDeptid.Add(197, 1268);
278
+            DWDeptid.Add(204, 1271);
279
+            DWDeptid.Add(199, 1264);
280
+            DWDeptid.Add(218, 1265);
281
+            DWDeptid.Add(202, 1269);
282
+            DWDeptid.Add(203, 1270);
247
             if (deptid>0)
283
             if (deptid>0)
248
             {
284
             {
249
-                sql += "and V.F_CreateDeptId='" + deptid + "'";
285
+                if (DWDeptid.ContainsKey(deptid))
286
+                {
287
+                    sql += "and V.F_CreateDeptId in(" + DWDeptid[deptid] + "," + deptid + ")";
288
+                }
289
+                else
290
+                    sql += "and V.F_CreateDeptId='" + deptid + "'";
291
+
292
+
293
+
250
             }
294
             }
251
             if (type >0)
295
             if (type >0)
252
             {
296
             {
291
             int pageindex = 1;
335
             int pageindex = 1;
292
             string strpagesize = RequestString.GetQueryString("pagesize");
336
             string strpagesize = RequestString.GetQueryString("pagesize");
293
             int pagesize = 10;
337
             int pagesize = 10;
294
-
338
+            Dictionary<int, int> DWDeptid = new Dictionary<int, int>();
339
+            DWDeptid.Add(220, 1267);
340
+            DWDeptid.Add(219, 1266);
341
+            DWDeptid.Add(197, 1268);
342
+            DWDeptid.Add(204, 1271);
343
+            DWDeptid.Add(199, 1264);
344
+            DWDeptid.Add(218, 1265);
345
+            DWDeptid.Add(202, 1269);
346
+            DWDeptid.Add(203, 1270);
295
             if (deptid > 0)
347
             if (deptid > 0)
296
-                sql += " and F_Deptid='" + deptid + "'";
348
+            {
349
+                if (DWDeptid.ContainsKey(deptid))
350
+                {
351
+                    sql += " and F_Deptid in(" + DWDeptid[deptid] + "," + deptid + ")";
352
+                   
353
+                }
354
+                else
355
+                    sql += " and F_Deptid='" + deptid + "'";
356
+            }
357
+               
297
             else
358
             else
298
                 return Error("请选择部门");
359
                 return Error("请选择部门");
299
             sql += "and datediff(MONTH ,F_CreateTime ,getdate())=0 ";
360
             sql += "and datediff(MONTH ,F_CreateTime ,getdate())=0 ";
805
         /// <param name="date"></param>
866
         /// <param name="date"></param>
806
         /// <param name="isdc"></param>
867
         /// <param name="isdc"></param>
807
         /// <returns></returns>
868
         /// <returns></returns>
808
-        public ActionResult GetDeptDeptAchievements()
869
+        public ActionResult GetDeptDeptAchievements(int type=0)
809
         {
870
         {
810
-            if (RedisHelper.StringGet("InfoNewGetDeptAchievements") != null)
871
+            if (RedisHelper.StringGet("InfoNewGetDeptAchievements"+ type) != null)
811
             {
872
             {
812
                 Task.Run(() =>
873
                 Task.Run(() =>
813
                 {
874
                 {
814
                     Dictionary<string, string> paras = new Dictionary<string, string>();
875
                     Dictionary<string, string> paras = new Dictionary<string, string>();
876
+                    paras.Add("@type", type.ToString());
815
                     var ob = DbHelperSQL.RunProcedure("P_DeptAchievements", paras, "DeptAchievements").Tables[0]; ;
877
                     var ob = DbHelperSQL.RunProcedure("P_DeptAchievements", paras, "DeptAchievements").Tables[0]; ;
816
-                    RedisHelper.KeyDelete("InfoNewGetDeptAchievements");
817
-                    RedisHelper.StringSet("InfoNewGetDeptAchievements", ob.ToJson(), new TimeSpan(0, 5, 0));
878
+                    RedisHelper.KeyDelete("InfoNewGetDeptAchievements"+ type);
879
+                    RedisHelper.StringSet("InfoNewGetDeptAchievements"+ type, ob.ToJson(), new TimeSpan(0, 5, 0));
818
                 });
880
                 });
819
-                return Content(RedisHelper.StringGet("InfoNewGetDeptAchievements").ToString());
881
+                return Content(RedisHelper.StringGet("InfoNewGetDeptAchievements"+ type).ToString());
820
             }
882
             }
821
             else
883
             else
822
             {
884
             {
823
                 Dictionary<string, string> paras = new Dictionary<string, string>();
885
                 Dictionary<string, string> paras = new Dictionary<string, string>();
886
+                paras.Add("@type", type.ToString());
824
                 var obj = DbHelperSQL.RunProcedure("P_DeptAchievements", paras, "DeptAchievements").Tables[0]; ;
887
                 var obj = DbHelperSQL.RunProcedure("P_DeptAchievements", paras, "DeptAchievements").Tables[0]; ;
825
-                RedisHelper.StringSet("InfoNewGetDeptAchievements", obj.ToJson(), new TimeSpan(0, 5, 0));
888
+                RedisHelper.StringSet("InfoNewGetDeptAchievements"+ type, obj.ToJson(), new TimeSpan(0, 5, 0));
826
                 return Content(obj.ToJson());
889
                 return Content(obj.ToJson());
827
             }
890
             }
828
 
891
 

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

56
             }
56
             }
57
             if (isdc>0)
57
             if (isdc>0)
58
             {
58
             {
59
-                var dtdc = DbHelperSQL.Query(" F_CustomerName 联系人姓名,F_Mobile 联系人电话,F_Email 邮箱,F_Address 地址,(select count(1) from dbo.T_Bus_WorkOrder where F_IsDelete = 0 and F_CusPhone=a.F_Mobile) as 工单数量 (select count(1) from dbo.T_Call_CallRecords where CallType=0  and CallNumber=a.F_Mobile ) as 来电数量"
59
+                var dtdc = DbHelperSQL.Query("select F_CustomerName 联系人姓名,F_Mobile 联系人电话,F_Email 邮箱,F_Address 地址,(select count(1) from dbo.T_Bus_WorkOrder where F_IsDelete = 0 and F_CusPhone=a.F_Mobile) as 工单数量 (select count(1) from dbo.T_Call_CallRecords where CallType=0  and CallNumber=a.F_Mobile ) as 来电数量"
60
                  + " from T_Cus_CustomerBase a WITH(NOLOCK) where 1=1 " + sql ).Tables[0];
60
                  + " from T_Cus_CustomerBase a WITH(NOLOCK) where 1=1 " + sql ).Tables[0];
61
                 var msg = new NPOIHelper().ExportToExcel("市民资料", dtdc);
61
                 var msg = new NPOIHelper().ExportToExcel("市民资料", dtdc);
62
                 if (msg == "")
62
                 if (msg == "")

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TotalTelController.cs

25
         }
25
         }
26
         private string[] getcols()
26
         private string[] getcols()
27
         {
27
         {
28
-            String[] str = { "时间", "电话呼入次数", "电话呼出次数", "正常接听次数", "未接通次数", "主动放弃次数", "黑名单拒接", "平均呼入时间", "峰值排队人数" };
28
+            String[] str = { "时间", "电话呼入次数", "电话呼出次数", "正常呼入接听次数", "呼入未接通次数", "呼入主动放弃次数", "黑名单拒接", "平均呼入时间", "峰值排队人数" };
29
             return str;
29
             return str;
30
         }
30
         }
31
 
31
 

+ 28 - 8
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs

17
 
17
 
18
 namespace CallCenterApi.Interface.Controllers.report
18
 namespace CallCenterApi.Interface.Controllers.report
19
 {
19
 {
20
-    [Authority]
20
+   // [Authority]
21
     public class WorkOrderReportController : BaseController
21
     public class WorkOrderReportController : BaseController
22
     {
22
     {
23
         private readonly BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
23
         private readonly BLL.T_Sys_Department departmentBLL = new BLL.T_Sys_Department();
761
         /// <param name="date"></param>
761
         /// <param name="date"></param>
762
         /// <param name="isdc"></param>
762
         /// <param name="isdc"></param>
763
         /// <returns></returns>
763
         /// <returns></returns>
764
-        public ActionResult GetDeptDeptAchievements(string starttime, string endtime)
764
+        public ActionResult GetDeptDeptAchievements(string starttime, string endtime
765
+            ,int type=0)
765
         {
766
         {
766
             if (string.IsNullOrEmpty(starttime))
767
             if (string.IsNullOrEmpty(starttime))
767
             {
768
             {
778
             Dictionary<string, string> paras = new Dictionary<string, string>();
779
             Dictionary<string, string> paras = new Dictionary<string, string>();
779
             paras.Add("@sdate", starttime);
780
             paras.Add("@sdate", starttime);
780
             paras.Add("@edate", endtime);
781
             paras.Add("@edate", endtime);
782
+            paras.Add("@type", type.ToString ());
781
             var obj = DbHelperSQL.RunProcedure("P_DeptAchievements_1", paras, "DeptAchievements").Tables[0]; ;
783
             var obj = DbHelperSQL.RunProcedure("P_DeptAchievements_1", paras, "DeptAchievements").Tables[0]; ;
782
             return Content(obj.ToJson());
784
             return Content(obj.ToJson());
783
 
785
 
1046
         /// <param name="starttime"></param>
1048
         /// <param name="starttime"></param>
1047
         /// <param name="endtime"></param>
1049
         /// <param name="endtime"></param>
1048
         /// <returns></returns>
1050
         /// <returns></returns>
1049
-        public ActionResult MergerHotline(DateTime? starttime , DateTime ? endtime )
1051
+        public ActionResult MergerHotline(DateTime? starttime , DateTime ? endtime,bool  isExport = false  )
1050
         {
1052
         {
1051
             DateTime date = DateTime.Now;
1053
             DateTime date = DateTime.Now;
1052
             if (starttime ==null )
1054
             if (starttime ==null )
1084
                                 mergerHot.voluntarily = CallRecords.Where(x => x.BeginTime
1086
                                 mergerHot.voluntarily = CallRecords.Where(x => x.BeginTime
1085
                          .Value.ToString("MM月dd日") == mergerHotSources.Data && x.CallState == 0 && x.PhoneType == source[i].F_Value && (x.UserCode == ""
1087
                          .Value.ToString("MM月dd日") == mergerHotSources.Data && x.CallState == 0 && x.PhoneType == source[i].F_Value && (x.UserCode == ""
1086
                              || x.UserCode != null)).Count();
1088
                              || x.UserCode != null)).Count();
1087
-                                mergerHotSources.MergerHot.Add(mergerHot);
1089
+
1090
+                            if (mergerHot.Call > 0)
1091
+                            {
1092
+                                mergerHot.rate = string.Format("{0:f2}%", (float)mergerHot.Connect / (float)mergerHot.Call * 100);
1093
+                            }
1094
+                            else
1095
+                            {
1096
+                                mergerHot.rate = "100%";
1097
+                            }
1098
+                         
1099
+                            mergerHotSources.MergerHot.Add(mergerHot);
1088
                             
1100
                             
1089
                         }
1101
                         }
1090
                         else if (i == source.Count)
1102
                         else if (i == source.Count)
1091
                         {
1103
                         {
1092
                             MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1104
                             MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1093
-                            mergerHot.Source = source[i].F_Value;
1105
+                            mergerHot.Source = "当日小计";
1094
                             mergerHot.Call = CallRecords.Where(x => x.BeginTime
1106
                             mergerHot.Call = CallRecords.Where(x => x.BeginTime
1095
                             .Value.ToString("MM月dd日") == mergerHotSources.Data ).Count();
1107
                             .Value.ToString("MM月dd日") == mergerHotSources.Data ).Count();
1096
                             mergerHot.Connect = CallRecords.Where(x => x.BeginTime
1108
                             mergerHot.Connect = CallRecords.Where(x => x.BeginTime
1114
                         else if (i == source.Count+1)
1126
                         else if (i == source.Count+1)
1115
                         {
1127
                         {
1116
                             MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1128
                             MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1117
-                            mergerHot.Source = source[i].F_Value;
1129
+                            mergerHot.Source = "累计";
1118
                             mergerHot.Call = CallRecords.Where(x => x.BeginTime 
1130
                             mergerHot.Call = CallRecords.Where(x => x.BeginTime 
1119
                             .Value.Date  >=starttime  .Value.Date && x.BeginTime
1131
                             .Value.Date  >=starttime  .Value.Date && x.BeginTime
1120
                             .Value.Date <= dt.Date ).Count();
1132
                             .Value.Date <= dt.Date ).Count();
1140
                             mergerHotSources.MergerHot.Add(mergerHot);
1152
                             mergerHotSources.MergerHot.Add(mergerHot);
1141
                         }
1153
                         }
1142
                     }
1154
                     }
1155
+                    MergerHotSource.Add(mergerHotSources);
1143
                 }
1156
                 }
1144
             }
1157
             }
1145
             if (MergerHotSource!=null && MergerHotSource .Count >0)
1158
             if (MergerHotSource!=null && MergerHotSource .Count >0)
1165
                     else if (i == source.Count)
1178
                     else if (i == source.Count)
1166
                     {
1179
                     {
1167
                         MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1180
                         MergerHot.MergerHots mergerHot = new MergerHot.MergerHots();
1168
-                        mergerHot.Source = source[i].F_Value;
1181
+                        mergerHot.Source ="当日小计";
1169
                         mergerHot.Call = CallRecords.Count();
1182
                         mergerHot.Call = CallRecords.Count();
1170
                         mergerHot.Connect = CallRecords.Where(x =>x.CallState == 1).Count();
1183
                         mergerHot.Connect = CallRecords.Where(x =>x.CallState == 1).Count();
1171
                         mergerHot.Notconnected = CallRecords.Where(x =>  x.CallState == 0 &&   x.UserCode != ""
1184
                         mergerHot.Notconnected = CallRecords.Where(x =>  x.CallState == 0 &&   x.UserCode != ""
1183
                         mergerHotSources.MergerHot.Add(mergerHot);
1196
                         mergerHotSources.MergerHot.Add(mergerHot);
1184
                     }
1197
                     }
1185
                 }
1198
                 }
1199
+                MergerHotSource.Add(mergerHotSources);
1200
+            }
1201
+            if (isExport)
1202
+            {
1203
+               
1204
+                new NPOIHelper().ExportMergerToExcel(MergerHotSource);
1205
+                return Success("导出excel");
1186
             }
1206
             }
1187
-           return Success("");
1207
+            return Success("获取成功", MergerHotSource);
1188
             
1208
             
1189
         }
1209
         }
1190
    
1210
    

+ 14 - 6
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

6850
             if (business > 0)
6850
             if (business > 0)
6851
                 sql += " and F_Business = '1'";
6851
                 sql += " and F_Business = '1'";
6852
             string Remind = "";
6852
             string Remind = "";
6853
-            if (Supervisor == 1)
6853
+            if (User.F_RoleCode == "DBZY")
6854
             {
6854
             {
6855
-                Remind += "and Supervisor='" + User.F_UserCode + "'";
6856
-            }
6857
-            else if (Supervisor == 2)
6858
-            {
6859
-                Remind += "and (Supervisor ='' or  Supervisor is null )";
6855
+                if (Supervisor == 1)
6856
+                {
6857
+                    if (strtab == "0")
6858
+                        Remind += "and Supervisor='" + User.F_UserCode + "'";
6859
+                    else
6860
+                        Remind += "and (Supervisor ='' or  Supervisor is null  " +
6861
+                            "or Supervisor='" + User.F_UserCode + "' )";
6862
+                }
6863
+                else if (Supervisor == 2)
6864
+                {
6865
+                    Remind += "and (Supervisor ='' or  Supervisor is null )";
6866
+                }
6860
             }
6867
             }
6868
+         
6861
             if (isExamine == 1)
6869
             if (isExamine == 1)
6862
             {
6870
             {
6863
                 Remind += "and F_IsExamine='1'";
6871
                 Remind += "and F_IsExamine='1'";

+ 865 - 0
CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

895
                 return "导出失败!";
895
                 return "导出失败!";
896
             }
896
             }
897
         }
897
         }
898
+
899
+
900
+
901
+        private string [] Merger = {"来电量", "接通量", "未接通","主动放弃","接通率"};
902
+
903
+        /// <summary>
904
+        /// 督办数据报表导出
905
+        /// </summary>
906
+        /// <param name="ds"></param>
907
+        /// <returns></returns>
908
+        public string ExportMergerToExcel(List<MergerHot.MergerHotSource> MergerHotSource)
909
+        {
910
+            try
911
+            {
912
+                int lenth = 0;
913
+                if (MergerHotSource!=null&& MergerHotSource.Count>0)
914
+                {
915
+                   if (MergerHotSource[0]!=null && MergerHotSource[0].MergerHot !=null
916
+                        && MergerHotSource[0].MergerHot.Count >0)
917
+                    {
918
+                        lenth = MergerHotSource[0].MergerHot.Count * 5+4;
919
+                    }
920
+                    else
921
+                    {
922
+                        return "";
923
+                    }
924
+                }
925
+                else
926
+                {
927
+                    return "";
928
+                }
929
+
930
+                HSSFWorkbook workbook = new HSSFWorkbook();
931
+                ISheet sheet = workbook.CreateSheet("归并热线每日数据统计");
932
+                ICellStyle cellStyle = workbook.CreateCellStyle();
933
+                NPOI.SS.UserModel.IFont cellfont = workbook.CreateFont();
934
+                cellfont.Boldweight = (short)FontBoldWeight.Normal;
935
+                cellStyle.SetFont(cellfont);
936
+                ICellStyle cellStylebt = workbook.CreateCellStyle();
937
+                NPOI.SS.UserModel.IFont cellfontbt = workbook.CreateFont();
938
+                cellfontbt.Boldweight = (short)FontBoldWeight.Bold;
939
+                cellStylebt.SetFont(cellfontbt);
940
+                cellStylebt.VerticalAlignment = VerticalAlignment.Center;
941
+                cellStylebt.Alignment = HorizontalAlignment.Center;
942
+                //cellStylebt.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
943
+                //cellStylebt.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
944
+                //cellStylebt.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
945
+                //cellStylebt.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
946
+                IRow irow1 = sheet.CreateRow(0);
947
+                ICell cell1 = irow1.CreateCell(0);
948
+                cell1.SetCellValue("归并热线每日数据统计");
949
+                cell1.CellStyle=cellStylebt;
950
+                 ICellStyle cellStylebt1 = workbook.CreateCellStyle();
951
+                NPOI.SS.UserModel.IFont cellfontbt1 = workbook.CreateFont();
952
+                cellfontbt1.Boldweight = (short)FontBoldWeight.Bold;
953
+                cellfontbt1.FontHeightInPoints = 22;
954
+                cellStylebt1.SetFont(cellfontbt1);
955
+                //cellStylebt1.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
956
+                //cellStylebt1.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
957
+                //cellStylebt1.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
958
+                //cellStylebt1.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
959
+                cellStylebt1.VerticalAlignment = VerticalAlignment.Center;
960
+                cellStylebt1.Alignment = HorizontalAlignment.Center;
961
+                cell1.CellStyle = cellStylebt1;
962
+                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 0, lenth));
963
+                IRow irow2 = sheet.CreateRow(3);
964
+                int icolIndex = 0;
965
+                ICellStyle cellStylebt2 = workbook.CreateCellStyle();
966
+                NPOI.SS.UserModel.IFont cellfontbt2 = workbook.CreateFont();
967
+                cellfontbt2.Boldweight = (short)FontBoldWeight.Bold;
968
+                cellStylebt2.WrapText = true;//设置换行这个要先设置
969
+                cellfontbt2.FontHeightInPoints = 14;
970
+                //cellStylebt2.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
971
+                //cellStylebt2.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
972
+                //cellStylebt2.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
973
+                //cellStylebt2.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
974
+                cellStylebt2.SetFont(cellfontbt2);
975
+                cellStylebt2.VerticalAlignment = VerticalAlignment.Center;
976
+                cellStylebt2.Alignment = HorizontalAlignment.Center;
977
+                cellStylebt2.FillForegroundColor = 23;
978
+
979
+                ICellStyle cellStylebt3 = workbook.CreateCellStyle();
980
+                NPOI.SS.UserModel.IFont cellfontbt3 = workbook.CreateFont();
981
+                cellfontbt3.Boldweight = (short)FontBoldWeight.Bold;
982
+                cellStylebt3.WrapText = true;//设置换行这个要先设置
983
+                cellfontbt3.FontHeightInPoints = 14;
984
+                //cellStylebt3.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
985
+                //cellStylebt3.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
986
+                //cellStylebt3.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
987
+                //cellStylebt3.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
988
+                cellStylebt3.SetFont(cellfontbt3);
989
+                cellStylebt3.VerticalAlignment = VerticalAlignment.Center;
990
+                cellStylebt3.Alignment = HorizontalAlignment.Center;
991
+                cellStylebt3.FillForegroundColor = 48;
992
+
993
+               
994
+                ICellStyle cellStylebt4 = workbook.CreateCellStyle();
995
+                NPOI.SS.UserModel.IFont cellfontbt4 = workbook.CreateFont();
996
+                cellStylebt4.WrapText = true;//设置换行这个要先设置
997
+                cellfontbt4.Boldweight = (short)FontBoldWeight.Bold;
998
+                cellfontbt4.FontHeightInPoints = 11;
999
+                //cellStylebt4.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1000
+                //cellStylebt4.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1001
+                //cellStylebt4.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1002
+                //cellStylebt4.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1003
+                cellStylebt4.SetFont(cellfontbt4);
1004
+                cellStylebt4.VerticalAlignment = VerticalAlignment.Center;
1005
+                cellStylebt4.Alignment = HorizontalAlignment.Center;
1006
+
1007
+
1008
+                ICellStyle cellStylebt5 = workbook.CreateCellStyle();
1009
+                NPOI.SS.UserModel.IFont cellfontbt5 = workbook.CreateFont();
1010
+                cellfontbt5.Boldweight = (short)FontBoldWeight.Bold;
1011
+                cellfontbt5.FontHeightInPoints = 11;
1012
+                //cellStylebt5.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1013
+                //cellStylebt5.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1014
+                //cellStylebt5.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1015
+                //cellStylebt5.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1016
+                cellStylebt5.WrapText = true;//设置换行这个要先设置
1017
+                cellStylebt5.SetFont(cellfontbt5);
1018
+               
1019
+                cellStylebt5.VerticalAlignment = VerticalAlignment.Center;
1020
+                cellStylebt5.Alignment = HorizontalAlignment.Center;
1021
+                cellStylebt5.FillForegroundColor = 57;
1022
+
1023
+                ICellStyle cellStylebt6 = workbook.CreateCellStyle();
1024
+                NPOI.SS.UserModel.IFont cellfontbt6 = workbook.CreateFont();
1025
+                cellfontbt6.Boldweight = (short)FontBoldWeight.Bold;
1026
+                cellfontbt6.FontHeightInPoints = 11;
1027
+                cellStylebt6.WrapText = true;//设置换行这个要先设置
1028
+                cellStylebt6.SetFont(cellfontbt6);
1029
+                //cellStylebt6.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1030
+                //cellStylebt6.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1031
+                //cellStylebt6.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1032
+                //cellStylebt6.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1033
+                cellStylebt6.VerticalAlignment = VerticalAlignment.Center;
1034
+                cellStylebt6.Alignment = HorizontalAlignment.Center;
1035
+                cellStylebt6.FillForegroundColor = 51;
1036
+
1037
+                ICellStyle cellStylebt7 = workbook.CreateCellStyle();
1038
+                NPOI.SS.UserModel.IFont cellfontbt7 = workbook.CreateFont();
1039
+                cellfontbt7.Boldweight = (short)FontBoldWeight.Bold;
1040
+                cellfontbt7.FontHeightInPoints = 11;
1041
+                cellStylebt7.WrapText = true;//设置换行这个要先设置
1042
+                cellStylebt7.SetFont(cellfontbt7);
1043
+                //cellStylebt7.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1044
+                //cellStylebt7.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1045
+                //cellStylebt7.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1046
+                //cellStylebt7.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1047
+                cellStylebt7.VerticalAlignment = VerticalAlignment.Center;
1048
+                cellStylebt7.Alignment = HorizontalAlignment.Center;
1049
+                cellStylebt7.FillForegroundColor = 54;
1050
+
1051
+
1052
+
1053
+                ICellStyle cellStylebt8 = workbook.CreateCellStyle();
1054
+                NPOI.SS.UserModel.IFont cellfontbt8 = workbook.CreateFont();
1055
+                cellfontbt8.FontHeightInPoints = 10;
1056
+                cellStylebt8.SetFont(cellfontbt8);
1057
+                cellStylebt8.WrapText = true;//设置换行这个要先设置
1058
+                //cellStylebt8.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1059
+                //cellStylebt8.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1060
+                //cellStylebt8.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1061
+                //cellStylebt8.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1062
+                cellStylebt8.VerticalAlignment = VerticalAlignment.Center;
1063
+                cellStylebt8.Alignment = HorizontalAlignment.Center;
1064
+                cellStylebt8.FillForegroundColor = 57;
1065
+
1066
+                ICellStyle cellStylebt9 = workbook.CreateCellStyle();
1067
+                NPOI.SS.UserModel.IFont cellfontbt9 = workbook.CreateFont();
1068
+                cellfontbt9.FontHeightInPoints = 11;
1069
+                cellStylebt9.SetFont(cellfontbt9);
1070
+                cellStylebt9.WrapText = true;//设置换行这个要先设置
1071
+                //cellStylebt9.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1072
+                //cellStylebt9.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1073
+                //cellStylebt9.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1074
+                //cellStylebt9.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1075
+                cellStylebt9.VerticalAlignment = VerticalAlignment.Center;
1076
+                cellStylebt9.Alignment = HorizontalAlignment.Center;
1077
+                cellStylebt9.FillForegroundColor = 51;
1078
+
1079
+                ICellStyle cellStylebt10 = workbook.CreateCellStyle();
1080
+                NPOI.SS.UserModel.IFont cellfontbt10 = workbook.CreateFont();
1081
+                cellfontbt10.Boldweight = (short)FontBoldWeight.Bold;
1082
+                cellfontbt10.FontHeightInPoints = 11;
1083
+                cellStylebt10.WrapText = true;//设置换行这个要先设置
1084
+                //cellStylebt10.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1085
+                //cellStylebt10.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1086
+                //cellStylebt10.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1087
+                //cellStylebt10.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1088
+                cellStylebt10.SetFont(cellfontbt10);
1089
+                cellStylebt10.VerticalAlignment = VerticalAlignment.Center;
1090
+                cellStylebt10.Alignment = HorizontalAlignment.Center;
1091
+                cellStylebt10.FillForegroundColor = 54;
1092
+
1093
+
1094
+                ICellStyle cellStylebt11 = workbook.CreateCellStyle();
1095
+                NPOI.SS.UserModel.IFont cellfontbt11 = workbook.CreateFont();
1096
+                cellfontbt11.FontHeightInPoints = 10;
1097
+                cellStylebt11.WrapText = true;//设置换行这个要先设置
1098
+                cellStylebt11.SetFont(cellfontbt11);
1099
+                //cellStylebt11.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1100
+                //cellStylebt11.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1101
+                //cellStylebt11.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1102
+                //cellStylebt11.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1103
+                cellStylebt11.VerticalAlignment = VerticalAlignment.Center;
1104
+                cellStylebt11.Alignment = HorizontalAlignment.Center;
1105
+
1106
+
1107
+                ICellStyle cellStylebt0 = workbook.CreateCellStyle();
1108
+                //cellStylebt0.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1109
+                //cellStylebt0.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1110
+                //cellStylebt0.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1111
+                //cellStylebt0.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1112
+                cellStylebt0.SetFont(cellfontbt);
1113
+                cellStylebt0.VerticalAlignment = VerticalAlignment.Center;
1114
+                cellStylebt0.Alignment = HorizontalAlignment.Center;
1115
+
1116
+
1117
+             
1118
+
1119
+                ICellStyle cellStylebt01 = workbook.CreateCellStyle();
1120
+                //cellStylebt01.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
1121
+                //cellStylebt01.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
1122
+                //cellStylebt01.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
1123
+                //cellStylebt01.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
1124
+                cellStylebt01.SetFont(cellfontbt);
1125
+                cellStylebt01.VerticalAlignment = VerticalAlignment.Center;
1126
+                cellStylebt01.Alignment = HorizontalAlignment.Center;
1127
+
1128
+                int indexsource = -1; 
1129
+                for (int i = 0; i <= MergerHotSource[0].MergerHot.Count
1130
+                    ;i++)
1131
+                {
1132
+                   
1133
+                    if (i == 0)
1134
+                    {
1135
+                        ICell cell = irow2.CreateCell(0);
1136
+                        cell.SetCellValue("来源");
1137
+                        cell.CellStyle = cellStylebt2;
1138
+                        indexsource = 0;
1139
+                        sheet.SetColumnWidth(0, 12 * 300);
1140
+                    }
1141
+                    else if (i >0&&i <= MergerHotSource[0].MergerHot.Count-2)
1142
+                    {
1143
+                        ICell cell = irow2.CreateCell(indexsource+1);
1144
+                        cell.SetCellValue(MergerHotSource[0].MergerHot[i - 1].Source);
1145
+                      
1146
+                        if (i ==1 )
1147
+                        {
1148
+                            if (MergerHotSource[0].MergerHot[i - 1].Source=="12345")
1149
+                            {
1150
+                                indexsource = 6;
1151
+                                sheet.AddMergedRegion(new CellRangeAddress(3, 3, 1, indexsource-1));
1152
+                            }
1153
+                            else
1154
+                            {
1155
+                                indexsource = 5;
1156
+                                sheet.AddMergedRegion(new CellRangeAddress(3, 3, 1, indexsource-1));
1157
+                            }
1158
+                        }
1159
+                        else
1160
+                        {
1161
+                            if (MergerHotSource[0].MergerHot[i - 1].Source == "12345")
1162
+                            {
1163
+                               
1164
+                                sheet.AddMergedRegion(new CellRangeAddress(3, 3, indexsource + 1, indexsource + 5));
1165
+                                indexsource = indexsource + 6;
1166
+
1167
+                            }
1168
+                            else
1169
+                            {
1170
+                                sheet.AddMergedRegion(new CellRangeAddress(3, 3, indexsource + 1, indexsource + 4));
1171
+                                indexsource += 5;
1172
+                               
1173
+                            }
1174
+                        }
1175
+                        cell.CellStyle = cellStylebt2;
1176
+                    }
1177
+                    else
1178
+                    {
1179
+                        ICell cell = irow2.CreateCell(indexsource + 1);
1180
+                        if (i == MergerHotSource[0].MergerHot.Count - 1)
1181
+                        {
1182
+                            cell.SetCellValue("当日小计");
1183
+                        }
1184
+                        else if (i == MergerHotSource[0].MergerHot.Count )
1185
+                        {
1186
+                            cell.SetCellValue("累计");
1187
+                        }
1188
+                        sheet.AddMergedRegion(new CellRangeAddress(3, 3, indexsource + 1, indexsource + 5));
1189
+                        cell.CellStyle = cellStylebt3;
1190
+                        indexsource += 6;
1191
+                    }
1192
+                  
1193
+                }
1194
+                IRow irow3 = sheet.CreateRow(4);
1195
+                indexsource = 0;
1196
+                for (int i = 0; i <= MergerHotSource[0].MergerHot.Count; i++)
1197
+                {
1198
+                    if (i == 0)
1199
+                    {
1200
+                        ICell cell = irow3.CreateCell(0);
1201
+                        cell.SetCellValue("日期");
1202
+                        cell.CellStyle = cellStylebt4;
1203
+                        sheet.AddMergedRegion(new CellRangeAddress(4, 8, 0, 0));
1204
+                    }
1205
+                    else if (i > 0 && i <= MergerHotSource[0].MergerHot.Count - 2)
1206
+                    {
1207
+                   
1208
+                        if (i == 1)
1209
+                        {
1210
+                            indexsource = 1;
1211
+                            if (MergerHotSource[0].MergerHot[i - 1].Source == "12345")
1212
+                            {
1213
+                                for (int j = 0; j < 5; j++)
1214
+                                {
1215
+                                    ICell cell = irow3.CreateCell(indexsource);
1216
+                                    switch (j)
1217
+                                    {
1218
+                                        case 0:
1219
+                                            cell.SetCellValue("来\n电\n量\n");
1220
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1221
+                                            cell.CellStyle = cellStylebt5;
1222
+                                          
1223
+                                            sheet.SetColumnWidth(1, 12 * 100);
1224
+                                            break;
1225
+                                        case 1:
1226
+                                            cell.SetCellValue("接\n通\n量\n");
1227
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1228
+                                            cell.CellStyle = cellStylebt6;
1229
+                                            sheet.SetColumnWidth(2, 12 * 100);
1230
+                                          
1231
+                                            break;
1232
+                                        case 2:
1233
+                                            cell.SetCellValue("接\n通\n率\n");
1234
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1235
+                                            cell.CellStyle = cellStylebt7;
1236
+                                            sheet.SetColumnWidth(3, 12 * 100);
1237
+                                           
1238
+                                           
1239
+                                            break;
1240
+                                        case 3:
1241
+                                            cell.SetCellValue("未\n接\n通\n");
1242
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1243
+                                            cell.CellStyle = cellStylebt4;
1244
+                                           
1245
+                                           
1246
+                                            sheet.SetColumnWidth(4, 12 * 100);
1247
+                                            break;
1248
+                                        case 4:
1249
+                                            cell.SetCellValue("主\n动\n放\n弃\n");
1250
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1251
+                                            cell.CellStyle = cellStylebt4;
1252
+                                            sheet.SetColumnWidth(5, 12 * 100);
1253
+                                            break;
1254
+                                      
1255
+                                    }
1256
+                                    indexsource += 1;
1257
+                                }
1258
+                                sheet.SetColumnWidth(6, 12 * 35);
1259
+                                indexsource = 6;
1260
+                            }
1261
+                            else
1262
+                            {
1263
+                                indexsource = 1;
1264
+                                for (int j = 0; j < 4; j++)
1265
+                                {
1266
+                                    ICell cell = irow3.CreateCell(indexsource);
1267
+                                    switch (j)
1268
+                                    {
1269
+                                        case 0:
1270
+                                            cell.SetCellValue("来\n电\n量\n");
1271
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1272
+                                            cell.CellStyle = cellStylebt5;
1273
+                                          
1274
+                                            sheet.SetColumnWidth(1, 12 * 100);
1275
+                                          
1276
+                                            break;
1277
+                                        case 1:
1278
+                                            cell.SetCellValue("接\n通\n量\n");
1279
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1280
+                                            cell.CellStyle = cellStylebt6;
1281
+                                            sheet.SetColumnWidth(2, 12 * 100);
1282
+                                          
1283
+                                          
1284
+                                            break;
1285
+                                        case 2:
1286
+                                            cell.SetCellValue("未\n接\n通\n");
1287
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1288
+                                            cell.CellStyle = cellStylebt4;
1289
+                                          
1290
+                                          
1291
+                                            sheet.SetColumnWidth(3, 12 * 100);
1292
+                                            break;
1293
+                                        case 3:
1294
+                                            cell.SetCellValue("主\n动\n放\n弃\n");
1295
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1296
+                                            cell.CellStyle = cellStylebt4;
1297
+                                           
1298
+                                          
1299
+                                            sheet.SetColumnWidth(4, 12 * 100);
1300
+                                            break;
1301
+
1302
+                                    }
1303
+                                  
1304
+                                    indexsource += 1;
1305
+                                }
1306
+                                sheet.SetColumnWidth(5, 12 * 35);
1307
+                                indexsource = 5;
1308
+                            }
1309
+                        }
1310
+                        else
1311
+                        {
1312
+                            if (MergerHotSource[0].MergerHot[i - 1].Source == "12345")
1313
+                            {
1314
+                                for (int j = 0; j < 5; j++)
1315
+                                {
1316
+                                    indexsource += 1;
1317
+                                    ICell cell = irow3.CreateCell(indexsource);
1318
+                                    switch (j)
1319
+                                    {
1320
+                                        case 0:
1321
+                                            cell.SetCellValue("来\n电\n量\n");
1322
+                                            cell.CellStyle = cellStylebt5;
1323
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1324
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1325
+                                            break;
1326
+                                        case 1:
1327
+                                            cell.SetCellValue("接\n通\n量\n");
1328
+                                            cell.CellStyle = cellStylebt6;
1329
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1330
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1331
+                                            break;
1332
+                                        case 2:
1333
+                                            cell.SetCellValue("接\n通\n率\n");
1334
+                                            cell.CellStyle = cellStylebt7;
1335
+                                            sheet.SetColumnWidth(7, 12 * 100);
1336
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1337
+                                            break;
1338
+                                        case 3:
1339
+                                            cell.SetCellValue("未\n接\n通\n");
1340
+                                            cell.CellStyle = cellStylebt4;
1341
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1342
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1343
+                                            break;
1344
+                                        case 4:
1345
+                                            cell.SetCellValue("主\n动\n放\n弃\n");
1346
+                                            cell.CellStyle = cellStylebt4;
1347
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1348
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1349
+                                            break;
1350
+                                    }
1351
+                                    for (int z = 0; z < 3; z++)
1352
+                                    {
1353
+                                        IRow irow6 = sheet.CreateRow(5 + z);
1354
+                                        ICell cell119 = irow2.CreateCell(indexsource);
1355
+                                        cell119.CellStyle = cellStylebt01;
1356
+                                    }
1357
+                                }
1358
+                                indexsource += 1;
1359
+                                sheet.SetColumnWidth(indexsource, 12 * 35);
1360
+
1361
+                            }
1362
+                            else
1363
+                            {
1364
+                                for (int j = 0; j < 4; j++)
1365
+                                {
1366
+                                    indexsource += 1;
1367
+                                    ICell cell = irow3.CreateCell(indexsource);
1368
+                                    switch (j)
1369
+                                    {
1370
+                                        case 0:
1371
+                                            cell.SetCellValue("来\n电\n量\n");
1372
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1373
+                                            cell.CellStyle = cellStylebt5;
1374
+                                          
1375
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1376
+                                            break;
1377
+                                        case 1:
1378
+                                            cell.SetCellValue("接\n通\n量\n");
1379
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1380
+                                            cell.CellStyle = cellStylebt6;
1381
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1382
+                                           
1383
+                                            break;
1384
+                                        case 2:
1385
+                                            cell.SetCellValue("未\n接\n通\n");
1386
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1387
+                                            cell.CellStyle = cellStylebt4;
1388
+                                           
1389
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1390
+                                            break;
1391
+                                        case 3:
1392
+                                            cell.SetCellValue("主\n动\n放\n弃\n");
1393
+                                            sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1394
+                                            cell.CellStyle = cellStylebt4;
1395
+                                          
1396
+                                            sheet.SetColumnWidth(indexsource, 12 * 100);
1397
+                                            break;
1398
+
1399
+                                    }
1400
+                                 
1401
+                                  
1402
+                                }
1403
+
1404
+                                indexsource += 1;
1405
+                                sheet.SetColumnWidth(indexsource, 12 * 35);
1406
+                            }
1407
+                          
1408
+                        }
1409
+                    }
1410
+                    else
1411
+                    {
1412
+                        for (int j = 0; j < 5; j++)
1413
+                        {
1414
+                            indexsource += 1;
1415
+                            ICell cell = irow3.CreateCell(indexsource);
1416
+                            switch (j)
1417
+                            {
1418
+                                case 0:
1419
+                                    cell.SetCellValue("来\n电\n量\n");
1420
+                                    sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1421
+                                    cell.CellStyle = cellStylebt5;
1422
+                                  
1423
+                                    sheet.SetColumnWidth(indexsource, 12 * 100);
1424
+                                    break;
1425
+                                case 1:
1426
+                                    cell.SetCellValue("接\n通\n量\n");
1427
+                                    sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1428
+                                    cell.CellStyle = cellStylebt6;
1429
+                                    sheet.SetColumnWidth(indexsource, 12 * 100);
1430
+                                   
1431
+                                    break;
1432
+                                case 2:
1433
+                                    cell.SetCellValue("未\n接\n通\n");
1434
+                                    sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1435
+                                    cell.CellStyle = cellStylebt4;
1436
+                                  
1437
+                                    sheet.SetColumnWidth(indexsource, 12 * 100);
1438
+                                    break;
1439
+                                case 3:
1440
+                                    cell.SetCellValue("主\n动\n放\n弃\n");
1441
+                                    sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1442
+                                    cell.CellStyle = cellStylebt4;
1443
+                                   
1444
+                                    sheet.SetColumnWidth(indexsource, 12 * 100);
1445
+                                    break;
1446
+                                case 4:
1447
+                                    cell.SetCellValue("接\n通\n率\n");
1448
+                                    sheet.AddMergedRegion(new CellRangeAddress(4, 8, indexsource, indexsource));
1449
+                                    cell.CellStyle = cellStylebt7;
1450
+                                    sheet.SetColumnWidth(indexsource, 12 * 200);
1451
+                                  
1452
+                               
1453
+                                    break;
1454
+                            }
1455
+                        
1456
+
1457
+                        }
1458
+                        indexsource += 1;
1459
+                        sheet.SetColumnWidth(indexsource, 12 * 35);
1460
+                    }
1461
+                }
1462
+
1463
+                for (int i=0;i< MergerHotSource.Count; i++)
1464
+                {
1465
+                    IRow irow4 = sheet.CreateRow(9+i );
1466
+                 
1467
+                        for (int j = 0; j <= MergerHotSource[i].MergerHot.Count; j++)
1468
+                        {
1469
+                        if (j == 0)
1470
+                        {
1471
+                            ICell cell = irow4.CreateCell(0);
1472
+                            cell.SetCellValue(MergerHotSource[i].Data);
1473
+                            cell.CellStyle = cellStylebt11;
1474
+                            indexsource = 0;
1475
+                        }
1476
+                       else  if (j > 0 && j <= MergerHotSource[i].MergerHot.Count - 2)
1477
+                       {
1478
+                              if (j == 1)
1479
+                                {
1480
+                                    if (MergerHotSource[i].MergerHot[ j-1].Source == "12345")
1481
+                                    {
1482
+                                        for (int z = 0; z < 5; z++)
1483
+
1484
+                                    {
1485
+                                        indexsource += 1;
1486
+                                        ICell cell = irow4.CreateCell(indexsource);
1487
+                                            switch (z)
1488
+                                            {
1489
+                                                case 0:
1490
+                                                    cell.SetCellValue(MergerHotSource[i ]
1491
+                                                        .MergerHot[j-1  ].Call );
1492
+                                                    cell.CellStyle = cellStylebt8;
1493
+                                                    break;
1494
+                                                case 1:
1495
+                                                    cell.SetCellValue(MergerHotSource[i]
1496
+                                                        .MergerHot[j - 1].Connect);
1497
+                                                    cell.CellStyle = cellStylebt9;
1498
+                                                    break;
1499
+                                                case 2:
1500
+                                                    cell.SetCellValue(MergerHotSource[i]
1501
+                                                        .MergerHot[j - 1].rate);
1502
+                                                    cell.CellStyle = cellStylebt10;
1503
+                                                    break;
1504
+                                                case 3:
1505
+                                                    cell.SetCellValue(MergerHotSource[i]
1506
+                                                        .MergerHot[j - 1].Notconnected);
1507
+                                                    cell.CellStyle = cellStylebt11;
1508
+                                                    
1509
+                                                    break;
1510
+                                                case 4:
1511
+                                                    cell.SetCellValue(MergerHotSource[i]
1512
+                                                        .MergerHot[j - 1].voluntarily);
1513
+                                                    cell.CellStyle = cellStylebt11;
1514
+                                                   
1515
+                                                   
1516
+                                                    break;
1517
+
1518
+                                            }
1519
+                                        }
1520
+                                       indexsource += 1;
1521
+
1522
+                                    }
1523
+                                    else
1524
+                                    {
1525
+                                        for (int z = 0; z < 4; z++)
1526
+                                        {
1527
+                                            indexsource += 1;
1528
+                                            ICell cell = irow4.CreateCell(indexsource);
1529
+                                            switch (z)
1530
+                                            {
1531
+                                                case 0:
1532
+                                                    cell.SetCellValue(MergerHotSource[i]
1533
+                                                        .MergerHot[j - 1].Call);
1534
+                                                    cell.CellStyle = cellStylebt8;
1535
+                                                    
1536
+                                                   
1537
+                                                    break;
1538
+                                                case 1:
1539
+                                                    cell.SetCellValue(MergerHotSource[i]
1540
+                                                        .MergerHot[j - 1].Connect);
1541
+                                                    cell.CellStyle = cellStylebt9;
1542
+
1543
+                                                   
1544
+                                                    
1545
+                                                    break;
1546
+                                                    
1547
+                                                case 2:
1548
+                                                    cell.SetCellValue(MergerHotSource[i]
1549
+                                                        .MergerHot[j - 1].Notconnected);
1550
+                                                    cell.CellStyle = cellStylebt11;
1551
+                                                    
1552
+                                                  
1553
+                                                    break;
1554
+                                                case 3:
1555
+                                                    cell.SetCellValue(MergerHotSource[i]
1556
+                                                        .MergerHot[j - 1].voluntarily);
1557
+                                                    cell.CellStyle = cellStylebt11;
1558
+                                                    
1559
+                                                  
1560
+                                                    break;
1561
+
1562
+                                            }
1563
+                                        }
1564
+                                    indexsource += 1;
1565
+
1566
+                                }
1567
+                                }
1568
+                                else
1569
+                                {
1570
+                                    if (MergerHotSource[i].MergerHot[j -1].Source == "12345")
1571
+                                    {
1572
+                                        for (int z = 0; z < 5; z++)
1573
+                                        {
1574
+                                            indexsource += 1;
1575
+                                            ICell cell = irow4.CreateCell(indexsource);
1576
+                                            switch (z)
1577
+                                            {
1578
+                                                case 0:
1579
+                                                    cell.SetCellValue(MergerHotSource[i]
1580
+                                                        .MergerHot[j - 1].Call);
1581
+                                                    cell.CellStyle = cellStylebt8;
1582
+                                                   
1583
+
1584
+                                                    break;
1585
+                                                case 1:
1586
+                                                    cell.SetCellValue(MergerHotSource[i]
1587
+                                                        .MergerHot[j - 1].Connect);
1588
+                                                    cell.CellStyle = cellStylebt9;
1589
+
1590
+                                                   
1591
+
1592
+                                                    break;
1593
+                                                case 2:
1594
+                                                    cell.SetCellValue(MergerHotSource[i]
1595
+                                                        .MergerHot[j - 1].rate);
1596
+                                                    cell.CellStyle = cellStylebt10;
1597
+
1598
+                                                    
1599
+
1600
+                                                    break;
1601
+                                                case 3:
1602
+                                                    cell.SetCellValue(MergerHotSource[i]
1603
+                                                        .MergerHot[j - 1].Notconnected);
1604
+                                                    cell.CellStyle = cellStylebt11;
1605
+                                                   
1606
+
1607
+                                                    break;
1608
+                                                case 4:
1609
+                                                    cell.SetCellValue(MergerHotSource[i]
1610
+                                                        .MergerHot[j - 1].voluntarily);
1611
+                                                    cell.CellStyle = cellStylebt11;
1612
+                                                   
1613
+
1614
+                                                    break;
1615
+
1616
+                                            }
1617
+                                        }
1618
+                                        indexsource += 1;
1619
+                                     
1620
+
1621
+                                    }
1622
+                                    else
1623
+                                    {
1624
+                                        for (int z = 0; z < 4; z++)
1625
+                                        {
1626
+                                            indexsource += 1;
1627
+                                            ICell cell = irow4.CreateCell(indexsource);
1628
+                                            switch (z)
1629
+                                            {
1630
+                                                case 0:
1631
+                                                    cell.SetCellValue(MergerHotSource[i]
1632
+                                                        .MergerHot[j - 1].Call);
1633
+                                                    cell.CellStyle = cellStylebt8;
1634
+                                                   
1635
+
1636
+                                                    break;
1637
+                                                case 1:
1638
+                                                    cell.SetCellValue(MergerHotSource[i]
1639
+                                                        .MergerHot[j - 1].Connect);
1640
+                                                    cell.CellStyle = cellStylebt9;
1641
+
1642
+                                                   
1643
+                                                    break;
1644
+
1645
+                                                case 2:
1646
+                                                    cell.SetCellValue(MergerHotSource[i]
1647
+                                                        .MergerHot[j - 1].Notconnected);
1648
+                                                    cell.CellStyle = cellStylebt11;
1649
+                                                   
1650
+                                                    break;
1651
+                                                case 3:
1652
+                                                    cell.SetCellValue(MergerHotSource[i]
1653
+                                                        .MergerHot[j - 1].voluntarily);
1654
+                                                    cell.CellStyle = cellStylebt11;
1655
+                                                  
1656
+                                                    break;
1657
+
1658
+                                            }
1659
+                                        }
1660
+                                        indexsource += 1;
1661
+                                       
1662
+
1663
+                                    }
1664
+                                }
1665
+                            }
1666
+                            else
1667
+                            {
1668
+                            if (i <= MergerHotSource.Count-1)
1669
+                            {
1670
+                                for (int z = 0; z < 5; z++)
1671
+                                {
1672
+                                    indexsource += 1;
1673
+                                    ICell cell = irow4.CreateCell(indexsource);
1674
+                                    switch (z)
1675
+                                    {
1676
+                                        case 0:
1677
+                                            cell.SetCellValue(MergerHotSource[i]
1678
+                                                .MergerHot[j - 1].Call);
1679
+                                            cell.CellStyle = cellStylebt8;
1680
+                                            break;
1681
+                                        case 1:
1682
+                                            cell.SetCellValue(MergerHotSource[i]
1683
+                                                .MergerHot[j - 1].Connect);
1684
+                                            cell.CellStyle = cellStylebt9;
1685
+
1686
+
1687
+
1688
+                                            break;
1689
+
1690
+                                        case 2:
1691
+                                            cell.SetCellValue(MergerHotSource[i]
1692
+                                                .MergerHot[j - 1].Notconnected);
1693
+                                            cell.CellStyle = cellStylebt11;
1694
+
1695
+
1696
+                                            break;
1697
+                                        case 3:
1698
+                                            cell.SetCellValue(MergerHotSource[i]
1699
+                                                .MergerHot[j - 1].voluntarily);
1700
+                                            cell.CellStyle = cellStylebt11;
1701
+
1702
+
1703
+                                            break;
1704
+                                        case 4:
1705
+                                            cell.SetCellValue(MergerHotSource[i]
1706
+                                                .MergerHot[j - 1].rate);
1707
+                                            cell.CellStyle = cellStylebt10;
1708
+
1709
+
1710
+                                            break;
1711
+
1712
+                                    }
1713
+                                }
1714
+                                indexsource += 1;
1715
+                            }
1716
+                               
1717
+                            }
1718
+                        }
1719
+
1720
+                    
1721
+                    
1722
+                }
1723
+
1724
+
1725
+
1726
+                //自适应列宽度
1727
+                //for (int i = 0; i < 20; i++)
1728
+                //{
1729
+                //    sheet.AutoSizeColumn(i);
1730
+                //    // sheet.SetColumnWidth(i, 20 * 256);
1731
+                //}
1732
+
1733
+                using (MemoryStream ms = new MemoryStream())
1734
+                {
1735
+                    workbook.Write(ms);
1736
+
1737
+                    HttpContext curContext = HttpContext.Current;
1738
+
1739
+
1740
+                    // 设置编码和附件格式
1741
+                    curContext.Response.ContentType = "application/vnd.ms-excel";
1742
+                    curContext.Response.ContentEncoding = Encoding.UTF8;
1743
+                    curContext.Response.Charset = "";
1744
+                    curContext.Response.AppendHeader("Content-Disposition",
1745
+                        "attachment;filename=" + HttpUtility.UrlEncode("归并数据统计" + ".xls", Encoding.UTF8));
1746
+
1747
+                    curContext.Response.BinaryWrite(ms.GetBuffer());
1748
+
1749
+                    workbook = null;
1750
+                    ms.Close();
1751
+                    ms.Dispose();
1752
+
1753
+                    curContext.Response.End();
1754
+                }
1755
+                return "";
1756
+            }
1757
+            catch
1758
+            {
1759
+                return "导出失败!";
1760
+            }
1761
+        }
1762
+
898
         /// <summary>
1763
         /// <summary>
899
         /// 弹出下载框导出excel
1764
         /// 弹出下载框导出excel
900
         /// </summary>
1765
         /// </summary>