|
|
@@ -12,6 +12,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
12
|
12
|
{
|
|
13
|
13
|
public class GDLYController : BaseController
|
|
14
|
14
|
{
|
|
|
15
|
+ BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
|
|
15
|
16
|
//// GET: GDLY
|
|
16
|
17
|
//public ActionResult Index()
|
|
17
|
18
|
//{
|
|
|
@@ -111,23 +112,28 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
111
|
112
|
DataTable dt = new DataTable();
|
|
112
|
113
|
string sql = "SELECT * from T_Sys_UserAccount where F_DeleteFlag=0 order by F_Userid asc";
|
|
113
|
114
|
dt = DbHelperSQL.Query(sql).Tables[0];
|
|
|
115
|
+ //获取工单来源数据
|
|
|
116
|
+ DataTable dtnew = new DataTable();
|
|
|
117
|
+ string sqlnew = "select * from T_Sys_DictionaryValue where F_State=1 and F_DictionaryFlag='GDLY'";
|
|
|
118
|
+ dtnew = DbHelperSQL.Query(sqlnew).Tables[0];
|
|
|
119
|
+ //统计
|
|
|
120
|
+ var list = bll.DataTableToList(bll.GetList($" IsDel=0 {sqltimeCallRecords}").Tables[0]);
|
|
114
|
121
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
115
|
122
|
{
|
|
116
|
123
|
DataRow drNew = dtNew.NewRow();
|
|
117
|
124
|
drNew["坐席人员"] = dt.Rows[i]["F_UserName"].ToString();
|
|
118
|
|
- //获取工单来源数据
|
|
119
|
|
- DataTable dtnew = new DataTable();
|
|
120
|
|
- string sqlnew = "select * from T_Sys_DictionaryValue where F_State=1 and F_DictionaryFlag='GDLY'";
|
|
121
|
|
- dtnew = DbHelperSQL.Query(sqlnew).Tables[0];
|
|
122
|
125
|
for (int j = 0; j < dtnew.Rows.Count; j++)
|
|
123
|
126
|
{
|
|
124
|
|
- string str = "select count(*) from T_Wo_WorkOrder where IsDel=0 and type=" + Convert.ToInt32(dtnew.Rows[j]["F_DictionaryValueId"].ToString()) + " and CreateUser='" + dt.Rows[i]["F_UserCode"].ToString() + "'" + sqltimeCallRecords;
|
|
125
|
|
- DataTable dtj = DbHelperSQL.Query(str).Tables[0];
|
|
|
127
|
+ //需要优化
|
|
|
128
|
+ //string str = "select count(*) from T_Wo_WorkOrder where IsDel=0 and type=" + Convert.ToInt32(dtnew.Rows[j]["F_DictionaryValueId"].ToString()) + " and CreateUser='" + dt.Rows[i]["F_UserCode"].ToString() + "'" + sqltimeCallRecords;
|
|
|
129
|
+ //DataTable dtj = DbHelperSQL.Query(str).Tables[0];
|
|
|
130
|
+ //int sum = 0;
|
|
|
131
|
+ //if (dtj.Rows[0][0] != null && dtj.Rows[0][0].ToString() != "")
|
|
|
132
|
+ //{
|
|
|
133
|
+ // sum = Convert.ToInt32(dtj.Rows[0][0]);
|
|
|
134
|
+ //}
|
|
126
|
135
|
int sum = 0;
|
|
127
|
|
- if (dtj.Rows[0][0] != null && dtj.Rows[0][0].ToString() != "")
|
|
128
|
|
- {
|
|
129
|
|
- sum = Convert.ToInt32(dtj.Rows[0][0]);
|
|
130
|
|
- }
|
|
|
136
|
+ sum = list.Where(x => x.Type == Convert.ToInt32(dtnew.Rows[j]["F_DictionaryValueId"].ToString()) && x.CreateUser.Equals(dt.Rows[i]["F_UserCode"].ToString())).Count();
|
|
131
|
137
|
drNew[j + 1] = sum.ToString();
|
|
132
|
138
|
}
|
|
133
|
139
|
|